diff --git a/itowns/dev/dist/itowns.js b/itowns/dev/dist/itowns.js index 8bb7d6a2..cad17d5e 100644 --- a/itowns/dev/dist/itowns.js +++ b/itowns/dev/dist/itowns.js @@ -1,3 +1,3 @@ /*! For license information please see itowns.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("itowns",[],e):"object"==typeof exports?exports.itowns=e():t.itowns=e()}(self,(()=>(()=>{var t,e={75550:t=>{"use strict";function e(t,e){this.x=t,this.y=e}t.exports=e,e.prototype={clone:function(){return new e(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),s=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t}},38929:(t,e,r)=>{t.exports.VectorTile=r(22779),r(66024),r(59701)},22779:(t,e,r)=>{"use strict";var i=r(59701);function n(t,e,r){if(3===t){var n=new i(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}t.exports=function(t,e){this.layers=t.readFields(n,{},e)}},66024:(t,e,r)=>{"use strict";var i=r(75550);function n(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(s,this,e)}function s(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos>3}if(s--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,s=0,o=1/0,a=-1/0,l=1/0,c=-1/0;t.pos>3}if(i--,1===r||2===r)(n+=t.readSVarint())a&&(a=n),(s+=t.readSVarint())c&&(c=s);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,a,c]},n.prototype.toGeoJSON=function(t,e,r){var i,s,a=this.extent*Math.pow(2,r),l=this.extent*t,c=this.extent*e,h=this.loadGeometry(),u=n.types[this.type];function d(t){for(var e=0;e{"use strict";var i=r(66024);function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(s,this,e),this.length=this._features.length}function s(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}t.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new i(this._pbf,e,this.extent,this._keys,this._values)}},36194:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>y});var i,n={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-n.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*n.Bounce.In(2*t):.5*n.Bounce.Out(2*t-1)+.5}}},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},o=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=s()),void 0===e&&(e=!1);var r=Object.keys(this._tweens);if(0===r.length)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i1?s(t[r],t[r-1],r-i):s(t[n],t[n+1>r?r:n+1],i-n)},Bezier:function(t,e){for(var r=0,i=t.length-1,n=Math.pow,s=a.Utils.Bernstein,o=0;o<=i;o++)r+=n(1-e,i-o)*n(e,o)*t[o]*s(i,o);return r},CatmullRom:function(t,e){var r=t.length-1,i=r*e,n=Math.floor(i),s=a.Utils.CatmullRom;return t[0]===t[r]?(e<0&&(n=Math.floor(i=r*(1+e))),s(t[(n-1+r)%r],t[n],t[(n+1)%r],t[(n+2)%r],i-n)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[r]-(s(t[r],t[r],t[r-1],t[r-1],i-r)-t[r]):s(t[n?n-1:0],t[n],t[r1;r--)e*=r;return i[t]=e,e}),CatmullRom:function(t,e,r,i,n){var s=.5*(r-t),o=.5*(i-e),a=n*n;return(2*e-2*r+s+o)*(n*a)+(-3*e+3*r-2*s-o)*a+s*n+e}}},l=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),c=new o,h=function(){function t(t,e){void 0===e&&(e=c),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=n.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=l.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?s()+parseFloat(t):t:s(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,r,i){for(var n in r){var s=t[n],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(r[n]);if("undefined"!==a&&"function"!==a){if(l){var c=r[n];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,s)),r[n]=[s].concat(c)}if("object"!==a&&!o||!s||l)void 0===e[n]&&(e[n]=s),o||(e[n]*=1),i[n]=l?r[n].slice().reverse():e[n]||0;else{for(var h in e[n]=o?[]:{},s)e[n][h]=s[h];i[n]=o?[]:{},this._setupProperties(s,e[n],r[n],i[n])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=s()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=s()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;tn)return!1;e&&this.start(t)}if(this._goToEnd=!1,t1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(r in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,s=a(t),o=s[0],l=s[1],c=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),h=0,u=l>0?o-4:o;for(r=0;r>16&255,c[h++]=e>>8&255,c[h++]=255&e;return 2===l&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,c[h++]=255&e),1===l&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,c[h++]=e>>8&255,c[h++]=255&e),c},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],o=16383,a=0,c=i-n;ac?c:a+o));return 1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,i){for(var n,s,o=[],a=e;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},48764:(t,e,r)=>{"use strict";var i=r(79742),n=r(80645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=l,e.h2=50;var o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|m(t,e),i=a(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return l.from(i,e,r);var n=function(t){if(l.isBuffer(t)){var e=0|f(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Q(t.length)?a(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return h(t),a(t<0?0:0|f(t))}function d(t){for(var e=t.length<0?0:0|f(t.length),r=a(e),i=0;i=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return i?-1:N(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function A(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var h=-1;for(s=r;sa&&(r=a-l),s=r;s>=0;s--){for(var u=!0,d=0;dn&&(i=n):i=n;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function M(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:c>223?3:c>191?2:1;if(n+u<=r)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[n+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=u}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii.length?l.from(s).copy(i,n):Uint8Array.prototype.set.call(i,s,n);else{if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n)}n+=s.length}return i},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(t,e,r,i,n){if(G(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(i,n),h=t.slice(e,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,i,n,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function D(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function k(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,8),n.write(t,e,r,i,52,8),r+8}l.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t],n=1,s=0;++s>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,i||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return k(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return k(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,i){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function F(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Q(t){return t!=t}var j=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()},94629:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hierarchyItemLength=e.infoLength=void 0,e.infoLength=160,e.hierarchyItemLength=32},73156: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Copc=void 0;const o=s(r(81693)),a=r(26115),l=r(52277),c=r(53216);async function h(t,{pointDataRecordFormat:e,pointDataRecordLength:r},i,n){const s=await async function(t,{pointDataOffset:e,pointDataLength:r}){return a.Getter.create(t)(e,e+r)}(t,i),{pointCount:l}=i;return o.PointData.decompressChunk(s,{pointCount:l,pointDataRecordFormat:e,pointDataRecordLength:r},n)}e.Copc={create:async function(t){const e=a.Getter.create(t),r=e(0,65536);async function i(t,i){return i>=65536?e(t,i):(await r).slice(t,i)}const n=o.Header.parse(await i(0,o.Constants.minHeaderLength)),s=await o.Vlr.walk(i,n),l=o.Vlr.find(s,"copc",1);if(!l)throw new Error("COPC info VLR is required");const h=c.Info.parse(await o.Vlr.fetch(i,l));let u;const d=o.Vlr.find(s,"LASF_Projection",2112);d&&d.contentLength&&(u=a.Binary.toCString(await o.Vlr.fetch(i,d)),""===u&&(u=void 0));let p=[];const f=o.Vlr.find(s,"LASF_Spec",4);return f&&(p=o.ExtraBytes.parse(await o.Vlr.fetch(i,f))),{header:n,vlrs:s,info:h,wkt:u,eb:p}},loadHierarchyPage:async function(t,e){const r=a.Getter.create(t);return l.Hierarchy.load(r,e)},loadPointDataBuffer:h,loadPointDataView:async function(t,e,r,{lazPerf:i,include:n}={}){const s=await h(t,e.header,r,i);return o.View.create(s,e.header,e.eb,n)}}},52277:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hierarchy=void 0;const i=r(26115),n=r(94629);function s(t){const e=i.Binary.toDataView(t);if(e.byteLength%n.hierarchyItemLength!=0)throw new Error(`Invalid hierarchy page length: ${e.byteLength}`);const r={},s={};for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Info=void 0;const i=r(26115),n=r(94629);e.Info={parse:function(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${n.infoLength}): ${e.byteLength}`);const r=[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)],s=e.getFloat64(24,!0);return{cube:[r[0]-s,r[1]-s,r[2]-s,r[0]+s,r[1]+s,r[2]+s],spacing:e.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,i.parseBigInt)((0,i.getBigUint64)(e,40,!0)),pageLength:(0,i.parseBigInt)((0,i.getBigUint64)(e,48,!0))},gpsTimeRange:[e.getFloat64(56,!0),e.getFloat64(64,!0)]}}}},44975:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},98212:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hierarchy=void 0,e.Hierarchy={parse:function(t){return Object.entries(t).reduce(((t,[e,r])=>(-1===r?t.pages[e]={}:r&&(t.nodes[e]={pointCount:r}),t)),{nodes:{},pages:{}})}}},66329: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(44975),e),n(r(98212),e)},37830: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e},o=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.Las=e.Ept=void 0,e.Ept=s(r(66329)),o(r(68750),e),e.Las=s(r(81693)),o(r(26115),e)},50755:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.evlrHeaderLength=e.vlrHeaderLength=e.minHeaderLength=void 0,e.minHeaderLength=375,e.vlrHeaderLength=54,e.evlrHeaderLength=60},14953:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dimensions=void 0;const i=r(26115),n=r(6125);e.Dimensions={create:function(t,e=[]){return Object.keys(t).reduce(((t,r)=>{const i=o[r];if(i)return{...t,[r]:i};const s=e.find((t=>t.name===r)),a=s&&n.ExtraBytes.getDimension(s);if(a)return{...t,[r]:a};throw new Error(`Failed to look up LAS type: ${r}`)}),{})}};const{Type:s}=i.Dimension,o={X:s.float64,Y:s.float64,Z:s.float64,Intensity:s.uint16,ReturnNumber:s.uint8,NumberOfReturns:s.uint8,ScanDirectionFlag:s.boolean,EdgeOfFlightLine:s.boolean,Classification:s.uint8,Synthetic:s.boolean,KeyPoint:s.boolean,Withheld:s.boolean,Overlap:s.boolean,ScanAngle:s.float32,UserData:s.uint8,PointSourceId:s.uint16,GpsTime:s.float64,Red:s.uint16,Green:s.uint16,Blue:s.uint16,ScannerChannel:s.uint8,Infrared:s.uint16}},6125:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtraBytes=void 0;const i=r(26115);e.ExtraBytes={getDimension:function({type:t,length:e}){switch(t){case"signed":case"unsigned":switch(e){case 1:case 2:case 4:case 8:return{type:t,size:e}}case"float":switch(e){case 4:case 8:return{type:t,size:e}}}},parse:function(t){if(t.byteLength%n!=0)throw new Error(`Invalid extra bytes VLR length: ${t.byteLength}`);const e=[];for(let r=0;r=11)throw new Error(`Invalid extra bytes "type" value: ${o}`);if(0===o)return{name:r,description:s,length:a};const l=(c=a,{hasNodata:Boolean(1&c),hasMin:Boolean(c>>1&1),hasMax:Boolean(c>>2&1),hasScale:Boolean(c>>3&1),hasOffset:Boolean(c>>4&1)});var c;const h=function(t){switch(t){case 1:return i.Dimension.Type.uint8;case 2:return i.Dimension.Type.int8;case 3:return i.Dimension.Type.uint16;case 4:return i.Dimension.Type.int16;case 5:return i.Dimension.Type.uint32;case 6:return i.Dimension.Type.int32;case 7:return i.Dimension.Type.uint64;case 8:return i.Dimension.Type.int64;case 9:return i.Dimension.Type.float32;case 10:return i.Dimension.Type.float64}}(o);if(!h)throw new Error(`Failed to extract dimension type: ${o}`);const{type:u,size:d}=h;function p(t){switch(u){case"signed":return(0,i.parseBigInt)(e.getBigInt64(t,!0));case"unsigned":return(0,i.parseBigInt)((0,i.getBigUint64)(e,t,!0));case"float":return e.getFloat64(t,!0)}}const f={name:r,description:s,type:u,length:d};return l.hasNodata&&(f.nodata=p(40)),l.hasMin&&(f.min=p(64)),l.hasMax&&(f.max=p(88)),l.hasScale&&(f.scale=e.getFloat64(112)),l.hasOffset&&(f.offset=e.getFloat64(136)),f}},29032:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Extractor=void 0;const i=r(26115);function n(t){const{scale:e,offset:r}=t,n=a(t);function s(t,e){return t.getUint8(n(e)+14)}function o(t,e){return t.getUint8(n(e)+15)}function l(t,e){return 31&o(t,e)}return{X:(t,s)=>i.Scale.unapply(t.getInt32(n(s),!0),e[0],r[0]),Y:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+4,!0),e[1],r[1]),Z:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+8,!0),e[2],r[2]),Intensity:(t,e)=>t.getUint16(n(e)+12,!0),ReturnNumber:(t,e)=>7&s(t,e),NumberOfReturns:(t,e)=>(56&s(t,e))>>3,ScanDirectionFlag:(t,e)=>(64&s(t,e))>>6,EdgeOfFlightLine:(t,e)=>(128&s(t,e))>>7,Classification:(t,e)=>{const r=l(t,e);return 12===r?0:r},Synthetic:(t,e)=>(32&o(t,e))>>5,KeyPoint:(t,e)=>(64&o(t,e))>>6,Withheld:(t,e)=>(128&o(t,e))>>7,Overlap:(t,e)=>12===l(t,e)?1:0,ScanAngle:(t,e)=>t.getInt8(n(e)+16),UserData:(t,e)=>t.getUint8(n(e)+17),PointSourceId:(t,e)=>t.getUint16(n(e)+18,!0)}}function s(t){const{scale:e,offset:r}=t,n=a(t);function s(t,e){return t.getUint8(n(e)+15)}return{X:(t,s)=>i.Scale.unapply(t.getInt32(n(s),!0),e[0],r[0]),Y:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+4,!0),e[1],r[1]),Z:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+8,!0),e[2],r[2]),Intensity:(t,e)=>t.getUint16(n(e)+12,!0),ReturnNumber:(t,e)=>15&t.getUint16(n(e)+14,!0),NumberOfReturns:(t,e)=>(240&t.getUint16(n(e)+14,!0))>>4,Synthetic:(t,e)=>1&s(t,e),KeyPoint:(t,e)=>(2&s(t,e))>>1,Withheld:(t,e)=>(4&s(t,e))>>2,Overlap:(t,e)=>(8&s(t,e))>>3,ScannerChannel:(t,e)=>(48&s(t,e))>>4,ScanDirectionFlag:(t,e)=>(64&s(t,e))>>6,EdgeOfFlightLine:(t,e)=>(128&s(t,e))>>7,Classification:(t,e)=>t.getUint8(n(e)+16),UserData:(t,e)=>t.getUint8(n(e)+17),ScanAngle:(t,e)=>.006*t.getInt16(n(e)+18,!0),PointSourceId:(t,e)=>t.getUint16(n(e)+20,!0),GpsTime:(t,e)=>t.getFloat64(n(e)+22,!0)}}function o(t){const e=a(t);return{...s(t),Red:(t,r)=>t.getUint16(e(r)+30,!0),Green:(t,r)=>t.getUint16(e(r)+32,!0),Blue:(t,r)=>t.getUint16(e(r)+34,!0)}}function a(t){const{pointDataRecordLength:e}=t;return function(t){return t*e}}e.Extractor={create:function(t,e=[]){const r=function(t,e){let r=function(t){switch(t){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${t}`)}}(t.pointDataRecordFormat);return e.reduce(((e,n)=>{const s=r;r+=n.length;const o=function(t,e,{type:r,length:n}){const s=a(t);switch(r){case"signed":switch(n){case 1:return(t,r)=>t.getInt8(s(r)+e);case 2:return(t,r)=>t.getInt16(s(r)+e,!0);case 4:return(t,r)=>t.getInt32(s(r)+e,!0);case 8:return(t,r)=>(0,i.parseBigInt)(t.getBigInt64(s(r)+e,!0))}case"unsigned":switch(n){case 1:return(t,r)=>t.getUint8(s(r)+e);case 2:return(t,r)=>t.getUint16(s(r)+e,!0);case 4:return(t,r)=>t.getUint32(s(r)+e,!0);case 8:return(t,r)=>(0,i.parseBigInt)((0,i.getBigUint64)(t,s(r)+e,!0))}case"float":switch(n){case 4:return(t,r)=>t.getFloat32(s(r)+e,!0);case 8:return(t,r)=>t.getFloat64(s(r)+e,!0)}}}(t,s,n);if(!o)return e;return{...e,[n.name]:(t,e)=>i.Scale.unapply(o(t,e),n.scale,n.offset)}}),{})}(t,e);return{...(()=>{const{pointDataRecordFormat:e}=t;switch(e){case 0:return n(t);case 1:return function(t){const e=a(t);return{...n(t),GpsTime:(t,r)=>t.getFloat64(e(r)+20,!0)}}(t);case 2:return function(t){const e=a(t);return{...n(t),Red:(t,r)=>t.getUint16(e(r)+20,!0),Green:(t,r)=>t.getUint16(e(r)+22,!0),Blue:(t,r)=>t.getUint16(e(r)+24,!0)}}(t);case 3:return function(t){const e=a(t);return{...n(t),GpsTime:(t,r)=>t.getFloat64(e(r)+20,!0),Red:(t,r)=>t.getUint16(e(r)+28,!0),Green:(t,r)=>t.getUint16(e(r)+30,!0),Blue:(t,r)=>t.getUint16(e(r)+32,!0)}}(t);case 6:return s(t);case 7:return o(t);case 8:return function(t){const e=a(t);return{...o(t),Infrared:(t,r)=>t.getUint16(e(r)+36,!0)}}(t);default:throw new Error(`Unsupported point data record format: ${e}`)}})(),...r}}}},73651:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Header=void 0;const i=r(26115),n=r(50755),s=r(64267);function o(t){const e=i.Binary.toDataView(t),r=[];for(let t=0;t<120;t+=8)r.push((0,i.getBigUint64)(e,t,!0));return r.map((t=>(0,i.parseBigInt)(t)))}function a(t){const e=i.Binary.toDataView(t),r=[];for(let t=0;t<20;t+=4)r.push(e.getUint32(t,!0));return r}e.Header={parse:function(t){if(t.byteLength{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decompressFile=e.decompressChunk=e.PointData=void 0;const i=r(42622),n=r(73651);let s;async function o(t){return t||(s||(s=(0,i.createLazPerf)()),s)}async function a(t,{pointCount:e,pointDataRecordFormat:r,pointDataRecordLength:i},n){const s=await o(n),a=new Uint8Array(e*i),l=s._malloc(t.byteLength),c=s._malloc(i),h=new s.ChunkDecoder;try{s.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),l),h.open(r,i,l);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatGuid=e.parsePoint=void 0;const i=r(26115);e.parsePoint=function(t){const e=i.Binary.toDataView(t);if(24!==e.byteLength)throw new Error(`Invalid tuple buffer length: ${e.byteLength}`);return[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)]},e.formatGuid=function(t){const e=i.Binary.toDataView(t);if(16!==e.byteLength)throw new Error(`Invalid GUID buffer length: ${e.byteLength}`);let r="";for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.View=void 0;const i=r(26115),n=r(14953),s=r(29032);e.View={create:function(t,e,r=[],o){let a=s.Extractor.create(e,r);if(o){const t=new Set([...o]);a=Object.entries(a).reduce(((e,[r,i])=>(t.has(r)&&(e[r]=i),e)),{})}const l=n.Dimensions.create(a,r),c=i.Binary.toDataView(t),h=e.pointDataRecordLength;if(c.byteLength%h!=0)throw new Error(`Invalid buffer length (${c.byteLength}) for point length ${h}`);const u=c.byteLength/e.pointDataRecordLength;return{pointCount:u,dimensions:l,getter:function(t){const e=a[t];if(!e)throw new Error(`No extractor for dimension: ${t}`);return function(t){if(t>=u)throw new RangeError(`View index (${t}) out of range: ${u}`);return e(c,t)}}}}}},79687:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Vlr=void 0;const i=r(26115),n=r(50755);function s(t,e,r){return t.find((t=>t.userId===e&&t.recordId===r))}function o(t,e){return(e?l:a)(t)}function a(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${n.vlrHeaderLength}): ${e.byteLength}`);return{userId:i.Binary.toCString(t.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:e.getUint16(20,!0),description:i.Binary.toCString(t.slice(22,54)),isExtended:!1}}function l(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${n.evlrHeaderLength}): ${e.byteLength}`);return{userId:i.Binary.toCString(t.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:(0,i.parseBigInt)((0,i.getBigUint64)(e,20,!0)),description:i.Binary.toCString(t.slice(28,60)),isExtended:!0}}async function c({get:t,startOffset:e,count:r,isExtended:i}){const s=[];let a=e;const l=i?n.evlrHeaderLength:n.vlrHeaderLength;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBigUint64=e.parseBigInt=void 0,e.parseBigInt=function(t){if(t>BigInt(Number.MAX_SAFE_INTEGER)||t{"use strict";function r(t){return new DataView(t.buffer,t.byteOffset,t.length)}function i(t){const e=r(t);let i="";for(let t=0;t{"use strict";function r([t,e,r,i,n,s]){return[t+(i-t)/2,e+(n-e)/2,r+(s-r)/2]}function i(t){return t[3]-t[0]}function n(t){return t[4]-t[1]}function s(t){return t[5]-t[2]}function o(t,[e,i,n]){const[s,o,a,l,c,h]=t,[u,d,p]=r(t);return[e?u:s,i?d:o,n?p:a,e?l:u,i?c:d,n?h:p]}Object.defineProperty(e,"__esModule",{value:!0}),e.Bounds=void 0,e.Bounds={min:function(t){return[t[0],t[1],t[2]]},max:function(t){return[t[3],t[4],t[5]]},mid:r,width:i,depth:n,height:s,cube:function(t){const e=r(t),o=Math.max(i(t),n(t),s(t))/2;return[e[0]-o,e[1]-o,e[2]-o,e[0]+o,e[1]+o,e[2]+o]},step:o,stepTo:function(t,[e,r,i,n]){for(let s=e-1;s>=0;--s)t=o(t,[r>>s&1,i>>s&1,n>>s&1]);return t},intersection:function(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1]),Math.max(t[2],e[2]),Math.min(t[3],e[3]),Math.min(t[4],e[4]),Math.min(t[5],e[5])]}}},15882:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dimension=void 0,e.Dimension={Type:{int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}},ctype:function({type:t,size:e}){switch(t){case"signed":switch(e){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(e){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(e){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${t}/${e}`)}}},28732: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Getter=void 0;const a=o(r(86747));function l(t){return async function(e,r){if(e<0||r<0||e>r)throw new Error("Invalid range");const i=await(0,a.default)(t,{headers:{Range:`bytes=${e}-${r-1}`}}),n=await i.arrayBuffer();return new Uint8Array(n)}}function c(t){return async function(e,i){const n=await Promise.resolve().then((()=>s(r(78963))));return async function(e=0,r=1/0){if(e<0||r<0||e>r)throw new Error("Invalid range");return await n.promises.access(t),async function(t){return await new Promise(((e,r)=>{const i=[];t.on("data",(t=>i.push(t))),t.on("error",r),t.on("end",(()=>e(Buffer.concat(i))))}))}(n.createReadStream(t,{start:e,end:r-1,autoClose:!0}))}(e,i)}}e.Getter={create:function(t){return"function"==typeof t?t:t.startsWith("http://")||t.startsWith("https://")?l(t):c(t)},http:l,file:c}},26115: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.Step=e.Scale=e.Key=e.Getter=e.Dimension=e.Bounds=e.Binary=void 0,n(r(51877),e);var s=r(16467);Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return s.Binary}});var o=r(45314);Object.defineProperty(e,"Bounds",{enumerable:!0,get:function(){return o.Bounds}});var a=r(15882);Object.defineProperty(e,"Dimension",{enumerable:!0,get:function(){return a.Dimension}});var l=r(28732);Object.defineProperty(e,"Getter",{enumerable:!0,get:function(){return l.Getter}});var c=r(49479);Object.defineProperty(e,"Key",{enumerable:!0,get:function(){return c.Key}});var h=r(50350);Object.defineProperty(e,"Scale",{enumerable:!0,get:function(){return h.Scale}});var u=r(96784);Object.defineProperty(e,"Step",{enumerable:!0,get:function(){return u.Step}})},49479:(t,e)=>{"use strict";function r(t){if("string"!=typeof t)return t;const[e,r,i,n,...s]=t.split("-").map((t=>parseInt(t,10))),o=[e,r,i,n];if(0!==s.length||o.some((t=>"number"!=typeof t||Number.isNaN(t))))throw new Error(`Invalid key: ${t}`);return o}Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={create:function(t,e=0,i=0,n=0){return"number"!=typeof t?r(t):[t,e,i,n]},parse:r,toString:function(t){return"string"==typeof t?t:t.join("-")},step:function(t,[r,i,n]){const[s,o,a,l]=e.Key.create(t);return[s+1,2*o+r,2*a+i,2*l+n]},up:function(t,r=1){const[i,n,s,o]=e.Key.create(t);return[i-r,n>>r,s>>r,o>>r]},compare:function(t,e){for(let r=0;re[r])return 1}return 0},depth:function(t){return t[0]}}},50350:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scale=void 0,e.Scale={apply:(t,e=1,r=0)=>(t-r)/e,unapply:(t,e=1,r=0)=>t*e+r}},96784:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Step=void 0,e.Step={fromIndex:function(t){if(t<0||t>=8)throw new Error(`Invalid step index: ${t}`);return[t>>0&1?1:0,t>>1&1?1:0,t>>2&1?1:0]},list:function(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}}},86747:function(t,e){var r="undefined"!=typeof self?self:this,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in t,o="ArrayBuffer"in t;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function m(t){var e=new FileReader,r=f(e);return e.readAsArrayBuffer(t),r}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&n&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var t,e,r,i=p(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,r=f(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i-1?i:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function x(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},A.call(v.prototype),A.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];b.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function w(t,r){return new Promise((function(i,s){var o=new v(t,r);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new b(n,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",l)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}w.polyfill=!0,t.fetch||(t.fetch=w,t.Headers=d,t.Request=v,t.Response=b),e.Headers=d,e.Request=v,e.Response=b,e.fetch=w,Object.defineProperty(e,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e},9187:t=>{"use strict";function e(t,e,i){i=i||2;var s,o,a,l,u,d,f,m=e&&e.length,g=m?e[0]*i:t.length,A=r(t,0,g,i,!0),y=[];if(!A||A.next===A.prev)return y;if(m&&(A=function(t,e,i,n){var s,o,a,l=[];for(s=0,o=e.length;s80*i){s=a=t[0],o=l=t[1];for(var v=i;va&&(a=u),d>l&&(l=d);f=0!==(f=Math.max(a-s,l-o))?32767/f:0}return n(A,y,i,s,o,f,0),y}function r(t,e,r,i,n){var s,o;if(n===S(t,e,r,i)>0)for(s=e;s=e;s-=i)o=w(s,t[s],t[s+1],o);return o&&A(o,o.next)&&(E(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!A(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(E(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function n(t,e,r,c,h,u,p){if(t){!p&&u&&function(t,e,r,i){var n=t;do{0===n.z&&(n.z=d(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){var e,r,i,n,s,o,a,l,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(o>1)}(n)}(t,c,h,u);for(var f,m,g=t;t.prev!==t.next;)if(f=t.prev,m=t.next,u?o(t,c,h,u):s(t))e.push(f.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),E(t),t=m.next,g=m.next;else if((t=m)===g){p?1===p?n(t=a(i(t),e,r),e,r,c,h,u,2):2===p&&l(t,e,r,c,h,u):n(i(t),e,r,c,h,u,1);break}}}function s(t){var e=t.prev,r=t,i=t.next;if(g(e,r,i)>=0)return!1;for(var n=e.x,s=r.x,o=i.x,a=e.y,l=r.y,c=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c,m=i.next;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&f(n,a,s,l,o,c,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,r,i){var n=t.prev,s=t,o=t.next;if(g(n,s,o)>=0)return!1;for(var a=n.x,l=s.x,c=o.x,h=n.y,u=s.y,p=o.y,m=al?a>c?a:c:l>c?l:c,v=h>u?h>p?h:p:u>p?u:p,x=d(m,A,e,r,i),b=d(y,v,e,r,i),_=t.prevZ,w=t.nextZ;_&&_.z>=x&&w&&w.z<=b;){if(_.x>=m&&_.x<=y&&_.y>=A&&_.y<=v&&_!==n&&_!==o&&f(a,h,l,u,c,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,w.x>=m&&w.x<=y&&w.y>=A&&w.y<=v&&w!==n&&w!==o&&f(a,h,l,u,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;_&&_.z>=x;){if(_.x>=m&&_.x<=y&&_.y>=A&&_.y<=v&&_!==n&&_!==o&&f(a,h,l,u,c,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;w&&w.z<=b;){if(w.x>=m&&w.x<=y&&w.y>=A&&w.y<=v&&w!==n&&w!==o&&f(a,h,l,u,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function a(t,e,r){var n=t;do{var s=n.prev,o=n.next.next;!A(s,o)&&y(s,n,n.next,o)&&b(s,o)&&b(o,s)&&(e.push(s.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),E(n),E(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function l(t,e,r,s,o,a){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var h=_(l,c);return l=i(l,l.next),h=i(h,h.next),n(l,e,r,s,o,a,0),void n(h,e,r,s,o,a,0)}c=c.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,i=e,n=t.x,s=t.y,o=-1/0;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){var a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>o&&(o=a,r=i.x=i.x&&i.x>=h&&n!==i.x&&f(sr.x||i.x===r.x&&u(r,i)))&&(r=i,p=l)),i=i.next}while(i!==c);return r}(t,e);if(!r)return e;var n=_(r,t);return i(n,n.next),i(r,r.next)}function u(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(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 p(t){var e=t,r=t;do{(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&y(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var r=t,i=!1,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)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||A(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function A(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,r,i){var n=x(g(t,e,r)),s=x(g(t,e,i)),o=x(g(r,i,t)),a=x(g(r,i,e));return n!==s&&o!==a||!(0!==n||!v(t,r,e))||!(0!==s||!v(t,i,e))||!(0!==o||!v(r,t,i))||!(0!==a||!v(r,e,i))}function v(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 x(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function _(t,e){var r=new M(t.i,t.x,t.y),i=new M(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 w(t,e,r,i){var n=new M(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 E(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 M(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}function S(t,e,r,i){for(var n=0,s=e,o=r-i;s0&&(i+=t[n-1].length,r.holes.push(i))}return r}},80645:(t,e)=>{e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,l=(1<>1,h=-7,u=r?n-1:0,d=r?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,l,c=8*s-n-1,h=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,n),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;t[r+p]=255&a,p+=f,a/=256,n-=8);for(o=o<0;t[r+p]=255&o,p+=f,o/=256,c-=8);t[r+p-f]|=128*m}},25705:(t,e,r)=>{"use strict";var i,n,s=r.g.MutationObserver||r.g.WebKitMutationObserver;if(s){var o=0,a=new s(u),l=r.g.document.createTextNode("");a.observe(l,{characterData:!0}),i=function(){l.data=o=++o%2}}else if(r.g.setImmediate||void 0===r.g.MessageChannel)i="document"in r.g&&"onreadystatechange"in r.g.document.createElement("script")?function(){var t=r.g.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},r.g.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new r.g.MessageChannel;c.port1.onmessage=u,i=function(){c.port2.postMessage(0)}}var h=[];function u(){var t,e;n=!0;for(var r=h.length;r;){for(e=h,h=[],t=-1;++t{t.exports=function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return n(e[o][1][t]||t)}),c,c.exports,t,e,r,i)}return r[o].exports}for(var s=void 0,o=0;o>>1],e)>=0?n=s+1:i=s;return n},e.exports=function(){function t(t){var e;this.options=t,this.comparator=this.options.comparator,this.data=(null!=(e=this.options.initialValues)?e.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return t.prototype.queue=function(t){var e;e=i(this.data,t,this.comparator),this.data.splice(e,0,t)},t.prototype.dequeue=function(){return this.data.pop()},t.prototype.peek=function(){return this.data[this.data.length-1]},t.prototype.clear=function(){this.data.length=0},t}()},{}],4:[function(t,e,r){e.exports=function(){function t(t){var e,r,i,n,s,o,a,l;for(this.comparator=(null!=t?t.comparator:void 0)||function(t,e){return t-e},this.pageSize=(null!=t?t.pageSize:void 0)||512,this.length=0,a=0;1<s;0<=s?++r:--r)e.push(null);if(this._memory=[],this._mask=this.pageSize-1,t.initialValues)for(i=0,n=(o=t.initialValues).length;i0&&(this._write(1,e),this._bubbleDown(1,e)),t},t.prototype.peek=function(){return this._read(1)},t.prototype.clear=function(){this.length=0,this._memory.length=0},t.prototype._write=function(t,e){var r;for(r=t>>this._shift;r>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[r][t&this._mask]=e},t.prototype._read=function(t){return this._memory[t>>this._shift][t&this._mask]},t.prototype._bubbleUp=function(t,e){var r,i,n,s;for(r=this.comparator;t>1&&(i=t&this._mask,t3?n=t&~this._mask|i>>1:i<2?(n=t-this.pageSize>>this._shift,n+=n&~(this._mask>>1),n|=this.pageSize>>1):n=t-2,!(r(s=this._read(n),e)<0));)this._write(n,e),this._write(t,s),t=n},t.prototype._bubbleDown=function(t,e){var r,i,n,s,o;for(o=this.comparator;tthis._mask&&!(t&this._mask-1)?r=i=t+2:t&this.pageSize>>1?(r=(t&~this._mask)>>1,i=1+(r=1+(r|=t&this._mask>>1)<0)for(t=e=1,r=this.data.length;1<=r?er;t=1<=r?++e:--e)this._bubbleUp(t)},t.prototype.queue=function(t){this.data.push(t),this._bubbleUp(this.data.length-1)},t.prototype.dequeue=function(){var t,e;return e=this.data[0],t=this.data.pop(),this.data.length>0&&(this.data[0]=t,this._bubbleDown(0)),e},t.prototype.peek=function(){return this.data[0]},t.prototype.clear=function(){this.length=0,this.data.length=0},t.prototype._bubbleUp=function(t){for(var e,r;t>0&&(e=t-1>>>1,this.comparator(this.data[t],this.data[e])<0);)r=this.data[e],this.data[e]=this.data[t],this.data[t]=r,t=e},t.prototype._bubbleDown=function(t){var e,r,i,n,s;for(e=this.data.length-1;n=1+(r=1+(t<<1)),i=t,r<=e&&this.comparator(this.data[r],this.data[i])<0&&(i=r),n<=e&&this.comparator(this.data[n],this.data[i])<0&&(i=n),i!==t;)s=this.data[i],this.data[i]=this.data[t],this.data[t]=s,t=i},t}()},{}]},{},[1])(1)},55733:(t,e,r)=>{t.exports=function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return n(e[o][1][t]||t)}),c,c.exports,t,e,r,i)}return r[o].exports}for(var s=void 0,o=0;o>2,a=(3&e)<<4|r>>4,l=1>6:64,c=2>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(c++)))>>2,i=(3&a)<<6|(l=s.indexOf(t.charAt(c++))),d[h++]=e,64!==a&&(d[h++]=r),64!==l&&(d[h++]=i);return d}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var i=t("./external"),n=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}a.prototype={getContentWorker:function(){var t=new n(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var i=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var i=t("./utils"),n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,r,i){var s=n,o=0+r;t^=-1;for(var a=0;a>>8^s[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,r,i){var s=n,o=0+r;t^=-1;for(var a=0;a>>8^s[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var i;i="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,r){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=i?"uint8array":"array";function l(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new l("Deflate",t)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function i(t,e){var r,i="";for(r=0;r>>=8;return i}function n(t,e,r,n,o,h){var u,d,p=t.file,f=t.compression,m=h!==a.utf8encode,g=s.transformTo("string",h(p.name)),A=s.transformTo("string",a.utf8encode(p.name)),y=p.comment,v=s.transformTo("string",h(y)),x=s.transformTo("string",a.utf8encode(y)),b=A.length!==p.name.length,_=x.length!==y.length,w="",E="",M="",S=p.dir,C=p.date,T={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(T.crc32=t.crc32,T.compressedSize=t.compressedSize,T.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),m||!b&&!_||(I|=2048);var R=0,B=0;S&&(R|=16),"UNIX"===o?(B=798,R|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(p.unixPermissions,S)):(B=20,R|=function(t){return 63&(t||0)}(p.dosPermissions)),u=C.getUTCHours(),u<<=6,u|=C.getUTCMinutes(),u<<=5,u|=C.getUTCSeconds()/2,d=C.getUTCFullYear()-1980,d<<=4,d|=C.getUTCMonth()+1,d<<=5,d|=C.getUTCDate(),b&&(E=i(1,1)+i(l(g),4)+A,w+="up"+i(E.length,2)+E),_&&(M=i(1,1)+i(l(v),4)+x,w+="uc"+i(M.length,2)+M);var L="";return L+="\n\0",L+=i(I,2),L+=f.magic,L+=i(u,2),L+=i(d,2),L+=i(T.crc32,4),L+=i(T.compressedSize,4),L+=i(T.uncompressedSize,4),L+=i(g.length,2),L+=i(w.length,2),{fileRecord:c.LOCAL_FILE_HEADER+L+g+w,dirRecord:c.CENTRAL_FILE_HEADER+i(B,2)+L+i(v.length,2)+"\0\0\0\0"+i(R,4)+i(n,4)+g+w+v}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),c=t("../signature");function h(t,e,r,i){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,o),h.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:function(t){return c.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,r){"use strict";var i=t("./Uint8ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var i=t("./DataReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var i=t("./ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var i=t("../utils"),n=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new a(t):n.uint8array?new l(i.transformTo("uint8array",t)):new s(i.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../utils");function s(t){i.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../crc32");function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function i(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=i},{}],29:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),l=t("../external"),c=null;if(a.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e,r){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=r,i.checkSupport(o),this._worker=t.pipe(new n(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return function(t,e){return new l.Promise((function(r,n){var s=[],a=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",(function(t,r){s.push(t),e&&e(r)})).on("error",(function(t){s=[],n(t)})).on("end",(function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return i.transformTo(t,e)}}(l,function(t,e){var r,i=0,n=null,s=0;for(r=0;r>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return n.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,n,s,o=t.length,l=new Array(2*o);for(e=r=0;e>10&1023,l[r++]=56320|1023&n)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),i.applyFromCharCode(l)}(t=i.transformTo(n.uint8array?"uint8array":"array",t))},i.inherits(c,o),c.prototype.processChunk=function(t){var e=i.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),l=e;o!==e.length&&(n.uint8array?(l=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(l=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(l),meta:t.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,i.inherits(h,o),h.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var i=t("./support"),n=t("./base64"),s=t("./nodejsUtils"),o=t("./external");function a(t){return t}function l(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r>10&1023,c[i++]=56320|1023&n)}return l(c,i)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,n){var s=i,o=n+r;t^=-1;for(var a=n;a>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){"use strict";var i,n=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),l=t("./messages"),c=0,h=0,u=-2,d=2,p=8,f=286,m=30,g=19,A=2*f+1,y=15,v=3,x=258,b=x+v+1,_=42,w=113;function E(t,e){return t.msg=l[e],e}function M(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(n.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function T(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,C(t.strm)}function I(t,e){t.pending_buf[t.pending++]=e}function R(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function B(t,e){var r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-b?t.strstart-(t.w_size-b):0,c=t.window,h=t.w_mask,u=t.prev,d=t.strstart+x,p=c[s+o-1],f=c[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(c[(r=e)+o]===f&&c[r+o-1]===p&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&sl&&0!=--n);return o<=t.lookahead?o:t.lookahead}function L(t){var e,r,i,s,l,c,h,u,d,p,f=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-b)){for(n.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--r;);for(e=r=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--r;);s+=f}if(0===t.strm.avail_in)break;if(c=t.strm,h=t.window,u=t.strstart+t.lookahead,p=void 0,(d=s)<(p=c.avail_in)&&(p=d),r=0===p?0:(c.avail_in-=p,n.arraySet(h,c.input,c.next_in,p,u),1===c.state.wrap?c.adler=o(c.adler,h,p,u):2===c.state.wrap&&(c.adler=a(c.adler,h,p,u)),c.next_in+=p,c.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=v)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=v&&(t.ins_h=(t.ins_h<=v)if(i=s._tr_tally(t,t.strstart-t.match_start,t.match_length-v),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=v){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=v&&(t.ins_h=(t.ins_h<=v&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-v,i=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-v),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(L(t),0===t.lookahead&&e===c)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,T(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-b&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(T(t,!1),t.strm.avail_out),1)})),new O(4,4,8,4,P),new O(4,5,16,8,P),new O(4,6,32,32,P),new O(4,4,16,16,D),new O(8,16,32,32,D),new O(8,16,128,128,D),new O(8,32,128,256,D),new O(32,128,258,1024,D),new O(32,258,258,4096,D)],r.deflateInit=function(t,e){return F(t,e,p,15,8,0)},r.deflateInit2=F,r.deflateReset=N,r.deflateResetKeep=U,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,h):u},r.deflate=function(t,e){var r,n,o,l;if(!t||!t.state||5>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,3),n.status=w);else{var d=p+(n.w_bits-8<<4)<<8;d|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(d|=32),d+=31-d%31,n.status=w,R(n,d),0!==n.strstart&&(R(n,t.adler>>>16),R(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending!==n.pending_buf_size));)I(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(t),n.pending+2<=n.pending_buf_size&&(I(n,255&t.adler),I(n,t.adler>>8&255),t.adler=0,n.status=w)):n.status=w),0!==n.pending){if(C(t),0===t.avail_out)return n.last_flush=-1,h}else if(0===t.avail_in&&M(e)<=M(r)&&4!==e)return E(t,-5);if(666===n.status&&0!==t.avail_in)return E(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==c&&666!==n.status){var f=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(L(t),0===t.lookahead)){if(e===c)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,i,n,o,a=t.window;;){if(t.lookahead<=x){if(L(t),t.lookahead<=x&&e===c)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=v&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=v?(r=s._tr_tally(t,1,t.match_length-v),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?1:2}(n,e):i[n.level].func(n,e);if(3!==f&&4!==f||(n.status=666),1===f||3===f)return 0===t.avail_out&&(n.last_flush=-1),h;if(2===f&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(S(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(t),0===t.avail_out))return n.last_flush=-1,h}return 4!==e?h:n.wrap<=0?1:(2===n.wrap?(I(n,255&t.adler),I(n,t.adler>>8&255),I(n,t.adler>>16&255),I(n,t.adler>>24&255),I(n,255&t.total_in),I(n,t.total_in>>8&255),I(n,t.total_in>>16&255),I(n,t.total_in>>24&255)):(R(n,t.adler>>>16),R(n,65535&t.adler)),C(t),0=r.w_size&&(0===a&&(S(r.head),r.strstart=0,r.block_start=0,r.insert=0),p=new n.Buf8(r.w_size),n.arraySet(p,e,f-r.w_size,r.w_size,0),e=p,f=r.w_size),l=t.avail_in,c=t.next_in,d=t.input,t.avail_in=f,t.next_in=0,t.input=e,L(r);r.lookahead>=v;){for(i=r.strstart,s=r.lookahead-(v-1);r.ins_h=(r.ins_h<>>=x=v>>>24,f-=x,0==(x=v>>>16&255))S[s++]=65535&v;else{if(!(16&x)){if(0==(64&x)){v=m[(65535&v)+(p&(1<>>=x,f-=x),f<15&&(p+=M[i++]<>>=x=v>>>24,f-=x,!(16&(x=v>>>16&255))){if(0==(64&x)){v=g[(65535&v)+(p&(1<>>=x,f-=x,(x=s-o)<_){if(h<(x=_-x)&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=d,(w=0)===u){if(w+=c-x,x>3,p&=(1<<(f-=b<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=h,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(u),e.distcode=e.distdyn=new i.Buf32(d),e.sane=1,e.back=-1,l):c}function g(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,m(t)):c}function A(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(i.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n<(s=o.wsize-o.wnext)&&(s=n),i.arraySet(o.window,e,r-n,s,o.wnext),(n-=s)?(i.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,N,2,0),v=y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&y)){t.msg="unknown compression method",r.mode=30;break}if(v-=4,P=8+(15&(y>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(N[0]=255&y,N[1]=y>>>8&255,r.check=s(r.check,N,2,0)),v=y=0,r.mode=3;case 3:for(;v<32;){if(0===g)break t;g--,y+=u[f++]<>>8&255,N[2]=y>>>16&255,N[3]=y>>>24&255,r.check=s(r.check,N,4,0)),v=y=0,r.mode=4;case 4:for(;v<16;){if(0===g)break t;g--,y+=u[f++]<>8),512&r.flags&&(N[0]=255&y,N[1]=y>>>8&255,r.check=s(r.check,N,2,0)),v=y=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===g)break t;g--,y+=u[f++]<>>8&255,r.check=s(r.check,N,2,0)),v=y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(g<(E=r.length)&&(E=g),E&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,u,f,E,P)),512&r.flags&&(r.check=s(r.check,u,E,f)),g-=E,f+=E,r.length-=E),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break t;for(E=0;P=u[f+E++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P)),P&&E>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===g)break t;g--,y+=u[f++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===g)break t;g--,y+=u[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(_(r),r.mode=20,6!==e)break;y>>>=2,v-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}y>>>=2,v-=2;break;case 14:for(y>>>=7&v,v-=7&v;v<32;){if(0===g)break t;g--,y+=u[f++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&y,v=y=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(E=r.length){if(g>>=5,v-=5,r.ndist=1+(31&y),y>>>=5,v-=5,r.ncode=4+(15&y),y>>>=4,v-=4,286>>=3,v-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},D=a(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,D){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=C,v-=C,r.lens[r.have++]=I;else{if(16===I){for(k=C+2;v>>=C,v-=C,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}P=r.lens[r.have-1],E=3+(3&y),y>>>=2,v-=2}else if(17===I){for(k=C+3;v>>=C)),y>>>=3,v-=3}else{for(k=C+7;v>>=C)),y>>>=7,v-=7}if(r.have+E>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;E--;)r.lens[r.have++]=P}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,O={bits:r.lenbits},D=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,D){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},D=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,D){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=g&&258<=A){t.next_out=m,t.avail_out=A,t.next_in=f,t.avail_in=g,r.hold=y,r.bits=v,o(t,b),m=t.next_out,d=t.output,A=t.avail_out,f=t.next_in,u=t.input,g=t.avail_in,y=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;T=(U=r.lencode[y&(1<>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>R)])>>>16&255,I=65535&U,!(R+(C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=R,v-=R,r.back+=R}if(y>>>=C,v-=C,r.back+=C,r.length=I,0===T){r.mode=26;break}if(32&T){r.back=-1,r.mode=12;break}if(64&T){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&T,r.mode=22;case 22:if(r.extra){for(k=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;T=(U=r.distcode[y&(1<>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>R)])>>>16&255,I=65535&U,!(R+(C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=R,v-=R,r.back+=R}if(y>>>=C,v-=C,r.back+=C,64&T){t.msg="invalid distance code",r.mode=30;break}r.offset=I,r.extra=15&T,r.mode=24;case 24:if(r.extra){for(k=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===A)break t;if(E=b-A,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}M=E>r.wnext?(E-=r.wnext,r.wsize-E):r.wnext-E,E>r.length&&(E=r.length),S=r.window}else S=d,M=m-r.offset,E=r.length;for(Ay?(x=U[N+u[E]],P[D+u[E]]):(x=96,0),p=1<>I)+(f-=p)]=v<<24|x<<16|b|0,0!==f;);for(p=1<>=1;if(0!==p?(L&=p-1,L+=p):L=0,E++,0==--O[w]){if(w===S)break;w=e[r+u[E]]}if(C>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function C(t,e,r){t.bi_valid>c-r?(t.bi_buf|=e<>c-t.bi_valid,t.bi_valid+=r-c):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function R(t,e,r){var i,n,s=new Array(l+1),o=0;for(i=1;i<=l;i++)s[i]=o=o+r[i-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=I(s[a]++,a))}}function B(t){var e;for(e=0;e>1;1<=r;r--)D(t,s,r);for(n=c;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],D(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,D(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,o,a,c=e.dyn_tree,h=e.max_code,u=e.stat_desc.static_tree,d=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(s=0;s<=l;s++)t.bl_count[s]=0;for(c[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(s=c[2*c[2*(i=t.heap[r])+1]+1]+1)&&(s=m,g++),c[2*i+1]=s,h>=7;i>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e>>3,(o=t.static_len+3+7>>>3)<=n&&(n=o)):n=o=r+5,r+4<=n&&-1!==e?z(t,e,r,i):4===t.strategy||o===n?(C(t,2+(i?1:0),3),O(t,f,m)):(C(t,4+(i?1:0),3),function(t,e,r,i){var n;for(C(t,e-257,5),C(t,r-1,5),C(t,i-4,4),n=0;n>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(A[r]+s+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){C(t,2,3),T(t,256,f),function(t){16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var r,i,n,s,o=1,a={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,r="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(s+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){n.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(t){var e=c.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):function(t){setTimeout(d,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i{var e,r=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var r,i,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){r=t,i=e})),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>W("You are getting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>W("You are setting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var s=Object.assign({},n),o=[],a="./this.program";if(n.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var l,c="";if("undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),e&&(c=e),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var h,u,d,p=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);function m(t,e){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){W("Module."+t+" has been replaced with plain "+e+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function g(t){return"FS_createPath"===t||"FS_createDataFile"===t||"FS_createPreloadedFile"===t||"FS_unlink"===t||"addRunDependency"===t||"FS_createLazyFile"===t||"FS_createDevice"===t||"removeRunDependency"===t}Object.assign(n,s),s=null,h="fetchSettings",Object.getOwnPropertyDescriptor(n,h)&&W("`Module."+h+"` was supplied but `"+h+"` not included in INCOMING_MODULE_JS_API"),n.arguments&&(o=n.arguments),m("arguments","arguments_"),n.thisProgram&&(a=n.thisProgram),m("thisProgram","thisProgram"),n.quit&&n.quit,m("quit","quit_"),y(void 0===n.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.read,"Module.read option was removed (modify read_ in JS)"),y(void 0===n.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),y(void 0===n.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),y(void 0===n.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),y(void 0===n.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),m("read","read_"),m("readAsync","readAsync"),m("readBinary","readBinary"),m("setWindowTitle","setWindowTitle"),y(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),y(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),y(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(u=n.wasmBinary),m("wasmBinary","wasmBinary"),n.noExitRuntime,m("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&W("no native wasm support detected");var A=!1;function y(t,e){t||W("Assertion failed"+(e?": "+e:""))}var v,x,b,_,w,E,M,S,C,T="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(t,e,r){for(var i=e+r,n=e;t[n]&&!(n>=i);)++n;if(n-e>16&&t.buffer&&T)return T.decode(t.subarray(e,n));for(var s="";e>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|a)}else s+=String.fromCharCode(o)}return s}function R(t,e){return t?I(b,t,e):""}function B(t,e,r,i){if(!(i>0))return 0;for(var n=r,s=r+i-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),a<=127){if(r>=s)break;e[r++]=a}else if(a<=2047){if(r+1>=s)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=s)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+3>=s)break;a>1114111&&tt("Invalid Unicode code point 0x"+a.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-n}function L(t){for(var e=0,r=0;r=55296&&i<=57343?(e+=4,++r):e+=3}return e}function P(t){v=t,n.HEAP8=x=new Int8Array(t),n.HEAP16=_=new Int16Array(t),n.HEAP32=E=new Int32Array(t),n.HEAPU8=b=new Uint8Array(t),n.HEAPU16=w=new Uint16Array(t),n.HEAPU32=M=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}var D=65536;n.TOTAL_STACK&&y(D===n.TOTAL_STACK,"the stack size can no longer be determined at runtime");var O,k=n.INITIAL_MEMORY||262144;function U(){if(!A){var t=Ee(),e=M[t>>2],r=M[t+4>>2];34821223==e&&2310721022==r||W("Stack overflow! Stack cookie has been overwritten at 0x"+t.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+e.toString(16)),1668509029!==M[0]&&W("Runtime error: The application has corrupted its heap memory area (address zero)!")}}m("INITIAL_MEMORY","INITIAL_MEMORY"),y(k>=D,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+k+"! (TOTAL_STACK="+D+")"),y("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),y(!n.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),y(262144==k,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var N=[],F=[],z=[],G=!1;y(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Q=0,j=null,V=null,H={};function W(t){n.onAbort&&n.onAbort(t),f(t="Aborted("+t+")"),A=!0;var e=new WebAssembly.RuntimeError(t);throw i(e),e}var q={error:function(){W("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){q.error()},createDataFile:function(){q.error()},createPreloadedFile:function(){q.error()},createLazyFile:function(){q.error()},open:function(){q.error()},mkdev:function(){q.error()},registerDevice:function(){q.error()},analyzePath:function(){q.error()},loadFilesFromDB:function(){q.error()},ErrnoError:function(){q.error()}};n.FS_createDataFile=q.createDataFile,n.FS_createPreloadedFile=q.createPreloadedFile;var Z,Y;function X(t){return t.startsWith("data:application/octet-stream;base64,")}function J(t,e){return function(){var r=t,i=e;return e||(i=n.asm),y(G,"native function `"+r+"` called before runtime initialization"),i[t]||y(i[t],"exported native function `"+r+"` not found"),i[t].apply(null,arguments)}}function K(t){try{if(t==Z&&u)return new Uint8Array(u);if(l)return l(t);throw"both async and sync fetching of the wasm failed"}catch(t){W(t)}}function $(t){for(;t.length>0;)t.shift()(n)}function tt(t){tt.shown||(tt.shown={}),tt.shown[t]||(tt.shown[t]=1,f(t))}function et(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){M[this.ptr+4>>2]=t},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(t){M[this.ptr+8>>2]=t},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_refcount=function(t){E[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,x[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=x[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,x[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=x[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=E[this.ptr>>2];E[this.ptr>>2]=t+1},this.release_ref=function(){var t=E[this.ptr>>2];return E[this.ptr>>2]=t-1,y(t>0),1===t},this.set_adjusted_ptr=function(t){M[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Me(this.get_type()))return M[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}function rt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}X(Z="laz-perf.wasm")||(Y=Z,Z=n.locateFile?n.locateFile(Y,c):c+Y);var it=void 0;function nt(t){for(var e="",r=t;b[r];)e+=it[b[r++]];return e}var st={},ot={},at={},lt=48,ct=57;function ht(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=lt&&e<=ct?"_"+t:t}function ut(t,e){return t=ht(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function dt(t,e){var r=ut(e,(function(t){this.name=e,this.message=t;var r=new Error(t).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var pt=void 0;function ft(t){throw new pt(t)}var mt=void 0;function gt(t){throw new mt(t)}function At(t,e,r){function i(e){var i=r(e);i.length!==t.length&>("Mismatched type converter count");for(var n=0;n{ot.hasOwnProperty(t)?n[e]=ot[t]:(s.push(t),st.hasOwnProperty(t)||(st[t]=[]),st[t].push((()=>{n[e]=ot[t],++o===s.length&&i(n)})))})),0===s.length&&i(n)}function yt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var i=e.name;if(t||ft('type "'+i+'" must have a positive integer typeid pointer'),ot.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;ft("Cannot register type '"+i+"' twice")}if(ot[t]=e,delete at[t],st.hasOwnProperty(t)){var n=st[t];delete st[t],n.forEach((t=>t()))}}function vt(t){ft(t.$$.ptrType.registeredClass.name+" instance already deleted")}var xt=!1;function bt(t){}function _t(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function wt(t,e,r){if(e===r)return t;if(void 0===r.baseClass)return null;var i=wt(t,e,r.baseClass);return null===i?null:r.downcast(i)}var Et={};var Mt=[];function St(){for(;Mt.length;){var t=Mt.pop();t.$$.deleteScheduled=!1,t.delete()}}var Ct=void 0;var Tt={};function It(t,e){return e.ptrType&&e.ptr||gt("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&>("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Bt(Object.create(t,{$$:{value:e}}))}function Rt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=function(t,e){return e=function(t,e){for(void 0===e&&ft("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),Tt[e]}(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var i=r.clone();return this.destructor(t),i}function n(){return this.isSmartPointer?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var s,o=this.registeredClass.getActualType(e),a=Et[o];if(!a)return n.call(this);s=this.isConst?a.constPointerType:a.pointerType;var l=wt(e,this.registeredClass,s.registeredClass);return null===l?n.call(this):this.isSmartPointer?It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}function Bt(t){return"undefined"==typeof FinalizationRegistry?(Bt=t=>t,t):(xt=new FinalizationRegistry((t=>{console.warn(t.leakWarning.stack.replace(/^Error: /,"")),_t(t.$$)})),Bt=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e},i=e.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+i.name+" <0x"+e.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Rt),xt.register(t,r,t)}return t},bt=t=>xt.unregister(t),Bt(t))}function Lt(){}function Pt(t,e,r){if(void 0===t[e].overloadTable){var i=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ft("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[i.argCount]=i}}function Dt(t,e,r,i,n,s,o,a){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=i,this.baseClass=n,this.getActualType=s,this.upcast=o,this.downcast=a,this.pureVirtualFunctions=[]}function Ot(t,e,r){for(;e!==r;)e.upcast||ft("Expected null or instance of "+r.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function kt(t,e){if(null===e)return this.isReference&&ft("null is not a valid "+this.name),0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name);var r=e.$$.ptrType.registeredClass;return Ot(e.$$.ptr,r,this.registeredClass)}function Ut(t,e){var r;if(null===e)return this.isReference&&ft("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&ft("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var i=e.$$.ptrType.registeredClass;if(r=Ot(e.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&ft("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:ft("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var n=e.clone();r=this.rawShare(r,Kt.toHandle((function(){n.delete()}))),null!==t&&t.push(this.rawDestructor,r)}break;default:ft("Unsupporting sharing policy")}return r}function Nt(t,e){if(null===e)return this.isReference&&ft("null is not a valid "+this.name),0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&ft("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;return Ot(e.$$.ptr,r,this.registeredClass)}function Ft(t){return this.fromWireType(E[t>>2])}function zt(t,e,r,i,n,s,o,a,l,c,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=i,this.isSmartPointer=n,this.pointeeType=s,this.sharingPolicy=o,this.rawGetPointee=a,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=h,n||void 0!==e.baseClass?this.toWireType=Ut:i?(this.toWireType=kt,this.destructorFunction=null):(this.toWireType=Nt,this.destructorFunction=null)}var Gt=[];function Qt(t){var e=Gt[t];return e||(t>=Gt.length&&(Gt.length=t+1),Gt[t]=e=O.get(t)),y(O.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e}function jt(t,e){var r=(t=nt(t)).includes("j")?function(t,e){y(t.includes("j")||t.includes("p"),"getDynCaller should only be called with i64 sigs");var r=[];return function(){return r.length=0,Object.assign(r,arguments),function(t,e,r){return t.includes("j")?function(t,e,r){y("dynCall_"+t in n,"bad function pointer type - no table for sig '"+t+"'"),r&&r.length?y(r.length===t.substring(1).replace(/j/g,"--").length):y(1==t.length);var i=n["dynCall_"+t];return r&&r.length?i.apply(null,[e].concat(r)):i.call(null,e)}(t,e,r):(y(Qt(e),"missing table entry in dynCall: "+e),Qt(e).apply(null,r))}(t,e,r)}}(t,e):Qt(e);return"function"!=typeof r&&ft("unknown function pointer with signature "+t+": "+e),r}var Vt=void 0;function Ht(t){var e=_e(t),r=nt(e);return be(e),r}function Wt(t,e){var r=[],i={};throw e.forEach((function t(e){i[e]||ot[e]||(at[e]?at[e].forEach(t):(r.push(e),i[e]=!0))})),new Vt(t+": "+r.map(Ht).join([", "]))}function qt(t,e){for(var r=[],i=0;i>2]);return r}function Zt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function Yt(t,e,r,i,n){var s=e.length;s<2&&ft("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==e[1]&&null!==r,a=!1,l=1;l0?", ":"")+u),d+=(c?"var rv = ":"")+"invoker(fn"+(u.length>0?", ":"")+u+");\n",a)d+="runDestructors(destructors);\n";else for(l=o?1:2;l(t||ft("Cannot use deleted val. handle = "+t),Jt[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Xt.length?Xt.pop():Jt.length;return Jt[e]={refcount:1,value:t},e}}};function $t(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function te(t,e){switch(e){case 2:return function(t){return this.fromWireType(S[t>>2])};case 3:return function(t){return this.fromWireType(C[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function ee(t,e,r){switch(e){case 0:return r?function(t){return x[t]}:function(t){return b[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return w[t>>1]};case 2:return r?function(t){return E[t>>2]}:function(t){return M[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ie(t,e){y(t%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=t,i=r>>1,n=i+e/2;!(i>=n)&&w[i];)++i;if((r=i<<1)-t>32&&re)return re.decode(b.subarray(t,r));for(var s="",o=0;!(o>=e/2);++o){var a=_[t+2*o>>1];if(0==a)break;s+=String.fromCharCode(a)}return s}function ne(t,e,r){if(y(e%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),y("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var i=e,n=(r-=2)<2*t.length?r/2:t.length,s=0;s>1]=o,e+=2}return _[e>>1]=0,e-i}function se(t){return 2*t.length}function oe(t,e){y(t%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,i="";!(r>=e/4);){var n=E[t+4*r>>2];if(0==n)break;if(++r,n>=65536){var s=n-65536;i+=String.fromCharCode(55296|s>>10,56320|1023&s)}else i+=String.fromCharCode(n)}return i}function ae(t,e,r){if(y(e%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),y("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var i=e,n=i+r-4,s=0;s=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++s)),E[e>>2]=o,(e+=4)+4>n)break}return E[e>>2]=0,e-i}function le(t){for(var e=0,r=0;r=55296&&i<=57343&&++r,e+=4}return e}function ce(t){try{return d.grow(t-v.byteLength+65535>>>16),P(d.buffer),1}catch(e){f("emscripten_realloc_buffer: Attempted to grow heap from "+v.byteLength+" bytes to "+t+" bytes, but got error: "+e)}}var he={};function ue(){if(!ue.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(var e in he)void 0===he[e]?delete t[e]:t[e]=he[e];var r=[];for(var e in t)r.push(e+"="+t[e]);ue.strings=r}return ue.strings}var de=[null,[],[]];function pe(t,e){var r=de[t];y(r),0===e||10===e?((1===t?p:f)(I(r,0)),r.length=0):r.push(e)}function fe(t){return t%4==0&&(t%100!=0||t%400==0)}var me=[31,29,31,30,31,30,31,31,30,31,30,31],ge=[31,28,31,30,31,30,31,31,30,31,30,31];function Ae(t,e,r,i){var n=E[i+40>>2],s={tm_sec:E[i>>2],tm_min:E[i+4>>2],tm_hour:E[i+8>>2],tm_mday:E[i+12>>2],tm_mon:E[i+16>>2],tm_year:E[i+20>>2],tm_wday:E[i+24>>2],tm_yday:E[i+28>>2],tm_isdst:E[i+32>>2],tm_gmtoff:E[i+36>>2],tm_zone:n?R(n):""},o=R(r),a={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in a)o=o.replace(new RegExp(l,"g"),a[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function u(t,e,r){for(var i="number"==typeof t?t.toString():t||"";i.length0?1:0}var i;return 0===(i=r(t.getFullYear()-e.getFullYear()))&&0===(i=r(t.getMonth()-e.getMonth()))&&(i=r(t.getDate()-e.getDate())),i}function f(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function m(t){var e=function(t,e){for(var r=new Date(t.getTime());e>0;){var i=fe(r.getFullYear()),n=r.getMonth(),s=(i?me:ge)[n];if(!(e>s-r.getDate()))return r.setDate(r.getDate()+e),r;e-=s-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(t.tm_year+1900,0,1),t.tm_yday),r=new Date(e.getFullYear(),0,4),i=new Date(e.getFullYear()+1,0,4),n=f(r),s=f(i);return p(n,e)<=0?p(s,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var g={"%a":function(t){return c[t.tm_wday].substring(0,3)},"%A":function(t){return c[t.tm_wday]},"%b":function(t){return h[t.tm_mon].substring(0,3)},"%B":function(t){return h[t.tm_mon]},"%C":function(t){return d((t.tm_year+1900)/100|0,2)},"%d":function(t){return d(t.tm_mday,2)},"%e":function(t){return u(t.tm_mday,2," ")},"%g":function(t){return m(t).toString().substring(2)},"%G":function(t){return m(t)},"%H":function(t){return d(t.tm_hour,2)},"%I":function(t){var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),d(e,2)},"%j":function(t){return d(t.tm_mday+function(t,e){for(var r=0,i=0;i<=e;r+=t[i++]);return r}(fe(t.tm_year+1900)?me:ge,t.tm_mon-1),3)},"%m":function(t){return d(t.tm_mon+1,2)},"%M":function(t){return d(t.tm_min,2)},"%n":function(){return"\n"},"%p":function(t){return t.tm_hour>=0&&t.tm_hour<12?"AM":"PM"},"%S":function(t){return d(t.tm_sec,2)},"%t":function(){return"\t"},"%u":function(t){return t.tm_wday||7},"%U":function(t){var e=t.tm_yday+7-t.tm_wday;return d(Math.floor(e/7),2)},"%V":function(t){var e=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&e++,e){if(53==e){var r=(t.tm_wday+371-t.tm_yday)%7;4==r||3==r&&fe(t.tm_year)||(e=1)}}else{e=52;var i=(t.tm_wday+7-t.tm_yday-1)%7;(4==i||5==i&&fe(t.tm_year%400-1))&&e++}return d(e,2)},"%w":function(t){return t.tm_wday},"%W":function(t){var e=t.tm_yday+7-(t.tm_wday+6)%7;return d(Math.floor(e/7),2)},"%y":function(t){return(t.tm_year+1900).toString().substring(2)},"%Y":function(t){return t.tm_year+1900},"%z":function(t){var e=t.tm_gmtoff,r=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(r?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(t){return t.tm_zone},"%%":function(){return"%"}};for(var l in o=o.replace(/%%/g,"\0\0"),g)o.includes(l)&&(o=o.replace(new RegExp(l,"g"),g[l](s)));var A,v,b,_=(!1,v=L(A=o=o.replace(/\0\0/g,"%"))+1,B(A,b=new Array(v),0,b.length),b);return _.length>e?0:(function(t,e){y(t.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),x.set(t,e)}(_,t),_.length-1)}!function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);it=t}(),pt=n.BindingError=dt(Error,"BindingError"),mt=n.InternalError=dt(Error,"InternalError"),Lt.prototype.isAliasOf=function(t){if(!(this instanceof Lt))return!1;if(!(t instanceof Lt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,i=t.$$.ptrType.registeredClass,n=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;i.baseClass;)n=i.upcast(n),i=i.baseClass;return e===i&&r===n},Lt.prototype.clone=function(){if(this.$$.ptr||vt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Bt(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},Lt.prototype.delete=function(){this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ft("Object already scheduled for deletion"),bt(this),_t(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Lt.prototype.isDeleted=function(){return!this.$$.ptr},Lt.prototype.deleteLater=function(){return this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ft("Object already scheduled for deletion"),Mt.push(this),1===Mt.length&&Ct&&Ct(St),this.$$.deleteScheduled=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Tt).length},n.getLiveInheritedInstances=function(){var t=[];for(var e in Tt)Tt.hasOwnProperty(e)&&t.push(Tt[e]);return t},n.flushPendingDeletes=St,n.setDelayFunction=function(t){Ct=t,Mt.length&&Ct&&Ct(St)},zt.prototype.getPointee=function(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},zt.prototype.destructor=function(t){this.rawDestructor&&this.rawDestructor(t)},zt.prototype.argPackAdvance=8,zt.prototype.readValueFromPointer=Ft,zt.prototype.deleteObject=function(t){null!==t&&t.delete()},zt.prototype.fromWireType=Rt,Vt=n.UnboundTypeError=dt(Error,"UnboundTypeError"),n.count_emval_handles=function(){for(var t=0,e=5;e>s])},destructorFunction:null})},_embind_register_class:function(t,e,r,i,s,o,a,l,c,h,u,d,p){u=nt(u),o=jt(s,o),l&&(l=jt(a,l)),h&&(h=jt(c,h)),p=jt(d,p);var f=ht(u);!function(t,e,r){n.hasOwnProperty(t)?(ft("Cannot register public name '"+t+"' twice"),Pt(n,t,t),n.hasOwnProperty(r)&&ft("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),n[t].overloadTable[void 0]=e):n[t]=e}(f,(function(){Wt("Cannot construct "+u+" due to unbound types",[i])})),At([t,e,r],i?[i]:[],(function(e){var r,s;e=e[0],s=i?(r=e.registeredClass).instancePrototype:Lt.prototype;var a=ut(f,(function(){if(Object.getPrototypeOf(this)!==c)throw new pt("Use 'new' to construct "+u);if(void 0===d.constructor_body)throw new pt(u+" has no accessible constructor");var t=d.constructor_body[arguments.length];if(void 0===t)throw new pt("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),c=Object.create(s,{constructor:{value:a}});a.prototype=c;var d=new Dt(u,a,c,p,r,o,l,h),m=new zt(u,d,!0,!1,!1),g=new zt(u+"*",d,!1,!1,!1),A=new zt(u+" const*",d,!1,!0,!1);return Et[t]={pointerType:g,constPointerType:A},function(t,e,r){n.hasOwnProperty(t)||gt("Replacing nonexistant public symbol"),n[t].overloadTable,n[t]=e,n[t].argCount=r}(f,a),[m,g,A]}))},_embind_register_class_constructor:function(t,e,r,i,n,s){y(e>0);var o=qt(e,r);n=jt(i,n),At([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new pt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{Wt("Cannot construct "+t.name+" due to unbound types",o)},At([],o,(function(i){return i.splice(1,0,null),t.registeredClass.constructor_body[e-1]=Yt(r,i,null,n,s),[]})),[]}))},_embind_register_class_function:function(t,e,r,i,n,s,o,a){var l=qt(r,i);e=nt(e),s=jt(n,s),At([],[t],(function(t){var i=(t=t[0]).name+"."+e;function n(){Wt("Cannot call "+i+" due to unbound types",l)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),a&&t.registeredClass.pureVirtualFunctions.push(e);var c=t.registeredClass.instancePrototype,h=c[e];return void 0===h||void 0===h.overloadTable&&h.className!==t.name&&h.argCount===r-2?(n.argCount=r-2,n.className=t.name,c[e]=n):(Pt(c,e,i),c[e].overloadTable[r-2]=n),At([],l,(function(n){var a=Yt(i,n,t,s,o);return void 0===c[e].overloadTable?(a.argCount=r-2,c[e]=a):c[e].overloadTable[r-2]=a,[]})),[]}))},_embind_register_emval:function(t,e){yt(t,{name:e=nt(e),fromWireType:function(t){var e=Kt.toValue(t);return function(t){t>4&&0==--Jt[t].refcount&&(Jt[t]=void 0,Xt.push(t))}(t),e},toWireType:function(t,e){return Kt.toHandle(e)},argPackAdvance:8,readValueFromPointer:Ft,destructorFunction:null})},_embind_register_float:function(t,e,r){var i=rt(r);yt(t,{name:e=nt(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+$t(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:te(e,i),destructorFunction:null})},_embind_register_integer:function(t,e,r,i,n){e=nt(e),-1===n&&(n=4294967295);var s=rt(r),o=t=>t;if(0===i){var a=32-8*r;o=t=>t<>>a}var l=e.includes("unsigned"),c=(t,r)=>{if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+$t(t)+'" to '+r);if(tn)throw new TypeError('Passing a number "'+$t(t)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+i+", "+n+"]!")};yt(t,{name:e,fromWireType:o,toWireType:l?function(t,e){return c(e,this.name),e>>>0}:function(t,e){return c(e,this.name),e},argPackAdvance:8,readValueFromPointer:ee(e,s,0!==i),destructorFunction:null})},_embind_register_memory_view:function(t,e,r){var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function n(t){var e=M,r=e[t>>=2],n=e[t+1];return new i(v,n,r)}yt(t,{name:r=nt(r),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:function(t,e){var r="std::string"===(e=nt(e));yt(t,{name:e,fromWireType:function(t){var e,i=M[t>>2],n=t+4;if(r)for(var s=n,o=0;o<=i;++o){var a=n+o;if(o==i||0==b[a]){var l=R(s,a-s);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),s=a+1}}else{var c=new Array(i);for(o=0;o>2]=i,r&&n)s=e,o=c,y("number"==typeof(a=i+1),"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),B(s,b,o,a);else if(n)for(var h=0;h255&&(be(c),ft("String has UTF-16 code units that do not fit in 8 bits")),b[c+h]=u}else for(h=0;hw,a=1):4===e&&(i=oe,n=ae,o=le,s=()=>M,a=2),yt(t,{name:r,fromWireType:function(t){for(var r,n=M[t>>2],o=s(),l=t+4,c=0;c<=n;++c){var h=t+4+c*e;if(c==n||0==o[h>>a]){var u=i(l,h-l);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),l=h+e}}return be(t),r},toWireType:function(t,i){"string"!=typeof i&&ft("Cannot pass non-string to C++ string type "+r);var s=o(i),l=xe(4+s+e);return M[l>>2]=s>>a,n(i,l+4,s+e),null!==t&&t.push(be,l),l},argPackAdvance:8,readValueFromPointer:Ft,destructorFunction:function(t){be(t)}})},_embind_register_void:function(t,e){yt(t,{isVoid:!0,name:e=nt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},abort:function(){W("native code called abort()")},emscripten_memcpy_big:function(t,e,r){b.copyWithin(t,e,e+r)},emscripten_resize_heap:function(t){var e=b.length;y((t>>>=0)>e);var r,i=2147483648;if(t>i)return f("Cannot enlarge memory, asked to go up to "+t+" bytes, but the limit is "+i+" bytes!"),!1;for(var n=1;n<=4;n*=2){var s=e*(1+.2/n);s=Math.min(s,t+100663296);var o=Math.min(i,(r=Math.max(t,s))+(65536-r%65536)%65536);if(ce(o))return!0}return f("Failed to grow the heap from "+e+" bytes to "+o+" bytes, not enough memory!"),!1},environ_get:function(t,e){var r=0;return ue().forEach((function(i,n){var s=e+r;M[t+4*n>>2]=s,function(t,e,r){for(var i=0;i>0]=t.charCodeAt(i);x[e>>0]=0}(i,s),r+=i.length+1})),0},environ_sizes_get:function(t,e){var r=ue();M[t>>2]=r.length;var i=0;return r.forEach((function(t){i+=t.length+1})),M[e>>2]=i,0},fd_close:function(t){W("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(t,e,r,i,n){return 70},fd_write:function(t,e,r,i){for(var n=0,s=0;s>2],a=M[e+4>>2];e+=8;for(var l=0;l>2]=n,0},strftime_l:function(t,e,r,i){return Ae(t,e,r,i)}},xe=(function(){var t,e={env:ve,wasi_snapshot_preview1:ve};function r(t,e){var r,i=t.exports;n.asm=i,y(d=n.asm.memory,"memory not found in wasm exports"),P(d.buffer),y(O=n.asm.__indirect_function_table,"table not found in wasm exports"),r=n.asm.__wasm_call_ctors,F.unshift(r),function(t){if(Q--,n.monitorRunDependencies&&n.monitorRunDependencies(Q),t?(y(H[t]),delete H[t]):f("warning: run dependency removed without ID"),0==Q&&(null!==j&&(clearInterval(j),j=null),V)){var e=V;V=null,e()}}("wasm-instantiate")}t="wasm-instantiate",Q++,n.monitorRunDependencies&&n.monitorRunDependencies(Q),t?(y(!H[t]),H[t]=1,null===j&&"undefined"!=typeof setInterval&&(j=setInterval((function(){if(A)return clearInterval(j),void(j=null);var t=!1;for(var e in H)t||(t=!0,f("still waiting on run dependencies:")),f("dependency: "+e);t&&f("(end of list)")}),1e4))):f("warning: run dependency added without ID");var s=n;function o(t){y(n===s,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),s=null,r(t.instance)}function a(t){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return K(Z)})):fetch(Z,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return K(Z)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),Z.startsWith("file://")&&f("warning: Loading from a file URI ("+Z+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),W(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(e,r)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(u||"function"!=typeof WebAssembly.instantiateStreaming||X(Z)||"function"!=typeof fetch?a(o):fetch(Z,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(i)}(),n.___wasm_call_ctors=J("__wasm_call_ctors"),n._malloc=J("malloc")),be=n._free=J("free"),_e=n.___getTypeName=J("__getTypeName"),we=(n.__embind_initialize_bindings=J("_embind_initialize_bindings"),n.___errno_location=J("__errno_location"),n._fflush=J("fflush"),n._emscripten_stack_init=function(){return(we=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),Ee=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(Ee=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)}),Me=(n.stackSave=J("stackSave"),n.stackRestore=J("stackRestore"),n.stackAlloc=J("stackAlloc"),n.___cxa_is_pointer_type=J("__cxa_is_pointer_type"));function Se(t){function e(){ye||(ye=!0,n.calledRun=!0,A||(y(!G),G=!0,U(),$(F),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),y(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),z.unshift(t);var t;$(z)}()))}var i;t=t||o,Q>0||(we(),y(0==(3&(i=Ee()))),M[i>>2]=34821223,M[i+4>>2]=2310721022,M[0]=1668509029,function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),N.unshift(t);var t;$(N)}(),Q>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e(),U()))}if(n.dynCall_viijii=J("dynCall_viijii"),n.dynCall_ji=J("dynCall_ji"),n.dynCall_jiji=J("dynCall_jiji"),n.dynCall_iiiiij=J("dynCall_iiiiij"),n.dynCall_iiiiijj=J("dynCall_iiiiijj"),n.dynCall_iiiiiijj=J("dynCall_iiiiiijj"),["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","print","printErr","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readAsmConstArgsArray","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","flush_NO_FILESYSTEM","dlopenMissingError","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var e="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";g(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),W(e)}})})),["ptrToString","zeroMemory","stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getRandomDevice","traverseStack","convertPCtoSourceLocation","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","reallyNegative","unSign","strLen","reSign","formatString","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","checkWasiClock","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","registerInheritedInstance","unregisterInheritedInstance","requireRegisteredType","enumReadValueFromPointer","validateThis","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(t){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var e="`"+t+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";g(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),tt(e)}})})),V=function t(){ye||Se(),ye||(V=t)},n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return Se(),t.ready});t.exports=r},43389:(t,e,r)=>{"use strict";var i=r(25705);function n(){}var s={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==n&&p(this,t)}function h(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function u(t,e,r){i((function(){var i;try{i=e(r)}catch(e){return s.reject(t,e)}i===t?s.reject(t,new TypeError("Cannot resolve promise with itself")):s.resolve(t,i)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var r=!1;function i(e){r||(r=!0,s.reject(t,e))}function n(e){r||(r=!0,s.resolve(t,e))}var o=f((function(){e(n,i)}));"error"===o.status&&i(o.value)}function f(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}t.exports=c,c.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){throw r}))}))},c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===o)return this;var r=new this.constructor(n);return this.state!==l?u(r,this.state===a?t:e,this.outcome):this.queue.push(new h(r,t,e)),r},h.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){s.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},s.resolve=function(t,e){var r=f(d,e);if("error"===r.status)return s.reject(t,r.value);var i=r.value;if(i)p(t,i);else{t.state=a,t.outcome=e;for(var n=-1,o=t.queue.length;++n{r(29718);var i=r(6941).s;function n(t){var e=new i;return(e.write(t)+e.end()).replace(/\0/g,"").trim()}t.exports=function t(e,r){if(!e)return n;try{new TextDecoder(e.trim())}catch(o){var i=s.exec(e);return i&&!r?t("windows-"+i[1],!0):n}return function(t){var r=new TextDecoder(e);return(r.decode(t,{stream:!0})+r.decode()).replace(/\0/g,"").trim()}};var s=/^(?:ANSI\s)?(\d+)$/m},9462:(t,e,r)=>{var i=r(11392);function n(t,e,r,i,n){var s=n(t.slice(e,e+r));switch(i){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return"y"===s.toLowerCase()||"t"===s.toLowerCase();default:return s}}function s(t,e,r,i){for(var s,o,a={},l=0,c=r.length;l{"use strict";t.exports=n;var i=r(80645);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var s=4294967296,o=1/s,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function h(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function u(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,s=this.pos;this.type=7&i,t(n,e,this),this.pos===s&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=x(this.buf,this.pos)+x(this.buf,this.pos+4)*s;return this.pos+=8,t},readSFixed64:function(){var t=x(this.buf,this.pos)+_(this.buf,this.pos+4)*s;return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,s=r.buf;if(i=(112&(n=s[r.pos++]))>>4,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<3,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<10,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<17,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<24,n<128)return c(t,i,e);if(i|=(1&(n=s[r.pos++]))<<31,n<128)return c(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,r){return a.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n239?4:l>223?3:l>191?2:1;if(n+h>r)break;1===h?l<128&&(c=l):2===h?128==(192&(s=t[n+1]))&&(c=(31&l)<<6|63&s)<=127&&(c=null):3===h?(s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&((c=(15&l)<<12|(63&s)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((c=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),n+=h}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==n.Bytes)return t.push(this.readVarint(e));var r=l(this);for(t=t||[];this.pos127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,s=0;s55295&&i<57344){if(!n){i>56319||s+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&h(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&h(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},24472:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>rr});var i=1,n=2,s=3,o=5,a=6378137,l=6356752.314,c=.0066943799901413165,h=484813681109536e-20,u=Math.PI/2,d=1e-10,p=.017453292519943295,f=57.29577951308232,m=Math.PI/4,g=2*Math.PI,A=3.14159265359,y={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const v={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var x=/[\s_\-\/\(\)]/g;function b(t,e){if(t[e])return t[e];for(var r,i=Object.keys(t),n=e.toLowerCase().replace(x,""),s=-1;++s=this.text.length)return;t=this.text[this.place++]}switch(this.state){case E:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},R.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(T.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},R.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=E)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=E,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},R.prototype.number=function(t){if(!I.test(t)){if(T.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},R.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},R.prototype.keyword=function(t){if(C.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=E)}if(!T.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},R.prototype.neutral=function(t){if(S.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(I.test(t))return this.word=t,void(this.state=3);if(!T.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},R.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=D(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(n),n}function k(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?k[t]=_(arguments[1]):k[t]=O(arguments[1]):k[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?k.apply(e,t):k(t)}));if("string"==typeof t){if(t in k)return k[t]}else"EPSG"in t?k["EPSG:"+t.EPSG]=t:"ESRI"in t?k["ESRI:"+t.ESRI]=t:"IAU2000"in t?k["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(k);const U=k;var N=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],F=["3857","900913","3785","102113"];function z(t,e){var r,i;if(t=t||{},!e)return t;for(i in e)void 0!==(r=e[i])&&(t[i]=r);return t}function G(t,e,r){var i=t*e;return r/Math.sqrt(1-i*i)}function Q(t){return t<0?-1:1}function j(t){return Math.abs(t)<=A?t:t-Q(t)*g}function V(t,e,r){var i=t*r,n=.5*t;return i=Math.pow((1-i)/(1+i),n),Math.tan(.5*(u-e))/i}function H(t,e){for(var r,i,n=.5*t,s=u-2*Math.atan(e),o=0;o<=15;o++)if(r=t*Math.sin(s),s+=i=u-2*Math.atan(e*Math.pow((1-r)/(1+r),n))-s,Math.abs(i)<=1e-10)return s;return-9999}function W(t){return t}var q=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,i=t.x,n=t.y;if(n*f>90&&n*f<-90&&i*f>180&&i*f<-180)return null;if(Math.abs(Math.abs(n)-u)<=d)return null;if(this.sphere)e=this.x0+this.a*this.k0*j(i-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(m+.5*n));else{var s=Math.sin(n),o=V(this.e,n,s);e=this.x0+this.a*this.k0*j(i-this.long0),r=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,i=t.x-this.x0,n=t.y-this.y0;if(this.sphere)r=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var s=Math.exp(-n/(this.a*this.k0));if(-9999===(r=H(this.e,s)))return null}return e=j(this.long0+i/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:W,inverse:W,names:["longlat","identity"]}],Z={},Y=[];function X(t,e){var r=Y.length;return t.names?(Y[r]=t,t.names.forEach((function(t){Z[t.toLowerCase()]=r})),this):(console.log(e),!0)}const J={start:function(){q.forEach(X)},add:X,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Z[e]&&Y[Z[e]]?Y[Z[e]]:void 0}};var K={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},$=K.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};K.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var tt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var et={};function rt(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:et[t]||null,isNull:!1}}function it(t){return t/3600*Math.PI/180}function nt(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function st(t){return t.map((function(t){return[it(t.longitudeShift),it(t.latitudeShift)]}))}function ot(t,e,r){return{name:nt(t,e+8,e+16).trim(),parent:nt(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function at(t,e,r,i){for(var n=e+176,s=[],o=0;o-1}))}(t)){var e=O(t);if(function(t){var e=b(t,"authority");if(e){var r=b(e,"epsg");return r&&F.indexOf(r)>-1}}(e))return U["EPSG:3857"];var r=function(t){var e=b(t,"extension");if(e)return b(e,"proj4")}(e);return r?_(r):e}return function(t){return"+"===t[0]}(t)?_(t):void 0}(t);if("object"==typeof r){var a=lt.projections.get(r.projName);if(a){if(r.datumCode&&"none"!==r.datumCode){var l=b(tt,r.datumCode);l&&(r.datum_params=r.datum_params||(l.towgs84?l.towgs84.split(","):null),r.ellps=l.ellipse,r.datumName=l.datumName?l.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var c,u,p,f,m,g,A=function(t,e,r,i,n){if(!t){var s=b(K,i);s||(s=$),t=s.a,e=s.b,r=s.rf}return r&&!e&&(e=(1-1/r)*t),(0===r||Math.abs(t-e)3&&(0===d.datum_params[3]&&0===d.datum_params[4]&&0===d.datum_params[5]&&0===d.datum_params[6]||(d.datum_type=n,d.datum_params[3]*=h,d.datum_params[4]*=h,d.datum_params[5]*=h,d.datum_params[6]=d.datum_params[6]/1e6+1))),u&&(d.datum_type=s,d.grids=u),d.a=r,d.b=a,d.es=l,d.ep2=c,d}(r.datumCode,r.datum_params,A.a,A.b,y.es,y.ep2,v);z(this,r),z(this,a),this.a=A.a,this.b=A.b,this.rf=A.rf,this.sphere=A.sphere,this.es=y.es,this.e=y.e,this.ep2=y.ep2,this.datum=x,this.init(),e(null,this)}else e(t)}else e(t)}lt.projections=J,lt.projections.start();const ct=lt;function ht(t,e,r){var i,n,s,o,a=t.x,l=t.y,c=t.z?t.z:0;if(l<-u&&l>-1.001*u)l=-u;else if(l>u&&l<1.001*u)l=u;else{if(l<-u)return{x:-1/0,y:-1/0,z:t.z};if(l>u)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(l),o=Math.cos(l),s=n*n,{x:((i=r/Math.sqrt(1-e*s))+c)*o*Math.cos(a),y:(i+c)*o*Math.sin(a),z:(i*(1-e)+c)*n}}function ut(t,e,r,i){var n,s,o,a,l,c,h,u,d,p,f,m,g,A,y,v=t.x,x=t.y,b=t.z?t.z:0;if(n=Math.sqrt(v*v+x*x),s=Math.sqrt(v*v+x*x+b*b),n/r<1e-12){if(A=0,s/r<1e-12)return y=-i,{x:t.x,y:t.y,z:t.z}}else A=Math.atan2(x,v);o=b/s,u=(a=n/s)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),d=o*l,g=0;do{g++,c=e*(h=r/Math.sqrt(1-e*d*d))/(h+(y=n*u+b*d-h*(1-e*d*d))),m=(f=o*(l=1/Math.sqrt(1-c*(2-c)*a*a)))*u-(p=a*(1-c)*l)*d,u=p,d=f}while(m*m>1e-24&&g<30);return{x:A,y:Math.atan(f/Math.abs(p)),z:y}}function dt(t){return t===i||t===n}function pt(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var i={x:-r.x,y:r.y},n={x:Number.NaN,y:Number.NaN},s=[];t:for(var o=0;oi.y||p>i.x||A1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=j(s.x+r.ll[0]),i.y=s.y+r.ll[1]}else isNaN(s.x)||(i.x=t.x+s.x,i.y=t.y+s.y);return i}function mt(t,e){var r,i={x:t.x/e.del[0],y:t.y/e.del[1]},n=Math.floor(i.x),s=Math.floor(i.y),o=i.x-1*n,a=i.y-1*s,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=e.lim[0])return l;if(s<0||s>=e.lim[1])return l;r=s*e.lim[0]+n;var c=e.cvs[r][0],h=e.cvs[r][1];r++;var u=e.cvs[r][0],d=e.cvs[r][1];r+=e.lim[0];var p=e.cvs[r][0],f=e.cvs[r][1];r--;var m=e.cvs[r][0],g=e.cvs[r][1],A=o*a,y=o*(1-a),v=(1-o)*(1-a),x=(1-o)*a;return l.x=v*c+y*u+x*m+A*p,l.y=v*h+y*d+x*g+A*f,l}function gt(t,e,r){var i,n,s,o=r.x,a=r.y,l=r.z||0,c={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==r.z)switch(0===s?(i=o,n=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(i=a,n=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(i=l,n="z"),t.axis[s]){case"e":case"n":c[n]=i;break;case"w":case"s":c[n]=-i;break;case"u":void 0!==r[n]&&(c.z=i);break;case"d":void 0!==r[n]&&(c.z=-i);break;default:return null}return c}function At(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function yt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function vt(t,e,r,h){var u,d=void 0!==(r=Array.isArray(r)?At(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){yt(t.x),yt(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===i||t.datum.datum_type===n||t.datum.datum_type===s)&&"WGS84"!==e.datumCode||(e.datum.datum_type===i||e.datum.datum_type===n||e.datum.datum_type===s)&&"WGS84"!==t.datumCode}(t,e)&&(r=vt(t,u=new ct("WGS84"),r,h),t=u),h&&"enu"!==t.axis&&(r=gt(t,!1,r)),"longlat"===t.projName)r={x:r.x*p,y:r.y*p,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===i?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==n||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===o||e.datum_type===o)return r;var h=t.a,u=t.es;if(t.datum_type===s){if(0!==pt(t,!1,r))return;h=a,u=c}var d=e.a,p=e.b,f=e.es;return e.datum_type===s&&(d=a,p=l,f=c),u!==f||h!==d||dt(t.datum_type)||dt(e.datum_type)?(r=ht(r,u,h),dt(t.datum_type)&&(r=function(t,e,r){if(e===i)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===n){var s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6];return{x:u*(t.x-h*t.y+c*t.z)+s,y:u*(h*t.x+t.y-l*t.z)+o,z:u*(-c*t.x+l*t.y+t.z)+a}}}(r,t.datum_type,t.datum_params)),dt(e.datum_type)&&(r=function(t,e,r){if(e===i)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===n){var s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],d=(t.x-s)/u,p=(t.y-o)/u,f=(t.z-a)/u;return{x:d+h*p-c*f,y:-h*d+p+l*f,z:c*d-l*p+f}}}(r,e.datum_type,e.datum_params)),r=ut(r,f,d,p),e.datum_type!==s||0===pt(e,!0,r)?r:void 0):r}(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*f,y:r.y*f,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),h&&"enu"!==e.axis?gt(e,!0,r):(r&&!d&&delete r.z,r)}var xt=ct("WGS84");function bt(t,e,r,i){var n,s,o;return Array.isArray(r)?(n=vt(t,e,r,i)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(r.splice(3)):[n.x,n.y,r[2]].concat(r.splice(3)):[n.x,n.y].concat(r.splice(2)):[n.x,n.y]):(s=vt(t,e,r,i),2===(o=Object.keys(r)).length||o.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;s[i]=r[i]})),s)}function _t(t){return t instanceof ct?t:t.oProj?t.oProj:ct(t)}const wt=function(t,e,r){t=_t(t);var i,n=!1;return void 0===e?(e=t,t=xt,n=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=xt,n=!0),e=_t(e),r?bt(t,e,r):(i={forward:function(r,i){return bt(t,e,r,i)},inverse:function(r,i){return bt(e,t,r,i)}},n&&(i.oProj=e),i)};var Et=6,Mt="AJSAJS",St="AFAFAF",Ct=65,Tt=73,It=79,Rt=86,Bt=90;const Lt={forward:Pt,inverse:function(t){var e=Ut(Ft(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:Dt};function Pt(t,e){return e=e||5,function(t,e){var r,i,n,s,o,a,l,c,h,u,d,p="00000"+t.easting,f="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(h=t.easting,u=t.northing,d=Nt(t.zoneNumber),r=Math.floor(h/1e5),i=Math.floor(u/1e5)%20,n=d-1,s=Mt.charCodeAt(n),o=St.charCodeAt(n),c=!1,(a=s+r-1)>Bt&&(a=a-Bt+Ct-1,c=!0),(a===Tt||sTt||(a>Tt||sIt||(a>It||sBt&&(a=a-Bt+Ct-1),(l=o+i)>Rt?(l=l-Rt+Ct-1,c=!0):c=!1,(l===Tt||oTt||(l>Tt||oIt||(l>It||oRt&&(l=l-Rt+Ct-1),String.fromCharCode(a)+String.fromCharCode(l))+p.substr(p.length-5,e)+f.substr(f.length-5,e)}(function(t){var e,r,i,n,s,o,a,l=t.lat,c=t.lon,h=6378137,u=.00669438,d=.9996,p=Ot(l),f=Ot(c);a=Math.floor((c+180)/6)+1,180===c&&(a=60),l>=56&&l<64&&c>=3&&c<12&&(a=32),l>=72&&l<84&&(c>=0&&c<9?a=31:c>=9&&c<21?a=33:c>=21&&c<33?a=35:c>=33&&c<42&&(a=37)),o=Ot(6*(a-1)-180+3),e=.006739496752268451,r=h/Math.sqrt(1-u*Math.sin(p)*Math.sin(p)),i=Math.tan(p)*Math.tan(p),n=e*Math.cos(p)*Math.cos(p);var m,g,A=d*r*((s=Math.cos(p)*(f-o))+(1-i+n)*s*s*s/6+(5-18*i+i*i+72*n-58*e)*s*s*s*s*s/120)+5e5,y=d*(h*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p))+r*Math.tan(p)*(s*s/2+(5-i+9*n+4*n*n)*s*s*s*s/24+(61-58*i+i*i+600*n-2.2240339282485886)*s*s*s*s*s*s/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(A),zoneNumber:a,zoneLetter:(m=l,g="Z",84>=m&&m>=72?g="X":72>m&&m>=64?g="W":64>m&&m>=56?g="V":56>m&&m>=48?g="U":48>m&&m>=40?g="T":40>m&&m>=32?g="S":32>m&&m>=24?g="R":24>m&&m>=16?g="Q":16>m&&m>=8?g="P":8>m&&m>=0?g="N":0>m&&m>=-8?g="M":-8>m&&m>=-16?g="L":-16>m&&m>=-24?g="K":-24>m&&m>=-32?g="J":-32>m&&m>=-40?g="H":-40>m&&m>=-48?g="G":-48>m&&m>=-56?g="F":-56>m&&m>=-64?g="E":-64>m&&m>=-72?g="D":-72>m&&m>=-80&&(g="C"),g)}}({lat:t[1],lon:t[0]}),e)}function Dt(t){var e=Ut(Ft(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Ot(t){return t*(Math.PI/180)}function kt(t){return t/Math.PI*180}function Ut(t){var e=t.northing,r=t.easting,i=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var s,o,a,l,c,h,u,d,p,f=.9996,m=6378137,g=.00669438,A=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,v=e;i<"N"&&(v-=1e7),u=6*(n-1)-180+3,s=.006739496752268451,p=(d=v/f/6367449.145945056)+(3*A/2-27*A*A*A/32)*Math.sin(2*d)+(21*A*A/16-55*A*A*A*A/32)*Math.sin(4*d)+151*A*A*A/96*Math.sin(6*d),o=m/Math.sqrt(1-g*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),l=s*Math.cos(p)*Math.cos(p),c=.99330562*m/Math.pow(1-g*Math.sin(p)*Math.sin(p),1.5),h=y/(o*f);var x=p-o*Math.tan(p)/c*(h*h/2-(5+3*a+10*l-4*l*l-9*s)*h*h*h*h/24+(61+90*a+298*l+45*a*a-1.6983531815716497-3*l*l)*h*h*h*h*h*h/720);x=kt(x);var b,_=(h-(1+2*a+l)*h*h*h/6+(5-2*l+28*a-3*l*l+8*s+24*a*a)*h*h*h*h*h/120)/Math.cos(p);if(_=u+kt(_),t.accuracy){var w=Ut({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:w.lat,right:w.lon,bottom:x,left:_}}else b={lat:x,lon:_};return b}function Nt(t){var e=t%Et;return 0===e&&(e=Et),e}function Ft(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,i=null,n="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;n+=e,s++}var o=parseInt(n,10);if(0===s||s+3>r)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;i=t.substring(s,s+=2);for(var l=Nt(o),c=function(t,e){for(var r=Mt.charCodeAt(e-1),i=1e5,n=!1;r!==t.charCodeAt(0);){if(++r===Tt&&r++,r===It&&r++,r>Bt){if(n)throw"Bad character: "+t;r=Ct,n=!0}i+=1e5}return i}(i.charAt(0),l),h=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=St.charCodeAt(e-1),i=0,n=!1;r!==t.charCodeAt(0);){if(++r===Tt&&r++,r===It&&r++,r>Rt){if(n)throw"Bad character: "+t;r=Ct,n=!0}i+=1e5}return i}(i.charAt(1),l);h0&&(d=1e5/Math.pow(10,m),p=t.substring(s,s+m),g=parseFloat(p)*d,f=t.substring(s+m),A=parseFloat(f)*d),{easting:g+c,northing:A+h,zoneLetter:a,zoneNumber:o,accuracy:d}}function zt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Gt(t,e,r){if(!(this instanceof Gt))return new Gt(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Gt.fromMGRS=function(t){return new Gt(Dt(t))},Gt.prototype.toMGRS=function(t){return Pt([this.x,this.y],t)};const Qt=Gt;var jt=.046875,Vt=.01953125,Ht=.01068115234375;function Wt(t){var e=[];e[0]=1-t*(.25+t*(jt+t*(Vt+t*Ht))),e[1]=t*(.75-t*(jt+t*(Vt+t*Ht)));var r=t*t;return e[2]=r*(.46875-t*(.013020833333333334+.007120768229166667*t)),r*=t,e[3]=r*(.3645833333333333-.005696614583333333*t),e[4]=r*t*.3076171875,e}function qt(t,e,r,i){return r*=e,e*=e,i[0]*t-r*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))}function Zt(t,e,r){for(var i=1/(1-e),n=t,s=20;s;--s){var o=Math.sin(n),a=1-e*o*o;if(n-=a=(qt(n,o,Math.cos(n),r)-t)*(a*Math.sqrt(a))*i,Math.abs(a)d?Math.tan(s):0,m=Math.pow(f,2),g=Math.pow(m,2);e=1-this.es*Math.pow(a,2),c/=Math.sqrt(e);var A=qt(s,a,l,this.en);r=this.a*(this.k0*c*(1+h/6*(1-m+u+h/20*(5-18*m+g+14*u-58*m*u+h/42*(61+179*g-g*m-479*m)))))+this.x0,i=this.a*(this.k0*(A-this.ml0+a*o*c/2*(1+h/12*(5-m+9*u+4*p+h/30*(61+g-58*m+270*u-330*m*u+h/56*(1385+543*g-g*m-3111*m))))))+this.y0}else{var y=l*Math.sin(o);if(Math.abs(Math.abs(y)-1)=1){if(y-1>d)return 93;i=0}else i=Math.acos(i);s<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=r,t.y=i,t},inverse:function(t){var e,r,i,n,s=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(r=Zt(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(r)d?Math.tan(r):0,h=this.ep2*Math.pow(l,2),p=Math.pow(h,2),f=Math.pow(c,2),m=Math.pow(f,2);e=1-this.es*Math.pow(a,2);var g=s*Math.sqrt(e)/this.k0,A=Math.pow(g,2);i=r-(e*=c)*A/(1-this.es)*.5*(1-A/12*(5+3*f-9*h*f+h-4*p-A/30*(61+90*f-252*h*f+45*m+46*h-A/56*(1385+3633*f+4095*m+1574*m*f)))),n=j(this.long0+g*(1-A/6*(1+2*f+h-A/20*(5+28*f+24*m+8*h*f+6*h-A/42*(61+662*f+1320*m+720*m*f))))/l)}else i=u*Q(o),n=0;else{var y=Math.exp(s/this.k0),v=.5*(y-1/y),x=this.lat0+o/this.k0,b=Math.cos(x);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(v,2))),i=Math.asin(e),o<0&&(i=-i),n=0===v&&0===b?0:j(Math.atan2(v,b)+this.long0)}return t.x=n,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Xt(t){var e=Math.exp(t);return(e-1/e)/2}function Jt(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),i=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function Kt(t,e){for(var r,i=2*Math.cos(2*e),n=t.length-1,s=t[n],o=0;--n>=0;)r=i*s-o+t[n],o=s,s=r;return e+r*Math.sin(2*e)}function $t(t,e,r){for(var i,n,s=Math.sin(e),o=Math.cos(e),a=Xt(r),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(r),c=2*o*l,h=-2*s*a,u=t.length-1,d=t[u],p=0,f=0,m=0;--u>=0;)i=f,n=p,d=c*(f=d)-i-h*(p=m)+t[u],m=h*f-n+c*p;return[(c=s*l)*d-(h=o*a)*m,c*m+h*d]}const te={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Yt.init.apply(this),this.forward=Yt.forward,this.inverse=Yt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var i=Kt(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var r,i=2*Math.cos(e),n=t.length-1,s=t[n],o=0;--n>=0;)r=i*s-o+t[n],o=s,s=r;return Math.sin(e)*r}(this.gtu,2*i))},forward:function(t){var e=j(t.x-this.long0),r=t.y;r=Kt(this.cbg,r);var i=Math.sin(r),n=Math.cos(r),s=Math.sin(e),o=Math.cos(e);r=Math.atan2(i,o*n),e=Math.atan2(s*n,Jt(i,n*o)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(Jt(1,e)+1))),t<0?-e:e}(Math.tan(e));var a,l,c=$t(this.gtu,2*r,2*e);return r+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,r,i=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var s=$t(this.utg,2*n,2*i);n+=s[0],i+=s[1],i=Math.atan(Xt(i));var o=Math.sin(n),a=Math.cos(n),l=Math.sin(i),c=Math.cos(i);n=Math.atan2(o*c,Jt(l,c*a)),e=j((i=Math.atan2(l,c*a))+this.long0),r=Kt(this.cgb,n)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ee={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(j(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*p,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,te.init.apply(this),this.forward=te.forward,this.inverse=te.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function re(t,e){return Math.pow((1-t)/(1+t),e)}const ie={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+m)/(Math.pow(Math.tan(.5*this.lat0+m),this.C)*re(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+m),this.C)*re(this.e*Math.sin(r),this.ratexp))-u,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,i=Math.pow(Math.tan(.5*r+m)/this.K,1/this.C),n=20;n>0&&(r=2*Math.atan(i*re(this.e*Math.sin(t.y),-.5*this.e))-u,!(Math.abs(r-t.y)<1e-14));--n)t.y=r;return n?(t.x=e,t.y=r,t):null},names:["gauss"]},ne={init:function(){ie.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,i,n;return t.x=j(t.x-this.long0),ie.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),i=Math.cos(t.x),n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*i),t.x=n*r*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*r*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,i,n,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var o=2*Math.atan2(s,this.R2);e=Math.sin(o),r=Math.cos(o),n=Math.asin(r*this.sinc0+t.y*e*this.cosc0/s),i=Math.atan2(t.x*e,s*this.cosc0*r-t.y*this.sinc0*e)}else n=this.phic0,i=0;return t.x=i,t.y=n,ie.inverse.apply(this,[t]),t.x=j(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},se={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=d&&(this.k0=.5*(1+Q(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=d&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=d&&Math.abs(Math.cos(this.lat_ts))>d&&(this.k0=.5*this.cons*G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/V(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=G(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,i,n,s,o,a=t.x,l=t.y,c=Math.sin(l),h=Math.cos(l),p=j(a-this.long0);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=d&&Math.abs(l+this.lat0)<=d?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*h*Math.cos(p)),t.x=this.a*e*h*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*h*Math.cos(p))+this.y0,t):(r=2*Math.atan(this.ssfn_(l,c,this.e))-u,n=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=d?(s=V(this.e,l*this.con,this.con*c),o=2*this.a*this.k0*s/this.cons,t.x=this.x0+o*Math.sin(a-this.long0),t.y=this.y0-this.con*o*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)0?j(this.long0+Math.atan2(t.x,-1*t.y)):j(this.long0+Math.atan2(t.x,t.y)):j(this.long0+Math.atan2(t.x*Math.sin(a),o*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=d){if(o<=d)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,i=o*this.cons/(2*this.a*this.k0),r=this.con*H(this.e,i),e=this.con*j(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=d?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/o),e=j(this.long0+Math.atan2(t.x*Math.sin(n),o*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))),r=-1*H(this.e,Math.tan(.5*(u+s)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(u+t))*Math.pow((1-e)/(1+e),.5*r)}},oe={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,i=1/this.rf,n=2*i-Math.pow(i,2),s=this.e=Math.sqrt(n);this.R=this.k0*r*Math.sqrt(1-n)/(1-n*Math.pow(e,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=-this.alpha*(e+r)+this.K,n=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,i=e/this.R,n=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(i)),o=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(n))),a=this.lambda0+o/this.alpha,l=0,c=s,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=c,t},names:["somerc"]};var ae=1e-7;const le={init:function(){var t,e,r,i,n,s,o,a,l,c,h,f,A,y=0,v=0,x=0,b=0,_=0,w=0,E=0;this.no_off=(A="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(A)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),M&&(E=this.alpha),S&&(y=this.rectified_grid_angle*p),M||S)v=this.longc;else if(x=this.long1,_=this.lat1,b=this.long2,w=this.lat2,Math.abs(_-w)<=ae||(t=Math.abs(_))<=ae||Math.abs(t-u)<=ae||Math.abs(Math.abs(this.lat0)-u)<=ae||Math.abs(Math.abs(w)-u)<=ae)throw new Error;var C=1-this.es;e=Math.sqrt(C),Math.abs(this.lat0)>d?(a=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*a*a,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*e/t,(n=(i=this.B*e/(r*Math.sqrt(t)))*i-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(V(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=n=1),M||S?(M?(h=Math.asin(Math.sin(E)/i),S||(y=E)):(h=y,E=Math.asin(i*Math.sin(h))),this.lam0=v-Math.asin(.5*(n-1/n)*Math.tan(h))/this.B):(s=Math.pow(V(this.e,_,Math.sin(_)),this.B),o=Math.pow(V(this.e,w,Math.sin(w)),this.B),n=this.E/s,l=(o-s)/(o+s),c=((c=this.E*this.E)-o*s)/(c+o*s),(t=x-b)<-Math.pi?b-=g:t>Math.pi&&(b+=g),this.lam0=j(.5*(x+b)-Math.atan(c*Math.tan(.5*this.B*(x-b))/l)/this.B),h=Math.atan(2*Math.sin(this.B*j(x-this.lam0))/(n-1/n)),y=E=Math.asin(i*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(E))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(m-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(m+n))},forward:function(t){var e,r,i,n,s,o,a,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-u)>d){if(e=.5*((s=this.E/Math.pow(V(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/s)),r=.5*(s+o),n=Math.sin(this.B*t.x),i=(e*this.singam-n*this.cosgam)/r,Math.abs(Math.abs(i)-1)0?this.v_pole_n:this.v_pole_s,a=this.ArB*t.y;return this.no_rot?(c.x=a,c.y=l):(a-=this.u_0,c.x=l*this.cosrot+a*this.sinrot,c.y=a*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,r,i,n,s,o,a,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((i=Math.exp(-this.BrA*r))-1/i),s=.5*(i+1/i),a=((o=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/s,Math.abs(Math.abs(a)-1)d?this.ns=Math.log(i/a)/Math.log(n/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=d&&(r=Q(r)*(u-2e-10));var i,n,s=Math.abs(Math.abs(r)-u);if(s>d)i=V(this.e,r,Math.sin(r)),n=this.a*this.f0*Math.pow(i,this.ns);else{if((s=r*this.ns)<=0)return null;n=0}var o=this.ns*j(e-this.long0);return t.x=this.k0*(n*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,t},inverse:function(t){var e,r,i,n,s,o=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+a*a),r=1):(e=-Math.sqrt(o*o+a*a),r=-1);var l=0;if(0!==e&&(l=Math.atan2(r*o,r*a)),0!==e||this.ns>0){if(r=1/this.ns,i=Math.pow(e/(this.a*this.f0),r),-9999===(n=H(this.e,i)))return null}else n=-u;return s=j(l/this.ns+this.long0),t.x=s,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},he={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,i,n,s,o,a,l=t.x,c=t.y,h=j(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),i=-h*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),s=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(n)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,i,n,s,o,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(e)),t.x=this.long0-r/this.alfa,o=e,a=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(a=1),o=t.y,c+=1}while(0===a&&c<15);return c>=15?null:t},names:["Krovak","krovak"]};function ue(t,e,r,i,n){return t*n-e*Math.sin(2*n)+r*Math.sin(4*n)-i*Math.sin(6*n)}function de(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function pe(t){return.375*t*(1+.25*t*(1+.46875*t))}function fe(t){return.05859375*t*t*(1+.75*t)}function me(t){return t*t*t*(35/3072)}function ge(t,e,r){var i=e*r;return t/Math.sqrt(1-i*i)}function Ae(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}const be={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-u)0)switch(this.qp=xe(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,e=t*t,r[0]+=.17222222222222222*e,r[1]=.06388888888888888*e,e*=t,r[0]+=.10257936507936508*e,r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=xe(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,i,n,s,o,a,l,c,h,p=t.x,f=t.y;if(p=j(p-this.long0),this.sphere){if(s=Math.sin(f),h=Math.cos(f),i=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+h*i:1+this.sinph0*s+this.cosph0*h*i)<=d)return null;e=(r=Math.sqrt(2/r))*h*Math.sin(p),r*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(f+this.lat0)=0?(e=(c=Math.sqrt(o))*n,r=i*(this.mode===this.S_POLE?c:-c)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,i,n,s,o,a,l,c,h,p=t.x/this.a,f=t.y/this.a;if(this.sphere){var m,g=0,A=0;if((r=.5*(m=Math.sqrt(p*p+f*f)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(A=Math.sin(r),g=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(m)<=d?0:Math.asin(f*A/m),p*=A,f=g*m;break;case this.OBLIQ:r=Math.abs(m)<=d?this.lat0:Math.asin(g*this.sinph0+f*A*this.cosph0/m),p*=A*this.cosph0,f=(g-Math.sin(r)*this.sinph0)*m;break;case this.N_POLE:f=-f,r=u-r;break;case this.S_POLE:r-=u}e=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(o=Math.sqrt(p*p+f*f))1&&(t=t>1?1:-1),Math.asin(t)}const we={init:function(){Math.abs(this.lat1+this.lat2)d?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=xe(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*j(e-this.long0),o=n*Math.sin(s)+this.x0,a=this.rh-n*Math.cos(s)+this.y0;return t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),n=0,0!==e&&(n=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-i*i)/(2*this.ns0)):(r=(this.c-i*i)/this.ns0,o=this.phi1z(this.e3,r)),s=j(n/this.ns0+this.long0),t.x=s,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,i,n,s,o=_e(.5*e);if(t0||Math.abs(s)<=d?(o=this.x0+1*this.a*r*Math.sin(i)/s,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)/s):(o=this.x0+this.infinity_dist*r*Math.sin(i),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*n)),t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),r=Math.sin(n),o=_e((i=Math.cos(n))*this.sin_p14+t.y*r*this.cos_p14/e),s=Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r),s=j(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t},names:["gnom"]},Me={init:function(){this.sphere||(this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,i=t.x,n=t.y,s=j(i-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=xe(this.e,Math.sin(n));e=this.x0+this.a*this.k0*s,r=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=j(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*u:u;for(var i,n,s,o,a=Math.asin(.5*e),l=0;l<30;l++)if(n=Math.sin(a),s=Math.cos(a),o=t*n,a+=i=Math.pow(1-o*o,2)/(2*s)*(e/(1-t*t)-n/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(i)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),e=j(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]},Se={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,i=j(e-this.long0),n=Ae(r-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*n,t},inverse:function(t){var e=t.x,r=t.y;return t.x=j(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Ae(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ce={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=de(this.es),this.e1=pe(this.es),this.e2=fe(this.es),this.e3=me(this.es),this.ml0=this.a*ue(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,i,n=t.x,s=t.y,o=j(n-this.long0);if(i=o*Math.sin(s),this.sphere)Math.abs(s)<=d?(e=this.a*o,r=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(s),r=this.a*(Ae(s-this.lat0)+(1-Math.cos(i))/Math.tan(s)));else if(Math.abs(s)<=d)e=this.a*o,r=-1*this.ml0;else{var a=ge(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(i),r=this.a*ue(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(i))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,i,n,s,o,a,l,c;if(i=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=d)e=j(i/this.a+this.long0),r=0;else{var h;for(o=this.lat0+n/this.a,a=i*i/this.a/this.a+o*o,l=o,s=20;s;--s)if(l+=c=-1*(o*(l*(h=Math.tan(l))+1)-l-.5*(l*l+a)*h)/((l-o)/h-1),Math.abs(c)<=d){r=l;break}e=j(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(n+this.ml0)<=d)r=0,e=j(this.long0+i/this.a);else{var u,p,f,m,g;for(o=(this.ml0+n)/this.a,a=i*i/this.a/this.a+o*o,l=o,s=20;s;--s)if(g=this.e*Math.sin(l),u=Math.sqrt(1-g*g)*Math.tan(l),p=this.a*ue(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(o*(u*(m=p/this.a)+1)-m-.5*u*(m*m+a))/(this.es*Math.sin(2*l)*(m*m+a-2*o*m)/(4*u)+(o-m)*(u*f-2/Math.sin(2*l))-f),Math.abs(c)<=d){r=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=j(this.long0+Math.asin(i*u/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]},Te={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,i=t.y-this.lat0,n=r-this.long0,s=i/h*1e-5,o=n,a=1,l=0;for(e=1;e<=10;e++)a*=s,l+=this.A[e]*a;var c,u=l,d=o,p=1,f=0,m=0,g=0;for(e=1;e<=6;e++)c=f*u+p*d,p=p*u-f*d,f=c,m=m+this.B_re[e]*p-this.B_im[e]*f,g=g+this.B_im[e]*p+this.B_re[e]*f;return t.x=g*this.a+this.x0,t.y=m*this.a+this.y0,t},inverse:function(t){var e,r,i=t.x,n=t.y,s=i-this.x0,o=(n-this.y0)/this.a,a=s/this.a,l=1,c=0,u=0,d=0;for(e=1;e<=6;e++)r=c*o+l*a,l=l*o-c*a,c=r,u=u+this.C_re[e]*l-this.C_im[e]*c,d=d+this.C_im[e]*l+this.C_re[e]*c;for(var p=0;p.999999999999&&(r=.999999999999),e=Math.asin(r);var i=j(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var n=Math.asin(r);return t.x=i,t.y=n,t},names:["Mollweide","moll"]},Le={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;return 0!==r&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere?(n=j(this.long0+s/this.ns),i=Ae(this.g-r/this.a),t.x=n,t.y=i,t):(i=ye(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),n=j(this.long0+s/this.ns),t.x=n,t.y=i,t)},names:["Equidistant_Conic","eqdc"]},Pe={init:function(){this.R=this.a},forward:function(t){var e,r,i=t.x,n=t.y,s=j(i-this.long0);Math.abs(n)<=d&&(e=this.x0+this.R*s,r=this.y0);var o=_e(2*Math.abs(n/Math.PI));(Math.abs(s)<=d||Math.abs(Math.abs(n)-u)<=d)&&(e=this.x0,r=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/s-s/Math.PI),l=a*a,c=Math.sin(o),h=Math.cos(o),p=h/(c+h-1),f=p*p,m=p*(2/c-1),g=m*m,A=Math.PI*this.R*(a*(p-g)+Math.sqrt(l*(p-g)*(p-g)-(g+l)*(f-g)))/(g+l);s<0&&(A=-A),e=this.x0+A;var y=l+p;return A=Math.PI*this.R*(m*y-a*Math.sqrt((g+l)*(l+1)-y*y))/(g+l),r=n>=0?this.y0+A:this.y0-A,t.x=e,t.y=r,t},inverse:function(t){var e,r,i,n,s,o,a,l,c,h,u,p;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=(i=t.x/u)*i+(n=t.y/u)*n,u=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+s))+1+2*n*n+s*s)+(2*(a=o-2*n*n+i*i)*a*a/l/l/l-9*o*a/l/l)/27)/(c=(o-a*a/3/l)/l)/(h=2*Math.sqrt(-c/3)),Math.abs(u)>1&&(u=u>=0?1:-1),p=Math.acos(u)/3,r=t.y>=0?(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(i)2*u*this.a)return;return r=e/this.a,i=Math.sin(r),n=Math.cos(r),s=this.long0,Math.abs(e)<=d?o=this.lat0:(o=_e(n*this.sin_p12+t.y*i*this.cos_p12/e),a=Math.abs(this.lat0)-u,s=Math.abs(a)<=d?this.lat0>=0?j(this.long0+Math.atan2(t.x,-t.y)):j(this.long0-Math.atan2(-t.x,t.y)):j(this.long0+Math.atan2(t.x*i,e*this.cos_p12*n-t.y*this.sin_p12*i))),t.x=s,t.y=o,t}return l=de(this.es),c=pe(this.es),h=fe(this.es),p=me(this.es),Math.abs(this.sin_p12-1)<=d?(o=ye(((f=this.a*ue(l,c,h,p,u))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,c,h,p),s=j(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=o,t):Math.abs(this.sin_p12+1)<=d?(f=this.a*ue(l,c,h,p,u),o=ye(((e=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,l,c,h,p),s=j(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),A=Math.atan2(t.x,t.y),m=ge(this.a,this.e,this.sin_p12),y=Math.cos(A),x=-(v=this.e*this.cos_p12*y)*v/(1-this.es),b=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),E=1-x*(w=(_=e/m)-x*(1+x)*Math.pow(_,3)/6-b*(1+3*x)*Math.pow(_,4)/24)*w/2-_*w*w*w/6,g=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*y),s=j(this.long0+Math.asin(Math.sin(A)*Math.sin(w)/Math.cos(g))),M=Math.sin(g),o=Math.atan2((M-this.es*E*this.sin_p12)*Math.tan(g),M*(1-this.es)),t.x=s,t.y=o,t)},names:["Azimuthal_Equidistant","aeqd"]},Oe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,i,n,s,o,a,l=t.x,c=t.y;return i=j(l-this.long0),e=Math.sin(c),r=Math.cos(c),n=Math.cos(i),((s=this.sin_p14*e+this.cos_p14*r*n)>0||Math.abs(s)<=d)&&(o=1*this.a*r*Math.sin(i),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)),t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o,a;return t.x-=this.x0,t.y-=this.y0,r=_e((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),i=Math.sin(r),n=Math.cos(r),o=this.long0,Math.abs(e)<=d?(a=this.lat0,t.x=o,t.y=a,t):(a=_e(n*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.abs(this.lat0)-u,Math.abs(s)<=d?(o=this.lat0>=0?j(this.long0+Math.atan2(t.x,-t.y)):j(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=a,t):(o=j(this.long0+Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i)),t.x=o,t.y=a,t))},names:["ortho"]};var ke=1,Ue=2,Ne=3,Fe=4;function ze(t,e,r,i){var n;return tm&&n<=u+m?(i.value=Ue,n-=u):n>u+m||n<=-(u+m)?(i.value=Ne,n=n>=0?n-A:n+A):(i.value=Fe,n+=u)),n}function Ge(t,e){var r=t+e;return r<-A?r+=g:r>+A&&(r-=g),r}const Qe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=u-m/2?this.face=5:this.lat0<=-(u-m/2)?this.face=6:Math.abs(this.long0)<=m?this.face=1:Math.abs(this.long0)<=u+m?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,i,n,s,o,a={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,5===this.face)n=u-e,r>=m&&r<=u+m?(l.value=ke,i=r-u):r>u+m||r<=-(u+m)?(l.value=Ue,i=r>0?r-A:r+A):r>-(u+m)&&r<=-m?(l.value=Ne,i=r+u):(l.value=Fe,i=r);else if(6===this.face)n=u+e,r>=m&&r<=u+m?(l.value=ke,i=-r+u):r=-m?(l.value=Ue,i=-r):r<-m&&r>=-(u+m)?(l.value=Ne,i=-r-u):(l.value=Fe,i=r>0?-r+A:-r-A);else{var c,h,d,p,f,g;2===this.face?r=Ge(r,+u):3===this.face?r=Ge(r,+A):4===this.face&&(r=Ge(r,-u)),p=Math.sin(e),f=Math.cos(e),g=Math.sin(r),c=f*Math.cos(r),h=f*g,d=p,1===this.face?i=ze(n=Math.acos(c),d,h,l):2===this.face?i=ze(n=Math.acos(h),d,-c,l):3===this.face?i=ze(n=Math.acos(-c),d,-h,l):4===this.face?i=ze(n=Math.acos(-h),d,c,l):(n=i=0,l.value=ke)}return o=Math.atan(12/A*(i+Math.acos(Math.sin(i)*Math.cos(m))-u)),s=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Ue?o+=u:l.value===Ne?o+=A:l.value===Fe&&(o+=1.5*A),a.x=s*Math.cos(o),a.y=s*Math.sin(o),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var e,r,i,n,s,o,a,l,c,h,d,p,f={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=ke:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=Ue,e-=u):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=Ne,e=e<0?e+A:e-A):(m.value=Fe,e+=u),c=A/12*Math.tan(e),s=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(s),(a=1-(i=Math.cos(e))*i*(n=Math.tan(r))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?a=-1:a>1&&(a=1),5===this.face)l=Math.acos(a),f.phi=u-l,m.value===ke?f.lam=o+u:m.value===Ue?f.lam=o<0?o+A:o-A:m.value===Ne?f.lam=o-u:f.lam=o;else if(6===this.face)l=Math.acos(a),f.phi=l-u,m.value===ke?f.lam=-o+u:m.value===Ue?f.lam=-o:m.value===Ne?f.lam=-o-u:f.lam=o<0?-o-A:-o+A;else{var g,y,v;c=(g=a)*g,y=(c+=(v=c>=1?0:Math.sqrt(1-c)*Math.sin(o))*v)>=1?0:Math.sqrt(1-c),m.value===Ue?(c=y,y=-v,v=c):m.value===Ne?(y=-y,v=-v):m.value===Fe&&(c=y,y=v,v=-c),2===this.face?(c=g,g=-y,y=c):3===this.face?(g=-g,y=-y):4===this.face&&(c=g,g=y,y=-c),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(y,g),2===this.face?f.lam=Ge(f.lam,-u):3===this.face?f.lam=Ge(f.lam,-A):4===this.face&&(f.lam=Ge(f.lam,+u))}return 0!==this.es&&(h=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),h&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var je=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ve=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],He=.8487,We=1.3523,qe=f/5,Ze=1/qe,Ye=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const Xe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=j(t.x-this.long0),r=Math.abs(t.y),i=Math.floor(r*qe);i<0?i=0:i>=18&&(i=17);var n={x:Ye(je[i],r=f*(r-Ze*i))*e,y:Ye(Ve[i],r)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*He+this.x0,n.y=n.y*this.a*We+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*He),y:Math.abs(t.y-this.y0)/(this.a*We)};if(e.y>=1)e.x/=je[18][0],e.y=t.y<0?-u:u;else{var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(Ve[r][0]>e.y)--r;else{if(!(Ve[r+1][0]<=e.y))break;++r}var i=Ve[r],n=5*(e.y-i[0])/(Ve[r+1][0]-i[0]);n=function(t,e,r,i){for(var n=e;i;--i){var s=t(n);if(n-=s,Math.abs(s)<1e-10)break}return n}((function(t){return(Ye(i,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(i,t)}),n,0,100),e.x/=Ye(je[r],n),e.y=(5*r+n)*p,t.y<0&&(e.y=-e.y)}return e.x=j(e.x+this.long0),e},names:["Robinson","robin"]},Je={init:function(){this.name="geocent"},forward:function(t){return ht(t,this.es,this.a)},inverse:function(t){return ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Ke={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const $e={init:function(){if(Object.keys(Ke).forEach(function(t){if(void 0===this[t])this[t]=Ke[t].def;else{if(Ke[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Ke[t].num&&(this[t]=parseFloat(this[t]))}Ke[t].degrees&&(this[t]=this[t]*p)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,r,i,n,s=Math.sin(t.y),o=Math.cos(t.y),a=Math.cos(t.x);switch(this.mode){case 3:r=this.sinph0*s+this.cosph0*o*a;break;case 2:r=o*a;break;case 1:r=-s;break;case 0:r=s}switch(e=(r=this.pn1/(this.p-r))*o*Math.sin(t.x),this.mode){case 3:r*=this.cosph0*s-this.sinph0*o*a;break;case 2:r*=s;break;case 0:r*=-o*a;break;case 1:r*=o*a}return n=1/((i=r*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-r*this.sg)*this.cw*n,r=i*n,t.x=e*this.a,t.y=r*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,r,i,n={x:t.x,y:t.y};i=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*i,r=this.pn1*t.y*this.cw*i,t.x=e*this.cg+r*this.sg,t.y=r*this.cg-e*this.sg;var s=Jt(t.x,t.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,i,n,s=t.x,o=t.y;if(s-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var a=this.radius_p/Jt(this.radius_p*Math.cos(o),Math.sin(o));if(r=a*Math.cos(s)*Math.cos(o),i=a*Math.sin(s)*Math.cos(o),n=a*Math.sin(o),(this.radius_g-r)*r-i*i-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/Jt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/Jt(i,e)))}else"sphere"===this.shape&&(e=Math.cos(o),r=Math.cos(s)*e,i=Math.sin(s)*e,n=Math.sin(o),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/Jt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/Jt(i,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,i,n,s=-1,o=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Jt(1,a)):(o=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Jt(1,o));var l=a/this.radius_p;if(e=o*o+l*l+s*s,(i=(r=2*this.radius_g*s)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),s=this.radius_g+n*s,o*=n,a*=n,t.x=Math.atan2(o,s),t.y=Math.atan(a*Math.cos(t.x)/s),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(o=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),e=o*o+a*a+s*s,(i=(r=2*this.radius_g*s)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),s=this.radius_g+n*s,o*=n,a*=n,t.x=Math.atan2(o,s),t.y=Math.atan(a*Math.cos(t.x)/s)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var er;wt.defaultDatum="WGS84",wt.Proj=ct,wt.WGS84=new wt.Proj("WGS84"),wt.Point=Qt,wt.toPoint=At,wt.defs=U,wt.nadgrid=function(t,e){var r=new DataView(e),i=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),n=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:nt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,i),s=function(t,e,r){for(var i=176,n=[],s=0;s{"use strict";const i=r(43389),n=r(69208),s=r(48764).lW;t.exports=function(t,e){return new i((function(r,i){const o=n(t,e),a=new XMLHttpRequest;a.open("GET",o,!0),"prj"!==e&&"cpg"!==e&&(a.responseType="arraybuffer"),a.addEventListener("load",(function(){return a.status>399?"prj"===e||"cpg"===e?r(!1):i(new Error(a.status)):r("prj"!==e&&"cpg"!==e?s.from(a.response):a.response)}),!1),a.send()}))}},9078:(t,e,r)=>{"use strict";const i=r(94830),n=r(69208),s=r(48764).lW;t.exports=async function(t,e){if(!r.g.fetch)return i(t,e);const o=n(t,e),a="prj"===e||"cpg"===e;try{const t=await fetch(o);if(t.status>399)throw new Error(t.statusText);if(a)return t.text();const e=await t.arrayBuffer();return s.from(e)}catch(t){if(console.log("ERROR",t,e),a||"dbf"===e)return!1;throw t}}},69208:(t,e,r)=>{const i=r.g.URL;t.exports=(t,e)=>{if(!e)return t;const r=new i(t);return r.pathname=`${r.pathname}.${e}`,r.href}},79003:(t,e,r)=>{"use strict";let i=r(24472);i.default&&(i=i.default);const n=r(32555),s=r(9078),o=r(76415),a=r(9462),l=r(43389),c=r(95079),h=r(48764).lW,u=r.g.URL,d=new c({max:20});function p(t){if(!t)throw new Error("forgot to pass buffer");return h.isBuffer(t)?t:f(t)?h.from(t):f(t.buffer)?1===t.BYTES_PER_ELEMENT?h.from(t):h.from(t.buffer):void 0}function f(t){return t instanceof r.g.ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(t)}function m(t,e){return"string"==typeof t&&d.has(t)?l.resolve(d.get(t)):m.getShapefile(t,e).then((function(e){return"string"==typeof t&&d.set(t,e),e}))}m.combine=function([t,e]){const r={type:"FeatureCollection",features:[]};let i=0;const n=t.length;for(e||(e=[]);i-1?l.push(r.slice(0,-3)+r.slice(-3).toLowerCase()):"dbf"!==r.slice(-3).toLowerCase()&&"cpg"!==r.slice(-3).toLowerCase()||(s[r.slice(0,-3)+r.slice(-3).toLowerCase()]=s[r]));if(!l.length)throw new Error("no layers founds");const c=l.map((function(t){let r,i;const n=t.lastIndexOf(".");return n>-1&&t.slice(n).indexOf("json")>-1?(r=JSON.parse(s[t]),r.fileName=t.slice(0,n)):e.indexOf(t.slice(n+1))>-1?(r=s[t],r.fileName=t):(s[t+".dbf"]&&(i=a(s[t+".dbf"],s[t+".cpg"])),r=m.combine([o(s[t+".shp"],s[t+".prj"]),i]),r.fileName=t),r}));return 1===c.length?c[0]:c};const g=async t=>{const e=await l.all([s(t,"shp"),s(t,"prj")]);let r=!1;try{e[1]&&(r=i(e[1]))}catch(t){r=!1}return o(e[0],r)},A=async t=>{const[e,r]=await l.all([s(t,"dbf"),s(t,"cpg")]);if(e)return a(e,r)};m.getShapefile=async function(t,e){if("string"!=typeof t)return m.parseZip(t);if(((t,e)=>".zip"===new u(t).pathname.slice(-4).toLowerCase())(t))return async function(t,e){const r=await s(t);return m.parseZip(r,e)}(t,e);const r=await l.all([g(t),A(t)]);return m.combine(r)},m.parseShp=function(t,e){if(t=p(t),h.isBuffer(e)&&(e=e.toString()),"string"==typeof e)try{e=i(e)}catch(t){e=!1}return o(t,e)},m.parseDbf=function(t,e){return t=p(t),a(t,e)},t.exports=m},76415:t=>{"use strict";function e(t,e){return!function(t){let e=0,r=1;const i=t.length;let n,s;for(;r0}(e)&&t.length?t[t.length-1].push(e):t.push([e]),t}i.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}},i.prototype.parseZPoint=function(t){const e=this.parsePoint(t);return e.coordinates.push(t.readDoubleLE(16)),e},i.prototype.parsePointArray=function(t,e,r){const i=[];let n=0;for(;n20&&(e-=20),!(e in r))throw new Error("I don't know that shp type");var i;this.parseFunc=this[r[e]],this.parseCoord=(i=t)?function(t,e){const r=[t.readDoubleLE(e),t.readDoubleLE(e+8)];return i.inverse(r)}:function(t,e){return[t.readDoubleLE(e),t.readDoubleLE(e+8)]}},i.prototype.getShpCode=function(){return this.parseHeader().shpCode},i.prototype.parseHeader=function(){const t=this.buffer.slice(0,100);return{length:t.readInt32BE(24)<<1,version:t.readInt32LE(28),shpCode:t.readInt32LE(32),bbox:[t.readDoubleLE(36),t.readDoubleLE(44),t.readDoubleLE(52),t.readDoubleLE(52)]}},i.prototype.getRows=function(){let t=100;const e=this.buffer.byteLength,r=[];let i;for(;t{"use strict";const i=r(55733);t.exports=async t=>{const e=new i;await e.loadAsync(t);const r=e.file(/.+/),n={};return await Promise.all(r.map((async t=>{let e;e="shp"===t.name.slice(-3).toLowerCase()||"dbf"===t.name.slice(-3).toLowerCase()?await t.async("nodebuffer"):await t.async("text"),n[t.name]=e}))),n}},95079:t=>{!function(){function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function r(){return 1}t.exports?t.exports=s:this.LRUCache=s;var i=!1;function n(t){i||"string"==typeof t||"number"==typeof t||(i=!0,console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! "+typeof t).stack))}function s(t){if(!(this instanceof s))return new s(t);"number"==typeof t&&(t={max:t}),t||(t={}),this._max=t.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=t.length||r,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=r),this._allowStale=t.stale||!1,this._maxAge=t.maxAge||null,this._dispose=t.dispose,this.reset()}function o(t,e,r){n(e);var i=t._cache[e];return i&&(a(t,i)?(h(t,i),t._allowStale||(i=void 0)):r&&function(t,e){c(t,e),e.lu=t._mru++,t._lruList[e.lu]=e}(t,i),i&&(i=i.value)),i}function a(t,e){if(!e||!e.maxAge&&!t._maxAge)return!1;var r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t._maxAge&&r>t._maxAge}function l(t){for(;t._lrut._max;)h(t,t._lruList[t._lru])}function c(t,e){for(delete t._lruList[e.lu];t._lruthis._max&&l(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(s.prototype,"lengthCalculator",{set:function(t){if("function"!=typeof t)for(var e in this._lengthCalculator=r,this._length=this._itemCount,this._cache)this._cache[e].length=1;else for(var e in this._lengthCalculator=t,this._length=0,this._cache)this._cache[e].length=this._lengthCalculator(this._cache[e].value),this._length+=this._cache[e].length;this._length>this._max&&l(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(s.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),s.prototype.forEach=function(t,e){e=e||this;for(var r=0,i=this._itemCount,n=this._mru-1;n>=0&&r=0&&e=0&&e=0&&ethis._max?(h(this,this._cache[t]),!1):(this._dispose&&this._dispose(t,this._cache[t].value),this._cache[t].now=s,this._cache[t].maxAge=i,this._cache[t].value=r,this._length+=o-this._cache[t].length,this._cache[t].length=o,this.get(t),this._length>this._max&&l(this),!0);var a=new u(t,r,this._mru++,o,s,i);return a.length>this._max?(this._dispose&&this._dispose(t,r),!1):(this._length+=a.length,this._lruList[a.lu]=this._cache[t]=a,this._itemCount++,this._length>this._max&&l(this),!0)},s.prototype.has=function(t){return n(t),!!e(this._cache,t)&&!a(this,this._cache[t])},s.prototype.get=function(t){return n(t),o(this,t,!0)},s.prototype.peek=function(t){return n(t),o(this,t,!1)},s.prototype.pop=function(){var t=this._lruList[this._lru];return h(this,t),t||null},s.prototype.del=function(t){n(t),h(this,this._cache[t])},s.prototype.load=function(t){this.reset();for(var e=Date.now(),r=t.length-1;r>=0;r--){var i=t[r];n(i.k);var s=i.e||0;if(0===s)this.set(i.k,i.v);else{var o=s-e;o>0&&this.set(i.k,i.v,o)}}}}()},6941:(t,e,r)=>{var i=r(48764).lW,n=i.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},s=e.s=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!n(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=l;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(t){return t.toString(this.encoding)}function a(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function l(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}s.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i,n=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,(i=e.charCodeAt(n))>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),t.copy(this.charBuffer,0,0,s),e.substring(0,n)}return e},s.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},s.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;e+=i.slice(0,r).toString(n)}return e}},29718:(t,e,r)=>{t.exports=r(59141)},59141:function(t,e,r){!function(e){"use strict";function i(t,e,r){return e<=t&&t<=r}t.exports&&!e["encoding-indexes"]&&r(37597);var n=Math.floor;function s(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o(t){return 0<=t&&t<=127}var a=o,l=-1;function c(t){this.tokens=[].slice.call(t),this.tokens.reverse()}c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():l},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.pop());else this.tokens.push(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(t)}};var h=-1;function u(t,e){if(t)throw TypeError("Decoder error");return e||65533}function d(t){throw TypeError("The code point "+t+" could not be encoded.")}function p(t){return t=String(t).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(m,t)?m[t]:null}var f=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],m={};f.forEach((function(t){t.encodings.forEach((function(t){t.labels.forEach((function(e){m[e]=t}))}))}));var g,A,y={},v={};function x(t,e){return e&&e[t]||null}function b(t,e){var r=e.indexOf(t);return-1===r?null:r}function _(t){if(!("encoding-indexes"in e))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return e["encoding-indexes"][t]}var w="utf-8";function E(t,e){if(!(this instanceof E))throw TypeError("Called as a function. Did you forget 'new'?");t=void 0!==t?String(t):w,e=s(e),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=p(t);if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+t);if(!v[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=r,Boolean(e.fatal)&&(i._error_mode="fatal"),Boolean(e.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal="fatal"===i._error_mode,this.ignoreBOM=i._ignoreBOM),i}function M(t,r){if(!(this instanceof M))throw TypeError("Called as a function. Did you forget 'new'?");r=s(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var i=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){var n=p(t=void 0!==t?String(t):w);if(null===n||"replacement"===n.name)throw RangeError("Unknown encoding: "+t);if(!y[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");i._encoding=n}else i._encoding=p("utf-8"),void 0!==t&&"console"in e&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase()),i}function S(t){var e=t.fatal,r=0,n=0,s=0,o=128,a=191;this.handler=function(t,c){if(c===l&&0!==s)return s=0,u(e);if(c===l)return h;if(0===s){if(i(c,0,127))return c;if(i(c,194,223))s=1,r=31&c;else if(i(c,224,239))224===c&&(o=160),237===c&&(a=159),s=2,r=15&c;else{if(!i(c,240,244))return u(e);240===c&&(o=144),244===c&&(a=143),s=3,r=7&c}return null}if(!i(c,o,a))return r=s=n=0,o=128,a=191,t.prepend(c),u(e);if(o=128,a=191,r=r<<6|63&c,(n+=1)!==s)return null;var d=r;return r=s=n=0,d}}function C(t){t.fatal,this.handler=function(t,e){if(e===l)return h;if(a(e))return e;var r,n;i(e,128,2047)?(r=1,n=192):i(e,2048,65535)?(r=2,n=224):i(e,65536,1114111)&&(r=3,n=240);for(var s=[(e>>6*r)+n];r>0;){var o=e>>6*(r-1);s.push(128|63&o),r-=1}return s}}function T(t,e){var r=e.fatal;this.handler=function(e,i){if(i===l)return h;if(o(i))return i;var n=t[i-128];return null===n?u(r):n}}function I(t,e){e.fatal,this.handler=function(e,r){if(r===l)return h;if(a(r))return r;var i=b(r,t);return null===i&&d(r),i+128}}function R(t){var e=t.fatal,r=0,n=0,s=0;this.handler=function(t,a){if(a===l&&0===r&&0===n&&0===s)return h;var c;if(a!==l||0===r&&0===n&&0===s||(r=0,n=0,s=0,u(e)),0!==s){c=null,i(a,48,57)&&(c=function(t){if(t>39419&&t<189e3||t>1237575)return null;if(7457===t)return 59335;var e,r=0,i=0,n=_("gb18030-ranges");for(e=0;e>8,i=255&t;return e?[r,i]:[i,r]}function j(t,e){var r=e.fatal,n=null,s=null;this.handler=function(e,o){if(o===l&&(null!==n||null!==s))return u(r);if(o===l&&null===n&&null===s)return h;if(null===n)return n=o,null;var a;if(a=t?(n<<8)+o:(o<<8)+n,n=null,null!==s){var c=s;return s=null,i(a,56320,57343)?65536+1024*(c-55296)+(a-56320):(e.prepend(Q(a,t)),u(r))}return i(a,55296,56319)?(s=a,null):i(a,56320,57343)?u(r):a}}function V(t,e){e.fatal,this.handler=function(e,r){if(r===l)return h;if(i(r,0,65535))return Q(r,t);var n=Q(55296+(r-65536>>10),t),s=Q(56320+(r-65536&1023),t);return n.concat(s)}}function H(t){t.fatal,this.handler=function(t,e){return e===l?h:o(e)?e:63360+e-128}}function W(t){t.fatal,this.handler=function(t,e){return e===l?h:a(e)?e:i(e,63360,63487)?e-63360+128:d(e)}}Object.defineProperty&&(Object.defineProperty(E.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(E.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(E.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),E.prototype.decode=function(t,e){var r;r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=s(e),this._do_not_flush||(this._decoder=v[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(e.stream);for(var i,n=new c(r),o=[];;){var a=n.read();if(a===l)break;if((i=this._decoder.handler(n,a))===h)break;null!==i&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}if(!this._do_not_flush){do{if((i=this._decoder.handler(n,n.read()))===h)break;null!==i&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}while(!n.endOfStream());this._decoder=null}return function(t){var e,r;return e=["UTF-8","UTF-16LE","UTF-16BE"],r=this._encoding.name,-1===e.indexOf(r)||this._ignoreBOM||this._BOMseen||(t.length>0&&65279===t[0]?(this._BOMseen=!0,t.shift()):t.length>0&&(this._BOMseen=!0)),function(t){for(var e="",r=0;r>10),56320+(1023&i)))}return e}(t)}.call(this,o)},Object.defineProperty&&Object.defineProperty(M.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),M.prototype.encode=function(t,e){t=void 0===t?"":String(t),e=s(e),this._do_not_flush||(this._encoder=y[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(e.stream);for(var r,i=new c(function(t){for(var e=String(t),r=e.length,i=0,n=[];i57343)n.push(s);else if(56320<=s&&s<=57343)n.push(65533);else if(55296<=s&&s<=56319)if(i===r-1)n.push(65533);else{var o=e.charCodeAt(i+1);if(56320<=o&&o<=57343){var a=1023&s,l=1023&o;n.push(65536+(a<<10)+l),i+=1}else n.push(65533)}i+=1}return n}(t)),n=[];;){var o=i.read();if(o===l)break;if((r=this._encoder.handler(i,o))===h)break;Array.isArray(r)?n.push.apply(n,r):n.push(r)}if(!this._do_not_flush){for(;(r=this._encoder.handler(i,i.read()))!==h;)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)},y["UTF-8"]=function(t){return new C(t)},v["UTF-8"]=function(t){return new S(t)},"encoding-indexes"in e&&f.forEach((function(t){"Legacy single-byte encodings"===t.heading&&t.encodings.forEach((function(t){var e=t.name,r=_(e.toLowerCase());v[e]=function(t){return new T(r,t)},y[e]=function(t){return new I(r,t)}}))})),v.GBK=function(t){return new R(t)},y.GBK=function(t){return new B(t,!0)},y.gb18030=function(t){return new B(t)},v.gb18030=function(t){return new R(t)},y.Big5=function(t){return new P(t)},v.Big5=function(t){return new L(t)},y["EUC-JP"]=function(t){return new O(t)},v["EUC-JP"]=function(t){return new D(t)},y["ISO-2022-JP"]=function(t){return new U(t)},v["ISO-2022-JP"]=function(t){return new k(t)},y.Shift_JIS=function(t){return new F(t)},v.Shift_JIS=function(t){return new N(t)},y["EUC-KR"]=function(t){return new G(t)},v["EUC-KR"]=function(t){return new z(t)},y["UTF-16BE"]=function(t){return new V(!0,t)},v["UTF-16BE"]=function(t){return new j(!0,t)},y["UTF-16LE"]=function(t){return new V(!1,t)},v["UTF-16LE"]=function(t){return new j(!1,t)},y["x-user-defined"]=function(t){return new W(t)},v["x-user-defined"]=function(t){return new H(t)},e.TextEncoder||(e.TextEncoder=M),e.TextDecoder||(e.TextDecoder=E),t.exports&&(t.exports={TextEncoder:e.TextEncoder,TextDecoder:e.TextDecoder,EncodingIndexes:e["encoding-indexes"]})}(this||{})},78963:()=>{},37597:()=>{},42917:(t,e,r)=>{"use strict";r(59749),r(86544),r(58373),r(96157),r(82529),r(84254),r(64155),r(93531),r(95906),r(50549),r(96285),r(18200),r(69373),r(66793),r(44578),r(21057),r(68932),r(95879),r(54927),r(92176),r(34338),r(2966),r(55791),r(97895),r(38077),r(25728),r(39772),r(59867),r(93383),r(62795),r(54564),r(49693),r(77049),r(76801),r(97195),r(63975),r(752),r(6203),r(72410),r(50886),r(37593),r(70560),r(278),r(81386),r(93374),r(89730),r(98742),r(65137),r(21932),r(62506),r(29830),r(12894),r(93530),r(13383),r(90385),r(91719),r(21319),r(69365),r(33870),r(99211),r(18201),r(55635),r(42227),r(99679),r(24343),r(65007),r(78150),r(59903),r(30024),r(60428),r(41517),r(56269),r(34284),r(45398),r(48324),r(7629),r(56646),r(89348),r(6557),r(62428),r(45263),r(74712),r(54986),r(47221),r(94992),r(25499),r(59944),r(78527),r(75239),r(92076),r(68813),r(96976),r(62700),r(91554),r(77509),r(21416),r(79288),r(53584),r(82243),r(95765),r(45993),r(92547),r(7936),r(32704),r(52362),r(21552),r(10704),r(97389),r(25284),r(60429),r(51013),r(33994),r(35082),r(40739),r(47409),r(36585),r(41830),r(85415),r(81919),r(99474),r(79997),r(88052),r(44079),r(14566),r(76101),r(36446),r(35140),r(4179),r(69358),r(75450),r(54993),r(48115),r(19330),r(30658),r(5399),r(60228),r(86466),r(80939),r(32320),r(73964),r(41195),r(87609),r(36409),r(13505),r(54333),r(30050),r(99871),r(1049),r(32349),r(50149),r(43792),r(69707),r(63545),r(62087),r(51505),r(45247),r(22373),r(76034),r(52003),r(68518),r(64043),r(25847),r(13440),r(7409),r(12826),r(19649),r(7961),r(86239),r(2918),r(20283),r(43843),r(12281),r(21694),r(22462),r(79866),r(72940),r(8472),r(92404),r(59588),r(57267),r(56532),r(61514),r(9873),r(268),r(20372),r(35237),r(28436),r(16386),r(3255),r(90343),r(21444),r(25906),r(95682),r(98041),r(6364),r(82954),r(19162),r(37960),r(470),r(67446),r(47729),r(2e3),r(29068),r(70292),r(55304),r(89988),r(854),r(28607),r(30938),r(75679),r(18557),r(95194),r(36664),r(55980),r(79943),r(96089),r(18539),r(48690),r(20522),r(82),r(45385),r(59495),r(85552),r(31803),r(91565),r(67987),r(49365),r(80677),r(19038),r(18118),r(41165),r(71522),r(79976),r(4797),r(7300),r(93356),r(62533),r(99724),r(24224),r(61121),r(99901),r(37133),r(622),r(51090),r(50414),r(89503),r(26810),r(18073),r(4154),r(7802),r(54883),r(38197),r(20097),r(36208),r(22525),r(96882),r(32539),r(5082),r(98),r(32221),r(67890),r(47041),r(86322),r(92253),r(97554),r(86247),r(21412),r(43097),r(11070),r(64578),r(77299),r(15694),r(17815),r(19029),r(6237),r(81954),r(87152),r(89667),r(49118),r(32411),r(3256),r(85625),r(10914),r(14494),r(9468),r(24587),r(60779),r(65503),r(50236),r(89246),r(31186),r(9279),r(26725),r(26125),r(2820),r(62517),r(54947),r(74993),r(78832),r(67602),r(50647),r(82639),r(63986),r(16054),r(53476),r(70928),r(49411),r(30005),r(73494),r(94564),r(41792),r(5985),r(31107),r(28244),r(3645),r(58429),r(39569),r(74320),r(20691),r(82964),r(67444),r(97968),r(747),r(41099),r(26320),r(20876),r(6052),r(39879),r(76791),r(75341),r(40019),r(92343),r(51096),r(4314),r(63111),r(23346),r(64984),r(64078),r(24453),r(66190),r(25684),r(31789),r(8677),r(346),r(59151),r(91069),r(18886),r(88065),r(68172),r(60445),r(99457),r(613),r(835),r(926),r(82899),r(29977),r(53669),r(31927),r(77131),r(55174),r(3210),r(76314),r(218),r(40393),r(6616),r(90810),r(19959),r(73347),r(71913),r(70003),r(79955),r(7859),r(31138),r(28809),r(2946),r(32460),r(57282),r(5058),r(15716),r(36814),r(30349),r(96986),r(95681),r(13781),r(33442),r(98873),r(61964),r(50308),r(69878),r(18955),r(52915),r(65115),r(19490),r(95752),r(32789),r(27913),r(6831),r(98686),r(90243),r(22275),r(98030),r(86220),r(21917),r(95853),r(66084),r(2741),r(59012),r(38320),r(78988),r(80546),r(62586),r(46019),r(5010),r(45749),r(4835),r(58799),r(18134),r(27041),r(44767),r(92981),r(85044),r(76677),r(96256),r(18241),r(59359),r(54302),r(1274),r(30548),r(25298),r(11882),r(915),r(91238),r(17911),r(23579),r(91117),r(85723),r(68680),r(77225),r(99369),r(22983),r(90201),r(13466),r(23321),r(84930),r(92465),r(45738),r(52586),r(84645),r(47522),r(76265),r(97337),r(13429),r(37462),r(40088),r(10455),r(3650),r(25564),r(96869),r(78730),r(69822),r(19979),r(79307),r(98858),r(61318),r(33228),r(50496)},46108:(t,e,r)=>{"use strict";r(42917)},10509:(t,e,r)=>{"use strict";var i=r(69985),n=r(23691),s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not a function")}},52655:(t,e,r)=>{"use strict";var i=r(19429),n=r(23691),s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not a constructor")}},9945:(t,e,r)=>{"use strict";var i=r(83914).has;t.exports=function(t){return i(t),t}},23550:(t,e,r)=>{"use strict";var i=r(69985),n=String,s=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw new s("Can't set "+n(t)+" as a prototype")}},10029:(t,e,r)=>{"use strict";var i=r(61034).has;t.exports=function(t){return i(t),t}},51082:t=>{"use strict";var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},457:(t,e,r)=>{"use strict";var i=r(16803).has;t.exports=function(t){return i(t),t}},53499:(t,e,r)=>{"use strict";var i=r(78616).has;t.exports=function(t){return i(t),t}},29199:(t,e,r)=>{"use strict";var i=r(22615),n=r(68844),s=r(54071),o=r(85027),a=r(10509),l=r(981),c=r(54849),h=r(44201),u=h("asyncDispose"),d=h("dispose"),p=n([].push),f=function(t,e,r){return arguments.length<3&&!l(t)&&(r=a(function(t,e){if("async-dispose"===e){var r=c(t,u);return void 0!==r?r:(r=c(t,d),function(){i(r,this)})}return c(t,d)}(o(t),e))),void 0===r?function(){}:s(r,t)};t.exports=function(t,e,r,i){var n;if(arguments.length<4){if(l(e)&&"sync-dispose"===r)return;n=f(e,r)}else n=f(void 0,r,i);p(t.stack,n)}},87370:(t,e,r)=>{"use strict";var i=r(44201),n=r(25391),s=r(72560).f,o=i("unscopables"),a=Array.prototype;void 0===a[o]&&s(a,o,{configurable:!0,value:n(null)}),t.exports=function(t){a[o][t]=!0}},71514:(t,e,r)=>{"use strict";var i=r(10730).charAt;t.exports=function(t,e,r){return e+(r?i(t,e).length:1)}},767:(t,e,r)=>{"use strict";var i=r(23622),n=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw new n("Incorrect invocation")}},33425:(t,e,r)=>{"use strict";var i=r(48999),n=String,s=TypeError;t.exports=function(t){if(void 0===t||i(t))return t;throw new s(n(t)+" is not an object or undefined")}},85027:(t,e,r)=>{"use strict";var i=r(48999),n=String,s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not an object")}},95668:(t,e,r)=>{"use strict";var i=r(50926),n=TypeError;t.exports=function(t){if("Uint8Array"===i(t))return t;throw new n("Argument is not an Uint8Array")}},37075:t=>{"use strict";t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},33050:(t,e,r)=>{"use strict";var i=r(52743),n=r(6648),s=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==n(t))throw new s("ArrayBuffer expected");return t.byteLength}},22961:(t,e,r)=>{"use strict";var i=r(68844),n=r(33050),s=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==n(t))return!1;try{return s(t,0,0),!1}catch(t){return!0}}},11655:(t,e,r)=>{"use strict";var i=r(3689);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},29195:(t,e,r)=>{"use strict";var i=r(19037),n=r(68844),s=r(52743),o=r(19842),a=r(22961),l=r(33050),c=r(21420),h=r(63514),u=i.structuredClone,d=i.ArrayBuffer,p=i.DataView,f=i.TypeError,m=Math.min,g=d.prototype,A=p.prototype,y=n(g.slice),v=s(g,"resizable","get"),x=s(g,"maxByteLength","get"),b=n(A.getInt8),_=n(A.setInt8);t.exports=(h||c)&&function(t,e,r){var i,n=l(t),s=void 0===e?n:o(e),g=!v||!v(t);if(a(t))throw new f("ArrayBuffer is detached");if(h&&(t=u(t,{transfer:[t]}),n===s&&(r||g)))return t;if(n>=s&&(!r||g))i=y(t,0,s);else{var A=r&&!g&&x?{maxByteLength:x(t)}:void 0;i=new d(s,A);for(var w=new p(t),E=new p(i),M=m(s,n),S=0;S{"use strict";var i,n,s,o=r(37075),a=r(67697),l=r(19037),c=r(69985),h=r(48999),u=r(36812),d=r(50926),p=r(23691),f=r(75773),m=r(11880),g=r(62148),A=r(23622),y=r(61868),v=r(49385),x=r(44201),b=r(14630),_=r(618),w=_.enforce,E=_.get,M=l.Int8Array,S=M&&M.prototype,C=l.Uint8ClampedArray,T=C&&C.prototype,I=M&&y(M),R=S&&y(S),B=Object.prototype,L=l.TypeError,P=x("toStringTag"),D=b("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",k=o&&!!v&&"Opera"!==d(l.opera),U=!1,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},z=function(t){var e=y(t);if(h(e)){var r=E(e);return r&&u(r,O)?r[O]:z(e)}},G=function(t){if(!h(t))return!1;var e=d(t);return u(N,e)||u(F,e)};for(i in N)(s=(n=l[i])&&n.prototype)?w(s)[O]=n:k=!1;for(i in F)(s=(n=l[i])&&n.prototype)&&(w(s)[O]=n);if((!k||!c(I)||I===Function.prototype)&&(I=function(){throw new L("Incorrect invocation")},k))for(i in N)l[i]&&v(l[i],I);if((!k||!R||R===B)&&(R=I.prototype,k))for(i in N)l[i]&&v(l[i].prototype,R);if(k&&y(T)!==R&&v(T,R),a&&!u(R,P))for(i in U=!0,g(R,P,{configurable:!0,get:function(){return h(this)?this[D]:void 0}}),N)l[i]&&f(l[i],D,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:k,TYPED_ARRAY_TAG:U&&D,aTypedArray:function(t){if(G(t))return t;throw new L("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!v||A(I,t)))return t;throw new L(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,i){if(a){if(r)for(var n in N){var s=l[n];if(s&&u(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}R[t]&&!r||m(R,t,r?e:k&&S[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,r){var i,n;if(a){if(v){if(r)for(i in N)if((n=l[i])&&u(n,t))try{delete n[t]}catch(t){}if(I[t]&&!r)return;try{return m(I,t,r?e:k&&I[t]||e)}catch(t){}}for(i in N)!(n=l[i])||n[t]&&!r||m(n,t,e)}},getTypedArrayConstructor:z,isView:function(t){if(!h(t))return!1;var e=d(t);return"DataView"===e||u(N,e)||u(F,e)},isTypedArray:G,TypedArray:I,TypedArrayPrototype:R}},83999:(t,e,r)=>{"use strict";var i=r(19037),n=r(68844),s=r(67697),o=r(37075),a=r(41236),l=r(75773),c=r(62148),h=r(6045),u=r(3689),d=r(767),p=r(68700),f=r(43126),m=r(19842),g=r(37788),A=r(15477),y=r(61868),v=r(49385),x=r(72741).f,b=r(62872),_=r(9015),w=r(55997),E=r(618),M=a.PROPER,S=a.CONFIGURABLE,C="ArrayBuffer",T="DataView",I="prototype",R="Wrong index",B=E.getterFor(C),L=E.getterFor(T),P=E.set,D=i[C],O=D,k=O&&O[I],U=i[T],N=U&&U[I],F=Object.prototype,z=i.Array,G=i.RangeError,Q=n(b),j=n([].reverse),V=A.pack,H=A.unpack,W=function(t){return[255&t]},q=function(t){return[255&t,t>>8&255]},Z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},X=function(t){return V(g(t),23,4)},J=function(t){return V(t,52,8)},K=function(t,e,r){c(t[I],e,{configurable:!0,get:function(){return r(this)[e]}})},$=function(t,e,r,i){var n=L(t),s=m(r),o=!!i;if(s+e>n.byteLength)throw new G(R);var a=n.bytes,l=s+n.byteOffset,c=_(a,l,l+e);return o?c:j(c)},tt=function(t,e,r,i,n,s){var o=L(t),a=m(r),l=i(+n),c=!!s;if(a+e>o.byteLength)throw new G(R);for(var h=o.bytes,u=a+o.byteOffset,d=0;dnt;)(rt=it[nt++])in O||l(O,rt,D[rt]);k.constructor=O}v&&y(N)!==F&&v(N,F);var st=new U(new O(2)),ot=n(N.setInt8);st.setInt8(0,2147483648),st.setInt8(1,2147483649),!st.getInt8(0)&&st.getInt8(1)||h(N,{setInt8:function(t,e){ot(this,t,e<<24>>24)},setUint8:function(t,e){ot(this,t,e<<24>>24)}},{unsafe:!0})}else k=(O=function(t){d(this,k);var e=m(t);P(this,{type:C,bytes:Q(z(e),0),byteLength:e}),s||(this.byteLength=e,this.detached=!1)})[I],N=(U=function(t,e,r){d(this,N),d(t,k);var i=B(t),n=i.byteLength,o=p(e);if(o<0||o>n)throw new G("Wrong offset");if(o+(r=void 0===r?n-o:f(r))>n)throw new G("Wrong length");P(this,{type:T,buffer:t,byteLength:r,byteOffset:o,bytes:i.bytes}),s||(this.buffer=t,this.byteLength=r,this.byteOffset=o)})[I],s&&(K(O,"byteLength",B),K(U,"buffer",L),K(U,"byteLength",L),K(U,"byteOffset",L)),h(N,{getInt8:function(t){return $(this,1,t)[0]<<24>>24},getUint8:function(t){return $(this,1,t)[0]},getInt16:function(t){var e=$(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=$(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Y($(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Y($(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return H($(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return H($(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){tt(this,1,t,W,e)},setUint8:function(t,e){tt(this,1,t,W,e)},setInt16:function(t,e){tt(this,2,t,q,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){tt(this,2,t,q,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){tt(this,4,t,Z,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){tt(this,4,t,Z,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){tt(this,4,t,X,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){tt(this,8,t,J,e,arguments.length>2&&arguments[2])}});w(O,C),w(U,T),t.exports={ArrayBuffer:O,DataView:U}},70357:(t,e,r)=>{"use strict";var i=r(90690),n=r(27578),s=r(6310),o=r(98494),a=Math.min;t.exports=[].copyWithin||function(t,e){var r=i(this),l=s(r),c=n(t,l),h=n(e,l),u=arguments.length>2?arguments[2]:void 0,d=a((void 0===u?l:n(u,l))-h,l-c),p=1;for(h0;)h in r?r[c]=r[h]:o(r,c),c+=p,h+=p;return r}},62872:(t,e,r)=>{"use strict";var i=r(90690),n=r(27578),s=r(6310);t.exports=function(t){for(var e=i(this),r=s(e),o=arguments.length,a=n(o>1?arguments[1]:void 0,r),l=o>2?arguments[2]:void 0,c=void 0===l?r:n(l,r);c>a;)e[a++]=t;return e}},57612:(t,e,r)=>{"use strict";var i=r(2960).forEach,n=r(16834)("forEach");t.exports=n?[].forEach:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}},2231:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(90690),o=r(19429),a=r(13807),l=r(5185),c=r(22302),h=r(91664),u=r(54849),d=r(76058),p=r(88277),f=r(44201),m=r(29019),g=r(62489).toArray,A=f("asyncIterator"),y=n(p("Array","values")),v=n(y([]).next),x=function(){return new b(this)},b=function(t){this.iterator=y(t)};b.prototype.next=function(){return v(this.iterator)},t.exports=function(t){var e=this,r=arguments.length,n=r>1?arguments[1]:void 0,p=r>2?arguments[2]:void 0;return new(d("Promise"))((function(r){var d=s(t);void 0!==n&&(n=i(n,p));var f=u(d,A),y=f?void 0:h(d)||x,v=o(e)?new e:[],b=f?a(d,f):new m(c(l(d,y)));r(g(b,n,v))}))}},59976:(t,e,r)=>{"use strict";var i=r(6310);t.exports=function(t,e,r){for(var n=0,s=arguments.length>2?r:i(e),o=new t(s);s>n;)o[n]=e[n++];return o}},21055:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(90690),o=r(71228),a=r(93292),l=r(19429),c=r(6310),h=r(76522),u=r(5185),d=r(91664),p=Array;t.exports=function(t){var e=s(t),r=l(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=i(m,f>2?arguments[2]:void 0));var A,y,v,x,b,_,w=d(e),E=0;if(!w||this===p&&a(w))for(A=c(e),y=r?new this(A):p(A);A>E;E++)_=g?m(e[E],E):e[E],h(y,E,_);else for(b=(x=u(e,w)).next,y=r?new this:[];!(v=n(b,x)).done;E++)_=g?o(x,m,[v.value,E],!0):v.value,h(y,E,_);return y.length=E,y}},44416:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(6310),l=r(83914),c=l.Map,h=l.get,u=l.has,d=l.set,p=n([].push);t.exports=function(t){for(var e,r,n=o(this),l=s(n),f=i(t,arguments.length>1?arguments[1]:void 0),m=new c,g=a(l),A=0;g>A;A++)e=f(r=l[A],A,n),u(m,e)?p(h(m,e),r):d(m,e,[r]);return m}},64976:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(18360),l=r(6310),c=r(25391),h=r(59976),u=Array,d=n([].push);t.exports=function(t,e,r,n){for(var p,f,m,g=o(t),A=s(g),y=i(e,r),v=c(null),x=l(A),b=0;x>b;b++)m=A[b],(f=a(y(m,b,g)))in v?d(v[f],m):v[f]=[m];if(n&&(p=n(g))!==u)for(f in v)v[f]=h(p,v[f]);return v}},84328:(t,e,r)=>{"use strict";var i=r(65290),n=r(27578),s=r(6310),o=function(t){return function(e,r,o){var a,l=i(e),c=s(l),h=n(o,c);if(t&&r!=r){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===r)return t||h||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},61969:(t,e,r)=>{"use strict";var i=r(54071),n=r(94413),s=r(90690),o=r(6310),a=function(t){var e=1===t;return function(r,a,l){for(var c,h=s(r),u=n(h),d=o(u),p=i(a,l);d-- >0;)if(p(c=u[d],d,h))switch(t){case 0:return c;case 1:return d}return e?-1:void 0}};t.exports={findLast:a(0),findLastIndex:a(1)}},2960:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(6310),l=r(27120),c=n([].push),h=function(t){var e=1===t,r=2===t,n=3===t,h=4===t,u=6===t,d=7===t,p=5===t||u;return function(f,m,g,A){for(var y,v,x=o(f),b=s(x),_=a(b),w=i(m,g),E=0,M=A||l,S=e?M(f,_):r||d?M(f,0):void 0;_>E;E++)if((p||E in b)&&(v=w(y=b[E],E,x),t))if(e)S[E]=v;else if(v)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:c(S,y)}else switch(t){case 4:return!1;case 7:c(S,y)}return u?-1:n||h?h:S}};t.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6),filterReject:h(7)}},60953:(t,e,r)=>{"use strict";var i=r(61735),n=r(65290),s=r(68700),o=r(6310),a=r(16834),l=Math.min,c=[].lastIndexOf,h=!!c&&1/[1].lastIndexOf(1,-0)<0,u=a("lastIndexOf"),d=h||!u;t.exports=d?function(t){if(h)return i(c,this,arguments)||0;var e=n(this),r=o(e),a=r-1;for(arguments.length>1&&(a=l(a,s(arguments[1]))),a<0&&(a=r+a);a>=0;a--)if(a in e&&e[a]===t)return a||0;return-1}:c},29042:(t,e,r)=>{"use strict";var i=r(3689),n=r(44201),s=r(3615),o=n("species");t.exports=function(t){return s>=51||!i((function(){var e=[];return(e.constructor={})[o]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},16834:(t,e,r)=>{"use strict";var i=r(3689);t.exports=function(t,e){var r=[][t];return!!r&&i((function(){r.call(null,e||function(){return 1},1)}))}},88820:(t,e,r)=>{"use strict";var i=r(10509),n=r(90690),s=r(94413),o=r(6310),a=TypeError,l=function(t){return function(e,r,l,c){var h=n(e),u=s(h),d=o(h);i(r);var p=t?d-1:0,f=t?-1:1;if(l<2)for(;;){if(p in u){c=u[p],p+=f;break}if(p+=f,t?p<0:d<=p)throw new a("Reduce of empty array with no initial value")}for(;t?p>=0:d>p;p+=f)p in u&&(c=r(c,u[p],p,h));return c}};t.exports={left:l(!1),right:l(!0)}},5649:(t,e,r)=>{"use strict";var i=r(67697),n=r(92297),s=TypeError,o=Object.getOwnPropertyDescriptor,a=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=a?function(t,e){if(n(t)&&!o(t,"length").writable)throw new s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},9015:(t,e,r)=>{"use strict";var i=r(27578),n=r(6310),s=r(76522),o=Array,a=Math.max;t.exports=function(t,e,r){for(var l=n(t),c=i(e,l),h=i(void 0===r?l:r,l),u=o(a(h-c,0)),d=0;c{"use strict";var i=r(68844);t.exports=i([].slice)},50382:(t,e,r)=>{"use strict";var i=r(9015),n=Math.floor,s=function(t,e){var r=t.length,l=n(r/2);return r<8?o(t,e):a(t,s(i(t,0,l),e),s(i(t,l),e),e)},o=function(t,e){for(var r,i,n=t.length,s=1;s0;)t[i]=t[--i];i!==s++&&(t[i]=r)}return t},a=function(t,e,r,i){for(var n=e.length,s=r.length,o=0,a=0;o{"use strict";var i=r(92297),n=r(19429),s=r(48999),o=r(44201)("species"),a=Array;t.exports=function(t){var e;return i(t)&&(e=t.constructor,(n(e)&&(e===a||i(e.prototype))||s(e)&&null===(e=e[o]))&&(e=void 0)),void 0===e?a:e}},27120:(t,e,r)=>{"use strict";var i=r(25271);t.exports=function(t,e){return new(i(t))(0===e?0:e)}},26166:(t,e,r)=>{"use strict";var i=r(6310);t.exports=function(t,e){for(var r=i(t),n=new e(r),s=0;s{"use strict";var i=r(68844),n=r(10509),s=r(981),o=r(6310),a=r(90690),l=r(83914),c=r(10613),h=l.Map,u=l.has,d=l.set,p=i([].push);t.exports=function(t){var e,r,i,l=a(this),f=o(l),m=[],g=new h,A=s(t)?function(t){return t}:n(t);for(e=0;e{"use strict";var i=r(6310),n=r(68700),s=RangeError;t.exports=function(t,e,r,o){var a=i(t),l=n(r),c=l<0?a+l:l;if(c>=a||c<0)throw new s("Incorrect index");for(var h=new e(a),u=0;u{"use strict";var i=r(22615),n=r(85027),s=r(25391),o=r(54849),a=r(6045),l=r(618),c=r(76058),h=r(23070),u=r(27807),d=c("Promise"),p="AsyncFromSyncIterator",f=l.set,m=l.getterFor(p),g=function(t,e,r){var i=t.done;d.resolve(t.value).then((function(t){e(u(t,i))}),r)},A=function(t){t.type=p,f(this,t)};A.prototype=a(s(h),{next:function(){var t=m(this);return new d((function(e,r){var s=n(i(t.next,t.iterator));g(s,e,r)}))},return:function(){var t=m(this).iterator;return new d((function(e,r){var s=o(t,"return");if(void 0===s)return e(u(void 0,!0));var a=n(i(s,t));g(a,e,r)}))}}),t.exports=A},52399:(t,e,r)=>{"use strict";var i=r(22615),n=r(76058),s=r(54849);t.exports=function(t,e,r,o){try{var a=s(t,"return");if(a)return n("Promise").resolve(i(a,t)).then((function(){e(r)}),(function(t){o(t)}))}catch(t){return o(t)}e(r)}},17394:(t,e,r)=>{"use strict";var i=r(22615),n=r(9302),s=r(85027),o=r(25391),a=r(75773),l=r(6045),c=r(44201),h=r(618),u=r(76058),d=r(54849),p=r(23070),f=r(27807),m=r(72125),g=u("Promise"),A=c("toStringTag"),y="AsyncIteratorHelper",v="WrapForValidAsyncIterator",x=h.set,b=function(t){var e=!t,r=h.getterFor(t?v:y),a=function(t){var i=n((function(){return r(t)})),s=i.error,o=i.value;return s||e&&o.done?{exit:!0,value:s?g.reject(o):g.resolve(f(void 0,!0))}:{exit:!1,value:o}};return l(o(p),{next:function(){var t=a(this),e=t.value;if(t.exit)return e;var r=n((function(){return s(e.nextHandler(g))})),i=r.error,o=r.value;return i&&(e.done=!0),i?g.reject(o):g.resolve(o)},return:function(){var e=a(this),r=e.value;if(e.exit)return r;r.done=!0;var o,l,c=r.iterator,h=n((function(){if(r.inner)try{m(r.inner.iterator,"normal")}catch(t){return m(c,"throw",t)}return d(c,"return")}));return o=l=h.value,h.error?g.reject(l):void 0===o?g.resolve(f(void 0,!0)):(l=(h=n((function(){return i(o,c)}))).value,h.error?g.reject(l):t?g.resolve(l):g.resolve(l).then((function(t){return s(t),f(void 0,!0)})))}})},_=b(!0),w=b(!1);a(w,A,"Async Iterator Helper"),t.exports=function(t,e){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=e?v:y,i.nextHandler=t,i.counter=0,i.done=!1,x(this,i)};return r.prototype=e?_:w,r}},40164:(t,e,r)=>{"use strict";var i=r(22615),n=r(82412),s=function(t,e){return[e,t]};t.exports=function(){return i(n,this,s)}},62489:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(48999),a=r(55565),l=r(76058),c=r(22302),h=r(52399),u=function(t){var e=0===t,r=1===t,u=2===t,d=3===t;return function(t,p,f){s(t);var m=void 0!==p;!m&&e||n(p);var g=c(t),A=l("Promise"),y=g.iterator,v=g.next,x=0;return new A((function(t,n){var l=function(t){h(y,n,t,n)},c=function(){try{if(m)try{a(x)}catch(t){l(t)}A.resolve(s(i(v,y))).then((function(i){try{if(s(i).done)e?(f.length=x,t(f)):t(!d&&(u||void 0));else{var a=i.value;try{if(m){var g=p(a,x),v=function(i){if(r)c();else if(u)i?c():h(y,t,!1,n);else if(e)try{f[x++]=i,c()}catch(t){l(t)}else i?h(y,t,d||a,n):c()};o(g)?A.resolve(g).then(v,l):v(g)}else f[x++]=a,c()}catch(t){l(t)}}}catch(t){n(t)}}),n)}catch(t){n(t)}};c()}))}};t.exports={toArray:u(0),forEach:u(1),every:u(2),some:u(3),find:u(4)}},82412:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(48999),a=r(22302),l=r(17394),c=r(27807),h=r(52399),u=l((function(t){var e=this,r=e.iterator,n=e.mapper;return new t((function(a,l){var u=function(t){e.done=!0,l(t)},d=function(t){h(r,u,t,u)};t.resolve(s(i(e.next,r))).then((function(r){try{if(s(r).done)e.done=!0,a(c(void 0,!0));else{var i=r.value;try{var l=n(i,e.counter++),h=function(t){a(c(t,!1))};o(l)?t.resolve(l).then(h,d):h(l)}catch(t){d(t)}}}catch(t){u(t)}}),u)}))}));t.exports=function(t){return s(this),n(t),new u(a(this),{mapper:t})}},23070:(t,e,r)=>{"use strict";var i,n,s=r(19037),o=r(84091),a=r(69985),l=r(25391),c=r(61868),h=r(11880),u=r(44201),d=r(53931),p="USE_FUNCTION_CONSTRUCTOR",f=u("asyncIterator"),m=s.AsyncIterator,g=o.AsyncIteratorPrototype;if(g)i=g;else if(a(m))i=m.prototype;else if(o[p]||s[p])try{n=c(c(c(Function("return async function*(){}()")()))),c(n)===Object.prototype&&(i=n)}catch(t){}i?d&&(i=l(i)):i={},a(i[f])||h(i,f,(function(){return this})),t.exports=i},40219:(t,e,r)=>{"use strict";var i=r(22615),n=r(17394);t.exports=n((function(){return i(this.next,this.iterator)}),!0)},18368:t=>{"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=e+"+/",i=e+"-_",n=function(t){for(var e={},r=0;r<64;r++)e[t.charAt(r)]=r;return e};t.exports={i2c:r,c2i:n(r),i2cUrl:i,c2iUrl:n(i)}},71228:(t,e,r)=>{"use strict";var i=r(85027),n=r(72125);t.exports=function(t,e,r,s){try{return s?e(i(r)[0],r[1]):e(r)}catch(e){n(t,"throw",e)}}},86431:(t,e,r)=>{"use strict";var i=r(44201)("iterator"),n=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){n=!0}};o[i]=function(){return this},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){try{if(!e&&!n)return!1}catch(t){return!1}var r=!1;try{var s={};s[i]=function(){return{next:function(){return{done:r=!0}}}},t(s)}catch(t){}return r}},6648:(t,e,r)=>{"use strict";var i=r(68844),n=i({}.toString),s=i("".slice);t.exports=function(t){return s(n(t),8,-1)}},50926:(t,e,r)=>{"use strict";var i=r(23043),n=r(69985),s=r(6648),o=r(44201)("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());t.exports=i?s:function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=a(t),o))?r:l?s(e):"Object"===(i=s(e))&&n(e.callee)?"Arguments":i}},28737:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(10509),o=r(52655),a=r(981),l=r(18734),c=[].push;t.exports=function(t){var e,r,h,u,d=arguments.length,p=d>1?arguments[1]:void 0;return o(this),(e=void 0!==p)&&s(p),a(t)?new this:(r=[],e?(h=0,u=i(p,d>2?arguments[2]:void 0),l(t,(function(t){n(c,r,u(t,h++))}))):l(t,c,{that:r}),new this(r))}},1114:(t,e,r)=>{"use strict";var i=r(96004);t.exports=function(){return new this(i(arguments))}},70800:(t,e,r)=>{"use strict";var i=r(25391),n=r(62148),s=r(6045),o=r(54071),a=r(767),l=r(981),c=r(18734),h=r(91934),u=r(27807),d=r(14241),p=r(67697),f=r(45375).fastKey,m=r(618),g=m.set,A=m.getterFor;t.exports={getConstructor:function(t,e,r,h){var u=t((function(t,n){a(t,d),g(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),p||(t.size=0),l(n)||c(n,t[h],{that:t,AS_ENTRIES:r})})),d=u.prototype,m=A(e),y=function(t,e,r){var i,n,s=m(t),o=v(t,e);return o?o.value=r:(s.last=o={index:n=f(e,!0),key:e,value:r,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=o),i&&(i.next=o),p?s.size++:t.size++,"F"!==n&&(s.index[n]=o)),t},v=function(t,e){var r,i=m(t),n=f(e);if("F"!==n)return i.index[n];for(r=i.first;r;r=r.next)if(r.key===e)return r};return s(d,{clear:function(){for(var t=m(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,p?t.size=0:this.size=0},delete:function(t){var e=this,r=m(e),i=v(e,t);if(i){var n=i.next,s=i.previous;delete r.index[i.index],i.removed=!0,s&&(s.next=n),n&&(n.previous=s),r.first===i&&(r.first=n),r.last===i&&(r.last=s),p?r.size--:e.size--}return!!i},forEach:function(t){for(var e,r=m(this),i=o(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!v(this,t)}}),s(d,r?{get:function(t){var e=v(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),p&&n(d,"size",{configurable:!0,get:function(){return m(this).size}}),u},setStrong:function(t,e,r){var i=e+" Iterator",n=A(e),s=A(i);h(t,e,(function(t,e){g(this,{type:i,target:t,state:n(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?u("keys"===e?r.key:"values"===e?r.value:[r.key,r.value],!1):(t.target=void 0,u(void 0,!0))}),r?"entries":"values",!r,!0),d(e)}}},70637:(t,e,r)=>{"use strict";var i=r(68844),n=r(6045),s=r(45375).getWeakData,o=r(767),a=r(85027),l=r(981),c=r(48999),h=r(18734),u=r(2960),d=r(36812),p=r(618),f=p.set,m=p.getterFor,g=u.find,A=u.findIndex,y=i([].splice),v=0,x=function(t){return t.frozen||(t.frozen=new b)},b=function(){this.entries=[]},_=function(t,e){return g(t.entries,(function(t){return t[0]===e}))};b.prototype={get:function(t){var e=_(this,t);if(e)return e[1]},has:function(t){return!!_(this,t)},set:function(t,e){var r=_(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=A(this.entries,(function(e){return e[0]===t}));return~e&&y(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,r,i){var u=t((function(t,n){o(t,p),f(t,{type:e,id:v++,frozen:void 0}),l(n)||h(n,t[i],{that:t,AS_ENTRIES:r})})),p=u.prototype,g=m(e),A=function(t,e,r){var i=g(t),n=s(a(e),!0);return!0===n?x(i).set(e,r):n[i.id]=r,t};return n(p,{delete:function(t){var e=g(this);if(!c(t))return!1;var r=s(t);return!0===r?x(e).delete(t):r&&d(r,e.id)&&delete r[e.id]},has:function(t){var e=g(this);if(!c(t))return!1;var r=s(t);return!0===r?x(e).has(t):r&&d(r,e.id)}}),n(p,r?{get:function(t){var e=g(this);if(c(t)){var r=s(t);return!0===r?x(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return A(this,t,e)}}:{add:function(t){return A(this,t,!0)}}),u}}},20319:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(35266),a=r(11880),l=r(45375),c=r(18734),h=r(767),u=r(69985),d=r(981),p=r(48999),f=r(3689),m=r(86431),g=r(55997),A=r(33457);t.exports=function(t,e,r){var y=-1!==t.indexOf("Map"),v=-1!==t.indexOf("Weak"),x=y?"set":"add",b=n[t],_=b&&b.prototype,w=b,E={},M=function(t){var e=s(_[t]);a(_,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(v&&!p(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return v&&!p(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(v&&!p(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(o(t,!u(b)||!(v||_.forEach&&!f((function(){(new b).entries().next()})))))w=r.getConstructor(e,t,y,x),l.enable();else if(o(t,!0)){var S=new w,C=S[x](v?{}:-0,1)!==S,T=f((function(){S.has(1)})),I=m((function(t){new b(t)})),R=!v&&f((function(){for(var t=new b,e=5;e--;)t[x](e,e);return!t.has(-0)}));I||((w=e((function(t,e){h(t,_);var r=A(new b,t,w);return d(e)||c(e,r[x],{that:r,AS_ENTRIES:y}),r}))).prototype=_,_.constructor=w),(T||R)&&(M("delete"),M("has"),y&&M("get")),(R||C)&&M(x),v&&_.clear&&delete _.clear}return E[t]=w,i({global:!0,constructor:!0,forced:w!==b},E),g(w,t),v||r.setStrong(w,t,y),w}},41544:(t,e,r)=>{"use strict";r(56646),r(51090);var i=r(76058),n=r(25391),s=r(48999),o=Object,a=TypeError,l=i("Map"),c=i("WeakMap"),h=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=n(null)};h.prototype.get=function(t,e){return this[t]||(this[t]=e())},h.prototype.next=function(t,e,r){var i=r?this.objectsByIndex[t]||(this.objectsByIndex[t]=new c):this.primitives||(this.primitives=new l),n=i.get(e);return n||i.set(e,n=new h),n};var u=new h;t.exports=function(){var t,e,r=u,i=arguments.length;for(t=0;t{"use strict";var i=r(36812),n=r(19152),s=r(82474),o=r(72560);t.exports=function(t,e,r){for(var a=n(e),l=o.f,c=s.f,h=0;h{"use strict";var i=r(44201)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[i]=!1,"/./"[t](e)}catch(t){}}return!1}},81748:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},71568:(t,e,r)=>{"use strict";var i=r(68844),n=r(74684),s=r(34327),o=/"/g,a=i("".replace);t.exports=function(t,e,r,i){var l=s(n(t)),c="<"+e;return""!==r&&(c+=" "+r+'="'+a(s(i),o,""")+'"'),c+">"+l+""}},27807:t=>{"use strict";t.exports=function(t,e){return{value:t,done:e}}},75773:(t,e,r)=>{"use strict";var i=r(67697),n=r(72560),s=r(75684);t.exports=i?function(t,e,r){return n.f(t,e,s(1,r))}:function(t,e,r){return t[e]=r,t}},75684:t=>{"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},76522:(t,e,r)=>{"use strict";var i=r(18360),n=r(72560),s=r(75684);t.exports=function(t,e,r){var o=i(e);o in t?n.f(t,o,s(0,r)):t[o]=r}},99455:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(77254).start,o=RangeError,a=isFinite,l=Math.abs,c=Date.prototype,h=c.toISOString,u=i(c.getTime),d=i(c.getUTCDate),p=i(c.getUTCFullYear),f=i(c.getUTCHours),m=i(c.getUTCMilliseconds),g=i(c.getUTCMinutes),A=i(c.getUTCMonth),y=i(c.getUTCSeconds);t.exports=n((function(){return"0385-07-25T07:06:39.999Z"!==h.call(new Date(-50000000000001))}))||!n((function(){h.call(new Date(NaN))}))?function(){if(!a(u(this)))throw new o("Invalid time value");var t=this,e=p(t),r=m(t),i=e<0?"-":e>9999?"+":"";return i+s(l(e),i?6:4,0)+"-"+s(A(t)+1,2,0)+"-"+s(d(t),2,0)+"T"+s(f(t),2,0)+":"+s(g(t),2,0)+":"+s(y(t),2,0)+"."+s(r,3,0)+"Z"}:h},81797:(t,e,r)=>{"use strict";var i=r(85027),n=r(35899),s=TypeError;t.exports=function(t){if(i(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new s("Incorrect hint");return n(this,t)}},62148:(t,e,r)=>{"use strict";var i=r(98702),n=r(72560);t.exports=function(t,e,r){return r.get&&i(r.get,e,{getter:!0}),r.set&&i(r.set,e,{setter:!0}),n.f(t,e,r)}},11880:(t,e,r)=>{"use strict";var i=r(69985),n=r(72560),s=r(98702),o=r(95014);t.exports=function(t,e,r,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(i(r)&&s(r,c,a),a.global)l?t[e]=r:o(e,r);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=r:n.f(t,e,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},6045:(t,e,r)=>{"use strict";var i=r(11880);t.exports=function(t,e,r){for(var n in e)i(t,n,e[n],r);return t}},95014:(t,e,r)=>{"use strict";var i=r(19037),n=Object.defineProperty;t.exports=function(t,e){try{n(i,t,{value:e,configurable:!0,writable:!0})}catch(r){i[t]=e}return e}},98494:(t,e,r)=>{"use strict";var i=r(23691),n=TypeError;t.exports=function(t,e){if(!delete t[e])throw new n("Cannot delete property "+i(e)+" of "+i(t))}},67697:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},21420:(t,e,r)=>{"use strict";var i,n,s,o,a=r(19037),l=r(21905),c=r(63514),h=a.structuredClone,u=a.ArrayBuffer,d=a.MessageChannel,p=!1;if(c)p=function(t){h(t,{transfer:[t]})};else if(u)try{d||(i=l("worker_threads"))&&(d=i.MessageChannel),d&&(n=new d,s=new u(2),o=function(t){n.port1.postMessage(null,[t])},2===s.byteLength&&(o(s),0===s.byteLength&&(p=o)))}catch(t){}t.exports=p},22659:t=>{"use strict";var e="object"==typeof document&&document.all,r=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:r}},36420:(t,e,r)=>{"use strict";var i=r(19037),n=r(48999),s=i.document,o=n(s)&&n(s.createElement);t.exports=function(t){return o?s.createElement(t):{}}},55565:t=>{"use strict";var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},37136:t=>{"use strict";t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},66338:t=>{"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},33265:(t,e,r)=>{"use strict";var i=r(36420)("span").classList,n=i&&i.constructor&&i.constructor.prototype;t.exports=n===Object.prototype?void 0:n},97365:(t,e,r)=>{"use strict";var i=r(30071).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},72532:(t,e,r)=>{"use strict";var i=r(88563),n=r(50806);t.exports=!i&&!n&&"object"==typeof window&&"object"==typeof document},83127:t=>{"use strict";t.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},88563:t=>{"use strict";t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},37298:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/MSIE|Trident/.test(i)},63221:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/ipad|iphone|ipod/i.test(i)&&"undefined"!=typeof Pebble},4764:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},50806:(t,e,r)=>{"use strict";var i=r(19037),n=r(6648);t.exports="process"===n(i.process)},27486:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/web0s(?!.*chrome)/i.test(i)},30071:t=>{"use strict";t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3615:(t,e,r)=>{"use strict";var i,n,s=r(19037),o=r(30071),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,h=c&&c.v8;h&&(n=(i=h.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!n&&o&&(!(i=o.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=o.match(/Chrome\/(\d+)/))&&(n=+i[1]),t.exports=n},27922:(t,e,r)=>{"use strict";var i=r(30071).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},72739:t=>{"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},56610:(t,e,r)=>{"use strict";var i=r(68844),n=Error,s=i("".replace),o=String(new n("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(o);t.exports=function(t,e){if(l&&"string"==typeof t&&!n.prepareStackTrace)for(;e--;)t=s(t,a,"");return t}},65411:(t,e,r)=>{"use strict";var i=r(75773),n=r(56610),s=r(49599),o=Error.captureStackTrace;t.exports=function(t,e,r,a){s&&(o?o(t,e):i(t,"stack",n(r,a)))}},49599:(t,e,r)=>{"use strict";var i=r(3689),n=r(75684);t.exports=!i((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",n(1,7)),7!==t.stack)}))},20445:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(85027),o=r(13841),a=Error.prototype.toString,l=n((function(){if(i){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==a.call(t))return!0}return"2: 1"!==a.call({message:1,name:2})||"Error"!==a.call({})}));t.exports=l?function(){var t=s(this),e=o(t.name,"Error"),r=o(t.message);return e?r?e+": "+r:e:r}:a},79989:(t,e,r)=>{"use strict";var i=r(19037),n=r(82474).f,s=r(75773),o=r(11880),a=r(95014),l=r(8758),c=r(35266);t.exports=function(t,e){var r,h,u,d,p,f=t.target,m=t.global,g=t.stat;if(r=m?i:g?i[f]||a(f,{}):(i[f]||{}).prototype)for(h in e){if(d=e[h],u=t.dontCallGetSet?(p=n(r,h))&&p.value:r[h],!c(m?h:f+(g?".":"#")+h,t.forced)&&void 0!==u){if(typeof d==typeof u)continue;l(d,u)}(t.sham||u&&u.sham)&&s(d,"sham",!0),o(r,h,d,t)}}},3689:t=>{"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},65773:(t,e,r)=>{"use strict";r(64043);var i=r(46576),n=r(11880),s=r(56308),o=r(3689),a=r(44201),l=r(75773),c=a("species"),h=RegExp.prototype;t.exports=function(t,e,r,u){var d=a(t),p=!o((function(){var e={};return e[d]=function(){return 7},7!==""[t](e)})),f=p&&!o((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[d]=/./[d]),r.exec=function(){return e=!0,null},r[d](""),!e}));if(!p||!f||r){var m=i(/./[d]),g=e(d,""[t],(function(t,e,r,n,o){var a=i(t),l=e.exec;return l===s||l===h.exec?p&&!o?{done:!0,value:m(e,r,n)}:{done:!0,value:a(r,e,n)}:{done:!1}}));n(String.prototype,t,g[0]),n(h,d,g[1])}u&&l(h[d],"sham",!0)}},37809:(t,e,r)=>{"use strict";var i=r(92297),n=r(6310),s=r(55565),o=r(54071),a=function(t,e,r,l,c,h,u,d){for(var p,f,m=c,g=0,A=!!u&&o(u,d);g0&&i(p)?(f=n(p),m=a(t,e,p,f,m,h-1)-1):(s(m+1),t[m]=p),m++),g++;return m};t.exports=a},71594:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},61735:(t,e,r)=>{"use strict";var i=r(97215),n=Function.prototype,s=n.apply,o=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?o.bind(s):function(){return o.apply(s,arguments)})},54071:(t,e,r)=>{"use strict";var i=r(46576),n=r(10509),s=r(97215),o=i(i.bind);t.exports=function(t,e){return n(t),void 0===e?t:s?o(t,e):function(){return t.apply(e,arguments)}}},97215:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},86761:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509),s=r(48999),o=r(36812),a=r(96004),l=r(97215),c=Function,h=i([].concat),u=i([].join),d={};t.exports=l?c.bind:function(t){var e=n(this),r=e.prototype,i=a(arguments,1),l=function(){var r=h(i,a(arguments));return this instanceof l?function(t,e,r){if(!o(d,e)){for(var i=[],n=0;n{"use strict";var i=r(97215),n=Function.prototype.call;t.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},33505:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509);t.exports=function(){return i(n(this))}},41236:(t,e,r)=>{"use strict";var i=r(67697),n=r(36812),s=Function.prototype,o=i&&Object.getOwnPropertyDescriptor,a=n(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!i||i&&o(s,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},52743:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509);t.exports=function(t,e,r){try{return i(n(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},46576:(t,e,r)=>{"use strict";var i=r(6648),n=r(68844);t.exports=function(t){if("Function"===i(t))return n(t)}},68844:(t,e,r)=>{"use strict";var i=r(97215),n=Function.prototype,s=n.call,o=i&&n.bind.bind(s,s);t.exports=i?o:function(t){return function(){return s.apply(t,arguments)}}},9093:t=>{"use strict";var e=TypeError;t.exports=function(t){var r=t&&t.alphabet;if(void 0===r||"base64"===r||"base64url"===r)return r||"base64";throw new e("Incorrect `alphabet` option")}},11427:(t,e,r)=>{"use strict";var i=r(22615),n=r(69985),s=r(85027),o=r(22302),a=r(91664),l=r(54849),c=r(44201),h=r(29019),u=c("asyncIterator");t.exports=function(t){var e,r=s(t),c=!0,d=l(r,u);return n(d)||(d=a(r),c=!1),void 0!==d?e=i(d,r):(e=r,c=!0),s(e),o(c?e:new h(o(e)))}},13807:(t,e,r)=>{"use strict";var i=r(22615),n=r(29019),s=r(85027),o=r(5185),a=r(22302),l=r(54849),c=r(44201)("asyncIterator");t.exports=function(t,e){var r=arguments.length<2?l(t,c):e;return r?s(i(r,t)):new n(a(o(t)))}},88277:(t,e,r)=>{"use strict";var i=r(19037);t.exports=function(t,e){var r=i[t],n=r&&r.prototype;return n&&n[e]}},76058:(t,e,r)=>{"use strict";var i=r(19037),n=r(69985);t.exports=function(t,e){return arguments.length<2?(r=i[t],n(r)?r:void 0):i[t]&&i[t][e];var r}},22302:t=>{"use strict";t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},36752:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(22302),o=r(91664);t.exports=function(t,e){e&&"string"==typeof t||n(t);var r=o(t);return s(n(void 0!==r?i(r,t):t))}},91664:(t,e,r)=>{"use strict";var i=r(50926),n=r(54849),s=r(981),o=r(9478),a=r(44201)("iterator");t.exports=function(t){if(!s(t))return n(t,a)||n(t,"@@iterator")||o[i(t)]}},5185:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(23691),a=r(91664),l=TypeError;t.exports=function(t,e){var r=arguments.length<2?a(t):e;if(n(r))return s(i(r,t));throw new l(o(t)+" is not iterable")}},92643:(t,e,r)=>{"use strict";var i=r(68844),n=r(92297),s=r(69985),o=r(6648),a=r(34327),l=i([].push);t.exports=function(t){if(s(t))return t;if(n(t)){for(var e=t.length,r=[],i=0;i{"use strict";var i=r(10509),n=r(981);t.exports=function(t,e){var r=t[e];return n(r)?void 0:i(r)}},41074:(t,e,r)=>{"use strict";var i=r(10509),n=r(85027),s=r(22615),o=r(68700),a=r(22302),l="Invalid size",c=RangeError,h=TypeError,u=Math.max,d=function(t,e,r,i){this.set=t,this.size=e,this.has=r,this.keys=i};d.prototype={getIterator:function(){return a(n(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}},t.exports=function(t){n(t);var e=+t.size;if(e!=e)throw new h(l);var r=o(e);if(r<0)throw new c(l);return new d(t,u(r,0),i(t.has),i(t.keys))}},27017:(t,e,r)=>{"use strict";var i=r(68844),n=r(90690),s=Math.floor,o=i("".charAt),a=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,i,u,d){var p=r+t.length,f=i.length,m=h;return void 0!==u&&(u=n(u),m=c),a(d,m,(function(n,a){var c;switch(o(a,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,r);case"'":return l(e,p);case"<":c=u[l(a,1,-1)];break;default:var h=+a;if(0===h)return n;if(h>f){var d=s(h/10);return 0===d?n:d<=f?void 0===i[d-1]?o(a,1):i[d-1]+o(a,1):n}c=i[h-1]}return void 0===c?"":c}))}},19037:function(t,e,r){"use strict";var i=function(t){return t&&t.Math===Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r.g&&r.g)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},36812:(t,e,r)=>{"use strict";var i=r(68844),n=r(90690),s=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(n(t),e)}},57248:t=>{"use strict";t.exports={}},20920:t=>{"use strict";t.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}},2688:(t,e,r)=>{"use strict";var i=r(76058);t.exports=i("document","documentElement")},68506:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(36420);t.exports=!i&&!n((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},15477:t=>{"use strict";var e=Array,r=Math.abs,i=Math.pow,n=Math.floor,s=Math.log,o=Math.LN2;t.exports={pack:function(t,a,l){var c,h,u,d=e(l),p=8*l-a-1,f=(1<>1,g=23===a?i(2,-24)-i(2,-77):0,A=t<0||0===t&&1/t<0?1:0,y=0;for((t=r(t))!=t||t===1/0?(h=t!=t?1:0,c=f):(c=n(s(t)/o),t*(u=i(2,-c))<1&&(c--,u*=2),(t+=c+m>=1?g/u:g*i(2,1-m))*u>=2&&(c++,u/=2),c+m>=f?(h=0,c=f):c+m>=1?(h=(t*u-1)*i(2,a),c+=m):(h=t*i(2,m-1)*i(2,a),c=0));a>=8;)d[y++]=255&h,h/=256,a-=8;for(c=c<0;)d[y++]=255&c,c/=256,p-=8;return d[--y]|=128*A,d},unpack:function(t,e){var r,n=t.length,s=8*n-e-1,o=(1<>1,l=s-7,c=n-1,h=t[c--],u=127&h;for(h>>=7;l>0;)u=256*u+t[c--],l-=8;for(r=u&(1<<-l)-1,u>>=-l,l+=e;l>0;)r=256*r+t[c--],l-=8;if(0===u)u=1-a;else{if(u===o)return r?NaN:h?-1/0:1/0;r+=i(2,e),u-=a}return(h?-1:1)*r*i(2,u-e)}}},94413:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(6648),o=Object,a=i("".split);t.exports=n((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?a(t,""):o(t)}:o},33457:(t,e,r)=>{"use strict";var i=r(69985),n=r(48999),s=r(49385);t.exports=function(t,e,r){var o,a;return s&&i(o=e.constructor)&&o!==r&&n(a=o.prototype)&&a!==r.prototype&&s(t,a),t}},6738:(t,e,r)=>{"use strict";var i=r(68844),n=r(69985),s=r(84091),o=i(Function.toString);n(s.inspectSource)||(s.inspectSource=function(t){return o(t)}),t.exports=s.inspectSource},62570:(t,e,r)=>{"use strict";var i=r(48999),n=r(75773);t.exports=function(t,e){i(e)&&"cause"in e&&n(t,"cause",e.cause)}},45375:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(57248),o=r(48999),a=r(36812),l=r(72560).f,c=r(72741),h=r(26062),u=r(27049),d=r(14630),p=r(71594),f=!1,m=d("meta"),g=0,A=function(t){l(t,m,{value:{objectID:"O"+g++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},f=!0;var t=c.f,e=n([].splice),r={};r[m]=1,t(r).length&&(c.f=function(r){for(var i=t(r),n=0,s=i.length;n{"use strict";var i,n,s,o=r(59834),a=r(19037),l=r(48999),c=r(75773),h=r(36812),u=r(84091),d=r(2713),p=r(57248),f="Object already initialized",m=a.TypeError,g=a.WeakMap;if(o||u.state){var A=u.state||(u.state=new g);A.get=A.get,A.has=A.has,A.set=A.set,i=function(t,e){if(A.has(t))throw new m(f);return e.facade=t,A.set(t,e),e},n=function(t){return A.get(t)||{}},s=function(t){return A.has(t)}}else{var y=d("state");p[y]=!0,i=function(t,e){if(h(t,y))throw new m(f);return e.facade=t,c(t,y,e),e},n=function(t){return h(t,y)?t[y]:{}},s=function(t){return h(t,y)}}t.exports={set:i,get:n,has:s,enforce:function(t){return s(t)?n(t):i(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=n(e)).type!==t)throw new m("Incompatible receiver, "+t+" required");return r}}}},93292:(t,e,r)=>{"use strict";var i=r(44201),n=r(9478),s=i("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||o[s]===t)}},92297:(t,e,r)=>{"use strict";var i=r(6648);t.exports=Array.isArray||function(t){return"Array"===i(t)}},9401:(t,e,r)=>{"use strict";var i=r(50926);t.exports=function(t){var e=i(t);return"BigInt64Array"===e||"BigUint64Array"===e}},69985:(t,e,r)=>{"use strict";var i=r(22659),n=i.all;t.exports=i.IS_HTMLDDA?function(t){return"function"==typeof t||t===n}:function(t){return"function"==typeof t}},19429:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(69985),o=r(50926),a=r(76058),l=r(6738),c=function(){},h=[],u=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=i(d.exec),f=!d.test(c),m=function(t){if(!s(t))return!1;try{return u(c,h,t),!0}catch(t){return!1}},g=function(t){if(!s(t))return!1;switch(o(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(d,l(t))}catch(t){return!0}};g.sham=!0,t.exports=!u||n((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?g:m},76251:(t,e,r)=>{"use strict";var i=r(36812);t.exports=function(t){return void 0!==t&&(i(t,"value")||i(t,"writable"))}},35266:(t,e,r)=>{"use strict";var i=r(3689),n=r(69985),s=/#|\.prototype\./,o=function(t,e){var r=l[a(t)];return r===h||r!==c&&(n(e)?i(e):!!e)},a=o.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",h=o.POLYFILL="P";t.exports=o},71973:(t,e,r)=>{"use strict";var i=r(48999),n=Math.floor;t.exports=Number.isInteger||function(t){return!i(t)&&isFinite(t)&&n(t)===t}},9603:(t,e,r)=>{"use strict";var i=r(50926),n=r(36812),s=r(981),o=r(44201),a=r(9478),l=o("iterator"),c=Object;t.exports=function(t){if(s(t))return!1;var e=c(t);return void 0!==e[l]||"@@iterator"in e||n(a,i(e))}},981:t=>{"use strict";t.exports=function(t){return null==t}},48999:(t,e,r)=>{"use strict";var i=r(69985),n=r(22659),s=n.all;t.exports=n.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:i(t)||t===s}:function(t){return"object"==typeof t?null!==t:i(t)}},53931:t=>{"use strict";t.exports=!1},55670:(t,e,r)=>{"use strict";var i=r(48999),n=r(618).get;t.exports=function(t){if(!i(t))return!1;var e=n(t);return!!e&&"RawJSON"===e.type}},91245:(t,e,r)=>{"use strict";var i=r(48999),n=r(6648),s=r(44201)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[s])?!!e:"RegExp"===n(t))}},30734:(t,e,r)=>{"use strict";var i=r(76058),n=r(69985),s=r(23622),o=r(39525),a=Object;t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return n(e)&&s(e.prototype,a(t))}},96704:(t,e,r)=>{"use strict";var i=r(22615);t.exports=function(t,e,r){for(var n,s,o=r?t:t.iterator,a=t.next;!(n=i(a,o)).done;)if(void 0!==(s=e(n.value)))return s}},18734:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(85027),o=r(23691),a=r(93292),l=r(6310),c=r(23622),h=r(5185),u=r(91664),d=r(72125),p=TypeError,f=function(t,e){this.stopped=t,this.result=e},m=f.prototype;t.exports=function(t,e,r){var g,A,y,v,x,b,_,w=r&&r.that,E=!(!r||!r.AS_ENTRIES),M=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),T=i(e,w),I=function(t){return g&&d(g,"normal",t),new f(!0,t)},R=function(t){return E?(s(t),C?T(t[0],t[1],I):T(t[0],t[1])):C?T(t,I):T(t)};if(M)g=t.iterator;else if(S)g=t;else{if(!(A=u(t)))throw new p(o(t)+" is not iterable");if(a(A)){for(y=0,v=l(t);v>y;y++)if((x=R(t[y]))&&c(m,x))return x;return new f(!1)}g=h(t,A)}for(b=M?t.next:g.next;!(_=n(b,g)).done;){try{x=R(_.value)}catch(t){d(g,"throw",t)}if("object"==typeof x&&x&&c(m,x))return x}return new f(!1)}},72125:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(54849);t.exports=function(t,e,r){var o,a;n(t);try{if(!(o=s(t,"return"))){if("throw"===e)throw r;return r}o=i(o,t)}catch(t){a=!0,o=t}if("throw"===e)throw r;if(a)throw o;return n(o),r}},30974:(t,e,r)=>{"use strict";var i=r(12013).IteratorPrototype,n=r(25391),s=r(75684),o=r(55997),a=r(9478),l=function(){return this};t.exports=function(t,e,r,c){var h=e+" Iterator";return t.prototype=n(i,{next:s(+!c,r)}),o(t,h,!1,!0),a[h]=l,t}},65419:(t,e,r)=>{"use strict";var i=r(22615),n=r(25391),s=r(75773),o=r(6045),a=r(44201),l=r(618),c=r(54849),h=r(12013).IteratorPrototype,u=r(27807),d=r(72125),p=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",g=l.set,A=function(t){var e=l.getterFor(t?m:f);return o(n(h),{next:function(){var r=e(this);if(t)return r.nextHandler();try{var i=r.done?void 0:r.nextHandler();return u(i,r.done)}catch(t){throw r.done=!0,t}},return:function(){var r=e(this),n=r.iterator;if(r.done=!0,t){var s=c(n,"return");return s?i(s,n):u(void 0,!0)}if(r.inner)try{d(r.inner.iterator,"normal")}catch(t){return d(n,"throw",t)}return d(n,"normal"),u(void 0,!0)}})},y=A(!0),v=A(!1);s(v,p,"Iterator Helper"),t.exports=function(t,e){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=e?m:f,i.nextHandler=t,i.counter=0,i.done=!1,g(this,i)};return r.prototype=e?y:v,r}},91934:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(53931),o=r(41236),a=r(69985),l=r(30974),c=r(61868),h=r(49385),u=r(55997),d=r(75773),p=r(11880),f=r(44201),m=r(9478),g=r(12013),A=o.PROPER,y=o.CONFIGURABLE,v=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,b=f("iterator"),_="keys",w="values",E="entries",M=function(){return this};t.exports=function(t,e,r,o,f,g,S){l(r,e,o);var C,T,I,R=function(t){if(t===f&&O)return O;if(!x&&t&&t in P)return P[t];switch(t){case _:case w:case E:return function(){return new r(this,t)}}return function(){return new r(this)}},B=e+" Iterator",L=!1,P=t.prototype,D=P[b]||P["@@iterator"]||f&&P[f],O=!x&&D||R(f),k="Array"===e&&P.entries||D;if(k&&(C=c(k.call(new t)))!==Object.prototype&&C.next&&(s||c(C)===v||(h?h(C,v):a(C[b])||p(C,b,M)),u(C,B,!0,!0),s&&(m[B]=M)),A&&f===w&&D&&D.name!==w&&(!s&&y?d(P,"name",w):(L=!0,O=function(){return n(D,this)})),f)if(T={values:R(w),keys:g?O:R(_),entries:R(E)},S)for(I in T)(x||L||!(I in P))&&p(P,I,T[I]);else i({target:e,proto:!0,forced:x||L},T);return s&&!S||P[b]===O||p(P,b,O,{name:f}),m[e]=O,T}},47082:(t,e,r)=>{"use strict";var i=r(22615),n=r(88983),s=function(t,e){return[e,t]};t.exports=function(){return i(n,this,s)}},88983:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(22302),a=r(65419),l=r(71228),c=a((function(){var t=this.iterator,e=s(i(this.next,t));if(!(this.done=!!e.done))return l(t,this.mapper,[e.value,this.counter++],!0)}));t.exports=function(t){return s(this),n(t),new c(o(this),{mapper:t})}},12013:(t,e,r)=>{"use strict";var i,n,s,o=r(3689),a=r(69985),l=r(48999),c=r(25391),h=r(61868),u=r(11880),d=r(44201),p=r(53931),f=d("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(n=h(h(s)))!==Object.prototype&&(i=n):m=!0),!l(i)||o((function(){var t={};return i[f].call(t)!==t}))?i={}:p&&(i=c(i)),a(i[f])||u(i,f,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:m}},9478:t=>{"use strict";t.exports={}},6310:(t,e,r)=>{"use strict";var i=r(43126);t.exports=function(t){return i(t.length)}},98702:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(69985),o=r(36812),a=r(67697),l=r(41236).CONFIGURABLE,c=r(6738),h=r(618),u=h.enforce,d=h.get,p=String,f=Object.defineProperty,m=i("".slice),g=i("".replace),A=i([].join),y=a&&!n((function(){return 8!==f((function(){}),"length",{value:8}).length})),v=String(String).split("String"),x=t.exports=function(t,e,r){"Symbol("===m(p(e),0,7)&&(e="["+g(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!o(t,"name")||l&&t.name!==e)&&(a?f(t,"name",{value:e,configurable:!0}):t.name=e),y&&r&&o(r,"arity")&&t.length!==r.arity&&f(t,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=u(t);return o(i,"source")||(i.source=A(v,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return s(this)&&d(this).source||c(this)}),"toString")},83914:(t,e,r)=>{"use strict";var i=r(68844),n=Map.prototype;t.exports={Map,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete),proto:n}},10613:(t,e,r)=>{"use strict";var i=r(68844),n=r(96704),s=r(83914),o=s.Map,a=s.proto,l=i(a.forEach),c=i(a.entries),h=c(new o).next;t.exports=function(t,e,r){return r?n({iterator:c(t),next:h},(function(t){return e(t[1],t[0])})):l(t,e)}},41432:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(69985),o=r(85027),a=TypeError;t.exports=function(t,e){var r,l=o(this),c=n(l.get),h=n(l.has),u=n(l.set),d=arguments.length>2?arguments[2]:void 0;if(!s(e)&&!s(d))throw new a("At least one callback required");return i(h,l,t)?(r=i(c,l,t),s(e)&&(r=e(r),i(u,l,t,r))):s(d)&&(r=d(),i(u,l,t,r)),r}},21745:t=>{"use strict";var e=Math.expm1,r=Math.exp;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!==e(-2e-17)?function(t){var e=+t;return 0===e?e:e>-1e-6&&e<1e-6?e+e*e/2:r(e)-1}:e},76043:(t,e,r)=>{"use strict";var i=r(40134);t.exports=Math.f16round||function(t){return i(t,.0009765625,65504,6103515625e-14)}},40134:(t,e,r)=>{"use strict";var i=r(55680),n=Math.abs,s=2220446049250313e-31,o=1/s;t.exports=function(t,e,r,a){var l=+t,c=n(l),h=i(l);if(cr||d!=d?h*(1/0):h*d}},37788:(t,e,r)=>{"use strict";var i=r(40134);t.exports=Math.fround||function(t){return i(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},4736:t=>{"use strict";var e=Math.log,r=Math.LOG10E;t.exports=Math.log10||function(t){return e(t)*r}},93956:t=>{"use strict";var e=Math.log;t.exports=Math.log1p||function(t){var r=+t;return r>-1e-8&&r<1e-8?r-r*r/2:e(1+r)}},84463:t=>{"use strict";t.exports=Math.scale||function(t,e,r,i,n){var s=+t,o=+e,a=+r,l=+i,c=+n;return s!=s||o!=o||a!=a||l!=l||c!=c?NaN:s===1/0||s===-1/0?s:(s-o)*(c-l)/(a-o)+l}},55680:t=>{"use strict";t.exports=Math.sign||function(t){var e=+t;return 0===e||e!=e?e:e<0?-1:1}},58828:t=>{"use strict";var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?r:e)(i)}},80231:(t,e,r)=>{"use strict";var i,n,s,o,a,l=r(19037),c=r(54071),h=r(82474).f,u=r(99886).set,d=r(34410),p=r(4764),f=r(63221),m=r(27486),g=r(50806),A=l.MutationObserver||l.WebKitMutationObserver,y=l.document,v=l.process,x=l.Promise,b=h(l,"queueMicrotask"),_=b&&b.value;if(!_){var w=new d,E=function(){var t,e;for(g&&(t=v.domain)&&t.exit();e=w.get();)try{e()}catch(t){throw w.head&&i(),t}t&&t.enter()};p||g||m||!A||!y?!f&&x&&x.resolve?((o=x.resolve(void 0)).constructor=x,a=c(o.then,o),i=function(){a(E)}):g?i=function(){v.nextTick(E)}:(u=c(u,l),i=function(){u(E)}):(n=!0,s=y.createTextNode(""),new A(E).observe(s,{characterData:!0}),i=function(){s.data=n=!n}),_=function(t){w.head||i(),w.add(t)}}t.exports=_},22818:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t}))},48742:(t,e,r)=>{"use strict";var i=r(10509),n=TypeError,s=function(t){var e,r;this.promise=new t((function(t,i){if(void 0!==e||void 0!==r)throw new n("Bad Promise constructor");e=t,r=i})),this.resolve=i(e),this.reject=i(r)};t.exports.f=function(t){return new s(t)}},13841:(t,e,r)=>{"use strict";var i=r(34327);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},4654:t=>{"use strict";var e=RangeError;t.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},42124:(t,e,r)=>{"use strict";var i=r(91245),n=TypeError;t.exports=function(t){if(i(t))throw new n("The method doesn't accept regular expressions");return t}},70046:(t,e,r)=>{"use strict";var i=r(19037).isFinite;t.exports=Number.isFinite||function(t){return"number"==typeof t&&i(t)}},14818:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(34327),a=r(61435).trim,l=r(86350),c=s("".charAt),h=i.parseFloat,u=i.Symbol,d=u&&u.iterator,p=1/h(l+"-0")!=-1/0||d&&!n((function(){h(Object(d))}));t.exports=p?function(t){var e=a(o(t)),r=h(e);return 0===r&&"-"===c(e,0)?-0:r}:h},67897:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(34327),a=r(61435).trim,l=r(86350),c=i.parseInt,h=i.Symbol,u=h&&h.iterator,d=/^[+-]?0x/i,p=s(d.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||u&&!n((function(){c(Object(u))}));t.exports=f?function(t,e){var r=a(o(t));return c(r,e>>>0||(p(d,r)?16:10))}:c},98554:(t,e,r)=>{"use strict";var i=r(618),n=r(30974),s=r(27807),o=r(981),a=r(48999),l=r(62148),c=r(67697),h="Incorrect Iterator.range arguments",u="NumericRangeIterator",d=i.set,p=i.getterFor(u),f=RangeError,m=TypeError,g=n((function(t,e,r,i,n,s){if(typeof t!=i||e!==1/0&&e!==-1/0&&typeof e!=i)throw new m(h);if(t===1/0||t===-1/0)throw new f(h);var l,p=e>t,g=!1;if(void 0===r)l=void 0;else if(a(r))l=r.step,g=!!r.inclusive;else{if(typeof r!=i)throw new m(h);l=r}if(o(l)&&(l=p?s:-s),typeof l!=i)throw new m(h);if(l===1/0||l===-1/0||l===n&&t!==e)throw new f(h);d(this,{type:u,start:t,end:e,step:l,inclusive:g,hitsEnd:t!=t||e!=e||l!=l||e>t!=l>n,currentCount:n,zero:n}),c||(this.start=t,this.end=e,this.step=l,this.inclusive=g)}),u,(function(){var t=p(this);if(t.hitsEnd)return s(void 0,!0);var e=t.start,r=t.end,i=e+t.step*t.currentCount++;i===r&&(t.hitsEnd=!0);var n=t.inclusive;return(r>e?n?i>r:i>=r:n?r>i:r>=i)?(t.hitsEnd=!0,s(void 0,!0)):s(i,!1)})),A=function(t){l(g.prototype,t,{get:function(){return p(this)[t]},set:function(){},configurable:!0,enumerable:!1})};c&&(A("start"),A("end"),A("inclusive"),A("step")),t.exports=g},45394:(t,e,r)=>{"use strict";var i=r(67697),n=r(68844),s=r(22615),o=r(3689),a=r(20300),l=r(7518),c=r(49556),h=r(90690),u=r(94413),d=Object.assign,p=Object.defineProperty,f=n([].concat);t.exports=!d||o((function(){if(i&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!==d({},t)[r]||a(d({},e)).join("")!==n}))?function(t,e){for(var r=h(t),n=arguments.length,o=1,d=l.f,p=c.f;n>o;)for(var m,g=u(arguments[o++]),A=d?f(a(g),d(g)):a(g),y=A.length,v=0;y>v;)m=A[v++],i&&!s(p,g,m)||(r[m]=g[m]);return r}:d},25391:(t,e,r)=>{"use strict";var i,n=r(85027),s=r(98920),o=r(72739),a=r(57248),l=r(2688),c=r(36420),h=r(2713),u="prototype",d="script",p=h("IE_PROTO"),f=function(){},m=function(t){return"<"+d+">"+t+""},g=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},A=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;A="undefined"!=typeof document?document.domain&&i?g(i):(e=c("iframe"),r="java"+d+":",e.style.display="none",l.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F):g(i);for(var n=o.length;n--;)delete A[u][o[n]];return A()};a[p]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(f[u]=n(t),r=new f,f[u]=null,r[p]=t):r=A(),void 0===e?r:s.f(r,e)}},98920:(t,e,r)=>{"use strict";var i=r(67697),n=r(15648),s=r(72560),o=r(85027),a=r(65290),l=r(20300);e.f=i&&!n?Object.defineProperties:function(t,e){o(t);for(var r,i=a(e),n=l(e),c=n.length,h=0;c>h;)s.f(t,r=n[h++],i[r]);return t}},72560:(t,e,r)=>{"use strict";var i=r(67697),n=r(68506),s=r(15648),o=r(85027),a=r(18360),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",p="writable";e.f=i?s?function(t,e,r){if(o(t),e=a(e),o(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]){var i=h(t,e);i&&i[p]&&(t[e]=r.value,r={configurable:d in r?r[d]:i[d],enumerable:u in r?r[u]:i[u],writable:!1})}return c(t,e,r)}:c:function(t,e,r){if(o(t),e=a(e),o(r),n)try{return c(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},82474:(t,e,r)=>{"use strict";var i=r(67697),n=r(22615),s=r(49556),o=r(75684),a=r(65290),l=r(18360),c=r(36812),h=r(68506),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(t,e){if(t=a(t),e=l(e),h)try{return u(t,e)}catch(t){}if(c(t,e))return o(!n(s.f,t,e),t[e])}},26062:(t,e,r)=>{"use strict";var i=r(6648),n=r(65290),s=r(72741).f,o=r(9015),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"Window"===i(t)?function(t){try{return s(t)}catch(t){return o(a)}}(t):s(n(t))}},72741:(t,e,r)=>{"use strict";var i=r(54948),n=r(72739).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,n)}},7518:(t,e)=>{"use strict";e.f=Object.getOwnPropertySymbols},61868:(t,e,r)=>{"use strict";var i=r(36812),n=r(69985),s=r(90690),o=r(2713),a=r(81748),l=o("IE_PROTO"),c=Object,h=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=s(t);if(i(e,l))return e[l];var r=e.constructor;return n(r)&&e instanceof r?r.prototype:e instanceof c?h:null}},27049:(t,e,r)=>{"use strict";var i=r(3689),n=r(48999),s=r(6648),o=r(11655),a=Object.isExtensible,l=i((function(){a(1)}));t.exports=l||o?function(t){return!!n(t)&&(!o||"ArrayBuffer"!==s(t))&&(!a||a(t))}:a},23622:(t,e,r)=>{"use strict";var i=r(68844);t.exports=i({}.isPrototypeOf)},42351:(t,e,r)=>{"use strict";var i=r(618),n=r(30974),s=r(27807),o=r(36812),a=r(20300),l=r(90690),c="Object Iterator",h=i.set,u=i.getterFor(c);t.exports=n((function(t,e){var r=l(t);h(this,{type:c,mode:e,object:r,keys:a(r),index:0})}),"Object",(function(){for(var t=u(this),e=t.keys;;){if(null===e||t.index>=e.length)return t.object=t.keys=null,s(void 0,!0);var r=e[t.index++],i=t.object;if(o(i,r)){switch(t.mode){case"keys":return s(r,!1);case"values":return s(i[r],!1)}return s([r,i[r]],!1)}}}))},54948:(t,e,r)=>{"use strict";var i=r(68844),n=r(36812),s=r(65290),o=r(84328).indexOf,a=r(57248),l=i([].push);t.exports=function(t,e){var r,i=s(t),c=0,h=[];for(r in i)!n(a,r)&&n(i,r)&&l(h,r);for(;e.length>c;)n(i,r=e[c++])&&(~o(h,r)||l(h,r));return h}},20300:(t,e,r)=>{"use strict";var i=r(54948),n=r(72739);t.exports=Object.keys||function(t){return i(t,n)}},49556:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);e.f=n?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},90600:(t,e,r)=>{"use strict";var i=r(53931),n=r(19037),s=r(3689),o=r(27922);t.exports=i||!s((function(){if(!(o&&o<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete n[t]}}))},49385:(t,e,r)=>{"use strict";var i=r(52743),n=r(85027),s=r(23550);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=i(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return n(r),s(i),e?t(r,i):r.__proto__=i,r}}():void 0)},49419:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(68844),o=r(61868),a=r(20300),l=r(65290),c=s(r(49556).f),h=s([].push),u=i&&n((function(){var t=Object.create(null);return t[2]=2,!c(t,2)})),d=function(t){return function(e){for(var r,n=l(e),s=a(n),d=u&&null===o(n),p=s.length,f=0,m=[];p>f;)r=s[f++],i&&!(d?r in n:c(n,r))||h(m,t?[r,n[r]]:n[r]);return m}};t.exports={entries:d(!0),values:d(!1)}},65073:(t,e,r)=>{"use strict";var i=r(23043),n=r(50926);t.exports=i?{}.toString:function(){return"[object "+n(this)+"]"}},35899:(t,e,r)=>{"use strict";var i=r(22615),n=r(69985),s=r(48999),o=TypeError;t.exports=function(t,e){var r,a;if("string"===e&&n(r=t.toString)&&!s(a=i(r,t)))return a;if(n(r=t.valueOf)&&!s(a=i(r,t)))return a;if("string"!==e&&n(r=t.toString)&&!s(a=i(r,t)))return a;throw new o("Can't convert object to primitive value")}},19152:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=r(72741),o=r(7518),a=r(85027),l=n([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=s.f(a(t)),r=o.f;return r?l(e,r(t)):e}},46675:(t,e,r)=>{"use strict";var i=r(68844),n=r(36812),s=SyntaxError,o=parseInt,a=String.fromCharCode,l=i("".charAt),c=i("".slice),h=i(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var r=!0,i="";e{"use strict";var i=r(19037);t.exports=i},9302:t=>{"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},87073:(t,e,r)=>{"use strict";var i=r(19037),n=r(17919),s=r(69985),o=r(35266),a=r(6738),l=r(44201),c=r(72532),h=r(88563),u=r(53931),d=r(3615),p=n&&n.prototype,f=l("species"),m=!1,g=s(i.PromiseRejectionEvent),A=o("Promise",(function(){var t=a(n),e=t!==String(n);if(!e&&66===d)return!0;if(u&&(!p.catch||!p.finally))return!0;if(!d||d<51||!/native code/.test(t)){var r=new n((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};if((r.constructor={})[f]=i,!(m=r.then((function(){}))instanceof i))return!0}return!e&&(c||h)&&!g}));t.exports={CONSTRUCTOR:A,REJECTION_EVENT:g,SUBCLASSING:m}},17919:(t,e,r)=>{"use strict";var i=r(19037);t.exports=i.Promise},72945:(t,e,r)=>{"use strict";var i=r(85027),n=r(48999),s=r(48742);t.exports=function(t,e){if(i(t),n(e)&&e.constructor===t)return e;var r=s.f(t);return(0,r.resolve)(e),r.promise}},562:(t,e,r)=>{"use strict";var i=r(17919),n=r(86431),s=r(87073).CONSTRUCTOR;t.exports=s||!n((function(t){i.all(t).then(void 0,(function(){}))}))},38055:(t,e,r)=>{"use strict";var i=r(72560).f;t.exports=function(t,e,r){r in t||i(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},34410:t=>{"use strict";var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},33666:(t,e,r)=>{"use strict";r(56646),r(51090);var i=r(76058),n=r(68844),s=r(83430),o=i("Map"),a=i("WeakMap"),l=n([].push),c=s("metadata"),h=c.store||(c.store=new a),u=function(t,e,r){var i=h.get(t);if(!i){if(!r)return;h.set(t,i=new o)}var n=i.get(e);if(!n){if(!r)return;i.set(e,n=new o)}return n};t.exports={store:h,getMap:u,has:function(t,e,r){var i=u(e,r,!1);return void 0!==i&&i.has(t)},get:function(t,e,r){var i=u(e,r,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,r,i){u(r,i,!0).set(t,e)},keys:function(t,e){var r=u(t,e,!1),i=[];return r&&r.forEach((function(t,e){l(i,e)})),i},toKey:function(t){return void 0===t||"symbol"==typeof t?t:String(t)}}},66100:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(69985),o=r(6648),a=r(56308),l=TypeError;t.exports=function(t,e){var r=t.exec;if(s(r)){var c=i(r,t,e);return null!==c&&n(c),c}if("RegExp"===o(t))return i(a,t,e);throw new l("RegExp#exec called on incompatible receiver")}},56308:(t,e,r)=>{"use strict";var i,n,s=r(22615),o=r(68844),a=r(34327),l=r(69633),c=r(87901),h=r(83430),u=r(25391),d=r(618).get,p=r(62100),f=r(26738),m=h("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,A=g,y=o("".charAt),v=o("".indexOf),x=o("".replace),b=o("".slice),_=(n=/b*/g,s(g,i=/a/,"a"),s(g,n,"a"),0!==i.lastIndex||0!==n.lastIndex),w=c.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(_||E||w||p||f)&&(A=function(t){var e,r,i,n,o,c,h,p=this,f=d(p),M=a(t),S=f.raw;if(S)return S.lastIndex=p.lastIndex,e=s(A,S,M),p.lastIndex=S.lastIndex,e;var C=f.groups,T=w&&p.sticky,I=s(l,p),R=p.source,B=0,L=M;if(T&&(I=x(I,"y",""),-1===v(I,"g")&&(I+="g"),L=b(M,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(M,p.lastIndex-1))&&(R="(?: "+R+")",L=" "+L,B++),r=new RegExp("^(?:"+R+")",I)),E&&(r=new RegExp("^"+R+"$(?!\\s)",I)),_&&(i=p.lastIndex),n=s(g,T?r:p,L),T?n?(n.input=b(n.input,B),n[0]=b(n[0],B),n.index=p.lastIndex,p.lastIndex+=n[0].length):p.lastIndex=0:_&&n&&(p.lastIndex=p.global?n.index+n[0].length:i),E&&n&&n.length>1&&s(m,n[0],r,(function(){for(o=1;o{"use strict";var i=r(85027);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},63477:(t,e,r)=>{"use strict";var i=r(22615),n=r(36812),s=r(23622),o=r(69633),a=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in a||n(t,"flags")||!s(a,t)?e:i(o,t)}},87901:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp,s=i((function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),o=s||i((function(){return!n("a","y").sticky})),a=s||i((function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},62100:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp;t.exports=i((function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},26738:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp;t.exports=i((function(){var t=n("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},74684:(t,e,r)=>{"use strict";var i=r(981),n=TypeError;t.exports=function(t){if(i(t))throw new n("Can't call method on "+t);return t}},68600:t=>{"use strict";t.exports=function(t,e){return t===e||t!=t&&e!=e}},70953:t=>{"use strict";t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},8552:(t,e,r)=>{"use strict";var i,n=r(19037),s=r(61735),o=r(69985),a=r(83127),l=r(30071),c=r(96004),h=r(21500),u=n.Function,d=/MSIE .\./.test(l)||a&&((i=n.Bun.version.split(".")).length<3||"0"===i[0]&&(i[1]<3||"3"===i[1]&&"0"===i[2]));t.exports=function(t,e){var r=e?2:1;return d?function(i,n){var a=h(arguments.length,1)>r,l=o(i)?i:u(i),d=a?c(arguments,r):[],p=a?function(){s(l,this,d)}:l;return e?t(p,n):t(p)}:t}},3097:(t,e,r)=>{"use strict";var i=r(61034),n=r(48774),s=i.Set,o=i.add;t.exports=function(t){var e=new s;return n(t,(function(t){o(e,t)})),e}},27748:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(3097),o=r(17026),a=r(41074),l=r(48774),c=r(96704),h=n.has,u=n.remove;t.exports=function(t){var e=i(this),r=a(t),n=s(e);return o(e)<=r.size?l(e,(function(t){r.includes(t)&&u(n,t)})):c(r.getIterator(),(function(t){h(e,t)&&u(n,t)})),n}},61034:(t,e,r)=>{"use strict";var i=r(68844),n=Set.prototype;t.exports={Set,add:i(n.add),has:i(n.has),remove:i(n.delete),proto:n}},72948:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(17026),o=r(41074),a=r(48774),l=r(96704),c=n.Set,h=n.add,u=n.has;t.exports=function(t){var e=i(this),r=o(t),n=new c;return s(e)>r.size?l(r.getIterator(),(function(t){u(e,t)&&h(n,t)})):a(e,(function(t){r.includes(t)&&h(n,t)})),n}},97795:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).has,s=r(17026),o=r(41074),a=r(48774),l=r(96704),c=r(72125);t.exports=function(t){var e=i(this),r=o(t);if(s(e)<=r.size)return!1!==a(e,(function(t){if(r.includes(t))return!1}),!0);var h=r.getIterator();return!1!==l(h,(function(t){if(n(e,t))return c(h,"normal",!1)}))}},26951:(t,e,r)=>{"use strict";var i=r(10029),n=r(17026),s=r(48774),o=r(41074);t.exports=function(t){var e=i(this),r=o(t);return!(n(e)>r.size)&&!1!==s(e,(function(t){if(!r.includes(t))return!1}),!0)}},3894:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).has,s=r(17026),o=r(41074),a=r(96704),l=r(72125);t.exports=function(t){var e=i(this),r=o(t);if(s(e){"use strict";var i=r(68844),n=r(96704),s=r(61034),o=s.Set,a=s.proto,l=i(a.forEach),c=i(a.keys),h=c(new o).next;t.exports=function(t,e,r){return r?n({iterator:c(t),next:h},e):l(t,e)}},53234:(t,e,r)=>{"use strict";var i=r(76058),n=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var e=i("Set");try{(new e)[t](n(0));try{return(new e)[t](n(-1)),!1}catch(t){return!0}}catch(t){return!1}}},17026:(t,e,r)=>{"use strict";var i=r(52743),n=r(61034);t.exports=i(n.proto,"size","get")||function(t){return t.size}},14241:(t,e,r)=>{"use strict";var i=r(76058),n=r(62148),s=r(44201),o=r(67697),a=s("species");t.exports=function(t){var e=i(t);o&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},62289:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(3097),o=r(41074),a=r(96704),l=n.add,c=n.has,h=n.remove;t.exports=function(t){var e=i(this),r=o(t).getIterator(),n=s(e);return a(r,(function(t){c(e,t)?h(n,t):l(n,t)})),n}},55997:(t,e,r)=>{"use strict";var i=r(72560).f,n=r(36812),s=r(44201)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!n(t,s)&&i(t,s,{configurable:!0,value:e})}},75674:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).add,s=r(3097),o=r(41074),a=r(96704);t.exports=function(t){var e=i(this),r=o(t).getIterator(),l=s(e);return a(r,(function(t){n(l,t)})),l}},2713:(t,e,r)=>{"use strict";var i=r(83430),n=r(14630),s=i("keys");t.exports=function(t){return s[t]||(s[t]=n(t))}},84091:(t,e,r)=>{"use strict";var i=r(19037),n=r(95014),s="__core-js_shared__",o=i[s]||n(s,{});t.exports=o},83430:(t,e,r)=>{"use strict";var i=r(53931),n=r(84091);(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.34.0",mode:i?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE",source:"https://github.com/zloirock/core-js"})},76373:(t,e,r)=>{"use strict";var i=r(85027),n=r(52655),s=r(981),o=r(44201)("species");t.exports=function(t,e){var r,a=i(t).constructor;return void 0===a||s(r=i(a)[o])?e:n(r)}},8195:(t,e,r)=>{"use strict";var i=r(68844),n=r(65290),s=r(34327),o=r(6310),a=TypeError,l=i([].push),c=i([].join);t.exports=function(t){var e=n(t),r=o(e);if(!r)return"";for(var i=arguments.length,h=[],u=0;;){var d=e[u++];if(void 0===d)throw new a("Incorrect template");if(l(h,s(d)),u===r)return c(h,"");u{"use strict";var i=r(3689);t.exports=function(t){return i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},10730:(t,e,r)=>{"use strict";var i=r(68844),n=r(68700),s=r(34327),o=r(74684),a=i("".charAt),l=i("".charCodeAt),c=i("".slice),h=function(t){return function(e,r){var i,h,u=s(o(e)),d=n(r),p=u.length;return d<0||d>=p?t?"":void 0:(i=l(u,d))<55296||i>56319||d+1===p||(h=l(u,d+1))<56320||h>57343?t?a(u,d):i:t?c(u,d,d+2):h-56320+(i-55296<<10)+65536}};t.exports={codeAt:h(!1),charAt:h(!0)}},35947:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(i)},77254:(t,e,r)=>{"use strict";var i=r(68844),n=r(43126),s=r(34327),o=r(90534),a=r(74684),l=i(o),c=i("".slice),h=Math.ceil,u=function(t){return function(e,r,i){var o,u,d=s(a(e)),p=n(r),f=d.length,m=void 0===i?" ":s(i);return p<=f||""===m?d:((u=l(m,h((o=p-f)/m.length))).length>o&&(u=c(u,0,o)),t?d+u:u+d)}};t.exports={start:u(!1),end:u(!0)}},98985:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=String.fromCharCode,o=i("String","fromCodePoint"),a=n("".charAt),l=n("".charCodeAt),c=n("".indexOf),h=n("".slice),u=function(t,e){var r=l(t,e);return r>=48&&r<=57},d=function(t,e,r){if(r>=t.length)return-1;for(var i=0;e=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1};t.exports=function(t){for(var e,r="",i=0,n=0;(n=c(t,"\\",n))>-1;){if(r+=h(t,i,n),++n===t.length)return;var l=a(t,n++);switch(l){case"b":r+="\b";break;case"t":r+="\t";break;case"n":r+="\n";break;case"v":r+="\v";break;case"f":r+="\f";break;case"r":r+="\r";break;case"\r":n1114111)return;r+=o(e);break;default:if(u(l,0))return;r+=l}i=n}return r+h(t,i)}},6430:(t,e,r)=>{"use strict";var i=r(68844),n=2147483647,s=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",l=RangeError,c=i(o.exec),h=Math.floor,u=String.fromCharCode,d=i("".charCodeAt),p=i([].join),f=i([].push),m=i("".replace),g=i("".split),A=i("".toLowerCase),y=function(t){return t+22+75*(t<26)},v=function(t,e,r){var i=0;for(t=r?h(t/700):t>>1,t+=h(t/e);t>455;)t=h(t/35),i+=36;return h(i+36*t/(t+38))},x=function(t){var e=[];t=function(t){for(var e=[],r=0,i=t.length;r=55296&&n<=56319&&r=o&&ih((n-c)/b))throw new l(a);for(c+=(x-o)*b,o=x,r=0;rn)throw new l(a);if(i===o){for(var _=c,w=36;;){var E=w<=m?1:w>=m+26?26:w-m;if(_{"use strict";var i=r(68700),n=r(34327),s=r(74684),o=RangeError;t.exports=function(t){var e=n(s(this)),r="",a=i(t);if(a<0||a===1/0)throw new o("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(e+=e))1&a&&(r+=e);return r}},79558:(t,e,r)=>{"use strict";var i=r(61435).end,n=r(75984);t.exports=n("trimEnd")?function(){return i(this)}:"".trimEnd},75984:(t,e,r)=>{"use strict";var i=r(41236).PROPER,n=r(3689),s=r(86350);t.exports=function(t){return n((function(){return!!s[t]()||"​…᠎"!=="​…᠎"[t]()||i&&s[t].name!==t}))}},72291:(t,e,r)=>{"use strict";var i=r(61435).start,n=r(75984);t.exports=n("trimStart")?function(){return i(this)}:"".trimStart},61435:(t,e,r)=>{"use strict";var i=r(68844),n=r(74684),s=r(34327),o=r(86350),a=i("".replace),l=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),h=function(t){return function(e){var r=s(n(e));return 1&t&&(r=a(r,l,"")),2&t&&(r=a(r,c,"$1")),r}};t.exports={start:h(1),end:h(2),trim:h(3)}},63514:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(3615),o=r(72532),a=r(88563),l=r(50806),c=i.structuredClone;t.exports=!!c&&!n((function(){if(a&&s>92||l&&s>94||o&&s>97)return!1;var t=new ArrayBuffer(8),e=c(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength}))},50146:(t,e,r)=>{"use strict";var i=r(3615),n=r(3689),s=r(19037).String;t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},13032:(t,e,r)=>{"use strict";var i=r(22615),n=r(76058),s=r(44201),o=r(11880);t.exports=function(){var t=n("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,a=s("toPrimitive");e&&!e[a]&&o(e,a,(function(t){return i(r,this)}),{arity:1})}},18992:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=i("Symbol"),o=s.keyFor,a=n(s.prototype.valueOf);t.exports=s.isRegisteredSymbol||function(t){try{return void 0!==o(a(t))}catch(t){return!1}}},8957:(t,e,r)=>{"use strict";for(var i=r(83430),n=r(76058),s=r(68844),o=r(30734),a=r(44201),l=n("Symbol"),c=l.isWellKnownSymbol,h=n("Object","getOwnPropertyNames"),u=s(l.prototype.valueOf),d=i("wks"),p=0,f=h(l),m=f.length;p{"use strict";var i=r(50146);t.exports=i&&!!Symbol.for&&!!Symbol.keyFor},99886:(t,e,r)=>{"use strict";var i,n,s,o,a=r(19037),l=r(61735),c=r(54071),h=r(69985),u=r(36812),d=r(3689),p=r(2688),f=r(96004),m=r(36420),g=r(21500),A=r(4764),y=r(50806),v=a.setImmediate,x=a.clearImmediate,b=a.process,_=a.Dispatch,w=a.Function,E=a.MessageChannel,M=a.String,S=0,C={},T="onreadystatechange";d((function(){i=a.location}));var I=function(t){if(u(C,t)){var e=C[t];delete C[t],e()}},R=function(t){return function(){I(t)}},B=function(t){I(t.data)},L=function(t){a.postMessage(M(t),i.protocol+"//"+i.host)};v&&x||(v=function(t){g(arguments.length,1);var e=h(t)?t:w(t),r=f(arguments,1);return C[++S]=function(){l(e,void 0,r)},n(S),S},x=function(t){delete C[t]},y?n=function(t){b.nextTick(R(t))}:_&&_.now?n=function(t){_.now(R(t))}:E&&!A?(o=(s=new E).port2,s.port1.onmessage=B,n=c(o.postMessage,o)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&i&&"file:"!==i.protocol&&!d(L)?(n=L,a.addEventListener("message",B,!1)):n=T in m("script")?function(t){p.appendChild(m("script"))[T]=function(){p.removeChild(this),I(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:v,clear:x}},23648:(t,e,r)=>{"use strict";var i=r(68844);t.exports=i(1..valueOf)},27578:(t,e,r)=>{"use strict";var i=r(68700),n=Math.max,s=Math.min;t.exports=function(t,e){var r=i(t);return r<0?n(r+e,0):s(r,e)}},71530:(t,e,r)=>{"use strict";var i=r(88732),n=TypeError;t.exports=function(t){var e=i(t,"number");if("number"==typeof e)throw new n("Can't convert number to bigint");return BigInt(e)}},19842:(t,e,r)=>{"use strict";var i=r(68700),n=r(43126),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=i(t),r=n(e);if(e!==r)throw new s("Wrong length or index");return r}},65290:(t,e,r)=>{"use strict";var i=r(94413),n=r(74684);t.exports=function(t){return i(n(t))}},68700:(t,e,r)=>{"use strict";var i=r(58828);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},43126:(t,e,r)=>{"use strict";var i=r(68700),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},90690:(t,e,r)=>{"use strict";var i=r(74684),n=Object;t.exports=function(t){return n(i(t))}},83250:(t,e,r)=>{"use strict";var i=r(15904),n=RangeError;t.exports=function(t,e){var r=i(t);if(r%e)throw new n("Wrong offset");return r}},15904:(t,e,r)=>{"use strict";var i=r(68700),n=RangeError;t.exports=function(t){var e=i(t);if(e<0)throw new n("The argument can't be less than 0");return e}},88732:(t,e,r)=>{"use strict";var i=r(22615),n=r(48999),s=r(30734),o=r(54849),a=r(35899),l=r(44201),c=TypeError,h=l("toPrimitive");t.exports=function(t,e){if(!n(t)||s(t))return t;var r,l=o(t,h);if(l){if(void 0===e&&(e="default"),r=i(l,t,e),!n(r)||s(r))return r;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},18360:(t,e,r)=>{"use strict";var i=r(88732),n=r(30734);t.exports=function(t){var e=i(t,"string");return n(e)?e:e+""}},2939:(t,e,r)=>{"use strict";var i=r(76058),n=r(69985),s=r(9603),o=r(48999),a=i("Set");t.exports=function(t){return function(t){return o(t)&&"number"==typeof t.size&&n(t.has)&&n(t.keys)}(t)?t:s(t)?new a(t):t}},23043:(t,e,r)=>{"use strict";var i={};i[r(44201)("toStringTag")]="z",t.exports="[object z]"===String(i)},34327:(t,e,r)=>{"use strict";var i=r(50926),n=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}},87191:t=>{"use strict";var e=Math.round;t.exports=function(t){var r=e(t);return r<0?0:r>255?255:255&r}},21905:(t,e,r)=>{"use strict";var i=r(50806);t.exports=function(t){try{if(i)return Function('return require("'+t+'")')()}catch(t){}}},23691:t=>{"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},31158:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(22615),o=r(67697),a=r(39800),l=r(54872),c=r(83999),h=r(767),u=r(75684),d=r(75773),p=r(71973),f=r(43126),m=r(19842),g=r(83250),A=r(87191),y=r(18360),v=r(36812),x=r(50926),b=r(48999),_=r(30734),w=r(25391),E=r(23622),M=r(49385),S=r(72741).f,C=r(41304),T=r(2960).forEach,I=r(14241),R=r(62148),B=r(72560),L=r(82474),P=r(618),D=r(33457),O=P.get,k=P.set,U=P.enforce,N=B.f,F=L.f,z=n.RangeError,G=c.ArrayBuffer,Q=G.prototype,j=c.DataView,V=l.NATIVE_ARRAY_BUFFER_VIEWS,H=l.TYPED_ARRAY_TAG,W=l.TypedArray,q=l.TypedArrayPrototype,Z=l.aTypedArrayConstructor,Y=l.isTypedArray,X="BYTES_PER_ELEMENT",J="Wrong length",K=function(t,e){Z(t);for(var r=0,i=e.length,n=new t(i);i>r;)n[r]=e[r++];return n},$=function(t,e){R(t,e,{configurable:!0,get:function(){return O(this)[e]}})},tt=function(t){var e;return E(Q,t)||"ArrayBuffer"===(e=x(t))||"SharedArrayBuffer"===e},et=function(t,e){return Y(t)&&!_(e)&&e in t&&p(+e)&&e>=0},rt=function(t,e){return e=y(e),et(t,e)?u(2,t[e]):F(t,e)},it=function(t,e,r){return e=y(e),!(et(t,e)&&b(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?N(t,e,r):(t[e]=r.value,t)};o?(V||(L.f=rt,B.f=it,$(q,"buffer"),$(q,"byteOffset"),$(q,"byteLength"),$(q,"length")),i({target:"Object",stat:!0,forced:!V},{getOwnPropertyDescriptor:rt,defineProperty:it}),t.exports=function(t,e,r){var o=t.match(/\d+/)[0]/8,l=t+(r?"Clamped":"")+"Array",c="get"+t,u="set"+t,p=n[l],y=p,v=y&&y.prototype,x={},_=function(t,e){N(t,e,{get:function(){return function(t,e){var r=O(t);return r.view[c](e*o+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,i){var n=O(t);n.view[u](e*o+n.byteOffset,r?A(i):i,!0)}(this,e,t)},enumerable:!0})};V?a&&(y=e((function(t,e,r,i){return h(t,v),D(b(e)?tt(e)?void 0!==i?new p(e,g(r,o),i):void 0!==r?new p(e,g(r,o)):new p(e):Y(e)?K(y,e):s(C,y,e):new p(m(e)),t,y)})),M&&M(y,W),T(S(p),(function(t){t in y||d(y,t,p[t])})),y.prototype=v):(y=e((function(t,e,r,i){h(t,v);var n,a,l,c=0,u=0;if(b(e)){if(!tt(e))return Y(e)?K(y,e):s(C,y,e);n=e,u=g(r,o);var d=e.byteLength;if(void 0===i){if(d%o)throw new z(J);if((a=d-u)<0)throw new z(J)}else if((a=f(i)*o)+u>d)throw new z(J);l=a/o}else l=m(e),n=new G(a=l*o);for(k(t,{buffer:n,byteOffset:u,byteLength:a,length:l,view:new j(n)});c{"use strict";var i=r(19037),n=r(3689),s=r(86431),o=r(54872).NATIVE_ARRAY_BUFFER_VIEWS,a=i.ArrayBuffer,l=i.Int8Array;t.exports=!o||!n((function(){l(1)}))||!n((function(){new l(-1)}))||!s((function(t){new l,new l(null),new l(1.5),new l(t)}),!0)||n((function(){return 1!==new l(new a(2),1,void 0).length}))},20716:(t,e,r)=>{"use strict";var i=r(59976),n=r(47338);t.exports=function(t,e){return i(n(t),e)}},41304:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(52655),o=r(90690),a=r(6310),l=r(5185),c=r(91664),h=r(93292),u=r(9401),d=r(54872).aTypedArrayConstructor,p=r(71530);t.exports=function(t){var e,r,f,m,g,A,y,v,x=s(this),b=o(t),_=arguments.length,w=_>1?arguments[1]:void 0,E=void 0!==w,M=c(b);if(M&&!h(M))for(v=(y=l(b,M)).next,b=[];!(A=n(v,y)).done;)b.push(A.value);for(E&&_>2&&(w=i(w,arguments[2])),r=a(b),f=new(d(x))(r),m=u(f),e=0;r>e;e++)g=E?w(b[e],e):b[e],f[e]=m?p(g):+g;return f}},47338:(t,e,r)=>{"use strict";var i=r(54872),n=r(76373),s=i.aTypedArrayConstructor,o=i.getTypedArrayConstructor;t.exports=function(t){return s(n(t,o(t)))}},14630:(t,e,r)=>{"use strict";var i=r(68844),n=0,s=Math.random(),o=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++n+s,36)}},76837:(t,e,r)=>{"use strict";var i=r(3689),n=r(44201),s=r(67697),o=r(53931),a=n("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),i="";return t.pathname="c%20d",e.forEach((function(t,r){e.delete("b"),i+=r+t})),r.delete("a",2),r.delete("b",void 0),o&&(!t.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!e.size&&(o||!s)||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},39525:(t,e,r)=>{"use strict";var i=r(50146);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},15648:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689);t.exports=i&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},21500:t=>{"use strict";var e=TypeError;t.exports=function(t,r){if(t{"use strict";var i=r(19037),n=r(69985),s=i.WeakMap;t.exports=n(s)&&/native code/.test(String(s))},16803:(t,e,r)=>{"use strict";var i=r(68844),n=WeakMap.prototype;t.exports={WeakMap,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete)}},78616:(t,e,r)=>{"use strict";var i=r(68844),n=WeakSet.prototype;t.exports={WeakSet,add:i(n.add),has:i(n.has),remove:i(n.delete)}},35405:(t,e,r)=>{"use strict";var i=r(50496),n=r(36812),s=r(96145),o=r(72560).f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});n(e,t)||o(e,t,{value:s.f(t)})}},96145:(t,e,r)=>{"use strict";var i=r(44201);e.f=i},44201:(t,e,r)=>{"use strict";var i=r(19037),n=r(83430),s=r(36812),o=r(14630),a=r(50146),l=r(39525),c=i.Symbol,h=n("wks"),u=l?c.for||c:c&&c.withoutSetter||o;t.exports=function(t){return s(h,t)||(h[t]=a&&s(c,t)?c[t]:u("Symbol."+t)),h[t]}},86350:t=>{"use strict";t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},51064:(t,e,r)=>{"use strict";var i=r(76058),n=r(36812),s=r(75773),o=r(23622),a=r(49385),l=r(8758),c=r(38055),h=r(33457),u=r(13841),d=r(62570),p=r(65411),f=r(67697),m=r(53931);t.exports=function(t,e,r,g){var A="stackTraceLimit",y=g?2:1,v=t.split("."),x=v[v.length-1],b=i.apply(null,v);if(b){var _=b.prototype;if(!m&&n(_,"cause")&&delete _.cause,!r)return b;var w=i("Error"),E=e((function(t,e){var r=u(g?e:t,void 0),i=g?new b(t):new b;return void 0!==r&&s(i,"message",r),p(i,E,i.stack,2),this&&o(_,this)&&h(i,this,E),arguments.length>y&&d(i,arguments[y]),i}));if(E.prototype=_,"Error"!==x?a?a(E,w):l(E,w,{name:!0}):f&&A in b&&(c(E,b,A),c(E,b,"prepareStackTrace")),l(E,b),!m)try{_.name!==x&&s(_,"name",x),_.constructor=E}catch(t){}return E}}},54927:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(3689),a=r(51064),l="AggregateError",c=n(l),h=!o((function(){return 1!==c([1]).errors[0]}))&&o((function(){return 7!==c([1],l,{cause:7}).cause}));i({global:!0,constructor:!0,arity:2,forced:h},{AggregateError:a(l,(function(t){return function(e,r){return s(t,this,arguments)}}),h,!0)})},39382:(t,e,r)=>{"use strict";var i=r(79989),n=r(23622),s=r(61868),o=r(49385),a=r(8758),l=r(25391),c=r(75773),h=r(75684),u=r(62570),d=r(65411),p=r(18734),f=r(13841),m=r(44201)("toStringTag"),g=Error,A=[].push,y=function(t,e){var r,i=n(v,this);o?r=o(new g,i?s(this):v):(r=i?this:l(v),c(r,m,"Error")),void 0!==e&&c(r,"message",f(e)),d(r,y,r.stack,1),arguments.length>2&&u(r,arguments[2]);var a=[];return p(t,A,{that:a}),c(r,"errors",a),r};o?o(y,g):a(y,g,{name:!0});var v=y.prototype=l(g.prototype,{constructor:h(1,y),message:h(1,""),name:h(1,"AggregateError")});i({global:!0,constructor:!0,arity:2},{AggregateError:y})},95879:(t,e,r)=>{"use strict";r(39382)},69365:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(83999),o=r(14241),a="ArrayBuffer",l=s[a];i({global:!0,constructor:!0,forced:n[a]!==l},{ArrayBuffer:l}),o(a)},33870:(t,e,r)=>{"use strict";var i=r(79989),n=r(54872);i({target:"ArrayBuffer",stat:!0,forced:!n.NATIVE_ARRAY_BUFFER_VIEWS},{isView:n.isView})},99211:(t,e,r)=>{"use strict";var i=r(79989),n=r(46576),s=r(3689),o=r(83999),a=r(85027),l=r(27578),c=r(43126),h=r(76373),u=o.ArrayBuffer,d=o.DataView,p=d.prototype,f=n(u.prototype.slice),m=n(p.getUint8),g=n(p.setUint8);i({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:s((function(){return!new u(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(f&&void 0===e)return f(a(this),t);for(var r=a(this).byteLength,i=l(t,r),n=l(void 0===e?r:e,r),s=new(h(this,u))(c(n-i)),o=new d(this),p=new d(s),A=0;i{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(68700),a=r(87370);i({target:"Array",proto:!0},{at:function(t){var e=n(this),r=s(e),i=o(t),a=i>=0?i:r+i;return a<0||a>=r?void 0:e[a]}}),a("at")},34338:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(92297),o=r(48999),a=r(90690),l=r(6310),c=r(55565),h=r(76522),u=r(27120),d=r(29042),p=r(44201),f=r(3615),m=p("isConcatSpreadable"),g=f>=51||!n((function(){var t=[];return t[m]=!1,t.concat()[0]!==t})),A=function(t){if(!o(t))return!1;var e=t[m];return void 0!==e?!!e:s(t)};i({target:"Array",proto:!0,arity:1,forced:!g||!d("concat")},{concat:function(t){var e,r,i,n,s,o=a(this),d=u(o,0),p=0;for(e=-1,i=arguments.length;e{"use strict";var i=r(79989),n=r(70357),s=r(87370);i({target:"Array",proto:!0},{copyWithin:n}),s("copyWithin")},55791:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).every;i({target:"Array",proto:!0,forced:!r(16834)("every")},{every:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},97895:(t,e,r)=>{"use strict";var i=r(79989),n=r(62872),s=r(87370);i({target:"Array",proto:!0},{fill:n}),s("fill")},38077:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filter;i({target:"Array",proto:!0,forced:!r(29042)("filter")},{filter:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},39772:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).findIndex,s=r(87370),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{findIndex:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},93383:(t,e,r)=>{"use strict";var i=r(79989),n=r(61969).findLastIndex,s=r(87370);i({target:"Array",proto:!0},{findLastIndex:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLastIndex")},59867:(t,e,r)=>{"use strict";var i=r(79989),n=r(61969).findLast,s=r(87370);i({target:"Array",proto:!0},{findLast:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLast")},25728:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).find,s=r(87370),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},54564:(t,e,r)=>{"use strict";var i=r(79989),n=r(37809),s=r(10509),o=r(90690),a=r(6310),l=r(27120);i({target:"Array",proto:!0},{flatMap:function(t){var e,r=o(this),i=a(r);return s(t),(e=l(r,0)).length=n(e,r,r,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},62795:(t,e,r)=>{"use strict";var i=r(79989),n=r(37809),s=r(90690),o=r(6310),a=r(68700),l=r(27120);i({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=s(this),r=o(e),i=l(e,0);return i.length=n(i,e,e,r,0,void 0===t?1:a(t)),i}})},49693:(t,e,r)=>{"use strict";var i=r(79989),n=r(57612);i({target:"Array",proto:!0,forced:[].forEach!==n},{forEach:n})},77049:(t,e,r)=>{"use strict";var i=r(79989),n=r(21055);i({target:"Array",stat:!0,forced:!r(86431)((function(t){Array.from(t)}))},{from:n})},76801:(t,e,r)=>{"use strict";var i=r(79989),n=r(84328).includes,s=r(3689),o=r(87370);i({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},97195:(t,e,r)=>{"use strict";var i=r(79989),n=r(46576),s=r(84328).indexOf,o=r(16834),a=n([].indexOf),l=!!a&&1/a([1],1,-0)<0;i({target:"Array",proto:!0,forced:l||!o("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return l?a(this,t,e)||0:s(this,t,e)}})},63975:(t,e,r)=>{"use strict";r(79989)({target:"Array",stat:!0},{isArray:r(92297)})},752:(t,e,r)=>{"use strict";var i=r(65290),n=r(87370),s=r(9478),o=r(618),a=r(72560).f,l=r(91934),c=r(27807),h=r(53931),u=r(67697),d="Array Iterator",p=o.set,f=o.getterFor(d);t.exports=l(Array,"Array",(function(t,e){p(this,{type:d,target:i(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,c(void 0,!0);switch(t.kind){case"keys":return c(r,!1);case"values":return c(e[r],!1)}return c([r,e[r]],!1)}),"values");var m=s.Arguments=s.Array;if(n("keys"),n("values"),n("entries"),!h&&u&&"values"!==m.name)try{a(m,"name",{value:"values"})}catch(t){}},6203:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(94413),o=r(65290),a=r(16834),l=n([].join);i({target:"Array",proto:!0,forced:s!==Object||!a("join",",")},{join:function(t){return l(o(this),void 0===t?",":t)}})},72410:(t,e,r)=>{"use strict";var i=r(79989),n=r(60953);i({target:"Array",proto:!0,forced:n!==[].lastIndexOf},{lastIndexOf:n})},50886:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).map;i({target:"Array",proto:!0,forced:!r(29042)("map")},{map:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},37593:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(19429),o=r(76522),a=Array;i({target:"Array",stat:!0,forced:n((function(){function t(){}return!(a.of.call(t)instanceof t)}))},{of:function(){for(var t=0,e=arguments.length,r=new(s(this)?this:a)(e);e>t;)o(r,t,arguments[t++]);return r.length=e,r}})},70560:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(5649),a=r(55565);i({target:"Array",proto:!0,arity:1,forced:r(3689)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=n(this),r=s(e),i=arguments.length;a(r+i);for(var l=0;l{"use strict";var i=r(79989),n=r(88820).right,s=r(16834),o=r(3615);i({target:"Array",proto:!0,forced:!r(50806)&&o>79&&o<83||!s("reduceRight")},{reduceRight:function(t){return n(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},278:(t,e,r)=>{"use strict";var i=r(79989),n=r(88820).left,s=r(16834),o=r(3615);i({target:"Array",proto:!0,forced:!r(50806)&&o>79&&o<83||!s("reduce")},{reduce:function(t){var e=arguments.length;return n(this,t,e,e>1?arguments[1]:void 0)}})},93374:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(92297),o=n([].reverse),a=[1,2];i({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),o(this)}})},89730:(t,e,r)=>{"use strict";var i=r(79989),n=r(92297),s=r(19429),o=r(48999),a=r(27578),l=r(6310),c=r(65290),h=r(76522),u=r(44201),d=r(29042),p=r(96004),f=d("slice"),m=u("species"),g=Array,A=Math.max;i({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var r,i,u,d=c(this),f=l(d),y=a(t,f),v=a(void 0===e?f:e,f);if(n(d)&&(r=d.constructor,(s(r)&&(r===g||n(r.prototype))||o(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return p(d,y,v);for(i=new(void 0===r?g:r)(A(v-y,0)),u=0;y{"use strict";var i=r(79989),n=r(2960).some;i({target:"Array",proto:!0,forced:!r(16834)("some")},{some:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},65137:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(90690),a=r(6310),l=r(98494),c=r(34327),h=r(3689),u=r(50382),d=r(16834),p=r(97365),f=r(37298),m=r(3615),g=r(27922),A=[],y=n(A.sort),v=n(A.push),x=h((function(){A.sort(void 0)})),b=h((function(){A.sort(null)})),_=d("sort"),w=!h((function(){if(m)return m<70;if(!(p&&p>3)){if(f)return!0;if(g)return g<603;var t,e,r,i,n="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)A.push({k:e+i,v:r})}for(A.sort((function(t,e){return e.v-t.v})),i=0;ic(r)?1:-1}}(t)),r=a(n),i=0;i{"use strict";r(14241)("Array")},62506:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(27578),o=r(68700),a=r(6310),l=r(5649),c=r(55565),h=r(27120),u=r(76522),d=r(98494),p=r(29042)("splice"),f=Math.max,m=Math.min;i({target:"Array",proto:!0,forced:!p},{splice:function(t,e){var r,i,p,g,A,y,v=n(this),x=a(v),b=s(t,x),_=arguments.length;for(0===_?r=i=0:1===_?(r=0,i=x-b):(r=_-2,i=m(f(o(e),0),x-b)),c(x+r-i),p=h(v,i),g=0;gx-i+r;g--)d(v,g-1)}else if(r>i)for(g=x-i;g>b;g--)y=g+r-1,(A=g+i-1)in v?v[y]=v[A]:d(v,y);for(g=0;g{"use strict";var i=r(79989),n=r(26166),s=r(65290),o=r(87370),a=Array;i({target:"Array",proto:!0},{toReversed:function(){return n(s(this),a)}}),o("toReversed")},12894:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(65290),a=r(59976),l=r(88277),c=r(87370),h=Array,u=n(l("Array","sort"));i({target:"Array",proto:!0},{toSorted:function(t){void 0!==t&&s(t);var e=o(this),r=a(h,e);return u(r,t)}}),c("toSorted")},93530:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370),s=r(55565),o=r(6310),a=r(27578),l=r(65290),c=r(68700),h=Array,u=Math.max,d=Math.min;i({target:"Array",proto:!0},{toSpliced:function(t,e){var r,i,n,p,f=l(this),m=o(f),g=a(t,m),A=arguments.length,y=0;for(0===A?r=i=0:1===A?(r=0,i=m-g):(r=A-2,i=d(u(c(e),0),m-g)),n=s(m+r-i),p=h(n);y{"use strict";r(87370)("flatMap")},13383:(t,e,r)=>{"use strict";r(87370)("flat")},91719:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(5649),a=r(98494),l=r(55565);i({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}}()},{unshift:function(t){var e=n(this),r=s(e),i=arguments.length;if(i){l(r+i);for(var c=r;c--;){var h=c+i;c in e?e[h]=e[c]:a(e,h)}for(var u=0;u{"use strict";var i=r(79989),n=r(16134),s=r(65290),o=Array;i({target:"Array",proto:!0},{with:function(t,e){return n(s(this),o,t,e)}})},87347:(t,e,r)=>{"use strict";var i=r(79989),n=r(83999);i({global:!0,constructor:!0,forced:!r(37075)},{DataView:n.DataView})},18201:(t,e,r)=>{"use strict";r(87347)},55635:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(3689)((function(){return 120!==new Date(16e11).getYear()})),o=n(Date.prototype.getFullYear);i({target:"Date",proto:!0,forced:s},{getYear:function(){return o(this)-1900}})},42227:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=Date,o=n(s.prototype.getTime);i({target:"Date",stat:!0},{now:function(){return o(new s)}})},99679:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=Date.prototype,a=n(o.getTime),l=n(o.setFullYear);i({target:"Date",proto:!0},{setYear:function(t){a(this);var e=s(t);return l(this,e>=0&&e<=99?e+1900:e)}})},24343:(t,e,r)=>{"use strict";r(79989)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},65007:(t,e,r)=>{"use strict";var i=r(79989),n=r(99455);i({target:"Date",proto:!0,forced:Date.prototype.toISOString!==n},{toISOString:n})},78150:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(90690),o=r(88732);i({target:"Date",proto:!0,arity:1,forced:n((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=s(this),r=o(e,"number");return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},59903:(t,e,r)=>{"use strict";var i=r(36812),n=r(11880),s=r(81797),o=r(44201)("toPrimitive"),a=Date.prototype;i(a,o)||n(a,o,s)},30024:(t,e,r)=>{"use strict";var i=r(68844),n=r(11880),s=Date.prototype,o="Invalid Date",a="toString",l=i(s[a]),c=i(s.getTime);String(new Date(NaN))!==o&&n(s,a,(function(){var t=c(this);return t==t?l(this):o}))},21057:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(61735),o=r(51064),a="WebAssembly",l=n[a],c=7!==new Error("e",{cause:7}).cause,h=function(t,e){var r={};r[t]=o(t,e,c),i({global:!0,constructor:!0,arity:1,forced:c},r)},u=function(t,e){if(l&&l[t]){var r={};r[t]=o(a+"."+t,e,c),i({target:a,stat:!0,constructor:!0,arity:1,forced:c},r)}};h("Error",(function(t){return function(e){return s(t,this,arguments)}})),h("EvalError",(function(t){return function(e){return s(t,this,arguments)}})),h("RangeError",(function(t){return function(e){return s(t,this,arguments)}})),h("ReferenceError",(function(t){return function(e){return s(t,this,arguments)}})),h("SyntaxError",(function(t){return function(e){return s(t,this,arguments)}})),h("TypeError",(function(t){return function(e){return s(t,this,arguments)}})),h("URIError",(function(t){return function(e){return s(t,this,arguments)}})),u("CompileError",(function(t){return function(e){return s(t,this,arguments)}})),u("LinkError",(function(t){return function(e){return s(t,this,arguments)}})),u("RuntimeError",(function(t){return function(e){return s(t,this,arguments)}}))},68932:(t,e,r)=>{"use strict";var i=r(11880),n=r(20445),s=Error.prototype;s.toString!==n&&i(s,"toString",n)},60428:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=n("".charAt),a=n("".charCodeAt),l=n(/./.exec),c=n(1..toString),h=n("".toUpperCase),u=/[\w*+\-./@]/,d=function(t,e){for(var r=c(t,16);r.length{"use strict";var i=r(79989),n=r(86761);i({target:"Function",proto:!0,forced:Function.bind!==n},{bind:n})},56269:(t,e,r)=>{"use strict";var i=r(69985),n=r(48999),s=r(72560),o=r(61868),a=r(44201),l=r(98702),c=a("hasInstance"),h=Function.prototype;c in h||s.f(h,c,{value:l((function(t){if(!i(this)||!n(t))return!1;var e=this.prototype;if(!n(e))return t instanceof this;for(;t=o(t);)if(e===t)return!0;return!1}),c)})},34284:(t,e,r)=>{"use strict";var i=r(67697),n=r(41236).EXISTS,s=r(68844),o=r(62148),a=Function.prototype,l=s(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,h=s(c.exec);i&&!n&&o(a,"name",{configurable:!0,get:function(){try{return h(c,l(this))[1]}catch(t){return""}}})},45398:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037);i({global:!0,forced:n.globalThis!==n},{globalThis:n})},48324:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(22615),a=r(68844),l=r(3689),c=r(69985),h=r(30734),u=r(96004),d=r(92643),p=r(50146),f=String,m=n("JSON","stringify"),g=a(/./.exec),A=a("".charAt),y=a("".charCodeAt),v=a("".replace),x=a(1..toString),b=/[\uD800-\uDFFF]/g,_=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,E=!p||l((function(){var t=n("Symbol")("stringify detection");return"[null]"!==m([t])||"{}"!==m({a:t})||"{}"!==m(Object(t))})),M=l((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),S=function(t,e){var r=u(arguments),i=d(e);if(c(i)||void 0!==t&&!h(t))return r[1]=function(t,e){if(c(i)&&(e=o(i,this,f(t),e)),!h(e))return e},s(m,null,r)},C=function(t,e,r){var i=A(r,e-1),n=A(r,e+1);return g(_,t)&&!g(w,n)||g(w,t)&&!g(_,i)?"\\u"+x(y(t,0),16):t};m&&i({target:"JSON",stat:!0,arity:3,forced:E||M},{stringify:function(t,e,r){var i=u(arguments),n=s(E?S:m,null,i);return M&&"string"==typeof n?v(n,b,C):n}})},7629:(t,e,r)=>{"use strict";var i=r(19037);r(55997)(i.JSON,"JSON",!0)},9322:(t,e,r)=>{"use strict";r(20319)("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70800))},89348:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(74684),a=r(18734),l=r(83914),c=r(53931),h=l.Map,u=l.has,d=l.get,p=l.set,f=n([].push);i({target:"Map",stat:!0,forced:c},{groupBy:function(t,e){o(t),s(e);var r=new h,i=0;return a(t,(function(t){var n=e(t,i++);u(r,n)?f(d(r,n),t):p(r,n,[t])})),r}})},56646:(t,e,r)=>{"use strict";r(9322)},6557:(t,e,r)=>{"use strict";var i=r(79989),n=r(93956),s=Math.acosh,o=Math.log,a=Math.sqrt,l=Math.LN2;i({target:"Math",stat:!0,forced:!s||710!==Math.floor(s(Number.MAX_VALUE))||s(1/0)!==1/0},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?o(e)+l:n(e-1+a(e-1)*a(e+1))}})},62428:(t,e,r)=>{"use strict";var i=r(79989),n=Math.asinh,s=Math.log,o=Math.sqrt;i({target:"Math",stat:!0,forced:!(n&&1/n(0)>0)},{asinh:function t(e){var r=+e;return isFinite(r)&&0!==r?r<0?-t(-r):s(r+o(r*r+1)):r}})},45263:(t,e,r)=>{"use strict";var i=r(79989),n=Math.atanh,s=Math.log;i({target:"Math",stat:!0,forced:!(n&&1/n(-0)<0)},{atanh:function(t){var e=+t;return 0===e?e:s((1+e)/(1-e))/2}})},74712:(t,e,r)=>{"use strict";var i=r(79989),n=r(55680),s=Math.abs,o=Math.pow;i({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return n(e)*o(s(e),1/3)}})},54986:(t,e,r)=>{"use strict";var i=r(79989),n=Math.floor,s=Math.log,o=Math.LOG2E;i({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-n(s(e+.5)*o):32}})},47221:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745),s=Math.cosh,o=Math.abs,a=Math.E;i({target:"Math",stat:!0,forced:!s||s(710)===1/0},{cosh:function(t){var e=n(o(t)-1)+1;return(e+1/(e*a*a))*(a/2)}})},94992:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745);i({target:"Math",stat:!0,forced:n!==Math.expm1},{expm1:n})},25499:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{fround:r(37788)})},59944:(t,e,r)=>{"use strict";var i=r(79989),n=Math.hypot,s=Math.abs,o=Math.sqrt;i({target:"Math",stat:!0,arity:2,forced:!!n&&n(1/0,NaN)!==1/0},{hypot:function(t,e){for(var r,i,n=0,a=0,l=arguments.length,c=0;a0?(i=r/c)*i:r;return c===1/0?1/0:c*o(n)}})},78527:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=Math.imul;i({target:"Math",stat:!0,forced:n((function(){return-5!==s(4294967295,5)||2!==s.length}))},{imul:function(t,e){var r=65535,i=+t,n=+e,s=r&i,o=r&n;return 0|s*o+((r&i>>>16)*o+s*(r&n>>>16)<<16>>>0)}})},75239:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{log10:r(4736)})},92076:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{log1p:r(93956)})},68813:(t,e,r)=>{"use strict";var i=r(79989),n=Math.log,s=Math.LN2;i({target:"Math",stat:!0},{log2:function(t){return n(t)/s}})},96976:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{sign:r(55680)})},62700:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(21745),o=Math.abs,a=Math.exp,l=Math.E;i({target:"Math",stat:!0,forced:n((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(t){var e=+t;return o(e)<1?(s(e)-s(-e))/2:(a(e-1)-a(-e-1))*(l/2)}})},91554:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745),s=Math.exp;i({target:"Math",stat:!0},{tanh:function(t){var e=+t,r=n(e),i=n(-e);return r===1/0?1:i===1/0?-1:(r-i)/(s(e)+s(-e))}})},77509:(t,e,r)=>{"use strict";r(55997)(Math,"Math",!0)},21416:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{trunc:r(58828)})},79288:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(67697),o=r(19037),a=r(50496),l=r(68844),c=r(35266),h=r(36812),u=r(33457),d=r(23622),p=r(30734),f=r(88732),m=r(3689),g=r(72741).f,A=r(82474).f,y=r(72560).f,v=r(23648),x=r(61435).trim,b="Number",_=o[b],w=a[b],E=_.prototype,M=o.TypeError,S=l("".slice),C=l("".charCodeAt),T=c(b,!_(" 0o1")||!_("0b1")||_("+0x1")),I=function(t){var e,r=arguments.length<1?0:_(function(t){var e=f(t,"number");return"bigint"==typeof e?e:function(t){var e,r,i,n,s,o,a,l,c=f(t,"number");if(p(c))throw new M("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=x(c),43===(e=C(c,0))||45===e){if(88===(r=C(c,2))||120===r)return NaN}else if(48===e){switch(C(c,1)){case 66:case 98:i=2,n=49;break;case 79:case 111:i=8,n=55;break;default:return+c}for(o=(s=S(c,2)).length,a=0;an)return NaN;return parseInt(s,i)}return+c}(e)}(t));return d(E,e=this)&&m((function(){v(e)}))?u(Object(r),this,I):r};I.prototype=E,T&&!n&&(E.constructor=I),i({global:!0,constructor:!0,wrap:!0,forced:T},{Number:I});var R=function(t,e){for(var r,i=s?g(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),n=0;i.length>n;n++)h(e,r=i[n])&&!h(t,r)&&y(t,r,A(e,r))};n&&w&&R(a[b],w),(T||n)&&R(a[b],_)},53584:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},82243:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isFinite:r(70046)})},95765:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isInteger:r(71973)})},45993:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},92547:(t,e,r)=>{"use strict";var i=r(79989),n=r(71973),s=Math.abs;i({target:"Number",stat:!0},{isSafeInteger:function(t){return n(t)&&s(t)<=9007199254740991}})},7936:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},32704:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},52362:(t,e,r)=>{"use strict";var i=r(79989),n=r(14818);i({target:"Number",stat:!0,forced:Number.parseFloat!==n},{parseFloat:n})},21552:(t,e,r)=>{"use strict";var i=r(79989),n=r(67897);i({target:"Number",stat:!0,forced:Number.parseInt!==n},{parseInt:n})},10704:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=r(23648),a=r(90534),l=r(4736),c=r(3689),h=RangeError,u=String,d=isFinite,p=Math.abs,f=Math.floor,m=Math.pow,g=Math.round,A=n(1..toExponential),y=n(a),v=n("".slice),x="-6.9000e-11"===A(-69e-12,4)&&"1.25e+0"===A(1.255,2)&&"1.235e+4"===A(12345,3)&&"3e+1"===A(25,0);i({target:"Number",proto:!0,forced:!x||!(c((function(){A(1,1/0)}))&&c((function(){A(1,-1/0)})))||!!c((function(){A(1/0,1/0),A(NaN,1/0)}))},{toExponential:function(t){var e=o(this);if(void 0===t)return A(e);var r=s(t);if(!d(e))return String(e);if(r<0||r>20)throw new h("Incorrect fraction digits");if(x)return A(e,r);var i="",n="",a=0,c="",b="";if(e<0&&(i="-",e=-e),0===e)a=0,n=y("0",r+1);else{var _=l(e);a=f(_);var w=0,E=m(10,a-r);2*e>=(2*(w=g(e/E))+1)*E&&(w+=1),w>=m(10,r+1)&&(w/=10,a+=1),n=u(w)}return 0!==r&&(n=v(n,0,1)+"."+v(n,1)),0===a?(c="+",b="0"):(c=a>0?"+":"-",b=u(p(a))),i+(n+"e")+c+b}})},97389:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=r(23648),a=r(90534),l=r(3689),c=RangeError,h=String,u=Math.floor,d=n(a),p=n("".slice),f=n(1..toFixed),m=function(t,e,r){return 0===e?r:e%2==1?m(t,e-1,r*t):m(t*t,e/2,r)},g=function(t,e,r){for(var i=-1,n=r;++i<6;)n+=e*t[i],t[i]=n%1e7,n=u(n/1e7)},A=function(t,e){for(var r=6,i=0;--r>=0;)i+=t[r],t[r]=u(i/e),i=i%e*1e7},y=function(t){for(var e=6,r="";--e>=0;)if(""!==r||0===e||0!==t[e]){var i=h(t[e]);r=""===r?i:r+d("0",7-i.length)+i}return r};i({target:"Number",proto:!0,forced:l((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!l((function(){f({})}))},{toFixed:function(t){var e,r,i,n,a=o(this),l=s(t),u=[0,0,0,0,0,0],f="",v="0";if(l<0||l>20)throw new c("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return h(a);if(a<0&&(f="-",a=-a),a>1e-21)if(r=(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(a*m(2,69,1))-69)<0?a*m(2,-e,1):a/m(2,e,1),r*=4503599627370496,(e=52-e)>0){for(g(u,0,r),i=l;i>=7;)g(u,1e7,0),i-=7;for(g(u,m(10,i,1),0),i=e-1;i>=23;)A(u,1<<23),i-=23;A(u,1<0?f+((n=v.length)<=l?"0."+d("0",l-n)+v:p(v,0,n-l)+"."+p(v,n-l)):f+v}})},25284:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(3689),o=r(23648),a=n(1..toPrecision);i({target:"Number",proto:!0,forced:s((function(){return"1"!==a(1,void 0)}))||!s((function(){a({})}))},{toPrecision:function(t){return void 0===t?a(o(this)):a(o(this),t)}})},60429:(t,e,r)=>{"use strict";var i=r(79989),n=r(45394);i({target:"Object",stat:!0,arity:2,forced:Object.assign!==n},{assign:n})},51013:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0,sham:!r(67697)},{create:r(25391)})},33994:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(10509),a=r(90690),l=r(72560);n&&i({target:"Object",proto:!0,forced:s},{__defineGetter__:function(t,e){l.f(a(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},35082:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(98920).f;i({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!n},{defineProperties:s})},40739:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(72560).f;i({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!n},{defineProperty:s})},47409:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(10509),a=r(90690),l=r(72560);n&&i({target:"Object",proto:!0,forced:s},{__defineSetter__:function(t,e){l.f(a(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},36585:(t,e,r)=>{"use strict";var i=r(79989),n=r(49419).entries;i({target:"Object",stat:!0},{entries:function(t){return n(t)}})},41830:(t,e,r)=>{"use strict";var i=r(79989),n=r(71594),s=r(3689),o=r(48999),a=r(45375).onFreeze,l=Object.freeze;i({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!n},{freeze:function(t){return l&&o(t)?l(a(t)):t}})},85415:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(76522);i({target:"Object",stat:!0},{fromEntries:function(t){var e={};return n(t,(function(t,r){s(e,t,r)}),{AS_ENTRIES:!0}),e}})},81919:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(65290),o=r(82474).f,a=r(67697);i({target:"Object",stat:!0,forced:!a||n((function(){o(1)})),sham:!a},{getOwnPropertyDescriptor:function(t,e){return o(s(t),e)}})},99474:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19152),o=r(65290),a=r(82474),l=r(76522);i({target:"Object",stat:!0,sham:!n},{getOwnPropertyDescriptors:function(t){for(var e,r,i=o(t),n=a.f,c=s(i),h={},u=0;c.length>u;)void 0!==(r=n(i,e=c[u++]))&&l(h,e,r);return h}})},79997:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(26062).f;i({target:"Object",stat:!0,forced:n((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:s})},79434:(t,e,r)=>{"use strict";var i=r(79989),n=r(50146),s=r(3689),o=r(7518),a=r(90690);i({target:"Object",stat:!0,forced:!n||s((function(){o.f(1)}))},{getOwnPropertySymbols:function(t){var e=o.f;return e?e(a(t)):[]}})},88052:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(90690),o=r(61868),a=r(81748);i({target:"Object",stat:!0,forced:n((function(){o(1)})),sham:!a},{getPrototypeOf:function(t){return o(s(t))}})},44079:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(68844),o=r(10509),a=r(74684),l=r(18360),c=r(18734),h=n("Object","create"),u=s([].push);i({target:"Object",stat:!0},{groupBy:function(t,e){a(t),o(e);var r=h(null),i=0;return c(t,(function(t){var n=l(e(t,i++));n in r?u(r[n],t):r[n]=[t]})),r}})},14566:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{hasOwn:r(36812)})},36446:(t,e,r)=>{"use strict";var i=r(79989),n=r(27049);i({target:"Object",stat:!0,forced:Object.isExtensible!==n},{isExtensible:n})},35140:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(48999),o=r(6648),a=r(11655),l=Object.isFrozen;i({target:"Object",stat:!0,forced:a||n((function(){l(1)}))},{isFrozen:function(t){return!s(t)||!(!a||"ArrayBuffer"!==o(t))||!!l&&l(t)}})},4179:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(48999),o=r(6648),a=r(11655),l=Object.isSealed;i({target:"Object",stat:!0,forced:a||n((function(){l(1)}))},{isSealed:function(t){return!s(t)||!(!a||"ArrayBuffer"!==o(t))||!!l&&l(t)}})},76101:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{is:r(70953)})},69358:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(20300);i({target:"Object",stat:!0,forced:r(3689)((function(){s(1)}))},{keys:function(t){return s(n(t))}})},75450:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(90690),a=r(18360),l=r(61868),c=r(82474).f;n&&i({target:"Object",proto:!0,forced:s},{__lookupGetter__:function(t){var e,r=o(this),i=a(t);do{if(e=c(r,i))return e.get}while(r=l(r))}})},54993:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(90690),a=r(18360),l=r(61868),c=r(82474).f;n&&i({target:"Object",proto:!0,forced:s},{__lookupSetter__:function(t){var e,r=o(this),i=a(t);do{if(e=c(r,i))return e.set}while(r=l(r))}})},48115:(t,e,r)=>{"use strict";var i=r(79989),n=r(48999),s=r(45375).onFreeze,o=r(71594),a=r(3689),l=Object.preventExtensions;i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{preventExtensions:function(t){return l&&n(t)?l(s(t)):t}})},19330:(t,e,r)=>{"use strict";var i=r(67697),n=r(62148),s=r(48999),o=r(90690),a=r(74684),l=Object.getPrototypeOf,c=Object.setPrototypeOf,h=Object.prototype,u="__proto__";if(i&&l&&c&&!(u in h))try{n(h,u,{configurable:!0,get:function(){return l(o(this))},set:function(t){var e=a(this);(s(t)||null===t)&&s(e)&&c(e,t)}})}catch(t){}},30658:(t,e,r)=>{"use strict";var i=r(79989),n=r(48999),s=r(45375).onFreeze,o=r(71594),a=r(3689),l=Object.seal;i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{seal:function(t){return l&&n(t)?l(s(t)):t}})},5399:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{setPrototypeOf:r(49385)})},60228:(t,e,r)=>{"use strict";var i=r(23043),n=r(11880),s=r(65073);i||n(Object.prototype,"toString",s,{unsafe:!0})},86466:(t,e,r)=>{"use strict";var i=r(79989),n=r(49419).values;i({target:"Object",stat:!0},{values:function(t){return n(t)}})},80939:(t,e,r)=>{"use strict";var i=r(79989),n=r(14818);i({global:!0,forced:parseFloat!==n},{parseFloat:n})},32320:(t,e,r)=>{"use strict";var i=r(79989),n=r(67897);i({global:!0,forced:parseInt!==n},{parseInt:n})},41195:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{allSettled:function(t){var e=this,r=o.f(e),i=r.resolve,c=r.reject,h=a((function(){var r=s(e.resolve),o=[],a=0,c=1;l(t,(function(t){var s=a++,l=!1;c++,n(r,e,t).then((function(t){l||(l=!0,o[s]={status:"fulfilled",value:t},--c||i(o))}),(function(t){l||(l=!0,o[s]={status:"rejected",reason:t},--c||i(o))}))})),--c||i(o)}));return h.error&&c(h.value),r.promise}})},81692:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{all:function(t){var e=this,r=o.f(e),i=r.resolve,c=r.reject,h=a((function(){var r=s(e.resolve),o=[],a=0,h=1;l(t,(function(t){var s=a++,l=!1;h++,n(r,e,t).then((function(t){l||(l=!0,o[s]=t,--h||i(o))}),c)})),--h||i(o)}));return h.error&&c(h.value),r.promise}})},87609:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(76058),a=r(48742),l=r(9302),c=r(18734),h=r(562),u="No one promise resolved";i({target:"Promise",stat:!0,forced:h},{any:function(t){var e=this,r=o("AggregateError"),i=a.f(e),h=i.resolve,d=i.reject,p=l((function(){var i=s(e.resolve),o=[],a=0,l=1,p=!1;c(t,(function(t){var s=a++,c=!1;l++,n(i,e,t).then((function(t){c||p||(p=!0,h(t))}),(function(t){c||p||(c=!0,o[s]=t,--l||d(new r(o,u)))}))})),--l||d(new r(o,u))}));return p.error&&d(p.value),i.promise}})},75089:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(87073).CONSTRUCTOR,o=r(17919),a=r(76058),l=r(69985),c=r(11880),h=o&&o.prototype;if(i({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(t){return this.then(void 0,t)}}),!n&&l(o)){var u=a("Promise").prototype.catch;h.catch!==u&&c(h,"catch",u,{unsafe:!0})}},56697:(t,e,r)=>{"use strict";var i,n,s,o=r(79989),a=r(53931),l=r(50806),c=r(19037),h=r(22615),u=r(11880),d=r(49385),p=r(55997),f=r(14241),m=r(10509),g=r(69985),A=r(48999),y=r(767),v=r(76373),x=r(99886).set,b=r(80231),_=r(20920),w=r(9302),E=r(34410),M=r(618),S=r(17919),C=r(87073),T=r(48742),I="Promise",R=C.CONSTRUCTOR,B=C.REJECTION_EVENT,L=C.SUBCLASSING,P=M.getterFor(I),D=M.set,O=S&&S.prototype,k=S,U=O,N=c.TypeError,F=c.document,z=c.process,G=T.f,Q=G,j=!!(F&&F.createEvent&&c.dispatchEvent),V="unhandledrejection",H=function(t){var e;return!(!A(t)||!g(e=t.then))&&e},W=function(t,e){var r,i,n,s=e.value,o=1===e.state,a=o?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{a?(o||(2===e.rejection&&J(e),e.rejection=1),!0===a?r=s:(u&&u.enter(),r=a(s),u&&(u.exit(),n=!0)),r===t.promise?c(new N("Promise-chain cycle")):(i=H(r))?h(i,r,l,c):l(r)):c(s)}catch(t){u&&!n&&u.exit(),c(t)}},q=function(t,e){t.notified||(t.notified=!0,b((function(){for(var r,i=t.reactions;r=i.get();)W(r,t);t.notified=!1,e&&!t.rejection&&Y(t)})))},Z=function(t,e,r){var i,n;j?((i=F.createEvent("Event")).promise=e,i.reason=r,i.initEvent(t,!1,!0),c.dispatchEvent(i)):i={promise:e,reason:r},!B&&(n=c["on"+t])?n(i):t===V&&_("Unhandled promise rejection",r)},Y=function(t){h(x,c,(function(){var e,r=t.facade,i=t.value;if(X(t)&&(e=w((function(){l?z.emit("unhandledRejection",i,r):Z(V,r,i)})),t.rejection=l||X(t)?2:1,e.error))throw e.value}))},X=function(t){return 1!==t.rejection&&!t.parent},J=function(t){h(x,c,(function(){var e=t.facade;l?z.emit("rejectionHandled",e):Z("rejectionhandled",e,t.value)}))},K=function(t,e,r){return function(i){t(e,i,r)}},$=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,q(t,!0))},tt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new N("Promise can't be resolved itself");var i=H(e);i?b((function(){var r={done:!1};try{h(i,e,K(tt,r,t),K($,r,t))}catch(e){$(r,e,t)}})):(t.value=e,t.state=1,q(t,!1))}catch(e){$({done:!1},e,t)}}};if(R&&(U=(k=function(t){y(this,U),m(t),h(i,this);var e=P(this);try{t(K(tt,e),K($,e))}catch(t){$(e,t)}}).prototype,(i=function(t){D(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=u(U,"then",(function(t,e){var r=P(this),i=G(v(this,k));return r.parent=!0,i.ok=!g(t)||t,i.fail=g(e)&&e,i.domain=l?z.domain:void 0,0===r.state?r.reactions.add(i):b((function(){W(i,r)})),i.promise})),n=function(){var t=new i,e=P(t);this.promise=t,this.resolve=K(tt,e),this.reject=K($,e)},T.f=G=function(t){return t===k||void 0===t?new n(t):Q(t)},!a&&g(S)&&O!==Object.prototype)){s=O.then,L||u(O,"then",(function(t,e){var r=this;return new k((function(t,e){h(s,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete O.constructor}catch(t){}d&&d(O,U)}o({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:k}),p(k,I,!1,!0),f(I)},36409:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(17919),o=r(3689),a=r(76058),l=r(69985),c=r(76373),h=r(72945),u=r(11880),d=s&&s.prototype;if(i({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=c(this,a("Promise")),r=l(t);return this.then(r?function(r){return h(e,t()).then((function(){return r}))}:t,r?function(r){return h(e,t()).then((function(){throw r}))}:t)}}),!n&&l(s)){var p=a("Promise").prototype.finally;d.finally!==p&&u(d,"finally",p,{unsafe:!0})}},73964:(t,e,r)=>{"use strict";r(56697),r(81692),r(75089),r(58829),r(42092),r(57905)},58829:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{race:function(t){var e=this,r=o.f(e),i=r.reject,c=a((function(){var o=s(e.resolve);l(t,(function(t){n(o,e,t).then(r.resolve,i)}))}));return c.error&&i(c.value),r.promise}})},42092:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(48742);i({target:"Promise",stat:!0,forced:r(87073).CONSTRUCTOR},{reject:function(t){var e=s.f(this);return n(e.reject,void 0,t),e.promise}})},57905:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(53931),o=r(17919),a=r(87073).CONSTRUCTOR,l=r(72945),c=n("Promise"),h=s&&!a;i({target:"Promise",stat:!0,forced:s||a},{resolve:function(t){return l(h&&this===c?o:this,t)}})},13505:(t,e,r)=>{"use strict";var i=r(79989),n=r(48742);i({target:"Promise",stat:!0},{withResolvers:function(){var t=n.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},54333:(t,e,r)=>{"use strict";var i=r(79989),n=r(61735),s=r(10509),o=r(85027);i({target:"Reflect",stat:!0,forced:!r(3689)((function(){Reflect.apply((function(){}))}))},{apply:function(t,e,r){return n(s(t),e,o(r))}})},30050:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(86761),a=r(52655),l=r(85027),c=r(48999),h=r(25391),u=r(3689),d=n("Reflect","construct"),p=Object.prototype,f=[].push,m=u((function(){function t(){}return!(d((function(){}),[],t)instanceof t)})),g=!u((function(){d((function(){}))})),A=m||g;i({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(t,e){a(t),l(e);var r=arguments.length<3?t:a(arguments[2]);if(g&&!m)return d(t,e,r);if(t===r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return s(f,i,e),new(s(o,t,i))}var n=r.prototype,u=h(c(n)?n:p),A=s(t,u,e);return c(A)?A:u}})},99871:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(85027),o=r(18360),a=r(72560);i({target:"Reflect",stat:!0,forced:r(3689)((function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})})),sham:!n},{defineProperty:function(t,e,r){s(t);var i=o(e);s(r);try{return a.f(t,i,r),!0}catch(t){return!1}}})},1049:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(82474).f;i({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var r=s(n(t),e);return!(r&&!r.configurable)&&delete t[e]}})},50149:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(85027),o=r(82474);i({target:"Reflect",stat:!0,sham:!n},{getOwnPropertyDescriptor:function(t,e){return o.f(s(t),e)}})},43792:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(61868);i({target:"Reflect",stat:!0,sham:!r(81748)},{getPrototypeOf:function(t){return s(n(t))}})},32349:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(48999),o=r(85027),a=r(76251),l=r(82474),c=r(61868);i({target:"Reflect",stat:!0},{get:function t(e,r){var i,h,u=arguments.length<3?e:arguments[2];return o(e)===u?e[r]:(i=l.f(e,r))?a(i)?i.value:void 0===i.get?void 0:n(i.get,u):s(h=c(e))?t(h,r,u):void 0}})},69707:(t,e,r)=>{"use strict";r(79989)({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},63545:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(27049);i({target:"Reflect",stat:!0},{isExtensible:function(t){return n(t),s(t)}})},62087:(t,e,r)=>{"use strict";r(79989)({target:"Reflect",stat:!0},{ownKeys:r(19152)})},51505:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(85027);i({target:"Reflect",stat:!0,sham:!r(71594)},{preventExtensions:function(t){s(t);try{var e=n("Object","preventExtensions");return e&&e(t),!0}catch(t){return!1}}})},22373:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(23550),o=r(49385);o&&i({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){n(t),s(e);try{return o(t,e),!0}catch(t){return!1}}})},45247:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(48999),a=r(76251),l=r(3689),c=r(72560),h=r(82474),u=r(61868),d=r(75684);i({target:"Reflect",stat:!0,forced:l((function(){var t=function(){},e=c.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}))},{set:function t(e,r,i){var l,p,f,m=arguments.length<4?e:arguments[3],g=h.f(s(e),r);if(!g){if(o(p=u(e)))return t(p,r,i,m);g=d(0)}if(a(g)){if(!1===g.writable||!o(m))return!1;if(l=h.f(m,r)){if(l.get||l.set||!1===l.writable)return!1;l.value=i,c.f(m,r,l)}else c.f(m,r,d(0,i))}else{if(void 0===(f=g.set))return!1;n(f,m,i)}return!0}})},76034:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(55997);i({global:!0},{Reflect:{}}),s(n.Reflect,"Reflect",!0)},52003:(t,e,r)=>{"use strict";var i=r(67697),n=r(19037),s=r(68844),o=r(35266),a=r(33457),l=r(75773),c=r(25391),h=r(72741).f,u=r(23622),d=r(91245),p=r(34327),f=r(63477),m=r(87901),g=r(38055),A=r(11880),y=r(3689),v=r(36812),x=r(618).enforce,b=r(14241),_=r(44201),w=r(62100),E=r(26738),M=_("match"),S=n.RegExp,C=S.prototype,T=n.SyntaxError,I=s(C.exec),R=s("".charAt),B=s("".replace),L=s("".indexOf),P=s("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,O=/a/g,k=/a/g,U=new S(O)!==O,N=m.MISSED_STICKY,F=m.UNSUPPORTED_Y;if(o("RegExp",i&&(!U||N||w||E||y((function(){return k[M]=!1,S(O)!==O||S(k)===k||"/a/i"!==String(S(O,"i"))}))))){for(var z=function(t,e){var r,i,n,s,o,h,m=u(C,this),g=d(t),A=void 0===e,y=[],b=t;if(!m&&g&&A&&t.constructor===z)return t;if((g||u(C,t))&&(t=t.source,A&&(e=f(b))),t=void 0===t?"":p(t),e=void 0===e?"":p(e),b=t,w&&"dotAll"in O&&(i=!!e&&L(e,"s")>-1)&&(e=B(e,/s/g,"")),r=e,N&&"sticky"in O&&(n=!!e&&L(e,"y")>-1)&&F&&(e=B(e,/y/g,"")),E&&(s=function(t){for(var e,r=t.length,i=0,n="",s=[],o=c(null),a=!1,l=!1,h=0,u="";i<=r;i++){if("\\"===(e=R(t,i)))e+=R(t,++i);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:I(D,P(t,i+1))&&(i+=2,l=!0),n+=e,h++;continue;case">"===e&&l:if(""===u||v(o,u))throw new T("Invalid capture group name");o[u]=!0,s[s.length]=[u,h],l=!1,u="";continue}l?u+=e:n+=e}return[n,s]}(t),t=s[0],y=s[1]),o=a(S(t,e),m?this:C,z),(i||n||y.length)&&(h=x(o),i&&(h.dotAll=!0,h.raw=z(function(t){for(var e,r=t.length,i=0,n="",s=!1;i<=r;i++)"\\"!==(e=R(t,i))?s||"."!==e?("["===e?s=!0:"]"===e&&(s=!1),n+=e):n+="[\\s\\S]":n+=e+R(t,++i);return n}(t),r)),n&&(h.sticky=!0),y.length&&(h.groups=y)),t!==b)try{l(o,"source",""===b?"(?:)":b)}catch(t){}return o},G=h(S),Q=0;G.length>Q;)g(z,S,G[Q++]);C.constructor=z,z.prototype=C,A(n,"RegExp",z,{constructor:!0})}b("RegExp")},68518:(t,e,r)=>{"use strict";var i=r(67697),n=r(62100),s=r(6648),o=r(62148),a=r(618).get,l=RegExp.prototype,c=TypeError;i&&n&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},64043:(t,e,r)=>{"use strict";var i=r(79989),n=r(56308);i({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})},25847:(t,e,r)=>{"use strict";var i=r(19037),n=r(67697),s=r(62148),o=r(69633),a=r(3689),l=i.RegExp,c=l.prototype;n&&a((function(){var t=!0;try{l(".","d")}catch(e){t=!1}var e={},r="",i=t?"dgimsy":"gimsy",n=function(t,i){Object.defineProperty(e,t,{get:function(){return r+=i,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in t&&(s.hasIndices="d"),s)n(o,s[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(e)!==i||r!==i}))&&s(c,"flags",{configurable:!0,get:o})},13440:(t,e,r)=>{"use strict";var i=r(67697),n=r(87901).MISSED_STICKY,s=r(6648),o=r(62148),a=r(618).get,l=RegExp.prototype,c=TypeError;i&&n&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},7409:(t,e,r)=>{"use strict";r(64043);var i,n,s=r(79989),o=r(22615),a=r(69985),l=r(85027),c=r(34327),h=(i=!1,(n=/[ac]/).exec=function(){return i=!0,/./.exec.apply(this,arguments)},!0===n.test("abc")&&i),u=/./.test;s({target:"RegExp",proto:!0,forced:!h},{test:function(t){var e=l(this),r=c(t),i=e.exec;if(!a(i))return o(u,e,r);var n=o(i,e,r);return null!==n&&(l(n),!0)}})},12826:(t,e,r)=>{"use strict";var i=r(41236).PROPER,n=r(11880),s=r(85027),o=r(34327),a=r(3689),l=r(63477),c="toString",h=RegExp.prototype[c],u=a((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),d=i&&h.name!==c;(u||d)&&n(RegExp.prototype,c,(function(){var t=s(this);return"/"+o(t.source)+"/"+o(l(t))}),{unsafe:!0})},17985:(t,e,r)=>{"use strict";r(20319)("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70800))},19649:(t,e,r)=>{"use strict";r(17985)},90343:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("anchor")},{anchor:function(t){return n(this,"a","name",t)}})},7961:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(68700),a=r(34327),l=r(3689),c=n("".charAt);i({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(t){var e=a(s(this)),r=e.length,i=o(t),n=i>=0?i:r+i;return n<0||n>=r?void 0:c(e,n)}})},21444:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("big")},{big:function(){return n(this,"big","","")}})},25906:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("blink")},{blink:function(){return n(this,"blink","","")}})},95682:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("bold")},{bold:function(){return n(this,"b","","")}})},86239:(t,e,r)=>{"use strict";var i=r(79989),n=r(10730).codeAt;i({target:"String",proto:!0},{codePointAt:function(t){return n(this,t)}})},2918:(t,e,r)=>{"use strict";var i,n=r(79989),s=r(46576),o=r(82474).f,a=r(43126),l=r(34327),c=r(42124),h=r(74684),u=r(27413),d=r(53931),p=s("".endsWith),f=s("".slice),m=Math.min,g=u("endsWith");n({target:"String",proto:!0,forced:!(!d&&!g&&(i=o(String.prototype,"endsWith"),i&&!i.writable)||g)},{endsWith:function(t){var e=l(h(this));c(t);var r=arguments.length>1?arguments[1]:void 0,i=e.length,n=void 0===r?i:m(a(r),i),s=l(t);return p?p(e,s,n):f(e,n-s.length,n)===s}})},98041:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fixed")},{fixed:function(){return n(this,"tt","","")}})},6364:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fontcolor")},{fontcolor:function(t){return n(this,"font","color",t)}})},82954:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fontsize")},{fontsize:function(t){return n(this,"font","size",t)}})},20283:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(27578),o=RangeError,a=String.fromCharCode,l=String.fromCodePoint,c=n([].join);i({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(t){for(var e,r=[],i=arguments.length,n=0;i>n;){if(e=+arguments[n++],s(e,1114111)!==e)throw new o(e+" is not a valid code point");r[n]=e<65536?a(e):a(55296+((e-=65536)>>10),e%1024+56320)}return c(r,"")}})},43843:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(42124),o=r(74684),a=r(34327),l=r(27413),c=n("".indexOf);i({target:"String",proto:!0,forced:!l("includes")},{includes:function(t){return!!~c(a(o(this)),a(s(t)),arguments.length>1?arguments[1]:void 0)}})},12281:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(34327),a=n("".charCodeAt);i({target:"String",proto:!0},{isWellFormed:function(){for(var t=o(s(this)),e=t.length,r=0;r=56320||++r>=e||56320!=(64512&a(t,r))))return!1}return!0}})},19162:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("italics")},{italics:function(){return n(this,"i","","")}})},21694:(t,e,r)=>{"use strict";var i=r(10730).charAt,n=r(34327),s=r(618),o=r(91934),a=r(27807),l="String Iterator",c=s.set,h=s.getterFor(l);o(String,"String",(function(t){c(this,{type:l,string:n(t),index:0})}),(function(){var t,e=h(this),r=e.string,n=e.index;return n>=r.length?a(void 0,!0):(t=i(r,n),e.index+=t.length,a(t,!1))}))},37960:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("link")},{link:function(t){return n(this,"a","href",t)}})},79866:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(46576),o=r(30974),a=r(27807),l=r(74684),c=r(43126),h=r(34327),u=r(85027),d=r(981),p=r(6648),f=r(91245),m=r(63477),g=r(54849),A=r(11880),y=r(3689),v=r(44201),x=r(76373),b=r(71514),_=r(66100),w=r(618),E=r(53931),M=v("matchAll"),S="RegExp String",C=S+" Iterator",T=w.set,I=w.getterFor(C),R=RegExp.prototype,B=TypeError,L=s("".indexOf),P=s("".matchAll),D=!!P&&!y((function(){P("a",/./)})),O=o((function(t,e,r,i){T(this,{type:C,regexp:t,string:e,global:r,unicode:i,done:!1})}),S,(function(){var t=I(this);if(t.done)return a(void 0,!0);var e=t.regexp,r=t.string,i=_(e,r);return null===i?(t.done=!0,a(void 0,!0)):t.global?(""===h(i[0])&&(e.lastIndex=b(r,c(e.lastIndex),t.unicode)),a(i,!1)):(t.done=!0,a(i,!1))})),k=function(t){var e,r,i,n=u(this),s=h(t),o=x(n,RegExp),a=h(m(n));return e=new o(o===RegExp?n.source:n,a),r=!!~L(a,"g"),i=!!~L(a,"u"),e.lastIndex=c(n.lastIndex),new O(e,s,r,i)};i({target:"String",proto:!0,forced:D},{matchAll:function(t){var e,r,i,s,o=l(this);if(d(t)){if(D)return P(o,t)}else{if(f(t)&&(e=h(l(m(t))),!~L(e,"g")))throw new B("`.matchAll` does not allow non-global regexes");if(D)return P(o,t);if(void 0===(i=g(t,M))&&E&&"RegExp"===p(t)&&(i=k),i)return n(i,t,o)}return r=h(o),s=new RegExp(t,"g"),E?n(k,s,r):s[M](r)}}),E||M in R||A(R,M,k)},22462:(t,e,r)=>{"use strict";var i=r(22615),n=r(65773),s=r(85027),o=r(981),a=r(43126),l=r(34327),c=r(74684),h=r(54849),u=r(71514),d=r(66100);n("match",(function(t,e,r){return[function(e){var r=c(this),n=o(e)?void 0:h(e,t);return n?i(n,e,r):new RegExp(e)[t](l(r))},function(t){var i=s(this),n=l(t),o=r(e,i,n);if(o.done)return o.value;if(!i.global)return d(i,n);var c=i.unicode;i.lastIndex=0;for(var h,p=[],f=0;null!==(h=d(i,n));){var m=l(h[0]);p[f]=m,""===m&&(i.lastIndex=u(n,a(i.lastIndex),c)),f++}return 0===f?null:p}]}))},72940:(t,e,r)=>{"use strict";var i=r(79989),n=r(77254).end;i({target:"String",proto:!0,forced:r(35947)},{padEnd:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},8472:(t,e,r)=>{"use strict";var i=r(79989),n=r(77254).start;i({target:"String",proto:!0,forced:r(35947)},{padStart:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},92404:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(65290),o=r(90690),a=r(34327),l=r(6310),c=n([].push),h=n([].join);i({target:"String",stat:!0},{raw:function(t){var e=s(o(t).raw),r=l(e);if(!r)return"";for(var i=arguments.length,n=[],u=0;;){if(c(n,a(e[u++])),u===r)return h(n,"");u{"use strict";r(79989)({target:"String",proto:!0},{repeat:r(90534)})},56532:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(68844),o=r(74684),a=r(69985),l=r(981),c=r(91245),h=r(34327),u=r(54849),d=r(63477),p=r(27017),f=r(44201),m=r(53931),g=f("replace"),A=TypeError,y=s("".indexOf),v=s("".replace),x=s("".slice),b=Math.max,_=function(t,e,r){return r>t.length?-1:""===e?r:y(t,e,r)};i({target:"String",proto:!0},{replaceAll:function(t,e){var r,i,s,f,w,E,M,S,C,T=o(this),I=0,R=0,B="";if(!l(t)){if((r=c(t))&&(i=h(o(d(t))),!~y(i,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(s=u(t,g))return n(s,t,T,e);if(m&&r)return v(h(T),t,e)}for(f=h(T),w=h(t),(E=a(e))||(e=h(e)),M=w.length,S=b(1,M),I=_(f,w,0);-1!==I;)C=E?h(e(w,I,f)):p(w,f,I,[],void 0,e),B+=x(f,R,I)+C,R=I+M,I=_(f,w,I+S);return R{"use strict";var i=r(61735),n=r(22615),s=r(68844),o=r(65773),a=r(3689),l=r(85027),c=r(69985),h=r(981),u=r(68700),d=r(43126),p=r(34327),f=r(74684),m=r(71514),g=r(54849),A=r(27017),y=r(66100),v=r(44201)("replace"),x=Math.max,b=Math.min,_=s([].concat),w=s([].push),E=s("".indexOf),M=s("".slice),S="$0"==="a".replace(/./,"$0"),C=!!/./[v]&&""===/./[v]("a","$0");o("replace",(function(t,e,r){var s=C?"$":"$0";return[function(t,r){var i=f(this),s=h(t)?void 0:g(t,v);return s?n(s,t,i,r):n(e,p(i),t,r)},function(t,n){var o=l(this),a=p(t);if("string"==typeof n&&-1===E(n,s)&&-1===E(n,"$<")){var h=r(e,o,a,n);if(h.done)return h.value}var f=c(n);f||(n=p(n));var g,v=o.global;v&&(g=o.unicode,o.lastIndex=0);for(var S,C=[];null!==(S=y(o,a))&&(w(C,S),v);)""===p(S[0])&&(o.lastIndex=m(a,d(o.lastIndex),g));for(var T,I="",R=0,B=0;B=R&&(I+=M(a,R,D)+L,R=D+P.length)}return I+M(a,R)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!S||C)},61514:(t,e,r)=>{"use strict";var i=r(22615),n=r(65773),s=r(85027),o=r(981),a=r(74684),l=r(70953),c=r(34327),h=r(54849),u=r(66100);n("search",(function(t,e,r){return[function(e){var r=a(this),n=o(e)?void 0:h(e,t);return n?i(n,e,r):new RegExp(e)[t](c(r))},function(t){var i=s(this),n=c(t),o=r(e,i,n);if(o.done)return o.value;var a=i.lastIndex;l(a,0)||(i.lastIndex=0);var h=u(i,n);return l(i.lastIndex,a)||(i.lastIndex=a),null===h?-1:h.index}]}))},470:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("small")},{small:function(){return n(this,"small","","")}})},9873:(t,e,r)=>{"use strict";var i=r(61735),n=r(22615),s=r(68844),o=r(65773),a=r(85027),l=r(981),c=r(91245),h=r(74684),u=r(76373),d=r(71514),p=r(43126),f=r(34327),m=r(54849),g=r(9015),A=r(66100),y=r(56308),v=r(87901),x=r(3689),b=v.UNSUPPORTED_Y,_=4294967295,w=Math.min,E=[].push,M=s(/./.exec),S=s(E),C=s("".slice);o("split",(function(t,e,r){var s;return s="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var s=f(h(this)),o=void 0===r?_:r>>>0;if(0===o)return[];if(void 0===t)return[s];if(!c(t))return n(e,s,t,o);for(var a,l,u,d=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),m=0,A=new RegExp(t.source,p+"g");(a=n(y,A,s))&&!((l=A.lastIndex)>m&&(S(d,C(s,m,a.index)),a.length>1&&a.index=o));)A.lastIndex===a.index&&A.lastIndex++;return m===s.length?!u&&M(A,"")||S(d,""):S(d,C(s,m)),d.length>o?g(d,0,o):d}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:n(e,this,t,r)}:e,[function(e,r){var i=h(this),o=l(e)?void 0:m(e,t);return o?n(o,e,i,r):n(s,f(i),e,r)},function(t,i){var n=a(this),o=f(t),l=r(s,n,o,i,s!==e);if(l.done)return l.value;var c=u(n,RegExp),h=n.unicode,m=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(b?"g":"y"),g=new c(b?"^(?:"+n.source+")":n,m),y=void 0===i?_:i>>>0;if(0===y)return[];if(0===o.length)return null===A(g,o)?[o]:[];for(var v=0,x=0,E=[];x{"use strict";var i,n=r(79989),s=r(46576),o=r(82474).f,a=r(43126),l=r(34327),c=r(42124),h=r(74684),u=r(27413),d=r(53931),p=s("".startsWith),f=s("".slice),m=Math.min,g=u("startsWith");n({target:"String",proto:!0,forced:!(!d&&!g&&(i=o(String.prototype,"startsWith"),i&&!i.writable)||g)},{startsWith:function(t){var e=l(h(this));c(t);var r=a(m(arguments.length>1?arguments[1]:void 0,e.length)),i=l(t);return p?p(e,i,r):f(e,r,r+i.length)===i}})},67446:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("strike")},{strike:function(){return n(this,"strike","","")}})},47729:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("sub")},{sub:function(){return n(this,"sub","","")}})},20372:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(68700),a=r(34327),l=n("".slice),c=Math.max,h=Math.min;i({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,e){var r,i,n=a(s(this)),u=n.length,d=o(t);return d===1/0&&(d=0),d<0&&(d=c(u+d,0)),(r=void 0===e?u:o(e))<=0||r===1/0||d>=(i=h(d+r,u))?"":l(n,d,i)}})},2e3:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("sup")},{sup:function(){return n(this,"sup","","")}})},35237:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(68844),o=r(74684),a=r(34327),l=r(3689),c=Array,h=s("".charAt),u=s("".charCodeAt),d=s([].join),p="".toWellFormed,f=p&&l((function(){return"1"!==n(p,1)}));i({target:"String",proto:!0,forced:f},{toWellFormed:function(){var t=a(o(this));if(f)return n(p,t);for(var e=t.length,r=c(e),i=0;i=56320||i+1>=e||56320!=(64512&u(t,i+1))?r[i]="�":(r[i]=h(t,i),r[++i]=h(t,i))}return d(r,"")}})},16386:(t,e,r)=>{"use strict";r(61313);var i=r(79989),n=r(79558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==n},{trimEnd:n})},10974:(t,e,r)=>{"use strict";var i=r(79989),n=r(72291);i({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==n},{trimLeft:n})},61313:(t,e,r)=>{"use strict";var i=r(79989),n=r(79558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==n},{trimRight:n})},3255:(t,e,r)=>{"use strict";r(10974);var i=r(79989),n=r(72291);i({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==n},{trimStart:n})},28436:(t,e,r)=>{"use strict";var i=r(79989),n=r(61435).trim;i({target:"String",proto:!0,forced:r(75984)("trim")},{trim:function(){return n(this)}})},58373:(t,e,r)=>{"use strict";r(35405)("asyncIterator")},37855:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(22615),o=r(68844),a=r(53931),l=r(67697),c=r(50146),h=r(3689),u=r(36812),d=r(23622),p=r(85027),f=r(65290),m=r(18360),g=r(34327),A=r(75684),y=r(25391),v=r(20300),x=r(72741),b=r(26062),_=r(7518),w=r(82474),E=r(72560),M=r(98920),S=r(49556),C=r(11880),T=r(62148),I=r(83430),R=r(2713),B=r(57248),L=r(14630),P=r(44201),D=r(96145),O=r(35405),k=r(13032),U=r(55997),N=r(618),F=r(2960).forEach,z=R("hidden"),G="Symbol",Q="prototype",j=N.set,V=N.getterFor(G),H=Object[Q],W=n.Symbol,q=W&&W[Q],Z=n.RangeError,Y=n.TypeError,X=n.QObject,J=w.f,K=E.f,$=b.f,tt=S.f,et=o([].push),rt=I("symbols"),it=I("op-symbols"),nt=I("wks"),st=!X||!X[Q]||!X[Q].findChild,ot=function(t,e,r){var i=J(H,e);i&&delete H[e],K(t,e,r),i&&t!==H&&K(H,e,i)},at=l&&h((function(){return 7!==y(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?ot:K,lt=function(t,e){var r=rt[t]=y(q);return j(r,{type:G,tag:t,description:e}),l||(r.description=e),r},ct=function(t,e,r){t===H&&ct(it,e,r),p(t);var i=m(e);return p(r),u(rt,i)?(r.enumerable?(u(t,z)&&t[z][i]&&(t[z][i]=!1),r=y(r,{enumerable:A(0,!1)})):(u(t,z)||K(t,z,A(1,{})),t[z][i]=!0),at(t,i,r)):K(t,i,r)},ht=function(t,e){p(t);var r=f(e),i=v(r).concat(ft(r));return F(i,(function(e){l&&!s(ut,r,e)||ct(t,e,r[e])})),t},ut=function(t){var e=m(t),r=s(tt,this,e);return!(this===H&&u(rt,e)&&!u(it,e))&&(!(r||!u(this,e)||!u(rt,e)||u(this,z)&&this[z][e])||r)},dt=function(t,e){var r=f(t),i=m(e);if(r!==H||!u(rt,i)||u(it,i)){var n=J(r,i);return!n||!u(rt,i)||u(r,z)&&r[z][i]||(n.enumerable=!0),n}},pt=function(t){var e=$(f(t)),r=[];return F(e,(function(t){u(rt,t)||u(B,t)||et(r,t)})),r},ft=function(t){var e=t===H,r=$(e?it:f(t)),i=[];return F(r,(function(t){!u(rt,t)||e&&!u(H,t)||et(i,rt[t])})),i};c||(C(q=(W=function(){if(d(q,this))throw new Y("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,e=L(t),r=function(t){var i=void 0===this?n:this;i===H&&s(r,it,t),u(i,z)&&u(i[z],e)&&(i[z][e]=!1);var o=A(1,t);try{at(i,e,o)}catch(t){if(!(t instanceof Z))throw t;ot(i,e,o)}};return l&&st&&at(H,e,{configurable:!0,set:r}),lt(e,t)})[Q],"toString",(function(){return V(this).tag})),C(W,"withoutSetter",(function(t){return lt(L(t),t)})),S.f=ut,E.f=ct,M.f=ht,w.f=dt,x.f=b.f=pt,_.f=ft,D.f=function(t){return lt(P(t),t)},l&&(T(q,"description",{configurable:!0,get:function(){return V(this).description}}),a||C(H,"propertyIsEnumerable",ut,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:W}),F(v(nt),(function(t){O(t)})),i({target:G,stat:!0,forced:!c},{useSetter:function(){st=!0},useSimple:function(){st=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(t,e){return void 0===e?y(t):ht(y(t),e)},defineProperty:ct,defineProperties:ht,getOwnPropertyDescriptor:dt}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:pt}),k(),U(W,G),B[z]=!0},86544:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19037),o=r(68844),a=r(36812),l=r(69985),c=r(23622),h=r(34327),u=r(62148),d=r(8758),p=s.Symbol,f=p&&p.prototype;if(n&&l(p)&&(!("description"in f)||void 0!==p().description)){var m={},g=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:h(arguments[0]),e=c(f,this)?new p(t):void 0===t?p():p(t);return""===t&&(m[e]=!0),e};d(g,p),g.prototype=f,f.constructor=g;var A="Symbol(description detection)"===String(p("description detection")),y=o(f.valueOf),v=o(f.toString),x=/^Symbol\((.*)\)[^)]+$/,b=o("".replace),_=o("".slice);u(f,"description",{configurable:!0,get:function(){var t=y(this);if(a(m,t))return"";var e=v(t),r=A?_(e,7,-1):b(e,x,"$1");return""===r?void 0:r}}),i({global:!0,constructor:!0,forced:!0},{Symbol:g})}},43975:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(36812),o=r(34327),a=r(83430),l=r(46549),c=a("string-to-symbol-registry"),h=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{for:function(t){var e=o(t);if(s(c,e))return c[e];var r=n("Symbol")(e);return c[e]=r,h[r]=e,r}})},96157:(t,e,r)=>{"use strict";r(35405)("hasInstance")},82529:(t,e,r)=>{"use strict";r(35405)("isConcatSpreadable")},84254:(t,e,r)=>{"use strict";r(35405)("iterator")},59749:(t,e,r)=>{"use strict";r(37855),r(43975),r(81445),r(48324),r(79434)},81445:(t,e,r)=>{"use strict";var i=r(79989),n=r(36812),s=r(30734),o=r(23691),a=r(83430),l=r(46549),c=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{keyFor:function(t){if(!s(t))throw new TypeError(o(t)+" is not a symbol");if(n(c,t))return c[t]}})},93531:(t,e,r)=>{"use strict";r(35405)("matchAll")},64155:(t,e,r)=>{"use strict";r(35405)("match")},95906:(t,e,r)=>{"use strict";r(35405)("replace")},50549:(t,e,r)=>{"use strict";r(35405)("search")},96285:(t,e,r)=>{"use strict";r(35405)("species")},18200:(t,e,r)=>{"use strict";r(35405)("split")},69373:(t,e,r)=>{"use strict";var i=r(35405),n=r(13032);i("toPrimitive"),n()},66793:(t,e,r)=>{"use strict";var i=r(76058),n=r(35405),s=r(55997);n("toStringTag"),s(i("Symbol"),"Symbol")},44578:(t,e,r)=>{"use strict";r(35405)("unscopables")},95194:(t,e,r)=>{"use strict";var i=r(54872),n=r(6310),s=r(68700),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",(function(t){var e=o(this),r=n(e),i=s(t),a=i>=0?i:r+i;return a<0||a>=r?void 0:e[a]}))},36664:(t,e,r)=>{"use strict";var i=r(68844),n=r(54872),s=i(r(70357)),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("copyWithin",(function(t,e){return s(o(this),t,e,arguments.length>2?arguments[2]:void 0)}))},55980:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).every,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("every",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},79943:(t,e,r)=>{"use strict";var i=r(54872),n=r(62872),s=r(71530),o=r(50926),a=r(22615),l=r(68844),c=r(3689),h=i.aTypedArray,u=i.exportTypedArrayMethod,d=l("".slice);u("fill",(function(t){var e=arguments.length;h(this);var r="Big"===d(o(this),0,3)?s(t):+t;return a(n,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),c((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},96089:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filter,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filter",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}))},48690:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).findIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},82:(t,e,r)=>{"use strict";var i=r(54872),n=r(61969).findLastIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},20522:(t,e,r)=>{"use strict";var i=r(54872),n=r(61969).findLast,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},18539:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).find,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("find",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},29068:(t,e,r)=>{"use strict";r(31158)("Float32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},70292:(t,e,r)=>{"use strict";r(31158)("Float64",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},45385:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).forEach,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("forEach",(function(t){n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},59495:(t,e,r)=>{"use strict";var i=r(39800);(0,r(54872).exportTypedArrayStaticMethod)("from",r(41304),i)},85552:(t,e,r)=>{"use strict";var i=r(54872),n=r(84328).includes,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("includes",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},31803:(t,e,r)=>{"use strict";var i=r(54872),n=r(84328).indexOf,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("indexOf",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},89988:(t,e,r)=>{"use strict";r(31158)("Int16",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},854:(t,e,r)=>{"use strict";r(31158)("Int32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},55304:(t,e,r)=>{"use strict";r(31158)("Int8",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},91565:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(54872),a=r(752),l=r(44201)("iterator"),c=i.Uint8Array,h=s(a.values),u=s(a.keys),d=s(a.entries),p=o.aTypedArray,f=o.exportTypedArrayMethod,m=c&&c.prototype,g=!n((function(){m[l].call([1])})),A=!!m&&m.values&&m[l]===m.values&&"values"===m.values.name,y=function(){return h(p(this))};f("entries",(function(){return d(p(this))}),g),f("keys",(function(){return u(p(this))}),g),f("values",y,g||!A,{name:"values"}),f(l,y,g||!A,{name:"values"})},67987:(t,e,r)=>{"use strict";var i=r(54872),n=r(68844),s=i.aTypedArray,o=i.exportTypedArrayMethod,a=n([].join);o("join",(function(t){return a(s(this),t)}))},49365:(t,e,r)=>{"use strict";var i=r(54872),n=r(61735),s=r(60953),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return n(s,o(this),e>1?[t,arguments[1]]:[t])}))},80677:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).map,s=r(47338),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("map",(function(t){return n(o(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(s(t))(e)}))}))},19038:(t,e,r)=>{"use strict";var i=r(54872),n=r(39800),s=i.aTypedArrayConstructor;(0,i.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,e=arguments.length,r=new(s(this))(e);e>t;)r[t]=arguments[t++];return r}),n)},41165:(t,e,r)=>{"use strict";var i=r(54872),n=r(88820).right,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},18118:(t,e,r)=>{"use strict";var i=r(54872),n=r(88820).left,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},71522:(t,e,r)=>{"use strict";var i=r(54872),n=i.aTypedArray,s=i.exportTypedArrayMethod,o=Math.floor;s("reverse",(function(){for(var t,e=this,r=n(e).length,i=o(r/2),s=0;s{"use strict";var i=r(19037),n=r(22615),s=r(54872),o=r(6310),a=r(83250),l=r(90690),c=r(3689),h=i.RangeError,u=i.Int8Array,d=u&&u.prototype,p=d&&d.set,f=s.aTypedArray,m=s.exportTypedArrayMethod,g=!c((function(){var t=new Uint8ClampedArray(2);return n(p,t,{length:1,0:3},1),3!==t[1]})),A=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new u(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));m("set",(function(t){f(this);var e=a(arguments.length>1?arguments[1]:void 0,1),r=l(t);if(g)return n(p,this,r,e);var i=this.length,s=o(r),c=0;if(s+e>i)throw new h("Wrong length");for(;c{"use strict";var i=r(54872),n=r(47338),s=r(3689),o=r(96004),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("slice",(function(t,e){for(var r=o(a(this),t,e),i=n(this),s=0,l=r.length,c=new i(l);l>s;)c[s]=r[s++];return c}),s((function(){new Int8Array(1).slice()})))},7300:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).some,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("some",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},93356:(t,e,r)=>{"use strict";var i=r(19037),n=r(46576),s=r(3689),o=r(10509),a=r(50382),l=r(54872),c=r(97365),h=r(37298),u=r(3615),d=r(27922),p=l.aTypedArray,f=l.exportTypedArrayMethod,m=i.Uint16Array,g=m&&n(m.prototype.sort),A=!(!g||s((function(){g(new m(2),null)}))&&s((function(){g(new m(2),{})}))),y=!!g&&!s((function(){if(u)return u<74;if(c)return c<67;if(h)return!0;if(d)return d<602;var t,e,r=new m(516),i=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,i[t]=t-2*e+3;for(g(r,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==i[t])return!0}));f("sort",(function(t){return void 0!==t&&o(t),y?g(this,t):a(p(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!y||A)},62533:(t,e,r)=>{"use strict";var i=r(54872),n=r(43126),s=r(27578),o=r(47338),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("subarray",(function(t,e){var r=a(this),i=r.length,l=s(t,i);return new(o(r))(r.buffer,r.byteOffset+l*r.BYTES_PER_ELEMENT,n((void 0===e?i:s(e,i))-l))}))},99724:(t,e,r)=>{"use strict";var i=r(19037),n=r(61735),s=r(54872),o=r(3689),a=r(96004),l=i.Int8Array,c=s.aTypedArray,h=s.exportTypedArrayMethod,u=[].toLocaleString,d=!!l&&o((function(){u.call(new l(1))}));h("toLocaleString",(function(){return n(u,d?a(c(this)):c(this),a(arguments))}),o((function(){return[1,2].toLocaleString()!==new l([1,2]).toLocaleString()}))||!o((function(){l.prototype.toLocaleString.call([1,2])})))},24224:(t,e,r)=>{"use strict";var i=r(26166),n=r(54872),s=n.aTypedArray,o=n.exportTypedArrayMethod,a=n.getTypedArrayConstructor;o("toReversed",(function(){return i(s(this),a(this))}))},61121:(t,e,r)=>{"use strict";var i=r(54872),n=r(68844),s=r(10509),o=r(59976),a=i.aTypedArray,l=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,h=n(i.TypedArrayPrototype.sort);c("toSorted",(function(t){void 0!==t&&s(t);var e=a(this),r=o(l(e),e);return h(r,t)}))},99901:(t,e,r)=>{"use strict";var i=r(54872).exportTypedArrayMethod,n=r(3689),s=r(19037),o=r(68844),a=s.Uint8Array,l=a&&a.prototype||{},c=[].toString,h=o([].join);n((function(){c.call({})}))&&(c=function(){return h(this)});var u=l.toString!==c;i("toString",c,u)},75679:(t,e,r)=>{"use strict";r(31158)("Uint16",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},18557:(t,e,r)=>{"use strict";r(31158)("Uint32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},28607:(t,e,r)=>{"use strict";r(31158)("Uint8",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},30938:(t,e,r)=>{"use strict";r(31158)("Uint8",(function(t){return function(e,r,i){return t(this,e,r,i)}}),!0)},37133:(t,e,r)=>{"use strict";var i=r(16134),n=r(54872),s=r(9401),o=r(68700),a=r(71530),l=n.aTypedArray,c=n.getTypedArrayConstructor,h=n.exportTypedArrayMethod,u=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();h("with",{with:function(t,e){var r=l(this),n=o(t),h=s(r)?a(e):+e;return i(r,c(r),n,h)}}.with,!u)},622:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=String.fromCharCode,a=n("".charAt),l=n(/./.exec),c=n("".slice),h=/^[\da-f]{2}$/i,u=/^[\da-f]{4}$/i;i({global:!0},{unescape:function(t){for(var e,r,i=s(t),n="",d=i.length,p=0;p{"use strict";var i,n=r(71594),s=r(19037),o=r(68844),a=r(6045),l=r(45375),c=r(20319),h=r(70637),u=r(48999),d=r(618).enforce,p=r(3689),f=r(59834),m=Object,g=Array.isArray,A=m.isExtensible,y=m.isFrozen,v=m.isSealed,x=m.freeze,b=m.seal,_={},w={},E=!s.ActiveXObject&&"ActiveXObject"in s,M=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},S=c("WeakMap",M,h),C=S.prototype,T=o(C.set);if(f)if(E){i=h.getConstructor(M,"WeakMap",!0),l.enable();var I=o(C.delete),R=o(C.has),B=o(C.get);a(C,{delete:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),I(this,t)||e.frozen.delete(t)}return I(this,t)},has:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),R(this,t)||e.frozen.has(t)}return R(this,t)},get:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),R(this,t)?B(this,t):e.frozen.get(t)}return B(this,t)},set:function(t,e){if(u(t)&&!A(t)){var r=d(this);r.frozen||(r.frozen=new i),R(this,t)?T(this,t,e):r.frozen.set(t,e)}else T(this,t,e);return this}})}else n&&p((function(){var t=x([]);return T(new S,t,1),!y(t)}))&&a(C,{set:function(t,e){var r;return g(t)&&(y(t)?r=_:v(t)&&(r=w)),T(this,t,e),r===_&&x(t),r===w&&b(t),this}})},51090:(t,e,r)=>{"use strict";r(45164)},87884:(t,e,r)=>{"use strict";r(20319)("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70637))},50414:(t,e,r)=>{"use strict";r(87884)},89503:(t,e,r)=>{"use strict";r(95879)},86247:(t,e,r)=>{"use strict";var i=r(67697),n=r(62148),s=r(22961),o=ArrayBuffer.prototype;i&&!("detached"in o)&&n(o,"detached",{configurable:!0,get:function(){return s(this)}})},43097:(t,e,r)=>{"use strict";var i=r(79989),n=r(29195);n&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},21412:(t,e,r)=>{"use strict";var i=r(79989),n=r(29195);n&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},4154:(t,e,r)=>{"use strict";r(92176)},7802:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filterReject,s=r(87370);i({target:"Array",proto:!0,forced:!0},{filterOut:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("filterOut")},54883:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filterReject,s=r(87370);i({target:"Array",proto:!0,forced:!0},{filterReject:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("filterReject")},20097:(t,e,r)=>{"use strict";r(93383)},38197:(t,e,r)=>{"use strict";r(59867)},18073:(t,e,r)=>{"use strict";r(79989)({target:"Array",stat:!0},{fromAsync:r(2231)})},96882:(t,e,r)=>{"use strict";var i=r(79989),n=r(16834),s=r(87370),o=r(44416);i({target:"Array",proto:!0,name:"groupToMap",forced:r(53931)||!n("groupByToMap")},{groupByToMap:o}),s("groupByToMap")},22525:(t,e,r)=>{"use strict";var i=r(79989),n=r(64976),s=r(16834),o=r(87370);i({target:"Array",proto:!0,forced:!s("groupBy")},{groupBy:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),o("groupBy")},32539:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370),s=r(44416);i({target:"Array",proto:!0,forced:r(53931)},{groupToMap:s}),n("groupToMap")},36208:(t,e,r)=>{"use strict";var i=r(79989),n=r(64976),s=r(87370);i({target:"Array",proto:!0},{group:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("group")},5082:(t,e,r)=>{"use strict";var i=r(79989),n=r(92297),s=Object.isFrozen,o=function(t,e){if(!s||!n(t)||!s(t))return!1;for(var r,i=0,o=t.length;i{"use strict";var i=r(67697),n=r(87370),s=r(90690),o=r(6310),a=r(62148);i&&(a(Array.prototype,"lastIndex",{configurable:!0,get:function(){var t=s(this),e=o(t);return 0===e?0:e-1}}),n("lastIndex"))},32221:(t,e,r)=>{"use strict";var i=r(67697),n=r(87370),s=r(90690),o=r(6310),a=r(62148);i&&(a(Array.prototype,"lastItem",{configurable:!0,get:function(){var t=s(this),e=o(t);return 0===e?void 0:t[e-1]},set:function(t){var e=s(this),r=o(e);return e[0===r?0:r-1]=t}}),n("lastItem"))},67890:(t,e,r)=>{"use strict";r(29830)},47041:(t,e,r)=>{"use strict";r(12894)},86322:(t,e,r)=>{"use strict";r(93530)},92253:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370);i({target:"Array",proto:!0,forced:!0},{uniqueBy:r(12397)}),n("uniqueBy")},97554:(t,e,r)=>{"use strict";r(21319)},11070:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(76058),o=r(10509),a=r(767),l=r(11880),c=r(6045),h=r(62148),u=r(44201),d=r(618),p=r(29199),f=s("Promise"),m=s("SuppressedError"),g=ReferenceError,A=u("asyncDispose"),y=u("toStringTag"),v="AsyncDisposableStack",x=d.set,b=d.getterFor(v),_="async-dispose",w="disposed",E=function(t){var e=b(t);if(e.state===w)throw new g(v+" already disposed");return e},M=function(){x(a(this,S),{type:v,state:"pending",stack:[]}),n||(this.disposed=!1)},S=M.prototype;c(S,{disposeAsync:function(){var t=this;return new f((function(e,r){var i=b(t);if(i.state===w)return e(void 0);i.state=w,n||(t.disposed=!0);var s,o=i.stack,a=o.length,l=!1,c=function(t){l?s=new m(t,s):(l=!0,s=t),h()},h=function(){if(a){var t=o[--a];o[a]=null;try{f.resolve(t()).then(h,c)}catch(t){c(t)}}else i.stack=null,l?r(s):e(void 0)};h()}))},use:function(t){return p(E(this),t,_),t},adopt:function(t,e){var r=E(this);return o(e),p(r,void 0,_,(function(){return e(t)})),t},defer:function(t){var e=E(this);o(t),p(e,void 0,_,t)},move:function(){var t=E(this),e=new M;return b(e).stack=t.stack,t.stack=[],t.state=w,n||(this.disposed=!0),e}}),n&&h(S,"disposed",{configurable:!0,get:function(){return b(this).state===w}}),l(S,A,S.disposeAsync,{name:"disposeAsync"}),l(S,y,v,{nonWritable:!0}),i({global:!0,constructor:!0},{AsyncDisposableStack:M})},77299:(t,e,r)=>{"use strict";r(79989)({target:"AsyncIterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(40164)})},15694:(t,e,r)=>{"use strict";var i=r(22615),n=r(11880),s=r(76058),o=r(54849),a=r(36812),l=r(44201),c=r(23070),h=l("asyncDispose"),u=s("Promise");a(c,h)||n(c,h,(function(){var t=this;return new u((function(e,r){var n=o(t,"return");n?u.resolve(i(n,t)).then((function(){e(void 0)}),r):e(void 0)}))}))},64578:(t,e,r)=>{"use strict";var i=r(79989),n=r(767),s=r(61868),o=r(75773),a=r(36812),l=r(44201),c=r(23070),h=r(53931),u=l("toStringTag"),d=TypeError,p=function(){if(n(this,c),s(this)===c)throw new d("Abstract class AsyncIterator not directly constructable")};p.prototype=c,a(c,u)||o(c,u,"AsyncIterator"),!h&&a(c,"constructor")&&c.constructor!==Object||o(c,"constructor",p),i({global:!0,constructor:!0,forced:h},{AsyncIterator:p})},17815:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(17394),h=r(27807),u=r(53931),d=c((function(t){var e=this;return new t((function(r,i){var o=function(t){e.done=!0,i(t)},a=function(){try{t.resolve(s(n(e.next,e.iterator))).then((function(t){try{s(t).done?(e.done=!0,r(h(void 0,!0))):e.remaining?(e.remaining--,a()):r(h(t.value,!1))}catch(t){o(t)}}),o)}catch(t){o(t)}};a()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:u},{drop:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},19029:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).every;i({target:"AsyncIterator",proto:!0,real:!0},{every:function(t){return n(this,t)}})},6237:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(22302),c=r(17394),h=r(27807),u=r(52399),d=r(53931),p=c((function(t){var e=this,r=e.iterator,i=e.predicate;return new t((function(s,l){var c=function(t){e.done=!0,l(t)},d=function(t){u(r,c,t,c)},p=function(){try{t.resolve(o(n(e.next,r))).then((function(r){try{if(o(r).done)e.done=!0,s(h(void 0,!0));else{var n=r.value;try{var l=i(n,e.counter++),u=function(t){t?s(h(n,!1)):p()};a(l)?t.resolve(l).then(u,d):u(l)}catch(t){d(t)}}}catch(t){c(t)}}),c)}catch(t){c(t)}};p()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:d},{filter:function(t){return o(this),s(t),new p(l(this),{predicate:t})}})},81954:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).find;i({target:"AsyncIterator",proto:!0,real:!0},{find:function(t){return n(this,t)}})},87152:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(22302),c=r(17394),h=r(27807),u=r(11427),d=r(52399),p=r(53931),f=c((function(t){var e=this,r=e.iterator,i=e.mapper;return new t((function(s,l){var c=function(t){e.done=!0,l(t)},p=function(t){d(r,c,t,c)},f=function(){try{t.resolve(o(n(e.next,r))).then((function(r){try{if(o(r).done)e.done=!0,s(h(void 0,!0));else{var n=r.value;try{var l=i(n,e.counter++),d=function(t){try{e.inner=u(t),m()}catch(t){p(t)}};a(l)?t.resolve(l).then(d,p):d(l)}catch(t){p(t)}}}catch(t){c(t)}}),c)}catch(t){c(t)}},m=function(){var r=e.inner;if(r)try{t.resolve(o(n(r.next,r.iterator))).then((function(t){try{o(t).done?(e.inner=null,f()):s(h(t.value,!1))}catch(t){p(t)}}),p)}catch(t){p(t)}else f()};m()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:p},{flatMap:function(t){return o(this),s(t),new f(l(this),{mapper:t,inner:null})}})},89667:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).forEach;i({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(t){return n(this,t)}})},49118:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(23622),o=r(11427),a=r(23070),l=r(40219);i({target:"AsyncIterator",stat:!0,forced:r(53931)},{from:function(t){var e=o("string"==typeof t?n(t):t);return s(a,e.iterator)?e.iterator:new l(e)}})},32411:(t,e,r)=>{"use strict";r(79989)({target:"AsyncIterator",proto:!0,real:!0,forced:!0},{indexed:r(40164)})},3256:(t,e,r)=>{"use strict";var i=r(79989),n=r(82412);i({target:"AsyncIterator",proto:!0,real:!0,forced:r(53931)},{map:n})},85625:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(76058),c=r(22302),h=r(52399),u=l("Promise"),d=TypeError;i({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(t){o(this),s(t);var e=c(this),r=e.iterator,i=e.next,l=arguments.length<2,p=l?void 0:arguments[1],f=0;return new u((function(e,s){var c=function(t){h(r,s,t,s)},m=function(){try{u.resolve(o(n(i,r))).then((function(r){try{if(o(r).done)l?s(new d("Reduce of empty iterator with no initial value")):e(p);else{var i=r.value;if(l)l=!1,p=i,m();else try{var n=t(p,i,f),h=function(t){p=t,m()};a(n)?u.resolve(n).then(h,c):h(n)}catch(t){c(t)}}f++}catch(t){s(t)}}),s)}catch(t){s(t)}};m()}))}})},10914:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).some;i({target:"AsyncIterator",proto:!0,real:!0},{some:function(t){return n(this,t)}})},14494:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(17394),h=r(27807),u=r(53931),d=c((function(t){var e,r=this,i=r.iterator;if(!r.remaining--){var o=h(void 0,!0);return r.done=!0,void 0!==(e=i.return)?t.resolve(n(e,i,void 0)).then((function(){return o})):o}return t.resolve(n(r.next,i)).then((function(t){return s(t).done?(r.done=!0,h(void 0,!0)):h(t.value,!1)})).then(null,(function(t){throw r.done=!0,t}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:u},{take:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},9468:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).toArray;i({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return n(this,void 0,[])}})},24587:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554);"function"==typeof BigInt&&i({target:"BigInt",stat:!0,forced:!0},{range:function(t,e,r){return new n(t,e,r,"bigint",BigInt(0),BigInt(1))}})},60779:(t,e,r)=>{"use strict";var i=r(79989),n=r(61735),s=r(41544),o=r(76058),a=r(25391),l=Object,c=function(){var t=o("Object","freeze");return t?t(a(null)):a(null)};i({global:!0,forced:!0},{compositeKey:function(){return n(s,l,arguments).get("object",c)}})},65503:(t,e,r)=>{"use strict";var i=r(79989),n=r(41544),s=r(76058),o=r(61735);i({global:!0,forced:!0},{compositeSymbol:function(){return 1===arguments.length&&"string"==typeof arguments[0]?s("Symbol").for(arguments[0]):o(n,null,arguments).get("symbol",s("Symbol"))}})},50236:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(15477).unpack,o=n(DataView.prototype.getUint16);i({target:"DataView",proto:!0},{getFloat16:function(t){var e=o(this,t,arguments.length>1&&arguments[1]);return s([255&e,e>>8&255],10)}})},89246:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844)(DataView.prototype.getUint8);i({target:"DataView",proto:!0,forced:!0},{getUint8Clamped:function(t){return n(this,t)}})},31186:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(50926),o=r(19842),a=r(15477).pack,l=r(76043),c=TypeError,h=n(DataView.prototype.setUint16);i({target:"DataView",proto:!0},{setFloat16:function(t,e){if("DataView"!==s(this))throw new c("Incorrect receiver");var r=o(t),i=a(l(e),10,2);return h(this,r,i[1]<<8|i[0],arguments.length>2&&arguments[2])}})},9279:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(50926),o=r(19842),a=r(87191),l=TypeError,c=n(DataView.prototype.setUint8);i({target:"DataView",proto:!0,forced:!0},{setUint8Clamped:function(t,e){if("DataView"!==s(this))throw new l("Incorrect receiver");var r=o(t);return c(this,r,a(e))}})},26725:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(76058),o=r(10509),a=r(767),l=r(11880),c=r(6045),h=r(62148),u=r(44201),d=r(618),p=r(29199),f=s("SuppressedError"),m=ReferenceError,g=u("dispose"),A=u("toStringTag"),y="DisposableStack",v=d.set,x=d.getterFor(y),b="sync-dispose",_="disposed",w=function(t){var e=x(t);if(e.state===_)throw new m(y+" already disposed");return e},E=function(){v(a(this,M),{type:y,state:"pending",stack:[]}),n||(this.disposed=!1)},M=E.prototype;c(M,{dispose:function(){var t=x(this);if(t.state!==_){t.state=_,n||(this.disposed=!0);for(var e,r=t.stack,i=r.length,s=!1;i;){var o=r[--i];r[i]=null;try{o()}catch(t){s?e=new f(t,e):(s=!0,e=t)}}if(t.stack=null,s)throw e}},use:function(t){return p(w(this),t,b),t},adopt:function(t,e){var r=w(this);return o(e),p(r,void 0,b,(function(){e(t)})),t},defer:function(t){var e=w(this);o(t),p(e,void 0,b,t)},move:function(){var t=w(this),e=new E;return x(e).stack=t.stack,t.stack=[],t.state=_,n||(this.disposed=!0),e}}),n&&h(M,"disposed",{configurable:!0,get:function(){return x(this).state===_}}),l(M,g,M.dispose,{name:"dispose"}),l(M,A,y,{nonWritable:!0}),i({global:!0,constructor:!0},{DisposableStack:E})},26125:(t,e,r)=>{"use strict";r(79989)({target:"Function",proto:!0,forced:!0},{demethodize:r(33505)})},2820:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(69985),o=r(6738),a=r(36812),l=r(67697),c=Object.getOwnPropertyDescriptor,h=/^\s*class\b/,u=n(h.exec);i({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(t){return s(t)&&!function(t){try{if(!l||!u(h,o(t)))return!1}catch(t){}var e=c(t,"prototype");return!!e&&a(e,"writable")&&!e.writable}(t)}})},62517:(t,e,r)=>{"use strict";r(79989)({target:"Function",stat:!0,forced:!0},{isConstructor:r(19429)})},54947:(t,e,r)=>{"use strict";var i=r(44201),n=r(72560).f,s=i("metadata"),o=Function.prototype;void 0===o[s]&&n(o,s,{value:null})},74993:(t,e,r)=>{"use strict";r(79989)({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:r(33505)})},78832:(t,e,r)=>{"use strict";r(45398)},50647:(t,e,r)=>{"use strict";r(79989)({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(47082)})},67602:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(767),o=r(85027),a=r(69985),l=r(61868),c=r(62148),h=r(76522),u=r(3689),d=r(36812),p=r(44201),f=r(12013).IteratorPrototype,m=r(67697),g=r(53931),A="constructor",y="Iterator",v=p("toStringTag"),x=TypeError,b=n[y],_=g||!a(b)||b.prototype!==f||!u((function(){b({})})),w=function(){if(s(this,f),l(this)===f)throw new x("Abstract class Iterator not directly constructable")},E=function(t,e){m?c(f,t,{configurable:!0,get:function(){return e},set:function(e){if(o(this),this===f)throw new x("You can't redefine this property");d(this,t)?this[t]=e:h(this,t,e)}}):f[t]=e};d(f,v)||E(v,y),!_&&d(f,A)&&f[A]!==Object||E(A,w),w.prototype=f,i({global:!0,constructor:!0,forced:_},{Iterator:w})},82639:(t,e,r)=>{"use strict";var i=r(22615),n=r(11880),s=r(54849),o=r(36812),a=r(44201),l=r(12013).IteratorPrototype,c=a("dispose");o(l,c)||n(l,c,(function(){var t=s(this,"return");t&&i(t,this)}))},63986:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(65419),h=r(53931),u=c((function(){for(var t,e=this.iterator,r=this.next;this.remaining;)if(this.remaining--,t=s(n(r,e)),this.done=!!t.done)return;if(t=s(n(r,e)),!(this.done=!!t.done))return t.value}));i({target:"Iterator",proto:!0,real:!0,forced:h},{drop:function(t){s(this);var e=l(a(+t));return new u(o(this),{remaining:e})}})},16054:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{every:function(t){o(this),s(t);var e=a(this),r=0;return!n(e,(function(e,i){if(!t(e,r++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},53476:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(22302),l=r(65419),c=r(71228),h=r(53931),u=l((function(){for(var t,e,r=this.iterator,i=this.predicate,s=this.next;;){if(t=o(n(s,r)),this.done=!!t.done)return;if(e=t.value,c(r,i,[e,this.counter++],!0))return e}}));i({target:"Iterator",proto:!0,real:!0,forced:h},{filter:function(t){return o(this),s(t),new u(a(this),{predicate:t})}})},70928:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{find:function(t){o(this),s(t);var e=a(this),r=0;return n(e,(function(e,i){if(t(e,r++))return i(e)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},49411:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(22302),l=r(36752),c=r(65419),h=r(72125),u=r(53931),d=c((function(){for(var t,e,r=this.iterator,i=this.mapper;;){if(e=this.inner)try{if(!(t=o(n(e.next,e.iterator))).done)return t.value;this.inner=null}catch(t){h(r,"throw",t)}if(t=o(n(this.next,r)),this.done=!!t.done)return;try{this.inner=l(i(t.value,this.counter++),!1)}catch(t){h(r,"throw",t)}}}));i({target:"Iterator",proto:!0,real:!0,forced:u},{flatMap:function(t){return o(this),s(t),new d(a(this),{mapper:t,inner:null})}})},30005:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{forEach:function(t){o(this),s(t);var e=a(this),r=0;n(e,(function(e){t(e,r++)}),{IS_RECORD:!0})}})},73494:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(90690),o=r(23622),a=r(12013).IteratorPrototype,l=r(65419),c=r(36752),h=r(53931),u=l((function(){return n(this.next,this.iterator)}),!0);i({target:"Iterator",stat:!0,forced:h},{from:function(t){var e=c("string"==typeof t?s(t):t,!0);return o(a,e.iterator)?e.iterator:new u(e)}})},94564:(t,e,r)=>{"use strict";r(79989)({target:"Iterator",proto:!0,real:!0,forced:!0},{indexed:r(47082)})},41792:(t,e,r)=>{"use strict";var i=r(79989),n=r(88983);i({target:"Iterator",proto:!0,real:!0,forced:r(53931)},{map:n})},5985:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554),s=TypeError;i({target:"Iterator",stat:!0,forced:!0},{range:function(t,e,r){if("number"==typeof t)return new n(t,e,r,"number",0,1);if("bigint"==typeof t)return new n(t,e,r,"bigint",BigInt(0),BigInt(1));throw new s("Incorrect Iterator.range arguments")}})},31107:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302),l=TypeError;i({target:"Iterator",proto:!0,real:!0},{reduce:function(t){o(this),s(t);var e=a(this),r=arguments.length<2,i=r?void 0:arguments[1],c=0;if(n(e,(function(e){r?(r=!1,i=e):i=t(i,e,c),c++}),{IS_RECORD:!0}),r)throw new l("Reduce of empty iterator with no initial value");return i}})},28244:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{some:function(t){o(this),s(t);var e=a(this),r=0;return n(e,(function(e,i){if(t(e,r++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3645:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(65419),h=r(72125),u=r(53931),d=c((function(){var t=this.iterator;if(!this.remaining--)return this.done=!0,h(t,"normal",void 0);var e=s(n(this.next,t));return(this.done=!!e.done)?void 0:e.value}));i({target:"Iterator",proto:!0,real:!0,forced:u},{take:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},58429:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(18734),o=r(22302),a=[].push;i({target:"Iterator",proto:!0,real:!0},{toArray:function(){var t=[];return s(o(n(this)),a,{that:t,IS_RECORD:!0}),t}})},39569:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(29019),o=r(40219),a=r(22302);i({target:"Iterator",proto:!0,real:!0,forced:r(53931)},{toAsync:function(){return new o(a(new s(a(n(this)))))}})},74320:(t,e,r)=>{"use strict";r(79989)({target:"JSON",stat:!0,forced:!r(22818)},{isRawJSON:r(55670)})},20691:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19037),o=r(76058),a=r(68844),l=r(22615),c=r(69985),h=r(48999),u=r(92297),d=r(36812),p=r(34327),f=r(6310),m=r(76522),g=r(3689),A=r(46675),y=r(50146),v=s.JSON,x=s.Number,b=s.SyntaxError,_=v&&v.parse,w=o("Object","keys"),E=Object.getOwnPropertyDescriptor,M=a("".charAt),S=a("".slice),C=a(/./.exec),T=a([].push),I=/^\d$/,R=/^[1-9]$/,B=/^(?:-|\d)$/,L=/^[\t\n\r ]$/,P=function(t,e,r,i){var n,s,o,a,c,p=t[e],m=i&&p===i.value,g=m&&"string"==typeof i.source?{source:i.source}:{};if(h(p)){var A=u(p),y=m?i.nodes:A?[]:{};if(A)for(n=y.length,o=f(p),a=0;a{"use strict";var i=r(79989),n=r(71594),s=r(22818),o=r(76058),a=r(22615),l=r(68844),c=r(69985),h=r(55670),u=r(34327),d=r(76522),p=r(46675),f=r(92643),m=r(14630),g=r(618).set,A=String,y=SyntaxError,v=o("JSON","parse"),x=o("JSON","stringify"),b=o("Object","create"),_=o("Object","freeze"),w=l("".charAt),E=l("".slice),M=l(/./.exec),S=l([].push),C=m(),T=C.length,I="Unacceptable as raw JSON",R=/^[\t\n\r ]$/;i({target:"JSON",stat:!0,forced:!s},{rawJSON:function(t){var e=u(t);if(""===e||M(R,w(e,0))||M(R,w(e,e.length-1)))throw new y(I);var r=v(e);if("object"==typeof r&&null!==r)throw new y(I);var i=b(null);return g(i,{type:"RawJSON"}),d(i,"rawJSON",e),n?_(i):i}}),x&&i({target:"JSON",stat:!0,arity:3,forced:!s},{stringify:function(t,e,r){var i=f(e),n=[],s=x(t,(function(t,e){var r=c(i)?a(i,this,A(t),e):e;return h(r)?C+(S(n,r.rawJSON)-1):r}),r);if("string"!=typeof s)return s;for(var o="",l=s.length,u=0;u{"use strict";var i=r(79989),n=r(9945),s=r(83914).remove;i({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(9945),s=r(83914),o=s.get,a=s.has,l=s.set;i({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,i,s=n(this);return a(s,t)?(r=o(s,t),"update"in e&&(r=e.update(r,t,s),l(s,t,r)),r):(i=e.insert(t,s),l(s,t,i),i)}})},747:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!1!==o(e,(function(t,i){if(!r(t,i,e))return!1}),!0)}})},41099:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){r(t,n,e)&&c(i,n,t)})),i}})},20876:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t,i){if(r(t,i,e))return{key:i}}),!0);return i&&i.key}})},26320:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t,i){if(r(t,i,e))return{value:t}}),!0);return i&&i.value}})},6052:(t,e,r)=>{"use strict";r(79989)({target:"Map",stat:!0,forced:!0},{from:r(28737)})},39879:(t,e,r)=>{"use strict";r(89348)},76791:(t,e,r)=>{"use strict";var i=r(79989),n=r(68600),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(t){return!0===o(s(this),(function(e){if(n(e,t))return!0}),!0)}})},75341:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(18734),o=r(69985),a=r(10509),l=r(83914).Map;i({target:"Map",stat:!0,forced:!0},{keyBy:function(t,e){var r=new(o(this)?this:l);a(e);var i=a(r.set);return s(t,(function(t){n(i,r,e(t),t)})),r}})},40019:(t,e,r)=>{"use strict";var i=r(79989),n=r(9945),s=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(t){var e=s(n(this),(function(e,r){if(e===t)return{key:r}}),!0);return e&&e.key}})},92343:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){c(i,r(t,n,e),t)})),i}})},51096:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){c(i,n,r(t,n,e))})),i}})},4314:(t,e,r)=>{"use strict";var i=r(79989),n=r(9945),s=r(18734),o=r(83914).set;i({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(t){for(var e=n(this),r=arguments.length,i=0;i{"use strict";r(79989)({target:"Map",stat:!0,forced:!0},{of:r(1114)})},23346:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(9945),o=r(10613),a=TypeError;i({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),r=arguments.length<2,i=r?void 0:arguments[1];if(n(t),o(e,(function(n,s){r?(r=!1,i=n):i=t(i,n,s,e)})),r)throw new a("Reduce of empty map with no initial value");return i}})},64984:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!0===o(e,(function(t,i){if(r(t,i,e))return!0}),!0)}})},24453:(t,e,r)=>{"use strict";r(79989)({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:r(41432)})},64078:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(9945),o=r(83914),a=TypeError,l=o.get,c=o.has,h=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{update:function(t,e){var r=s(this),i=arguments.length;n(e);var o=c(r,t);if(!o&&i<3)throw new a("Updating absent value");var u=o?l(r,t):n(i>2?arguments[2]:void 0)(t,r);return h(r,t,e(u,t,r)),r}})},66190:(t,e,r)=>{"use strict";r(79989)({target:"Map",proto:!0,real:!0,forced:!0},{upsert:r(41432)})},25684:(t,e,r)=>{"use strict";var i=r(79989),n=Math.min,s=Math.max;i({target:"Math",stat:!0,forced:!0},{clamp:function(t,e,r){return n(r,s(e,t))}})},31789:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180})},8677:(t,e,r)=>{"use strict";var i=r(79989),n=180/Math.PI;i({target:"Math",stat:!0,forced:!0},{degrees:function(t){return t*n}})},59151:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{f16round:r(76043)})},346:(t,e,r)=>{"use strict";var i=r(79989),n=r(84463),s=r(37788);i({target:"Math",stat:!0,forced:!0},{fscale:function(t,e,r,i,o){return s(n(t,e,r,i,o))}})},91069:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{iaddh:function(t,e,r,i){var n=t>>>0,s=r>>>0;return(e>>>0)+(i>>>0)+((n&s|(n|s)&~(n+s>>>0))>>>31)|0}})},18886:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{imulh:function(t,e){var r=65535,i=+t,n=+e,s=i&r,o=n&r,a=i>>16,l=n>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>16)+((s*l>>>0)+(c&r)>>16)}})},88065:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{isubh:function(t,e,r,i){var n=t>>>0,s=r>>>0;return(e>>>0)-(i>>>0)-((~n&s|~(n^s)&n-s>>>0)>>>31)|0}})},68172:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},60445:(t,e,r)=>{"use strict";var i=r(79989),n=Math.PI/180;i({target:"Math",stat:!0,forced:!0},{radians:function(t){return t*n}})},99457:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{scale:r(84463)})},613:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(70046),o=r(30974),a=r(27807),l=r(618),c="Seeded Random",h=c+" Generator",u=l.set,d=l.getterFor(h),p=TypeError,f=o((function(t){u(this,{type:h,seed:t%2147483647})}),c,(function(){var t=d(this),e=t.seed=(1103515245*t.seed+12345)%2147483647;return a((1073741823&e)/1073741823,!1)}));i({target:"Math",stat:!0,forced:!0},{seededPRNG:function(t){var e=n(t).seed;if(!s(e))throw new p('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new f(e)}})},835:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{signbit:function(t){var e=+t;return e==e&&0===e?1/e==-1/0:e<0}})},926:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{umulh:function(t,e){var r=65535,i=+t,n=+e,s=i&r,o=n&r,a=i>>>16,l=n>>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>>16)+((s*l>>>0)+(c&r)>>>16)}})},82899:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o="Invalid number representation",a=RangeError,l=SyntaxError,c=TypeError,h=parseInt,u=Math.pow,d=/^[\d.a-z]+$/,p=n("".charAt),f=n(d.exec),m=n(1..toString),g=n("".slice),A=n("".split);i({target:"Number",stat:!0,forced:!0},{fromString:function(t,e){var r=1;if("string"!=typeof t)throw new c(o);if(!t.length)throw new l(o);if("-"===p(t,0)&&(r=-1,!(t=g(t,1)).length))throw new l(o);var i=void 0===e?10:s(e);if(i<2||i>36)throw new a("Invalid radix");if(!f(d,t))throw new l(o);var n=A(t,"."),y=h(n[0],i);if(n.length>1&&(y+=h(n[1],i)/u(i,n[1].length)),10===i&&m(y,i)!==t)throw new l(o);return r*y}})},29977:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554);i({target:"Number",stat:!0,forced:!0},{range:function(t,e,r){return new n(t,e,r,"number",0,1)}})},3210:(t,e,r)=>{"use strict";r(44079)},53669:(t,e,r)=>{"use strict";r(14566)},31927:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateEntries:function(t){return new n(t,"entries")}})},77131:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateKeys:function(t){return new n(t,"keys")}})},55174:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateValues:function(t){return new n(t,"values")}})},63503:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(67697),o=r(14241),a=r(10509),l=r(85027),c=r(767),h=r(69985),u=r(981),d=r(48999),p=r(54849),f=r(11880),m=r(6045),g=r(62148),A=r(20920),y=r(44201),v=r(618),x=y("observable"),b="Observable",_="Subscription",w="SubscriptionObserver",E=v.getterFor,M=v.set,S=E(b),C=E(_),T=E(w),I=function(t){this.observer=l(t),this.cleanup=void 0,this.subscriptionObserver=void 0};I.prototype={type:_,clean:function(){var t=this.cleanup;if(t){this.cleanup=void 0;try{t()}catch(t){A(t)}}},close:function(){if(!s){var t=this.facade,e=this.subscriptionObserver;t.closed=!0,e&&(e.closed=!0)}this.observer=void 0},isClosed:function(){return void 0===this.observer}};var R=function(t,e){var r,i=M(this,new I(t));s||(this.closed=!1);try{(r=p(t,"start"))&&n(r,t,this)}catch(t){A(t)}if(!i.isClosed()){var o=i.subscriptionObserver=new B(i);try{var l=e(o),c=l;u(l)||(i.cleanup=h(l.unsubscribe)?function(){c.unsubscribe()}:a(l))}catch(t){return void o.error(t)}i.isClosed()&&i.clean()}};R.prototype=m({},{unsubscribe:function(){var t=C(this);t.isClosed()||(t.close(),t.clean())}}),s&&g(R.prototype,"closed",{configurable:!0,get:function(){return C(this).isClosed()}});var B=function(t){M(this,{type:w,subscriptionState:t}),s||(this.closed=!1)};B.prototype=m({},{next:function(t){var e=T(this).subscriptionState;if(!e.isClosed()){var r=e.observer;try{var i=p(r,"next");i&&n(i,r,t)}catch(t){A(t)}}},error:function(t){var e=T(this).subscriptionState;if(!e.isClosed()){var r=e.observer;e.close();try{var i=p(r,"error");i?n(i,r,t):A(t)}catch(t){A(t)}e.clean()}},complete:function(){var t=T(this).subscriptionState;if(!t.isClosed()){var e=t.observer;t.close();try{var r=p(e,"complete");r&&n(r,e)}catch(t){A(t)}t.clean()}}}),s&&g(B.prototype,"closed",{configurable:!0,get:function(){return T(this).subscriptionState.isClosed()}});var L=function(t){c(this,P),M(this,{type:b,subscriber:a(t)})},P=L.prototype;m(P,{subscribe:function(t){var e=arguments.length;return new R(h(t)?{next:t,error:e>1?arguments[1]:void 0,complete:e>2?arguments[2]:void 0}:d(t)?t:{},S(this).subscriber)}}),f(P,x,(function(){return this})),i({global:!0,constructor:!0,forced:!0},{Observable:L}),o(b)},9818:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(22615),o=r(85027),a=r(19429),l=r(5185),c=r(54849),h=r(18734),u=r(44201)("observable");i({target:"Observable",stat:!0,forced:!0},{from:function(t){var e=a(this)?this:n("Observable"),r=c(o(t),u);if(r){var i=o(s(r,t));return i.constructor===e?i:new e((function(t){return i.subscribe(t)}))}var d=l(t);return new e((function(t){h(d,(function(e,r){if(t.next(e),t.closed)return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),t.complete()}))}})},76314:(t,e,r)=>{"use strict";r(63503),r(9818),r(38771)},38771:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(19429),o=n("Array");i({target:"Observable",stat:!0,forced:!0},{of:function(){for(var t=s(this)?this:n("Observable"),e=arguments.length,r=o(e),i=0;i{"use strict";r(41195)},40393:(t,e,r)=>{"use strict";r(87609)},6616:(t,e,r)=>{"use strict";var i=r(79989),n=r(48742),s=r(9302);i({target:"Promise",stat:!0,forced:!0},{try:function(t){var e=n.f(this),r=s(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}})},90810:(t,e,r)=>{"use strict";r(13505)},19959:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.set;i({target:"Reflect",stat:!0},{defineMetadata:function(t,e,r){var i=arguments.length<4?void 0:o(arguments[3]);a(t,e,s(r),i)}})},73347:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.getMap,l=n.store;i({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var r=arguments.length<3?void 0:o(arguments[2]),i=a(s(e),r,!1);if(void 0===i||!i.delete(t))return!1;if(i.size)return!0;var n=l.get(e);return n.delete(r),!!n.size||l.delete(e)}})},70003:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(33666),o=r(85027),a=r(61868),l=n(r(12397)),c=n([].concat),h=s.keys,u=s.toKey,d=function(t,e){var r=h(t,e),i=a(t);if(null===i)return r;var n=d(i,e);return n.length?r.length?l(c(r,n)):n:r};i({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:u(arguments[1]);return d(o(t),e)}})},71913:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=r(61868),a=n.has,l=n.get,c=n.toKey,h=function(t,e,r){if(a(t,e,r))return l(t,e,r);var i=o(e);return null!==i?h(t,i,r):void 0};i({target:"Reflect",stat:!0},{getMetadata:function(t,e){var r=arguments.length<3?void 0:c(arguments[2]);return h(t,s(e),r)}})},7859:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.keys,a=n.toKey;i({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:a(arguments[1]);return o(s(t),e)}})},79955:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.get,a=n.toKey;i({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var r=arguments.length<3?void 0:a(arguments[2]);return o(t,s(e),r)}})},31138:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=r(61868),a=n.has,l=n.toKey,c=function(t,e,r){if(a(t,e,r))return!0;var i=o(e);return null!==i&&c(t,i,r)};i({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var r=arguments.length<3?void 0:l(arguments[2]);return c(t,s(e),r)}})},28809:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.has,a=n.toKey;i({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var r=arguments.length<3?void 0:a(arguments[2]);return o(t,s(e),r)}})},2946:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.set;i({target:"Reflect",stat:!0},{metadata:function(t,e){return function(r,i){a(t,e,s(r),o(i))}}})},32460:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=r(86350),a=n("".charCodeAt),l=n("".replace),c=RegExp("[!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^`{|}~"+o+"]","g");i({target:"RegExp",stat:!0,forced:!0},{escape:function(t){var e=s(t),r=a(e,0);return(r>47&&r<58?"\\x3":"")+l(e,c,"\\$&")}})},57282:(t,e,r)=>{"use strict";var i=r(79989),n=r(10029),s=r(61034).add;i({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,r=arguments.length;e{"use strict";var i=r(79989),n=r(10029),s=r(61034).remove;i({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(27748);i({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(t){return n(o,this,s(t))}})},15716:(t,e,r)=>{"use strict";var i=r(79989),n=r(27748);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("difference")},{difference:n})},30349:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!1!==o(e,(function(t){if(!r(t,t,e))return!1}),!0)}})},96986:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(61034),a=r(48774),l=o.Set,c=o.add;i({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t){r(t,t,e)&&c(i,t)})),i}})},95681:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t){if(r(t,t,e))return{value:t}}),!0);return i&&i.value}})},13781:(t,e,r)=>{"use strict";r(79989)({target:"Set",stat:!0,forced:!0},{from:r(28737)})},98873:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(72948);i({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(t){return n(o,this,s(t))}})},33442:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(72948);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("intersection")||n((function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:s})},50308:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(97795);i({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(t){return n(o,this,s(t))}})},61964:(t,e,r)=>{"use strict";var i=r(79989),n=r(97795);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isDisjointFrom")},{isDisjointFrom:n})},18955:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(26951);i({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(t){return n(o,this,s(t))}})},69878:(t,e,r)=>{"use strict";var i=r(79989),n=r(26951);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isSubsetOf")},{isSubsetOf:n})},65115:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(3894);i({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(t){return n(o,this,s(t))}})},52915:(t,e,r)=>{"use strict";var i=r(79989),n=r(3894);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isSupersetOf")},{isSupersetOf:n})},19490:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10029),o=r(48774),a=r(34327),l=n([].join),c=n([].push);i({target:"Set",proto:!0,real:!0,forced:!0},{join:function(t){var e=s(this),r=void 0===t?",":a(t),i=[];return o(e,(function(t){c(i,t)})),l(i,r)}})},95752:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(61034),a=r(48774),l=o.Set,c=o.add;i({target:"Set",proto:!0,real:!0,forced:!0},{map:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t){c(i,r(t,t,e))})),i}})},32789:(t,e,r)=>{"use strict";r(79989)({target:"Set",stat:!0,forced:!0},{of:r(1114)})},27913:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(10029),o=r(48774),a=TypeError;i({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),r=arguments.length<2,i=r?void 0:arguments[1];if(n(t),o(e,(function(n){r?(r=!1,i=n):i=t(i,n,n,e)})),r)throw new a("Reduce of empty set with no initial value");return i}})},6831:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!0===o(e,(function(t){if(r(t,t,e))return!0}),!0)}})},90243:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(62289);i({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(t){return n(o,this,s(t))}})},98686:(t,e,r)=>{"use strict";var i=r(79989),n=r(62289);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("symmetricDifference")},{symmetricDifference:n})},98030:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(75674);i({target:"Set",proto:!0,real:!0,forced:!0},{union:function(t){return n(o,this,s(t))}})},22275:(t,e,r)=>{"use strict";var i=r(79989),n=r(75674);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("union")},{union:n})},86220:(t,e,r)=>{"use strict";var i=r(79989),n=r(10730).charAt,s=r(74684),o=r(68700),a=r(34327);i({target:"String",proto:!0,forced:!0},{at:function(t){var e=a(s(this)),r=e.length,i=o(t),l=i>=0?i:r+i;return l<0||l>=r?void 0:n(e,l)}})},95853:(t,e,r)=>{"use strict";var i=r(79989),n=r(30974),s=r(27807),o=r(74684),a=r(34327),l=r(618),c=r(10730),h=c.codeAt,u=c.charAt,d="String Iterator",p=l.set,f=l.getterFor(d),m=n((function(t){p(this,{type:d,string:t,index:0})}),"String",(function(){var t,e=f(this),r=e.string,i=e.index;return i>=r.length?s(void 0,!0):(t=u(r,i),e.index+=t.length,s({codePoint:h(t,0),position:i},!1))}));i({target:"String",proto:!0,forced:!0},{codePoints:function(){return new m(a(o(this)))}})},21917:(t,e,r)=>{"use strict";r(79989)({target:"String",stat:!0,forced:!0},{cooked:r(8195)})},66084:(t,e,r)=>{"use strict";var i=r(71594),n=r(79989),s=r(98702),o=r(68844),a=r(61735),l=r(85027),c=r(90690),h=r(69985),u=r(6310),d=r(72560).f,p=r(9015),f=r(16803),m=r(8195),g=r(98985),A=r(86350),y=new f.WeakMap,v=f.get,x=f.has,b=f.set,_=Array,w=TypeError,E=Object.freeze||Object,M=Object.isFrozen,S=Math.min,C=o("".charAt),T=o("".slice),I=o("".split),R=o(/./.exec),B=/([\n\u2028\u2029]|\r\n?)/g,L=RegExp("^["+A+"]*"),P=RegExp("[^"+A+"]"),D="Invalid tag",O=function(t,e){if(void 0===e||t===e)return t;for(var r=0,i=S(t.length,e.length);r0)throw new w("Invalid opening line");e[1]=""}if(p){if(1===e.length||R(P,e[e.length-1]))throw new w("Invalid closing line");e[e.length-2]="",e[e.length-1]=""}for(var f=2;f{"use strict";r(12281)},59012:(t,e,r)=>{"use strict";r(79866)},38320:(t,e,r)=>{"use strict";r(56532)},78988:(t,e,r)=>{"use strict";r(35237)},26810:(t,e,r)=>{"use strict";var i=r(79989),n=r(23622),s=r(61868),o=r(49385),a=r(8758),l=r(25391),c=r(75773),h=r(75684),u=r(65411),d=r(13841),p=r(44201)("toStringTag"),f=Error,m=function(t,e,r){var i,a=n(g,this);return o?i=o(new f,a?s(this):g):(i=a?this:l(g),c(i,p,"Error")),void 0!==r&&c(i,"message",d(r)),u(i,m,i.stack,1),c(i,"error",t),c(i,"suppressed",e),i};o?o(m,f):a(m,f,{name:!0});var g=m.prototype=l(f.prototype,{constructor:h(1,m),message:h(1,""),name:h(1,"SuppressedError")});i({global:!0,constructor:!0,arity:3},{SuppressedError:m})},80546:(t,e,r)=>{"use strict";var i=r(19037),n=r(35405),s=r(72560).f,o=r(82474).f,a=i.Symbol;if(n("asyncDispose"),a){var l=o(a,"asyncDispose");l.enumerable&&l.configurable&&l.writable&&s(a,"asyncDispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},62586:(t,e,r)=>{"use strict";var i=r(19037),n=r(35405),s=r(72560).f,o=r(82474).f,a=i.Symbol;if(n("dispose"),a){var l=o(a,"dispose");l.enumerable&&l.configurable&&l.writable&&s(a,"dispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},46019:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(18992)})},5010:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(18992)})},45749:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(8957)})},4835:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(8957)})},58799:(t,e,r)=>{"use strict";r(35405)("matcher")},27041:(t,e,r)=>{"use strict";r(35405)("metadataKey")},18134:(t,e,r)=>{"use strict";r(35405)("metadata")},44767:(t,e,r)=>{"use strict";r(35405)("observable")},92981:(t,e,r)=>{"use strict";r(35405)("patternMatch")},85044:(t,e,r)=>{"use strict";r(35405)("replaceAll")},96256:(t,e,r)=>{"use strict";r(95194)},18241:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filterReject,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filterOut",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},59359:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filterReject,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filterReject",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},1274:(t,e,r)=>{"use strict";r(82)},54302:(t,e,r)=>{"use strict";r(20522)},76677:(t,e,r)=>{"use strict";var i=r(76058),n=r(52655),s=r(2231),o=r(54872),a=r(59976),l=o.aTypedArrayConstructor;(0,o.exportTypedArrayStaticMethod)("fromAsync",(function(t){var e=this,r=arguments.length,o=r>1?arguments[1]:void 0,c=r>2?arguments[2]:void 0;return new(i("Promise"))((function(r){n(e),r(s(t,o,c))})).then((function(t){return a(l(e),t)}))}),!0)},30548:(t,e,r)=>{"use strict";var i=r(54872),n=r(64976),s=r(47338),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("groupBy",(function(t){var e=arguments.length>1?arguments[1]:void 0;return n(o(this),t,e,s)}),!0)},25298:(t,e,r)=>{"use strict";r(24224)},11882:(t,e,r)=>{"use strict";r(61121)},915:(t,e,r)=>{"use strict";var i=r(54872),n=r(6310),s=r(9401),o=r(27578),a=r(71530),l=r(68700),c=r(3689),h=i.aTypedArray,u=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,p=Math.max,f=Math.min;d("toSpliced",(function(t,e){var r,i,c,d,m,g,A,y=h(this),v=u(y),x=n(y),b=o(t,x),_=arguments.length,w=0;if(0===_)r=i=0;else if(1===_)r=0,i=x-b;else if(i=f(p(l(e),0),x-b),r=_-2){d=new v(r),c=s(d);for(var E=2;E<_;E++)m=arguments[E],d[E-2]=c?a(m):+m}for(A=new v(g=x+r-i);w{"use strict";var i=r(68844),n=r(54872),s=r(59976),o=r(12397),a=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,h=i(o);c("uniqueBy",(function(t){return a(this),s(l(this),h(this,t))}),!0)},17911:(t,e,r)=>{"use strict";r(37133)},23579:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(33425),a=r(51082),l=r(36812),c=r(59976),h=r(18368),u=r(9093),d=h.c2i,p=h.c2iUrl,f=n.Uint8Array,m=n.SyntaxError,g=s("".charAt),A=s("".replace),y=s("".slice),v=s([].push),x=/[\t\n\f\r ]/g,b="Extra bits";f&&i({target:"Uint8Array",stat:!0,forced:!0},{fromBase64:function(t){a(t);var e=arguments.length>1?o(arguments[1]):void 0,r="base64"===u(e)?d:p,i=!!e&&!!e.strict,n=i?t:A(t,x,"");if(n.length%4==0)"=="===y(n,-2)?n=y(n,0,-2):"="===y(n,-1)&&(n=y(n,0,-1));else if(i)throw new m("Input is not correctly padded");var s=n.length%4;switch(s){case 1:throw new m("Bad input length");case 2:n+="AA";break;case 3:n+="A"}for(var h=[],_=0,w=n.length,E=function(t){var e=g(n,_+t);if(!l(r,e))throw new m('Bad char in input: "'+e+'"');return r[e]<<18-6*t};_>16&255,M>>8&255,255&M)}var S=h.length;if(2===s){if(i&&0!==h[S-2])throw new m(b);S-=2}else if(3===s){if(i&&0!==h[S-1])throw new m(b);S--}return c(f,h,S)}})},91117:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(51082),a=n.Uint8Array,l=n.SyntaxError,c=n.parseInt,h=/[^\da-f]/i,u=s(h.exec),d=s("".slice);a&&i({target:"Uint8Array",stat:!0,forced:!0},{fromHex:function(t){o(t);var e=t.length;if(e%2)throw new l("String should have an even number of characters");if(u(h,t))throw new l("String should only contain hex characters");for(var r=new a(e/2),i=0;i{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(33425),a=r(95668),l=r(18368),c=r(9093),h=l.i2c,u=l.i2cUrl,d=n.Uint8Array,p=s("".charAt);d&&i({target:"Uint8Array",proto:!0,forced:!0},{toBase64:function(){for(var t,e=a(this),r=arguments.length?o(arguments[0]):void 0,i="base64"===c(r)?h:u,n="",s=0,l=e.length,d=function(e){return p(i,t>>6*e&63)};s+2{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(95668),a=n.Uint8Array,l=s(1..toString);a&&i({target:"Uint8Array",proto:!0,forced:!0},{toHex:function(){o(this);for(var t="",e=0,r=this.length;e{"use strict";var i=r(79989),n=r(457),s=r(16803).remove;i({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(457),s=r(16803),o=s.get,a=s.has,l=s.set;i({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,i,s=n(this);return a(s,t)?(r=o(s,t),"update"in e&&(r=e.update(r,t,s),l(s,t,r)),r):(i=e.insert(t,s),l(s,t,i),i)}})},99369:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",stat:!0,forced:!0},{from:r(28737)})},22983:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",stat:!0,forced:!0},{of:r(1114)})},13466:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",proto:!0,real:!0,forced:!0},{upsert:r(41432)})},23321:(t,e,r)=>{"use strict";var i=r(79989),n=r(53499),s=r(78616).add;i({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,r=arguments.length;e{"use strict";var i=r(79989),n=r(53499),s=r(78616).remove;i({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";r(79989)({target:"WeakSet",stat:!0,forced:!0},{from:r(28737)})},45738:(t,e,r)=>{"use strict";r(79989)({target:"WeakSet",stat:!0,forced:!0},{of:r(1114)})},52586:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(68844),a=r(22615),l=r(3689),c=r(34327),h=r(21500),u=r(18368).c2i,d=/[^\d+/a-z]/i,p=/[\t\n\f\r ]+/g,f=/[=]{1,2}$/,m=s("atob"),g=String.fromCharCode,A=o("".charAt),y=o("".replace),v=o(d.exec),x=!!m&&!l((function(){return"hi"!==m("aGk=")})),b=x&&l((function(){return""!==m(" ")})),_=x&&!l((function(){m("a")})),w=x&&!l((function(){m()})),E=x&&1!==m.length;i({global:!0,bind:!0,enumerable:!0,forced:!x||b||_||w||E},{atob:function(t){if(h(arguments.length,1),x&&!b&&!_)return a(m,n,t);var e,r,i,o=y(c(t),p,""),l="",w=0,E=0;if(o.length%4==0&&(o=y(o,f,"")),(e=o.length)%4==1||v(d,o))throw new(s("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;w>(-2*E&6)));return l}})},84645:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(68844),a=r(22615),l=r(3689),c=r(34327),h=r(21500),u=r(18368).i2c,d=s("btoa"),p=o("".charAt),f=o("".charCodeAt),m=!!d&&!l((function(){return"aGk="!==d("hi")})),g=m&&!l((function(){d()})),A=m&&l((function(){return"bnVsbA=="!==d(null)})),y=m&&1!==d.length;i({global:!0,bind:!0,enumerable:!0,forced:!m||g||A||y},{btoa:function(t){if(h(arguments.length,1),m)return a(d,n,c(t));for(var e,r,i=c(t),o="",l=0,g=u;p(i,l)||(g="=",l%1);){if((r=f(i,l+=3/4))>255)throw new(s("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=p(g,63&(e=e<<8|r)>>8-l%1*8)}return o}})},19742:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(99886).clear;i({global:!0,bind:!0,enumerable:!0,forced:n.clearImmediate!==s},{clearImmediate:s})},47522:(t,e,r)=>{"use strict";var i=r(19037),n=r(66338),s=r(33265),o=r(57612),a=r(75773),l=function(t){if(t&&t.forEach!==o)try{a(t,"forEach",o)}catch(e){t.forEach=o}};for(var c in n)n[c]&&l(i[c]&&i[c].prototype);l(s)},76265:(t,e,r)=>{"use strict";var i=r(19037),n=r(66338),s=r(33265),o=r(752),a=r(75773),l=r(55997),c=r(44201)("iterator"),h=o.values,u=function(t,e){if(t){if(t[c]!==h)try{a(t,c,h)}catch(e){t[c]=h}if(l(t,e,!0),n[e])for(var r in o)if(t[r]!==o[r])try{a(t,r,o[r])}catch(e){t[r]=o[r]}}};for(var d in n)u(i[d]&&i[d].prototype,d);u(s,"DOMTokenList")},97337:(t,e,r)=>{"use strict";var i=r(79989),n=r(21905),s=r(76058),o=r(3689),a=r(25391),l=r(75684),c=r(72560).f,h=r(11880),u=r(62148),d=r(36812),p=r(767),f=r(85027),m=r(20445),g=r(13841),A=r(37136),y=r(56610),v=r(618),x=r(67697),b=r(53931),_="DOMException",w="DATA_CLONE_ERR",E=s("Error"),M=s(_)||function(){try{(new(s("MessageChannel")||n("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name===w&&25===t.code)return t.constructor}}(),S=M&&M.prototype,C=E.prototype,T=v.set,I=v.getterFor(_),R="stack"in new E(_),B=function(t){return d(A,t)&&A[t].m?A[t].c:0},L=function(){p(this,P);var t=arguments.length,e=g(t<1?void 0:arguments[0]),r=g(t<2?void 0:arguments[1],"Error"),i=B(r);if(T(this,{type:_,name:r,message:e,code:i}),x||(this.name=r,this.message=e,this.code=i),R){var n=new E(e);n.name=_,c(this,"stack",l(1,y(n.stack,1)))}},P=L.prototype=a(C),D=function(t){return{enumerable:!0,configurable:!0,get:t}},O=function(t){return D((function(){return I(this)[t]}))};x&&(u(P,"code",O("code")),u(P,"message",O("message")),u(P,"name",O("name"))),c(P,"constructor",l(1,L));var k=o((function(){return!(new M instanceof E)})),U=k||o((function(){return C.toString!==m||"2: 1"!==String(new M(1,2))})),N=k||o((function(){return 25!==new M(1,"DataCloneError").code})),F=k||25!==M[w]||25!==S[w],z=b?U||N||F:k;i({global:!0,constructor:!0,forced:z},{DOMException:z?L:M});var G=s(_),Q=G.prototype;for(var j in U&&(b||M===G)&&h(Q,"toString",m),N&&x&&M===G&&u(Q,"code",D((function(){return B(f(this).name)}))),A)if(d(A,j)){var V=A[j],H=V.s,W=l(6,V.c);d(G,H)||c(G,H,W),d(Q,H)||c(Q,H,W)}},13429:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(75684),a=r(72560).f,l=r(36812),c=r(767),h=r(33457),u=r(13841),d=r(37136),p=r(56610),f=r(67697),m=r(53931),g="DOMException",A=s("Error"),y=s(g),v=function(){c(this,x);var t=arguments.length,e=u(t<1?void 0:arguments[0]),r=u(t<2?void 0:arguments[1],"Error"),i=new y(e,r),n=new A(e);return n.name=g,a(i,"stack",o(1,p(n.stack,1))),h(i,this,v),i},x=v.prototype=y.prototype,b="stack"in new A(g),_="stack"in new y(1,2),w=y&&f&&Object.getOwnPropertyDescriptor(n,g),E=!(!w||w.writable&&w.configurable),M=b&&!E&&!_;i({global:!0,constructor:!0,forced:m||M},{DOMException:M?v:y});var S=s(g),C=S.prototype;if(C.constructor!==S)for(var T in m||a(C,"constructor",o(1,S)),d)if(l(d,T)){var I=d[T],R=I.s;l(S,R)||a(S,R,o(6,I.c))}},37462:(t,e,r)=>{"use strict";var i=r(76058),n="DOMException";r(55997)(i(n),n)},40088:(t,e,r)=>{"use strict";r(19742),r(52731)},10455:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(80231),o=r(10509),a=r(21500),l=r(50806),c=n.process;i({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){a(arguments.length,1),o(t);var e=l&&c.domain;s(e?e.bind(t):t)}})},3650:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(62148),o=r(67697),a=TypeError,l=Object.defineProperty,c=n.self!==n;try{if(o){var h=Object.getOwnPropertyDescriptor(n,"self");!c&&h&&h.get&&h.enumerable||s(n,"self",{get:function(){return n},set:function(t){if(this!==n)throw new a("Illegal invocation");l(n,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:c},{self:n})}catch(t){}},52731:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(99886).set,o=r(8552),a=n.setImmediate?o(s,!1):s;i({global:!0,bind:!0,enumerable:!0,forced:n.setImmediate!==a},{setImmediate:a})},10209:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(8552)(n.setInterval,!0);i({global:!0,bind:!0,forced:n.setInterval!==s},{setInterval:s})},83509:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(8552)(n.setTimeout,!0);i({global:!0,bind:!0,forced:n.setTimeout!==s},{setTimeout:s})},25564:(t,e,r)=>{"use strict";var i,n=r(53931),s=r(79989),o=r(19037),a=r(76058),l=r(68844),c=r(3689),h=r(14630),u=r(69985),d=r(19429),p=r(981),f=r(48999),m=r(30734),g=r(18734),A=r(85027),y=r(50926),v=r(36812),x=r(76522),b=r(75773),_=r(6310),w=r(21500),E=r(63477),M=r(83914),S=r(61034),C=r(48774),T=r(21420),I=r(49599),R=r(63514),B=o.Object,L=o.Array,P=o.Date,D=o.Error,O=o.TypeError,k=o.PerformanceMark,U=a("DOMException"),N=M.Map,F=M.has,z=M.get,G=M.set,Q=S.Set,j=S.add,V=S.has,H=a("Object","keys"),W=l([].push),q=l((!0).valueOf),Z=l(1..valueOf),Y=l("".valueOf),X=l(P.prototype.getTime),J=h("structuredClone"),K="DataCloneError",$="Transferring",tt=function(t){return!c((function(){var e=new o.Set([7]),r=t(e),i=t(B(7));return r===e||!r.has(7)||!f(i)||7!=+i}))&&t},et=function(t,e){return!c((function(){var r=new e,i=t({a:r,b:r});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===r.stack)}))},rt=o.structuredClone,it=n||!et(rt,D)||!et(rt,U)||(i=rt,!!c((function(){var t=i(new o.AggregateError([1],J,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==J||3!==t.cause}))),nt=!rt&&tt((function(t){return new k(J,{detail:t}).detail})),st=tt(rt)||nt,ot=function(t){throw new U("Uncloneable type: "+t,K)},at=function(t,e){throw new U((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",K)},lt=function(t,e){return st||at(e),st(t)},ct=function(t,e,r){if(F(e,t))return z(e,t);var i,n,s,a,l,c;if("SharedArrayBuffer"===(r||y(t)))i=st?st(t):t;else{var h=o.DataView;h||u(t.slice)||at("ArrayBuffer");try{if(u(t.slice)&&!t.resizable)i=t.slice(0);else{n=t.byteLength,s="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0,i=new ArrayBuffer(n,s),a=new h(t),l=new h(i);for(c=0;c1&&!p(arguments[1])?A(arguments[1]):void 0,n=i?i.transfer:void 0;void 0!==n&&(r=function(t,e){if(!f(t))throw new O("Transfer option cannot be converted to a sequence");var r=[];g(t,(function(t){W(r,A(t))}));for(var i,n,s,a,l,c=0,h=_(r),p=new Q;c{"use strict";r(10209),r(83509)},2625:(t,e,r)=>{"use strict";r(752);var i=r(79989),n=r(19037),s=r(22615),o=r(68844),a=r(67697),l=r(76837),c=r(11880),h=r(62148),u=r(6045),d=r(55997),p=r(30974),f=r(618),m=r(767),g=r(69985),A=r(36812),y=r(54071),v=r(50926),x=r(85027),b=r(48999),_=r(34327),w=r(25391),E=r(75684),M=r(5185),S=r(91664),C=r(27807),T=r(21500),I=r(44201),R=r(50382),B=I("iterator"),L="URLSearchParams",P=L+"Iterator",D=f.set,O=f.getterFor(L),k=f.getterFor(P),U=Object.getOwnPropertyDescriptor,N=function(t){if(!a)return n[t];var e=U(n,t);return e&&e.value},F=N("fetch"),z=N("Request"),G=N("Headers"),Q=z&&z.prototype,j=G&&G.prototype,V=n.RegExp,H=n.TypeError,W=n.decodeURIComponent,q=n.encodeURIComponent,Z=o("".charAt),Y=o([].join),X=o([].push),J=o("".replace),K=o([].shift),$=o([].splice),tt=o("".split),et=o("".slice),rt=/\+/g,it=Array(4),nt=function(t){return it[t-1]||(it[t-1]=V("((?:%[\\da-f]{2}){"+t+"})","gi"))},st=function(t){try{return W(t)}catch(e){return t}},ot=function(t){var e=J(t,rt," "),r=4;try{return W(e)}catch(t){for(;r;)e=J(e,nt(r--),st);return e}},at=/[!'()~]|%20/g,lt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ct=function(t){return lt[t]},ht=function(t){return J(q(t),at,ct)},ut=p((function(t,e){D(this,{type:P,target:O(t).entries,index:0,kind:e})}),L,(function(){var t=k(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,C(void 0,!0);var i=e[r];switch(t.kind){case"keys":return C(i.key,!1);case"values":return C(i.value,!1)}return C([i.key,i.value],!1)}),!0),dt=function(t){this.entries=[],this.url=null,void 0!==t&&(b(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Z(t,0)?et(t,1):t:_(t)))};dt.prototype={type:L,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,i,n,o,a,l,c=this.entries,h=S(t);if(h)for(r=(e=M(t,h)).next;!(i=s(r,e)).done;){if(o=(n=M(x(i.value))).next,(a=s(o,n)).done||(l=s(o,n)).done||!s(o,n).done)throw new H("Expected sequence with length 2");X(c,{key:_(a.value),value:_(l.value)})}else for(var u in t)A(t,u)&&X(c,{key:u,value:_(t[u])})},parseQuery:function(t){if(t)for(var e,r,i=this.entries,n=tt(t,"&"),s=0;s0?arguments[0]:void 0));a||(this.size=t.entries.length)},ft=pt.prototype;if(u(ft,{append:function(t,e){var r=O(this);T(arguments.length,2),X(r.entries,{key:_(t),value:_(e)}),a||this.length++,r.updateURL()},delete:function(t){for(var e=O(this),r=T(arguments.length,1),i=e.entries,n=_(t),s=r<2?void 0:arguments[1],o=void 0===s?s:_(s),l=0;le.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=O(this).entries,i=y(t,arguments.length>1?arguments[1]:void 0),n=0;n1?At(arguments[1]):{})}}),g(z)){var yt=function(t){return m(this,Q),new z(t,arguments.length>1?At(arguments[1]):{})};Q.constructor=yt,yt.prototype=Q,i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:yt})}}t.exports={URLSearchParams:pt,getState:O}},98858:(t,e,r)=>{"use strict";var i=r(11880),n=r(68844),s=r(34327),o=r(21500),a=URLSearchParams,l=a.prototype,c=n(l.append),h=n(l.delete),u=n(l.forEach),d=n([].push),p=new a("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&i(l,"delete",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=[];u(this,(function(t,e){d(i,{key:e,value:t})})),o(e,1);for(var n,a=s(t),l=s(r),p=0,f=0,m=!1,g=i.length;p{"use strict";var i=r(11880),n=r(68844),s=r(34327),o=r(21500),a=URLSearchParams,l=a.prototype,c=n(l.getAll),h=n(l.has),u=new a("a=1");!u.has("a",2)&&u.has("a",void 0)||i(l,"has",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=c(this,t);o(e,1);for(var n=s(r),a=0;a{"use strict";r(2625)},33228:(t,e,r)=>{"use strict";var i=r(67697),n=r(68844),s=r(62148),o=URLSearchParams.prototype,a=n(o.forEach);i&&!("size"in o)&&s(o,"size",{get:function(){var t=0;return a(this,(function(){t++})),t},configurable:!0,enumerable:!0})},69822:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(3689),o=r(21500),a=r(34327),l=r(76837),c=n("URL");i({target:"URL",stat:!0,forced:!(l&&s((function(){c.canParse()})))},{canParse:function(t){var e=o(arguments.length,1),r=a(t),i=e<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return!!new c(r,i)}catch(t){return!1}}})},79391:(t,e,r)=>{"use strict";r(21694);var i,n=r(79989),s=r(67697),o=r(76837),a=r(19037),l=r(54071),c=r(68844),h=r(11880),u=r(62148),d=r(767),p=r(36812),f=r(45394),m=r(21055),g=r(9015),A=r(10730).codeAt,y=r(6430),v=r(34327),x=r(55997),b=r(21500),_=r(2625),w=r(618),E=w.set,M=w.getterFor("URL"),S=_.URLSearchParams,C=_.getState,T=a.URL,I=a.TypeError,R=a.parseInt,B=Math.floor,L=Math.pow,P=c("".charAt),D=c(/./.exec),O=c([].join),k=c(1..toString),U=c([].pop),N=c([].push),F=c("".replace),z=c([].shift),G=c("".split),Q=c("".slice),j=c("".toLowerCase),V=c([].unshift),H="Invalid scheme",W="Invalid host",q="Invalid port",Z=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,J=/^0x/i,K=/^[0-7]+$/,$=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,rt=/[\0\t\n\r #/:<>?@[\\\]^|]/,it=/^[\u0000-\u0020]+/,nt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,st=/[\t\n\r]/g,ot=function(t){var e,r,i,n;if("number"==typeof t){for(e=[],r=0;r<4;r++)V(e,t%256),t=B(t/256);return O(e,".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,r=1,i=null,n=0,s=0;s<8;s++)0!==t[s]?(n>r&&(e=i,r=n),i=null,n=0):(null===i&&(i=s),++n);return n>r&&(e=i,r=n),e}(t),r=0;r<8;r++)n&&0===t[r]||(n&&(n=!1),i===r?(e+=r?":":"::",n=!0):(e+=k(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},at={},lt=f({},at,{" ":1,'"':1,"<":1,">":1,"`":1}),ct=f({},lt,{"#":1,"?":1,"{":1,"}":1}),ht=f({},ct,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ut=function(t,e){var r=A(t,0);return r>32&&r<127&&!p(e,t)?t:encodeURIComponent(t)},dt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pt=function(t,e){var r;return 2===t.length&&D(Z,P(t,0))&&(":"===(r=P(t,1))||!e&&"|"===r)},ft=function(t){var e;return t.length>1&&pt(Q(t,0,2))&&(2===t.length||"/"===(e=P(t,2))||"\\"===e||"?"===e||"#"===e)},mt=function(t){return"."===t||"%2e"===j(t)},gt={},At={},yt={},vt={},xt={},bt={},_t={},wt={},Et={},Mt={},St={},Ct={},Tt={},It={},Rt={},Bt={},Lt={},Pt={},Dt={},Ot={},kt={},Ut=function(t,e,r){var i,n,s,o=v(t);if(e){if(n=this.parse(o))throw new I(n);this.searchParams=null}else{if(void 0!==r&&(i=new Ut(r,!0)),n=this.parse(o,null,i))throw new I(n);(s=C(new S)).bindURL(this),this.searchParams=s}};Ut.prototype={type:"URL",parse:function(t,e,r){var n,s,o,a,l,c=this,h=e||gt,u=0,d="",f=!1,A=!1,y=!1;for(t=v(t),e||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=F(t,it,""),t=F(t,nt,"$1")),t=F(t,st,""),n=m(t);u<=n.length;){switch(s=n[u],h){case gt:if(!s||!D(Z,s)){if(e)return H;h=yt;continue}d+=j(s),h=At;break;case At:if(s&&(D(Y,s)||"+"===s||"-"===s||"."===s))d+=j(s);else{if(":"!==s){if(e)return H;d="",h=yt,u=0;continue}if(e&&(c.isSpecial()!==p(dt,d)||"file"===d&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=d,e)return void(c.isSpecial()&&dt[c.scheme]===c.port&&(c.port=null));d="","file"===c.scheme?h=It:c.isSpecial()&&r&&r.scheme===c.scheme?h=vt:c.isSpecial()?h=wt:"/"===n[u+1]?(h=xt,u++):(c.cannotBeABaseURL=!0,N(c.path,""),h=Dt)}break;case yt:if(!r||r.cannotBeABaseURL&&"#"!==s)return H;if(r.cannotBeABaseURL&&"#"===s){c.scheme=r.scheme,c.path=g(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,h=kt;break}h="file"===r.scheme?It:bt;continue;case vt:if("/"!==s||"/"!==n[u+1]){h=bt;continue}h=Et,u++;break;case xt:if("/"===s){h=Mt;break}h=Pt;continue;case bt:if(c.scheme=r.scheme,s===i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query;else if("/"===s||"\\"===s&&c.isSpecial())h=_t;else if("?"===s)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query="",h=Ot;else{if("#"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.path.length--,h=Pt;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query,c.fragment="",h=kt}break;case _t:if(!c.isSpecial()||"/"!==s&&"\\"!==s){if("/"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,h=Pt;continue}h=Mt}else h=Et;break;case wt:if(h=Et,"/"!==s||"/"!==P(d,u+1))continue;u++;break;case Et:if("/"!==s&&"\\"!==s){h=Mt;continue}break;case Mt:if("@"===s){f&&(d="%40"+d),f=!0,o=m(d);for(var x=0;x65535)return q;c.port=c.isSpecial()&&w===dt[c.scheme]?null:w,d=""}if(e)return;h=Lt;continue}return q}d+=s;break;case It:if(c.scheme="file","/"===s||"\\"===s)h=Rt;else{if(!r||"file"!==r.scheme){h=Pt;continue}switch(s){case i:c.host=r.host,c.path=g(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=g(r.path),c.query="",h=Ot;break;case"#":c.host=r.host,c.path=g(r.path),c.query=r.query,c.fragment="",h=kt;break;default:ft(O(g(n,u),""))||(c.host=r.host,c.path=g(r.path),c.shortenPath()),h=Pt;continue}}break;case Rt:if("/"===s||"\\"===s){h=Bt;break}r&&"file"===r.scheme&&!ft(O(g(n,u),""))&&(pt(r.path[0],!0)?N(c.path,r.path[0]):c.host=r.host),h=Pt;continue;case Bt:if(s===i||"/"===s||"\\"===s||"?"===s||"#"===s){if(!e&&pt(d))h=Pt;else if(""===d){if(c.host="",e)return;h=Lt}else{if(a=c.parseHost(d))return a;if("localhost"===c.host&&(c.host=""),e)return;d="",h=Lt}continue}d+=s;break;case Lt:if(c.isSpecial()){if(h=Pt,"/"!==s&&"\\"!==s)continue}else if(e||"?"!==s)if(e||"#"!==s){if(s!==i&&(h=Pt,"/"!==s))continue}else c.fragment="",h=kt;else c.query="",h=Ot;break;case Pt:if(s===i||"/"===s||"\\"===s&&c.isSpecial()||!e&&("?"===s||"#"===s)){if(".."===(l=j(l=d))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===s||"\\"===s&&c.isSpecial()||N(c.path,"")):mt(d)?"/"===s||"\\"===s&&c.isSpecial()||N(c.path,""):("file"===c.scheme&&!c.path.length&&pt(d)&&(c.host&&(c.host=""),d=P(d,0)+":"),N(c.path,d)),d="","file"===c.scheme&&(s===i||"?"===s||"#"===s))for(;c.path.length>1&&""===c.path[0];)z(c.path);"?"===s?(c.query="",h=Ot):"#"===s&&(c.fragment="",h=kt)}else d+=ut(s,ct);break;case Dt:"?"===s?(c.query="",h=Ot):"#"===s?(c.fragment="",h=kt):s!==i&&(c.path[0]+=ut(s,at));break;case Ot:e||"#"!==s?s!==i&&("'"===s&&c.isSpecial()?c.query+="%27":c.query+="#"===s?"%23":ut(s,at)):(c.fragment="",h=kt);break;case kt:s!==i&&(c.fragment+=ut(s,lt))}u++}},parseHost:function(t){var e,r,i;if("["===P(t,0)){if("]"!==P(t,t.length-1))return W;if(e=function(t){var e,r,i,n,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,h=null,u=0,d=function(){return P(t,u)};if(":"===d()){if(":"!==P(t,1))return;u+=2,h=++c}for(;d();){if(8===c)return;if(":"!==d()){for(e=r=0;r<4&&D(tt,d());)e=16*e+R(d(),16),u++,r++;if("."===d()){if(0===r)return;if(u-=r,c>6)return;for(i=0;d();){if(n=null,i>0){if(!("."===d()&&i<4))return;u++}if(!D(X,d()))return;for(;D(X,d());){if(s=R(d(),10),null===n)n=s;else{if(0===n)return;n=10*n+s}if(n>255)return;u++}l[c]=256*l[c]+n,2!=++i&&4!==i||c++}if(4!==i)return;break}if(":"===d()){if(u++,!d())return}else if(d())return;l[c++]=e}else{if(null!==h)return;u++,h=++c}}if(null!==h)for(o=c-h,c=7;0!==c&&o>0;)a=l[c],l[c--]=l[h+o-1],l[h+--o]=a;else if(8!==c)return;return l}(Q(t,1,-1)),!e)return W;this.host=e}else if(this.isSpecial()){if(t=y(t),D(et,t))return W;if(e=function(t){var e,r,i,n,s,o,a,l=G(t,".");if(l.length&&""===l[l.length-1]&&l.length--,(e=l.length)>4)return t;for(r=[],i=0;i1&&"0"===P(n,0)&&(s=D(J,n)?16:8,n=Q(n,8===s?1:2)),""===n)o=0;else{if(!D(10===s?$:8===s?K:tt,n))return t;o=R(n,s)}N(r,o)}for(i=0;i=L(256,5-e))return null}else if(o>255)return null;for(a=U(r),i=0;i1?arguments[1]:void 0,i=E(e,new Ut(t,!1,r));s||(e.href=i.serialize(),e.origin=i.getOrigin(),e.protocol=i.getProtocol(),e.username=i.getUsername(),e.password=i.getPassword(),e.host=i.getHost(),e.hostname=i.getHostname(),e.port=i.getPort(),e.pathname=i.getPathname(),e.search=i.getSearch(),e.searchParams=i.getSearchParams(),e.hash=i.getHash())},Ft=Nt.prototype,zt=function(t,e){return{get:function(){return M(this)[t]()},set:e&&function(t){return M(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(u(Ft,"href",zt("serialize","setHref")),u(Ft,"origin",zt("getOrigin")),u(Ft,"protocol",zt("getProtocol","setProtocol")),u(Ft,"username",zt("getUsername","setUsername")),u(Ft,"password",zt("getPassword","setPassword")),u(Ft,"host",zt("getHost","setHost")),u(Ft,"hostname",zt("getHostname","setHostname")),u(Ft,"port",zt("getPort","setPort")),u(Ft,"pathname",zt("getPathname","setPathname")),u(Ft,"search",zt("getSearch","setSearch")),u(Ft,"searchParams",zt("getSearchParams")),u(Ft,"hash",zt("getHash","setHash"))),h(Ft,"toJSON",(function(){return M(this).serialize()}),{enumerable:!0}),h(Ft,"toString",(function(){return M(this).serialize()}),{enumerable:!0}),T){var Gt=T.createObjectURL,Qt=T.revokeObjectURL;Gt&&h(Nt,"createObjectURL",l(Gt,T)),Qt&&h(Nt,"revokeObjectURL",l(Qt,T))}x(Nt,"URL"),n({global:!0,constructor:!0,forced:!o,sham:!s},{URL:Nt})},78730:(t,e,r)=>{"use strict";r(79391)},19979:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615);i({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return n(URL.prototype.toString,this)}})},92294:(t,e,r)=>{"use strict";r.d(e,{TE:()=>Lr,th:()=>Hr});var i={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,doc:"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{js:"v2.10.0",android:"10.7.0",ios:"10.7.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0",android:"10.0.0",ios:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0",android:"10.0.0",ios:"10.0.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0",ios:"4.1.0",macos:"0.8.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."},globe:{doc:"A globe projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",requires:["source"],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{js:"2.10.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",requires:["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"2.10.0",android:"10.7.0",ios:"10.7.0"}}}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0",macos:"10.5.0"}},"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={},o={exports:{}};!function(t,e){!function(r){var i=e&&!e.nodeType&&e,s=t&&!t.nodeType&&t,o="object"==typeof n&&n;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var a,l,c=2147483647,h=36,u=26,d=38,p=700,f=/^xn--/,m=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=h-1,v=Math.floor,x=String.fromCharCode;function b(t){throw RangeError(A[t])}function _(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function w(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+_((t=t.replace(g,".")).split("."),e).join(".")}function E(t){for(var e,r,i=[],n=0,s=t.length;n=55296&&e<=56319&&n65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+x(t)})).join("")}function S(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,r){var i=0;for(t=r?v(t/p):t>>1,t+=v(t/e);t>y*u>>1;i+=h)t=v(t/y);return v(i+(y+1)*t/(t+d))}function T(t){var e,r,i,n,s,o,a,l,d,p,f,m=[],g=t.length,A=0,y=128,x=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&b("not-basic"),m.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=g&&b("invalid-input"),((l=(f=t.charCodeAt(n++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||l>v((c-A)/o))&&b("overflow"),A+=l*o,!(l<(d=a<=x?1:a>=x+u?u:a-x));a+=h)o>v(c/(p=h-d))&&b("overflow"),o*=p;x=C(A-s,e=m.length+1,0==s),v(A/e)>c-y&&b("overflow"),y+=v(A/e),A%=e,m.splice(A++,0,y)}return M(m)}function I(t){var e,r,i,n,s,o,a,l,d,p,f,m,g,A,y,_=[];for(m=(t=E(t)).length,e=128,r=0,s=72,o=0;o=e&&fv((c-r)/(g=i+1))&&b("overflow"),r+=(a-e)*g,e=a,o=0;oc&&b("overflow"),f==e){for(l=r,d=h;!(l<(p=d<=s?1:d>=s+u?u:d-s));d+=h)y=l-p,A=h-p,_.push(x(S(p+y%A,0))),l=v(y/A);_.push(x(S(l,0))),s=C(r,g,i==n),r=0,++i}++r,++e}return _.join("")}if(a={version:"1.3.2",ucs2:{decode:E,encode:M},decode:T,encode:I,toASCII:function(t){return w(t,(function(t){return m.test(t)?"xn--"+I(t):t}))},toUnicode:function(t){return w(t,(function(t){return f.test(t)?T(t.slice(4).toLowerCase()):t}))}},i&&s)if(t.exports==i)s.exports=a;else for(l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);else r.punycode=a}(n)}(o,o.exports);var a={};function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var c=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};a.decode=a.parse=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var s=/\+/g;t=t.split(e);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var a=t.length;o>0&&a>o&&(a=o);for(var c=0;c=0?(h=f.substr(0,m),u=f.substr(m+1)):(h=f,u=""),d=decodeURIComponent(h),p=decodeURIComponent(u),l(n,d)?Array.isArray(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n},a.encode=a.stringify=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(c(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(c(t))})).join(e):n+encodeURIComponent(c(t[i]))})).join(e):i?encodeURIComponent(c(i))+r+encodeURIComponent(c(t)):""};var h=o.exports,u=function(t){return"string"==typeof t},d=function(t){return"object"==typeof t&&null!==t},p=function(t){return null===t},f=function(t){return null==t};function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}s.parse=I,s.resolve=function(t,e){return I(t,!1,!0).resolve(e)},s.resolveObject=function(t,e){return t?I(t,!1,!0).resolveObject(e):e},s.format=function(t){return u(t)&&(t=I(t)),t instanceof m?t.format():m.prototype.format.call(t)},s.Url=m;var g=/^([a-z0-9.+-]+:)/i,A=/:[0-9]*$/,y=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,v=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),x=["'"].concat(v),b=["%","/","?",";","#"].concat(x),_=["/","?","#"],w=/^[+a-z0-9A-Z_-]{0,63}$/,E=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},C={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=a;function I(t,e,r){if(t&&d(t)&&t instanceof m)return t;var i=new m;return i.parse(t,e,r),i}function R(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}m.prototype.parse=function(t,e,r){if(!u(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?P+="x":P+=L[D];if(!P.match(w)){var k=R.slice(0,A),U=R.slice(A+1),N=L.match(E);N&&(k.push(N[1]),U.unshift(N[2])),U.length&&(o="/"+U.join(".")+o),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=h.toASCII(this.hostname));var F=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+F,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!M[c])for(A=0,B=x.length;A0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift())),r.search=t.search,r.query=t.query,p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=w.slice(-1)[0],T=(r.host||t.host||w.length>1)&&("."===M||".."===M)||""===M,I=0,R=w.length;R>=0;R--)"."===(M=w[R])?w.splice(R,1):".."===M?(w.splice(R,1),I++):I&&(w.splice(R,1),I--);if(!b&&!_)for(;I--;I)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),T&&"/"!==w.join("/").substr(-1)&&w.push("");var B,L=""===w[0]||w[0]&&"/"===w[0].charAt(0);return E&&(r.hostname=r.host=L?"":w.length?w.shift():"",(B=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift())),(b=b||r.host&&w.length)&&!L&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},m.prototype.parseHost=function(){var t=this.host,e=A.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};class B extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}var L=B;class P{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,r]of e)this.bindings[t]=r}concat(t){return new P(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var D=P;const O={kind:"null"},k={kind:"number"},U={kind:"string"},N={kind:"boolean"},F={kind:"color"},z={kind:"object"},G={kind:"value"},Q={kind:"collator"},j={kind:"formatted"},V={kind:"resolvedImage"};function H(t,e){return{kind:"array",itemType:t,N:e}}function W(t){if("array"===t.kind){const e=W(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const q=[O,k,U,N,F,j,z,H(G),V];function Z(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Z(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of q)if(!Z(t,e))return null}return`Expected ${W(t)} but found ${W(e)} instead.`}function Y(t,e){return e.some((e=>e.kind===t.kind))}function X(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var J,K={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 $(t){return(t=Math.round(t))<0?0:t>255?255:t}function tt(t){return t<0?0:t>1?1:t}function et(t){return"%"===t[t.length-1]?$(parseFloat(t)/100*255):$(parseInt(t))}function rt(t){return"%"===t[t.length-1]?tt(parseFloat(t)/100):tt(parseFloat(t))}function it(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{J={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in K)return K[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.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===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var s=r.substr(0,i),o=r.substr(i+1,n-(i+1)).split(","),a=1;switch(s){case"rgba":if(4!==o.length)return null;a=rt(o.pop());case"rgb":return 3!==o.length?null:[et(o[0]),et(o[1]),et(o[2]),a];case"hsla":if(4!==o.length)return null;a=rt(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,c=rt(o[1]),h=rt(o[2]),u=h<=.5?h*(c+1):h+c-h*c,d=2*h-u;return[$(255*it(d,u,l+1/3)),$(255*it(d,u,l)),$(255*it(d,u,l-1/3)),a];default:return null}}return null}}catch(t){}class nt{constructor(t,e,r,i=1){this.r=t,this.g=e,this.b=r,this.a=i}static parse(t){if(!t)return;if(t instanceof nt)return t;if("string"!=typeof t)return;const e=J(t);return e?new nt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,r,i]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(r)},${i})`}toArray(){const{r:t,g:e,b:r,a:i}=this;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*r/i,i]}toArray01(){const{r:t,g:e,b:r,a:i}=this;return 0===i?[0,0,0,0]:[t/i,e/i,r/i,i]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:r,a:i}=this;return[t,e,r,i]}}nt.black=new nt(0,0,0,1),nt.white=new nt(1,1,1,1),nt.transparent=new nt(0,0,0,0),nt.red=new nt(1,0,0,1),nt.blue=new nt(0,0,1,1);var st=nt;class ot{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class at{constructor(t,e,r,i,n){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n}}class lt{constructor(t){this.sections=t}static fromString(t){return new lt([new at(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof lt?t:lt.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const r={};e.fontStack&&(r["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(r["font-scale"]=e.scale),e.textColor&&(r["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(r)}return t}}class ct{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new ct({name:t,available:!1}):null}serialize(){return["image",this.name]}}function ht(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ut(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof st)return!0;if(t instanceof ot)return!0;if(t instanceof lt)return!0;if(t instanceof ct)return!0;if(Array.isArray(t)){for(const e of t)if(!ut(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!ut(t[e]))return!1;return!0}return!1}function dt(t){if(null===t)return O;if("string"==typeof t)return U;if("boolean"==typeof t)return N;if("number"==typeof t)return k;if(t instanceof st)return F;if(t instanceof ot)return Q;if(t instanceof lt)return j;if(t instanceof ct)return V;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=dt(e);if(r){if(r===t)continue;r=G;break}r=t}return H(r||G,e)}return z}function pt(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof st||t instanceof lt||t instanceof ct?t.toString():JSON.stringify(t)}class ft{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!ut(t[1]))return e.error("invalid value");const r=t[1];let i=dt(r);const n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new ft(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof st?["rgba"].concat(this.value.toArray()):this.value instanceof lt?this.value.serialize():this.value}}var mt=ft,gt=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const At={string:U,number:k,boolean:N,object:z};class yt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,i=1;const n=t[0];if("array"===n){let n,s;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in At)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=At[r],i++}else n=G;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],i++}r=H(n,s)}else r=At[n];const s=[];for(;it.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);const i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((t=>t.serialize())))}}var vt=yt;class xt{constructor(t){this.type=j,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const i=[];let n=!1;for(let r=1;r<=t.length-1;++r){const s=t[r];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;let t=null;if(s["font-scale"]&&(t=e.parse(s["font-scale"],1,k),!t))return null;let r=null;if(s["text-font"]&&(r=e.parse(s["text-font"],1,H(U)),!r))return null;let o=null;if(s["text-color"]&&(o=e.parse(s["text-color"],1,F),!o))return null;const a=i[i.length-1];a.scale=t,a.font=r,a.textColor=o}else{const s=e.parse(t[r],1,G);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:s,scale:null,font:null,textColor:null})}}return new xt(i)}evaluate(t){return new lt(this.sections.map((e=>{const r=e.content.evaluate(t);return dt(r)===V?new at("",r,null,null,null):new at(pt(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const r={};e.scale&&(r["font-scale"]=e.scale.serialize()),e.font&&(r["text-font"]=e.font.serialize()),e.textColor&&(r["text-color"]=e.textColor.serialize()),t.push(r)}return t}}class bt{constructor(t){this.type=V,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,U);return r?new bt(r):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),r=ct.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const _t={"to-boolean":N,"to-color":F,"to-number":k,"to-string":U};class wt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");const i=_t[r],n=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:ht(e[0],e[1],e[2],e[3]),!r))return new st(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gt(r||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const i=Number(e);if(!isNaN(i))return i}throw new gt(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?lt.fromString(pt(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ct.fromString(pt(this.args[0].evaluate(t))):pt(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new xt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new bt(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Et=wt;const Mt=["Unknown","Point","LineString","Polygon"];var St=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Mt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:r,y:i}=this.featureTileCoord,n=r*e-t[0],s=i*e-t[1];return this.featureDistanceData.bearing[0]*n+this.featureDistanceData.bearing[1]*s}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=st.parse(t)),e}};class Ct{constructor(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const r=t[0],i=Ct.definitions[r];if(!i)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(i)?i[0]:i.type,s=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,o=s.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[i,s]of o){a=new ee(e.registry,e.path,null,e.scope);const o=[];let l=!1;for(let e=1;e{return e=t,Array.isArray(e)?`(${e.map(W).join(", ")})`:`(${W(e.type)}...)`;var e})).join(" | "),i=[];for(let r=1;r=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Pt(t,e){const r=(180+t[0])/360,i=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const s=Math.pow(2,e.z);return[Math.round(r*s*Rt),Math.round(i*s*Rt)]}function Dt(t,e,r){const i=t[0]-e[0],n=t[1]-e[1],s=t[0]-r[0],o=t[1]-r[1];return i*o-s*n==0&&i*s<=0&&n*o<=0}function Ot(t,e){let r=!1;for(let o=0,a=e.length;oi[1]!=s[1]>i[1]&&i[0]<(s[0]-n[0])*(i[1]-n[1])/(s[1]-n[1])+n[0]&&(r=!r)}}var i,n,s;return r}function kt(t,e){for(let r=0;r0&&u<0||h<0&&u>0}function Nt(t,e,r,i){const n=[e[0]-t[0],e[1]-t[1]];return 0!=(s=[i[0]-r[0],i[1]-r[1]])[0]*(o=n)[1]-s[1]*o[0]&&!(!Ut(t,e,r,i)||!Ut(r,i,t,e));var s,o}function Ft(t,e,r){for(const i of r)for(let r=0;rr[2]){const e=.5*i;let n=t[0]-r[0]>e?-i:r[0]-t[0]>e?i:0;0===n&&(n=t[0]-r[2]>e?-i:r[2]-t[0]>e?i:0),t[0]+=n}Bt(e,t)}function Ht(t,e,r,i){const n=Math.pow(2,i.z)*Rt,s=[i.x*Rt,i.y*Rt],o=[];if(!t)return o;for(const i of t)for(const t of i){const i=[t.x+s[0],t.y+s[1]];Vt(i,e,r,n),o.push(i)}return o}function Wt(t,e,r,i){const n=Math.pow(2,i.z)*Rt,s=[i.x*Rt,i.y*Rt],o=[];if(!t)return o;for(const r of t){const t=[];for(const i of r){const r=[i.x+s[0],i.y+s[1]];Bt(e,r),t.push(r)}o.push(t)}if(e[2]-e[0]<=n/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of o)for(const i of t)Vt(i,e,r,n)}var a;return o}class qt{constructor(t,e){this.type=N,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(ut(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t{e&&!Yt(t)&&(e=!1)})),e}function Xt(t){if(t instanceof Tt&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Xt(t)&&(e=!1)})),e}function Jt(t,e){if(t instanceof Tt&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!Jt(t,e)&&(r=!1)})),r}class Kt{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const r=t[1];return e.scope.has(r)?new Kt(r,e.scope.get(r)):e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var $t=Kt;class te{constructor(t,e=[],r,i=new D,n=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=i,this.errors=n,this.expectedType=r}parse(t,e,r,i,n={}){return e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)}_parse(t,e){function r(t,e,r){return"assert"===r?new vt(e,[t]):"coerce"===r?new Et(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=t[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const n=this.registry[i];if(n){let i=n.parse(t,this);if(!i)return null;if(this.expectedType){const t=this.expectedType,n=i.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else i=r(i,t,e.typeAnnotation||"coerce");else i=r(i,t,e.typeAnnotation||"assert")}if(!(i instanceof mt)&&"resolvedImage"!==i.type.kind&&re(i)){const t=new St;try{i=new mt(i.type,i.evaluate(t))}catch(t){return this.error(t.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){const i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new te(this.registry,i,e||null,n,this.errors)}error(t,...e){const r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new L(r,t))}checkSubtype(t,e){const r=Z(t,e);return r&&this.error(r),r}}var ee=te;function re(t){if(t instanceof $t)return re(t.boundExpression);if(t instanceof Tt&&"error"===t.name)return!1;if(t instanceof It)return!1;if(t instanceof Zt)return!1;const e=t instanceof Et||t instanceof vt;let r=!0;return t.eachChild((t=>{r=e?r&&re(t):r&&t instanceof mt})),!!r&&Yt(t)&&Jt(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function ie(t,e){const r=t.length-1;let i,n,s=0,o=r,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),i=t[a],n=t[a+1],i<=e){if(a===r||ee))throw new gt("Input is not a number.");o=a-1}return 0}class ne{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,k);if(!r)return null;const i=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let r=1;r=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=e.parse(o,l,n);if(!c)return null;n=n||c.type,i.push([s,c])}return new ne(n,r,i)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);const n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[ie(e,i)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var se=ne,oe=ae;function ae(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=i}function le(t,e,r){return t*(1-r)+e*r}ae.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,i=0;i<8;i++){var n=this.sampleCurveX(r)-t;if(Math.abs(n)n?o=r:a=r,r=.5*(a-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var ce=Object.freeze({__proto__:null,number:le,color:function(t,e,r){return new st(le(t.r,e.r,r),le(t.g,e.g,r),le(t.b,e.b,r),le(t.a,e.a,r))},array:function(t,e,r){return t.map(((t,i)=>le(t,e[i],r)))}});const he=.95047,ue=1.08883,de=4/29,pe=6/29,fe=3*pe*pe,me=pe*pe*pe,ge=Math.PI/180,Ae=180/Math.PI;function ye(t){return t>me?Math.pow(t,1/3):t/fe+de}function ve(t){return t>pe?t*t*t:fe*(t-de)}function xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function be(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _e(t){const e=be(t.r),r=be(t.g),i=be(t.b),n=ye((.4124564*e+.3575761*r+.1804375*i)/he),s=ye((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*s-16,a:500*(n-s),b:200*(s-ye((.0193339*e+.119192*r+.9503041*i)/ue)),alpha:t.a}}function we(t){let e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*ve(e),r=he*ve(r),i=ue*ve(i),new st(xe(3.2404542*r-1.5371385*e-.4985314*i),xe(-.969266*r+1.8760108*e+.041556*i),xe(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function Ee(t,e,r){const i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}const Me={forward:_e,reverse:we,interpolate:function(t,e,r){return{l:le(t.l,e.l,r),a:le(t.a,e.a,r),b:le(t.b,e.b,r),alpha:le(t.alpha,e.alpha,r)}}},Se={forward:function(t){const{l:e,a:r,b:i}=_e(t),n=Math.atan2(i,r)*Ae;return{h:n<0?n+360:n,c:Math.sqrt(r*r+i*i),l:e,alpha:t.a}},reverse:function(t){const e=t.h*ge,r=t.c;return we({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Ee(t.h,e.h,r),c:le(t.c,e.c,r),l:le(t.l,e.l,r),alpha:le(t.alpha,e.alpha,r)}}};var Ce=Object.freeze({__proto__:null,lab:Me,hcl:Se});class Te{constructor(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[t,e]of n)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,r,i){let n=0;if("exponential"===t.name)n=Ie(e,t.base,r,i);else if("linear"===t.name)n=Ie(e,1,r,i);else if("cubic-bezier"===t.name){const s=t.controlPoints;n=new oe(s[0],s[1],s[2],s[3]).solve(Ie(e,1,r,i))}return n}static parse(t,e){let[r,i,n,...s]=t;if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const t=i[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:t}}else{if("cubic-bezier"!==i[0])return e.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const t=i.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,k),!n)return null;const o=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=F:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=e.parse(i,l,a);if(!c)return null;a=a||c.type,o.push([r,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Te(a,r,i,n,o):e.error(`Type ${W(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);const n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);const s=ie(e,i),o=e[s],a=e[s+1],l=Te.interpolationFactor(this.interpolation,i,o,a),c=r[s].evaluate(t),h=r[s+1].evaluate(t);return"interpolate"===this.operator?ce[this.type.kind.toLowerCase()](c,h,l):"interpolate-hcl"===this.operator?Se.reverse(Se.interpolate(Se.forward(c),Se.forward(h),l)):Me.reverse(Me.interpolate(Me.forward(c),Me.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;tZ(i,t.type)));return new Be(s?G:r,n)}evaluate(t){let e,r=null,i=0;for(const n of this.args){if(i++,r=n.evaluate(t),r&&r instanceof ct&&!r.available&&(e||(e=r),r=null,i===this.args.length))return e;if(null!==r)break}return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Le=Be;class Pe{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let i=1;i=r.length)throw new gt(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new gt(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var ke=Oe;class Ue{constructor(t,e){this.type=N,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,G);return r&&i?Y(r.type,[N,U,k,O,G])?new Ue(r,i):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!X(e,["boolean","string","number","null"]))throw new gt(`Expected first argument to be of type boolean, string, number or null, but found ${W(dt(e))} instead.`);if(!X(r,["string","array"]))throw new gt(`Expected second argument to be of type array or string, but found ${W(dt(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ne=Ue;class Fe{constructor(t,e,r){this.type=k,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,G);if(!r||!i)return null;if(!Y(r.type,[N,U,k,O,G]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(r.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,k);return n?new Fe(r,i,n):null}return new Fe(r,i)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!X(e,["boolean","string","number","null"]))throw new gt(`Expected first argument to be of type boolean, string, number or null, but found ${W(dt(e))} instead.`);if(!X(r,["string","array"]))throw new gt(`Expected second argument to be of type array or string, but found ${W(dt(r))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var ze=Fe;class Ge{constructor(t,e,r,i,n,s){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=s}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n={},s=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,dt(t)))return null}else r=dt(t);if(void 0!==n[String(t)])return c.error("Branch labels must be unique.");n[String(t)]=s.length}const h=e.parse(l,o,i);if(!h)return null;i=i||h.type,s.push(h)}const o=e.parse(t[1],1,G);if(!o)return null;const a=e.parse(t[t.length-1],t.length-1,i);return a?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new Ge(r,i,o,n,s,a):null}evaluate(t){const e=this.input.evaluate(t);return(dt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),r=[],i={};for(const t of e){const e=i[this.cases[t]];void 0===e?(i[this.cases[t]]=r.length,r.push([this.cases[t],[t]])):r[e][1].push(t)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,i]of r)1===i.length?t.push(n(i[0])):t.push(i.map(n)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}var Qe=Ge;class je{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const i=[];for(let n=1;ne.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Ve=je;class He{constructor(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,k);if(!r||!i)return null;if(!Y(r.type,[H(G),U,G]))return e.error(`Expected first argument to be of type array or string, but found ${W(r.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,k);return n?new He(r.type,r,i,n):null}return new He(r.type,r,i)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!X(e,["string","array"]))throw new gt(`Expected first argument to be of type array or string, but found ${W(dt(e))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var We=He;function qe(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ze(t,e,r,i){return 0===i.compare(e,r)}function Ye(t,e,r){const i="=="!==t&&"!="!==t;return class n{constructor(t,e,r){this.type=N,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let s=e.parse(t[1],1,G);if(!s)return null;if(!qe(r,s.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${W(s.type)}'.`);let o=e.parse(t[2],2,G);if(!o)return null;if(!qe(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${W(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${W(s.type)}' and '${W(o.type)}'.`);i&&("value"===s.type.kind&&"value"!==o.type.kind?s=new vt(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new vt(s.type,[o])));let a=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Q),!a)return null}return new n(s,o,a)}evaluate(n){const s=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){const e=dt(s),r=dt(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new gt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const t=dt(s),r=dt(o);if("string"!==t.kind||"string"!==r.kind)return e(n,s,o)}return this.collator?r(n,s,o,this.collator.evaluate(n)):e(n,s,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Xe=Ye("==",(function(t,e,r){return e===r}),Ze),Je=Ye("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!Ze(0,e,r,i)})),Ke=Ye("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),tr=Ye("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),er=Ye(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0}));class rr{constructor(t,e,r,i,n,s){this.type=U,this.number=t,this.locale=e,this.currency=r,this.unit=i,this.minFractionDigits=n,this.maxFractionDigits=s}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,k);if(!r)return null;const i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=e.parse(i.locale,1,U),!n))return null;let s=null;if(i.currency&&(s=e.parse(i.currency,1,U),!s))return null;let o=null;if(i.unit&&(o=e.parse(i.unit,1,U),!o))return null;let a=null;if(i["min-fraction-digits"]&&(a=e.parse(i["min-fraction-digits"],1,k),!a))return null;let l=null;return i["max-fraction-digits"]&&(l=e.parse(i["max-fraction-digits"],1,k),!l)?null:new rr(r,n,s,o,a,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class ir{constructor(t){this.type=k,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${W(r.type)} instead.`):new ir(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new gt(`Expected value to be of type string or array, but found ${W(dt(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const nr={"==":Xe,"!=":Je,">":$e,"<":Ke,">=":er,"<=":tr,array:vt,at:ke,boolean:vt,case:Ve,coalesce:Le,collator:It,format:xt,image:bt,in:Ne,"index-of":ze,interpolate:Re,"interpolate-hcl":Re,"interpolate-lab":Re,length:ir,let:De,literal:mt,match:Qe,number:vt,"number-format":rr,object:vt,slice:We,step:se,string:vt,"to-boolean":Et,"to-color":Et,"to-number":Et,"to-string":Et,var:$t,within:Zt};function sr(t,[e,r,i,n]){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);const s=n?n.evaluate(t):1,o=ht(e,r,i,s);if(o)throw new gt(o);return new st(e/255*s,r/255*s,i/255*s,s)}function or(t,e){return t in e}function ar(t,e){const r=e[t];return void 0===r?null:r}function lr(t){return{type:t}}Tt.register(nr,{error:[{kind:"error"},[U],(t,[e])=>{throw new gt(e.evaluate(t))}],typeof:[U,[G],(t,[e])=>W(dt(e.evaluate(t)))],"to-rgba":[H(k,4),[F],(t,[e])=>e.evaluate(t).toArray()],rgb:[F,[k,k,k],sr],rgba:[F,[k,k,k,k],sr],has:{type:N,overloads:[[[U],(t,[e])=>or(e.evaluate(t),t.properties())],[[U,z],(t,[e,r])=>or(e.evaluate(t),r.evaluate(t))]]},get:{type:G,overloads:[[[U],(t,[e])=>ar(e.evaluate(t),t.properties())],[[U,z],(t,[e,r])=>ar(e.evaluate(t),r.evaluate(t))]]},"feature-state":[G,[U],(t,[e])=>ar(e.evaluate(t),t.featureState||{})],properties:[z,[],t=>t.properties()],"geometry-type":[U,[],t=>t.geometryType()],id:[G,[],t=>t.id()],zoom:[k,[],t=>t.globals.zoom],pitch:[k,[],t=>t.globals.pitch||0],"distance-from-center":[k,[],t=>t.distanceFromCenter()],"heatmap-density":[k,[],t=>t.globals.heatmapDensity||0],"line-progress":[k,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[k,[],t=>t.globals.skyRadialProgress||0],accumulated:[G,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[k,lr(k),(t,e)=>{let r=0;for(const i of e)r+=i.evaluate(t);return r}],"*":[k,lr(k),(t,e)=>{let r=1;for(const i of e)r*=i.evaluate(t);return r}],"-":{type:k,overloads:[[[k,k],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[k],(t,[e])=>-e.evaluate(t)]]},"/":[k,[k,k],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[k,[k,k],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[k,[],()=>Math.LN2],pi:[k,[],()=>Math.PI],e:[k,[],()=>Math.E],"^":[k,[k,k],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[k,[k],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[k,[k],(t,[e])=>Math.log(e.evaluate(t))],log2:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[k,[k],(t,[e])=>Math.sin(e.evaluate(t))],cos:[k,[k],(t,[e])=>Math.cos(e.evaluate(t))],tan:[k,[k],(t,[e])=>Math.tan(e.evaluate(t))],asin:[k,[k],(t,[e])=>Math.asin(e.evaluate(t))],acos:[k,[k],(t,[e])=>Math.acos(e.evaluate(t))],atan:[k,[k],(t,[e])=>Math.atan(e.evaluate(t))],min:[k,lr(k),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[k,lr(k),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[k,[k],(t,[e])=>Math.abs(e.evaluate(t))],round:[k,[k],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[k,[k],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[k,[k],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[N,[U,G],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[N,[G],(t,[e])=>t.id()===e.value],"filter-type-==":[N,[U],(t,[e])=>t.geometryType()===e.value],"filter-<":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{const r=t.id(),i=e.value;return typeof r==typeof i&&r":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[N,[G],(t,[e])=>e.value in t.properties()],"filter-has-id":[N,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[N,[H(U)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[N,[H(G)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[N,[U,H(G)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[N,[U,H(G)],(t,[e,r])=>function(t,e,r,i){for(;r<=i;){const n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:N,overloads:[[[N,N],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[lr(N),(t,e)=>{for(const r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:N,overloads:[[[N,N],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[lr(N),(t,e)=>{for(const r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[N,[N],(t,[e])=>!e.evaluate(t)],"is-supported-script":[N,[U],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[U,[U],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[U,[U],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[U,lr(G),(t,e)=>e.map((e=>pt(e.evaluate(t)))).join("")],"resolved-locale":[U,[Q],(t,[e])=>e.evaluate(t).resolvedLocale()]});var cr=nr;function hr(t){return{result:"success",value:t}}function ur(t){return{result:"error",value:t}}function dr(t){return!!t.expression&&t.expression.interpolated}function pr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function fr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function mr(t){return t}function gr(t,e){const r="color"===e.type,i=t.stops&&"object"==typeof t.stops[0][0],n=i||void 0!==t.property,s=i||!n,o=t.type||(dr(e)?"exponential":"interval");if(r&&((t=R({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],st.parse(t[1])]))),t.default?t.default=st.parse(t.default):t.default=st.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!Ce[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let a,l,c;if("exponential"===o)a=xr;else if("interval"===o)a=vr;else if("categorical"===o){a=yr,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=br}if(i){const r={},i=[];for(let e=0;et[0])),evaluate:({zoom:r},i)=>xr({stops:n,base:t.base},e,r).evaluate(r,i)}}if(s){const r="exponential"===o?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Re.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>a(t,e,r,l,c)}}return{kind:"source",evaluate(r,i){const n=i&&i.properties?i.properties[t.property]:void 0;return void 0===n?Ar(t.default,e.default):a(t,e,n,l,c)}}}function Ar(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function yr(t,e,r,i,n){return Ar(typeof r===n?i[r]:void 0,t.default,e.default)}function vr(t,e,r){if("number"!==pr(r))return Ar(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const n=ie(t.stops.map((t=>t[0])),r);return t.stops[n][1]}function xr(t,e,r){const i=void 0!==t.base?t.base:1;if("number"!==pr(r))return Ar(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const s=ie(t.stops.map((t=>t[0])),r),o=function(t,e,r,i){const n=i-r,s=t-r;return 0===n?0:1===e?s/n:(Math.pow(e,s)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[s][0],t.stops[s+1][0]),a=t.stops[s][1],l=t.stops[s+1][1];let c=ce[e.type]||mr;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=Ce[t.colorSpace];c=(t,r)=>e.reverse(e.interpolate(e.forward(t),e.forward(r),o))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),r=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==r)return c(e,r,o)}}:c(a,l,o)}function br(t,e,r){return"color"===e.type?r=st.parse(r):"formatted"===e.type?r=lt.fromString(r.toString()):"resolvedImage"===e.type?r=ct.fromString(r.toString()):pr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Ar(r,t.default,e.default)}class _r{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new St,this._defaultValue=e?"color"===(r=e).type&&(fr(r.default)||Array.isArray(r.default))?new st(0,0,0,0):"color"===r.type?st.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,i,n,s,o,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,s,o,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s||null,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new gt(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function wr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in cr}function Er(t,e){const r=new ee(cr,[],e?function(t){const e={color:F,string:U,number:k,enum:U,boolean:N,formatted:j,resolvedImage:V};return"array"===t.type?H(e[t.value]||G,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?hr(new _r(i,e)):ur(r.errors)}class Mr{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Xt(e.expression)}evaluateWithoutErrorHandling(t,e,r,i,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,s)}evaluate(t,e,r,i,n,s){return this._styleExpression.evaluate(t,e,r,i,n,s)}}class Sr{constructor(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Xt(e.expression),this.interpolationType=i}evaluateWithoutErrorHandling(t,e,r,i,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,s)}evaluate(t,e,r,i,n,s){return this._styleExpression.evaluate(t,e,r,i,n,s)}interpolationFactor(t,e,r){return this.interpolationType?Re.interpolationFactor(this.interpolationType,t,e,r):0}}function Cr(t,e){if("error"===(t=Er(t,e)).result)return t;const r=t.value.expression,i=Yt(r);if(!i&&"data-driven"!==e["property-type"])return ur([new L("","data expressions not supported")]);const n=Jt(r,["zoom","pitch","distance-from-center"]);if(!n&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return ur([new L("","zoom expressions not supported")]);const s=Ir(r);if(!s&&!n)return ur([new L("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof L)return ur([s]);if(s instanceof Re&&!dr(e))return ur([new L("",'"interpolate" expressions cannot be used with this property')]);if(!s)return hr(new Mr(i?"constant":"source",t.value));const o=s instanceof Re?s.interpolation:void 0;return hr(new Sr(i?"camera":"composite",t.value,s.labels,o))}class Tr{constructor(t,e){this._parameters=t,this._specification=e,R(this,gr(this._parameters,this._specification))}static deserialize(t){return new Tr(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ir(t){let e=null;if(t instanceof De)e=Ir(t.result);else if(t instanceof Le){for(const r of t.args)if(e=Ir(r),e)break}else(t instanceof se||t instanceof Re)&&t.input instanceof Tt&&"zoom"===t.input.name&&(e=t);return e instanceof L||t.eachChild((t=>{const r=Ir(t);r instanceof L?e=r:!e&&r?e=new L("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new L("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Rr(t){if(Array.isArray(t))return t.map(Rr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const r in t)e[r]=Rr(t[r]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Br(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Br(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Lr(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Br(t)||(t=Fr(t));const r=t;let n=!0;try{n=function(t){if(!Or(t))return t;let e=Rr(t);return Dr(e),e=Pr(e),e}(r)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const s=i[`filter_${e}`],o=Er(n,s);let a=null;if("error"===o.result)throw new Error(o.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,r)=>o.value.evaluate(t,e,{},r);let l=null,c=null;if(n!==r){const t=Er(r,s);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));l=(e,r,i,n,s)=>t.value.evaluate(e,r,{},i,void 0,void 0,n,s),c=!Yt(t.value.expression)}return{filter:a,dynamicFilter:l||void 0,needGeometry:Nr(n),needFeature:!!c}}function Pr(t){if(!Array.isArray(t))return t;const e=function(t){if(kr.has(t[0]))for(let e=1;ePr(t)))}function Dr(t){let e=!1;const r=[];if("case"===t[0]){for(let i=1;i",">=","<","<=","to-boolean"]);function Ur(t,e){return te?1:0}function Nr(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?zr(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fr))):"all"===e?["all"].concat(t.slice(1).map(Fr)):"none"===e?["all"].concat(t.slice(1).map(Fr).map(jr)):"in"===e?Gr(t[1],t.slice(2)):"!in"===e?jr(Gr(t[1],t.slice(2))):"has"===e?Qr(t[1]):"!has"===e?jr(Qr(t[1])):"within"!==e||t;var r}function zr(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Gr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Ur)]]:["filter-in-small",t,["literal",e]]}}function Qr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function jr(t){return["!",t]}function Vr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}!function(t){var e=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,12],r=[1,13],i=[1,9],n=[1,10],s=[1,11],o=[1,14],a=[1,15],l=[14,18,22,24],c=[18,22],h=[22,24],u={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,r,i,n,s,o){var a=s.length-1;switch(n){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=s[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=s[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[s[a-2],s[a]];break;case 16:this.$={},this.$[s[a][0]]=s[a][1];break;case 17:this.$=s[a-2],s[a-2][s[a][0]]=s[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[s[a]];break;case 21:this.$=s[a-2],s[a-2].push(s[a])}},table:[{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,12:1,13:2,15:7,16:8,17:o,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:23,15:7,16:8,17:o,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(c,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:30,15:7,16:8,17:o,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:31,15:7,16:8,17:o,23:a},t(c,[2,17]),t(c,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=[0],r=[null],i=[],n=this.table,s="",o=0,a=0,l=i.slice.call(arguments,1),c=Object.create(this.lexer),h={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(h.yy[u]=this.yy[u]);c.setInput(t,h.yy),h.yy.lexer=c,h.yy.parser=this,void 0===c.yylloc&&(c.yylloc={});var d=c.yylloc;i.push(d);var p=c.options&&c.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,g,A,y,v,x,b,_,w={};;){if(m=e[e.length-1],this.defaultActions[m]?g=this.defaultActions[m]:(null==f&&(_=void 0,"number"!=typeof(_=c.lex()||1)&&(_=this.symbols_[_]||_),f=_),g=n[m]&&n[m][f]),void 0===g||!g.length||!g[0]){var E;for(y in b=[],n[m])this.terminals_[y]&&y>2&&b.push("'"+this.terminals_[y]+"'");E=c.showPosition?"Parse error on line "+(o+1)+":\n"+c.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(E,{text:c.match,token:this.terminals_[f]||f,line:c.yylineno,loc:d,expected:b})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(g[0]){case 1:e.push(f),r.push(c.yytext),i.push(c.yylloc),e.push(g[1]),f=null,a=c.yyleng,s=c.yytext,o=c.yylineno,d=c.yylloc;break;case 2:if(v=this.productions_[g[1]][1],w.$=r[r.length-v],w._$={first_line:i[i.length-(v||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(v||1)].first_column,last_column:i[i.length-1].last_column},p&&(w._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(A=this.performAction.apply(w,[s,a,o,h.yy,g[1],r,i].concat(l))))return A;v&&(e=e.slice(0,-1*v*2),r=r.slice(0,-1*v),i=i.slice(0,-1*v)),e.push(this.productions_[g[1]][0]),r.push(w.$),i.push(w._$),x=n[e[e.length-2]][e[e.length-1]],e.push(x);break;case 3:return!0}}return!0}},d={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=r,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,i){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function p(){this.yy={}}return u.lexer=d,p.prototype=u,u.Parser=p,new p}();void 0!==Vr&&(t.parser=e,t.Parser=e.Parser,t.parse=function(){return e.parse.apply(e,arguments)})}({}),new Set(["vector","raster","raster-dem"]);const Hr={StyleExpression:_r,isExpression:wr,isExpressionFilter:Br,createExpression:Er,createPropertyExpression:Cr,normalizePropertyExpression:function(t,e){if(fr(t))return new Tr(t,e);if(wr(t)){const r=Cr(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return"string"==typeof t&&"color"===e.type&&(r=st.parse(t)),{kind:"constant",evaluate:()=>r}}},ZoomConstantExpression:Mr,ZoomDependentExpression:Sr,StylePropertyFunction:Tr}},75153:(t,e,r)=>{"use strict";function i(t,e){return Array.from(t.getElementsByTagName(e))}function n(t){return"#"===t[0]?t:`#${t}`}function s(t){return t?.normalize(),t&&t.textContent||""}function o(t,e,r){const i=t.getElementsByTagName(e),n=i.length?i[0]:null;return n&&r&&r(n),n}function a(t,e,r){const i={};if(!t)return i;const n=t.getElementsByTagName(e),s=n.length?n[0]:null;return s&&r?r(s,i):i}function l(t,e,r){const i=s(o(t,e));return i&&r&&r(i)||{}}function c(t,e,r){const i=parseFloat(s(o(t,e)));if(!isNaN(i))return i&&r&&r(i)||{}}function h(t,e,r){const i=parseFloat(s(o(t,e)));if(!isNaN(i))return r&&r(i),i}function u(t,e){const r={};for(const i of e)l(t,i,(t=>{r[i]=t}));return r}function d(t){return 1===t?.nodeType}function p(t){return a(t,"line",(t=>Object.assign({},l(t,"color",(t=>({stroke:`#${t}`}))),c(t,"opacity",(t=>({"stroke-opacity":t}))),c(t,"width",(t=>({"stroke-width":96*t/25.4}))))))}function f(t){let e=[];if(null===t)return e;for(const r of Array.from(t.childNodes)){if(!d(r))continue;const t=m(r.nodeName);if("gpxtpx:TrackPointExtension"===t)e=e.concat(f(r));else{const i=s(r);e.push([t,g(i)])}}return e}function m(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function g(t){const e=parseFloat(t);return isNaN(e)?t:e}function A(t){const e=[parseFloat(t.getAttribute("lon")||""),parseFloat(t.getAttribute("lat")||"")];if(isNaN(e[0])||isNaN(e[1]))return null;h(t,"ele",(t=>{e.push(t)}));const r=o(t,"time");return{coordinates:e,time:r?s(r):null,extendedValues:f(o(t,"extensions"))}}function y(t){const e=u(t,["name","cmt","desc","type","time","keywords"]),r=Array.from(t.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const i of r)i.parentNode?.parentNode===t&&(e[i.tagName.replace(":","_")]=s(i));const n=i(t,"link");return n.length&&(e.links=n.map((t=>Object.assign({href:t.getAttribute("href")},u(t,["text","type"]))))),e}function v(t,e){const r=i(t,e),n=[],s=[],o={};for(let t=0;t1,l=Object.assign({_gpxType:"trk"},y(t),p(o(t,"extensions")),n.length?{coordinateProperties:{times:a?n:n[0]}}:{});for(const t of s){r.push(t.line),l.coordinateProperties||(l.coordinateProperties={});const e=l.coordinateProperties,i=Object.entries(t.extendedValues);for(let t=0;tnew Array(t.line.length).fill(null)))),e[r][t]=n):e[r]=n}}return{type:"Feature",properties:l,geometry:a?{type:"MultiLineString",coordinates:r}:{type:"LineString",coordinates:r[0]}}}function _(t){const e=Object.assign(y(t),u(t,["sym"])),r=A(t);return r?{type:"Feature",properties:e,geometry:{type:"Point",coordinates:r.coordinates}}:null}function*w(t){for(const e of i(t,"trk")){const t=b(e);t&&(yield t)}for(const e of i(t,"rte")){const t=x(e);t&&(yield t)}for(const e of i(t,"wpt")){const t=_(e);t&&(yield t)}}function E(t){return{type:"FeatureCollection",features:Array.from(w(t))}}function M(t,e){const r={},i="stroke"==e||"fill"===e?e:e+"-color";return"#"===t[0]&&(t=t.substring(1)),6===t.length||3===t.length?r[i]="#"+t:8===t.length&&(r[e+"-opacity"]=parseInt(t.substring(0,2),16)/255,r[i]="#"+t.substring(6,8)+t.substring(4,6)+t.substring(2,4)),r}function S(t,e,r){const i={};return h(t,e,(t=>{i[r]=t})),i}function C(t,e){return a(t,"color",(t=>M(s(t),e)))}function T(t){return a(t,"Icon",((t,e)=>(l(t,"href",(t=>{e.icon=t})),e)))}function I(t){return Object.assign({},function(t){return a(t,"PolyStyle",((t,e)=>Object.assign(e,a(t,"color",(t=>M(s(t),"fill"))),l(t,"fill",(t=>{if("0"===t)return{"fill-opacity":0}})),l(t,"outline",(t=>{if("0"===t)return{"stroke-opacity":0}})))))}(t),function(t){return a(t,"LineStyle",(t=>Object.assign(C(t,"stroke"),S(t,"width","stroke-width"))))}(t),function(t){return a(t,"LabelStyle",(t=>Object.assign(C(t,"label"),S(t,"scale","label-scale"))))}(t),function(t){return a(t,"IconStyle",(t=>Object.assign(C(t,"icon"),S(t,"scale","icon-scale"),S(t,"heading","icon-heading"),a(t,"hotSpot",(t=>{const e=parseFloat(t.getAttribute("x")||""),r=parseFloat(t.getAttribute("y")||""),i=t.getAttribute("xunits")||"",n=t.getAttribute("yunits")||"";return isNaN(e)||isNaN(r)?{}:{"icon-offset":[e,r],"icon-offset-units":[i,n]}})),T(t))))}(t))}r.d(e,{DS:()=>J,ng:()=>E});const R=t=>Number(t),B={string:t=>t,int:R,uint:R,short:R,ushort:R,float:R,double:R,bool:t=>Boolean(t)};function L(t,e){return a(t,"ExtendedData",((t,r)=>{for(const e of i(t,"Data"))r[e.getAttribute("name")||""]=s(o(e,"value"));for(const n of i(t,"SimpleData")){const t=n.getAttribute("name")||"",i=e[t]||B.string;r[t]=i(s(n))}return r}))}function P(t){const e=o(t,"description");for(const t of Array.from(e?.childNodes||[]))if(4===t.nodeType)return{description:{"@type":"html",value:s(t)}};return{}}function D(t){return a(t,"TimeSpan",(t=>({timespan:{begin:s(o(t,"begin")),end:s(o(t,"end"))}})))}function O(t){return a(t,"TimeStamp",(t=>({timestamp:s(o(t,"when"))})))}function k(t,e){return l(t,"styleUrl",(t=>(t=n(t),e[t]?Object.assign({styleUrl:t},e[t]):{styleUrl:t})))}const U=/\s*/g,N=/^\s*|\s*$/g,F=/\s+/;function z(t){return t.replace(U,"").split(",").map(parseFloat).filter((t=>!isNaN(t))).slice(0,3)}function G(t){return t.replace(N,"").split(F).map(z).filter((t=>t.length>=2))}function Q(t){let e=i(t,"coord");var r;0===e.length&&(r=t,"coord","*",e=Array.from(r.getElementsByTagNameNS("*","coord")));const n=e.map((t=>s(t).split(" ").map(parseFloat)));return 0===n.length?null:{geometry:n.length>2?{type:"LineString",coordinates:n}:{type:"Point",coordinates:n[0]},times:i(t,"when").map((t=>s(t)))}}function j(t){if(0===t.length)return t;const e=t[0],r=t[t.length-1];let i=!0;for(let t=0;t=2&&e.push({type:"Point",coordinates:t});break}case"LinearRing":case"LineString":{const t=G(V(s));t.length>=2&&e.push({type:"LineString",coordinates:t});break}case"Polygon":{const t=[];for(const e of i(s,"LinearRing")){const r=j(G(V(e)));r.length>=4&&t.push(r)}t.length&&e.push({type:"Polygon",coordinates:t});break}case"Track":case"gx:Track":{const t=Q(s);if(!t)break;const{times:i,geometry:n}=t;e.push(n),i.length&&r.push(i);break}}}return{geometries:e,coordTimes:r}}function W(t,e,r,i){const{coordTimes:n,geometries:s}=H(t),o=function(t){return 0===t.length?null:1===t.length?t[0]:{type:"GeometryCollection",geometries:t}}(s);if(!o&&i.skipNullGeometry)return null;const a={type:"Feature",geometry:o,properties:Object.assign(u(t,["name","address","visibility","open","phoneNumber","description"]),P(t),k(t,e),I(t),L(t,r),D(t),O(t),n.length?{coordinateProperties:{times:1===n.length?n[0]:n}}:{})};void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=t.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}const q=Math.PI/180;function Z(t,e,r,i){const n=function(t){return o(t,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[j(G(V(t)))]}}:function(t){const e=o(t,"LatLonBox");if(e){const t=h(e,"north"),r=h(e,"west"),i=h(e,"east"),n=h(e,"south"),s=h(e,"rotation");if("number"==typeof t&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i){const e=[r,n,i,t];let o=[[[r,t],[i,t],[i,n],[r,n],[r,t]]];return"number"==typeof s&&(o=function(t,e,r){const i=[(t[0]+t[2])/2,(t[1]+t[3])/2];return[e[0].map((t=>{const e=t[1]-i[1],n=t[0]-i[0],s=Math.sqrt(Math.pow(e,2)+Math.pow(n,2)),o=Math.atan2(e,n)+r*q;return[i[0]+Math.cos(o)*s,i[1]+Math.sin(o)*s]}))]}(e,o,s)),{bbox:e,geometry:{type:"Polygon",coordinates:o}}}}return null}(t)}(t),s=n?.geometry||null;if(!s&&i.skipNullGeometry)return null;const a={type:"Feature",geometry:s,properties:Object.assign({"@geometry-type":"groundoverlay"},u(t,["name","address","visibility","open","phoneNumber","description"]),P(t),k(t,e),I(t),T(t),L(t,r),D(t),O(t))};n?.bbox&&(a.bbox=n.bbox),void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=t.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}function Y(t){let e=t.getAttribute("id");const r=t.parentNode;return!e&&d(r)&&"CascadingStyle"===r.localName&&(e=r.getAttribute("kml:id")||r.getAttribute("id")),n(e||"")}function*X(t,e={skipNullGeometry:!1}){const r=function(t){const e={};for(const r of i(t,"Style"))e[Y(r)]=I(r);for(const r of i(t,"StyleMap")){const t=n(r.getAttribute("id")||"");l(r,"styleUrl",(r=>{r=n(r),e[r]&&(e[t]=e[r])}))}return e}(t),s=function(t){const e={};for(const r of i(t,"SimpleField"))e[r.getAttribute("name")||""]=B[r.getAttribute("type")||""]||B.string;return e}(t);for(const n of i(t,"Placemark")){const t=W(n,r,s,e);t&&(yield t)}for(const n of i(t,"GroundOverlay")){const t=Z(n,r,s,e);t&&(yield t)}}function J(t,e={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(X(t,e))}}},61861:(t,e,r)=>{"use strict";r.d(e,{Q:()=>Y,Z:()=>lt});var i=r(99477);const n=1e3/60,s=function(t){t.id&&(clearInterval(t.id),t.id=void 0),t.waitTimer&&(clearInterval(t.waitTimer),t.waitTimer=void 0),t.keyframe=0},o=function(t){s(t),t.isEnded()&&t.dispatchEvent({type:"animation-ended"}),t.dispatchEvent({type:"animation-stopped"}),t.duration=0};class a extends i.EventDispatcher{constructor(){super(),this.id=null,this.keyframe=0,this.duration=0,this.state=0,this.waitTimer=null,this.callback=()=>{}}isPlaying(){return 1===this.state}isStopped(){return 0===this.state}isEnded(){return 2===this.state}setCallback(t){this.callback=t}play(t){this.duration=t,this.dispatchEvent({type:"animation-started"}),this.state=1,s(this),this.id=setInterval(this.frame.bind(this),n)}playLater(t,e){const r=Math.floor(n*e);window.clearInterval(this.waitTimer);const i=this;this.waitTimer=window.setTimeout((()=>{i.play(t)}),r)}stop(){this.state=0,o(this)}frame(){this.keyframe1&&void 0!==arguments[1]?arguments[1]:{};super(),this._view=t,this._domElement=t.domElement;let r=!0;Object.defineProperty(this,"enabled",{get:()=>r,set:t=>{t||(this.onKeyUp(),this.onPointerUp()),r=t}});let n=!0;Object.defineProperty(this,"enableKeys",{get:()=>n,set:t=>{t||this.onKeyUp(),n=t}}),this.NONE={};let s=this.NONE;Object.defineProperty(this,"currentState",{get:()=>s,set:t=>{if(s!==t){const e=s;s=t,this.dispatchEvent({type:"state-changed",viewCoords:p,previous:e})}}}),this._clickTimeStamp=0,this._lastMousePressed={viewCoords:new i.Vector2},this._currentMousePressed=void 0,this._currentKeyPressed=void 0,this._onPointerDown=this.onPointerDown.bind(this),this._onPointerMove=this.onPointerMove.bind(this),this._onPointerUp=this.onPointerUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onBlur=this.onBlur.bind(this),this._onContextMenu=this.onContextMenu.bind(this),this._domElement.addEventListener("pointerdown",this._onPointerDown,!1),this._domElement.addEventListener("wheel",this._onMouseWheel,!1),this._domElement.addEventListener("keydown",this._onKeyDown,!1),this._domElement.addEventListener("keyup",this._onKeyUp,!1),this._domElement.addEventListener("blur",this._onBlur),this._domElement.addEventListener("contextmenu",this._onContextMenu,!1),this.setFromOptions(e)}inputToState(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const i of Object.keys(d)){const n=this[i];if(n.enable&&n.mouseButton===t&&n.keyboard===e&&n.double===r){if(!n._trigger)return n;this.dispatchEvent({type:n._event,viewCoords:void 0!==t&&p,direction:n._direction})}}return this.NONE}touchToState(t){for(const e of Object.keys(d)){const r=this[e];if(r.enable&&t==r.finger)return r}return this.NONE}setFromOptions(t){for(const e in d)if({}.hasOwnProperty.call(d,e)){let r={};r=t[e]||this[e]||Object.assign(r,d[e]),t[e]&&void 0===t[e].enable&&(r.enable=this[e].enable),r.double=!!r.double,r._event=d[e]._event,r._trigger=d[e]._trigger,r._direction=d[e]._direction,this[e]=r}}onPointerDown(t){this.enabled&&(p.copy(this._view.eventToViewCoords(t)),"mouse"===t.pointerType&&(this._currentMousePressed=t.button,void 0===this._currentKeyPressed&&(t.ctrlKey?this._currentKeyPressed=17:t.shiftKey?this._currentKeyPressed=16:t.metaKey&&(this._currentKeyPressed=91)),this.currentState=this.inputToState(this._currentMousePressed,this._currentKeyPressed,t.timeStamp-this._clickTimeStamp<500&&this._lastMousePressed.button===this._currentMousePressed&&this._lastMousePressed.viewCoords.distanceTo(p)<5),this._clickTimeStamp=t.timeStamp,this._lastMousePressed.button=this._currentMousePressed,this._lastMousePressed.viewCoords.copy(p)),this._domElement.addEventListener("pointermove",this._onPointerMove,!1),this._domElement.addEventListener("pointerup",this._onPointerUp,!1),this._domElement.addEventListener("mouseleave",this._onPointerUp,!1))}onPointerMove(t){t.preventDefault(),this.enabled&&(p.copy(this._view.eventToViewCoords(t)),"mouse"===t.pointerType)&&this.dispatchEvent({type:this.currentState._event,viewCoords:p})}onPointerUp(){this.enabled&&(this._currentMousePressed=void 0,this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("mouseleave",this._onPointerUp,!1),this.currentState=this.NONE)}onMouseWheel(t){t.preventDefault(),this.enabled&&this.ZOOM.enable&&this.dispatchEvent({type:this.ZOOM._event,delta:t.deltaY})}onKeyDown(t){this.enabled&&this.enableKeys&&(this._currentKeyPressed=t.keyCode,this.inputToState(this._currentMousePressed,this._currentKeyPressed))}onKeyUp(){this.enabled&&this.enableKeys&&(this._currentKeyPressed=void 0,void 0===this._currentMousePressed&&(this.currentState=this.NONE))}onBlur(){this.onKeyUp(),this.onPointerUp()}onContextMenu(t){t.preventDefault()}dispose(){this._clickTimeStamp=0,this._lastMousePressed=void 0,this._currentKeyPressed=void 0,this._domElement.removeEventListener("pointerdown",this._onPointerDown,!1),this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("wheel",this._onMouseWheel,!1),this._domElement.removeEventListener("keydown",this._onKeyDown,!1),this._domElement.removeEventListener("keyup",this._onKeyUp,!1),this._domElement.removeEventListener("blur",this._onBlur),this._domElement.removeEventListener("contextmenu",this._onContextMenu,!1)}}const m=f;var g=r(73502);const A=1e-6,y={up:new i.Vector2(0,1),bottom:new i.Vector2(0,-1),left:new i.Vector2(1,0),right:new i.Vector2(-1,0)},v=new i.Vector2,x=new i.Vector2,b=new i.Vector2,_=new i.Spherical(1,.01,0),w=new i.Spherical(1,0,0);let E=1;const M=new i.Vector2,S=new i.Vector2,C=new i.Vector2,T=new i.Vector3,I=new i.Vector2,R=new i.Vector2,B=new i.Vector2;let L;const P=new i.Quaternion,D=new i.Object3D,O=new c.Z("EPSG:4978");D.matrixWorldInverse=new i.Matrix4;const k=new c.Z("EPSG:4978",0,0,0),U=new c.Z("EPSG:4326",0,0,0);function N(t,e){k.setFromVector3(t).as("EPSG:4326",U),e.position.copy(t),e.lookAt(U.geodesicNormal.add(t)),e.rotateX(.5*Math.PI),e.updateMatrixWorld(!0)}let F=0,z=!0;const G=new i.Quaternion(0,0,0,1),Q=new i.Vector3,j=new i.Vector3,V=new i.Quaternion,H=new i.Sphere,W=new i.Vector3,q=new i.Vector3,Z={},Y={PAN_CHANGED:"pan-changed",ORIENTATION_CHANGED:"orientation-changed",RANGE_CHANGED:"range-changed",CAMERA_TARGET_CHANGED:"camera-target-changed"},X=new i.Quaternion,J=new i.Quaternion,K=new i.Vector3(1,0,0);let $=1/0;const tt=new i.Vector3,et=new i.Vector3,rt=new i.Raycaster,it=new i.Vector3,nt=new i.Vector3,st=new i.Sphere;let ot;class at extends i.EventDispatcher{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.player=new l,this.view=t,this.camera=t.camera3D,this.states=new m(this.view),Object.defineProperty(this,"enabled",{get:()=>this.states.enabled,set:t=>{console.warn("GlobeControls.enabled property is deprecated. Use StateControl.enabled instead - which you can access with GlobeControls.states.enabled."),this.states.enabled=t}}),r.zoomSpeed&&(console.warn("Controls zoomSpeed parameter is deprecated. Use zoomFactor instead."),r.zoomFactor=r.zoomFactor||r.zoomSpeed),this.zoomFactor=r.zoomFactor||1.25,this.minDistance=r.minDistance||250,this.maxDistance=r.maxDistance||8*h.c.x,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.rotateSpeed=r.rotateSpeed||.25,this.keyPanSpeed=r.keyPanSpeed||7,this.minPolarAngle=i.MathUtils.degToRad(r.minPolarAngle??.5),this.maxPolarAngle=i.MathUtils.degToRad(r.minPolarAngle??86),this.minAzimuthAngle=r.minAzimuthAngle?i.MathUtils.degToRad(r.minAzimuthAngle):-1/0,this.maxAzimuthAngle=r.maxAzimuthAngle?i.MathUtils.degToRad(r.maxAzimuthAngle):1/0,this.handleCollision=void 0===r.handleCollision||r.handleCollision,this.minDistanceCollision=60,Object.defineProperty(this,"enableKeys",{get:()=>this.states.enableKeys,set:t=>{console.warn("GlobeControls.enableKeys property is deprecated. Use StateControl.enableKeys instead - which you can access with GlobeControls.states.enableKeys."),this.states.enableKeys=t}}),this.enableDamping=!1!==r.enableDamping,this.dampingMoveFactor=null!=r.dampingMoveFactor?r.dampingMoveFactor:.25,this.startEvent={type:"start"},this.endEvent={type:"end"},this.updateHelper=function(){},this._onEndingMove=null,this._onTravel=this.travel.bind(this),this._onTouchStart=this.onTouchStart.bind(this),this._onTouchEnd=this.onTouchEnd.bind(this),this._onTouchMove=this.onTouchMove.bind(this),this._onStateChange=this.onStateChange.bind(this),this._onRotation=this.handleRotation.bind(this),this._onDrag=this.handleDrag.bind(this),this._onDolly=this.handleDolly.bind(this),this._onPan=this.handlePan.bind(this),this._onPanoramic=this.handlePanoramic.bind(this),this._onZoom=this.handleZoom.bind(this),this.states.addEventListener("state-changed",this._onStateChange,!1),this.states.addEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.addEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.addEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.addEventListener(this.states.PAN._event,this._onPan,!1),this.states.addEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.addEventListener("zoom",this._onZoom,!1),this.view.domElement.addEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.addEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.addEventListener("touchmove",this._onTouchMove,!1),this.states.addEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.addEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),t.scene.add(D),e.isExtent?e.center().as("EPSG:4978",k):(e.coord.as("EPSG:4978",k),e.tilt=e.tilt||89.5,e.heading=e.heading||0),N(k,D),this.lookAtCoordinate(e,!1),O.crs=this.view.referenceCrs}get dollyInScale(){return this.zoomFactor}get dollyOutScale(){return 1/this.zoomFactor}get isPaused(){return this.states.currentState===this.states.NONE&&!this.player.isPlaying()}onEndingMove(t){this._onEndingMove&&(this.player.removeEventListener("animation-stopped",this._onEndingMove),this._onEndingMove=null),this.handlingEvent(t)}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.theta-=t}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.phi-=t}panLeft(t){const e=this.camera.matrix.elements;T.fromArray(e),T.multiplyScalar(-t),Q.add(T)}panUp(t){const e=this.camera.matrix.elements;T.fromArray(e,4),T.multiplyScalar(t),Q.add(T)}mouseToPan(t,e){const r=this.view.mainLoop.gfxEngine;if(this.camera.isPerspectiveCamera){let n=this.camera.position.distanceTo(this.getCameraTargetPosition());n*=2*Math.tan(i.MathUtils.degToRad(.5*this.camera.fov)),this.panLeft(t*n/r.width*this.camera.aspect),this.panUp(e*n/r.height)}else this.camera.isOrthographicCamera&&(this.panLeft(t*(this.camera.right-this.camera.left)/r.width),this.panUp(e*(this.camera.top-this.camera.bottom)/r.height))}dolly(t){0!==t&&(L=t>0?this.dollyInScale:this.dollyOutScale,this.camera.isPerspectiveCamera?E/=L:this.camera.isOrthographicCamera&&(this.camera.zoom=i.MathUtils.clamp(this.camera.zoom*L,this.minZoom,this.maxZoom),this.camera.updateProjectionMatrix(),this.view.notifyChange(this.camera)))}getMinDistanceCameraBoundingSphereObbsUp(t){if(t.level>10&&1==t.children.length&&t.geometry){const e=t.obb;st.center.copy(this.camera.position),st.radius=this.minDistanceCollision,e.isSphereAboveXYBox(st)&&($=Math.min(st.center.z-e.box3D.max.z,$))}}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.states.currentState;if($=1/0,this.handleCollision&&this.view.tileLayer)for(const t of this.view.tileLayer.level0Nodes)t.traverse(this.getMinDistanceCameraBoundingSphereObbsUp.bind(this));switch(t){case this.states.MOVE_GLOBE:if($<0)D.translateY(-$),this.camera.position.setLength(this.camera.position.length()-$);else if($r&&w.phi>0){const t=e-r,i=1-(t-($-r))/t;w.phi*=i*i}else if($-r&&w.phi>n){let t=-Math.asin(.25*(r-$)/_.radius);t=i.MathUtils.clamp(t,n,0);const e=1-(r-$)/(2*r);w.phi=i.MathUtils.lerp(w.phi,t,e),$-=Math.sin(w.phi)*_.radius}_.theta+=w.theta,_.phi+=w.phi,_.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,_.theta)),_.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,_.phi)),_.radius=this.camera.position.length()*E,_.makeSafe(),_.radius=Math.max(this.minDistance,Math.min(this.maxDistance,_.radius)),this.camera.position.setFromSpherical(_),$<0&&(this.camera.position.y-=$,_.setFromVector3(this.camera.position),w.phi=0),D.localToWorld(this.camera.position)}}this.camera.up.copy(D.position).normalize(),this.camera.lookAt(D.position),this.enableDamping?(w.theta*=.75,w.phi*=.75,P.slerp(G,.2*this.dampingMoveFactor)):(w.theta=0,w.phi=0,P.set(0,0,0,1)),E=1,Q.set(0,0,0),(j.distanceToSquared(this.camera.position)>A||8*(1-V.dot(this.camera.quaternion))>A)&&(this.view.notifyChange(this.camera),j.copy(this.camera.position),V.copy(this.camera.quaternion)),this.enableDamping&&t===this.states.ORBIT&&this.player.isStopped()&&(w.theta>A||w.phi>A)&&(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.playLater(60,2)),this.view.dispatchEvent({type:g.b.CAMERA_MOVED,coord:O.setFromVector3(D.position),range:_.radius,heading:-i.MathUtils.radToDeg(_.theta),tilt:90-i.MathUtils.radToDeg(_.phi)})}onStateChange(t){this.states.currentState!==this.states.NONE?(u.ZP.stop(this.view,this.camera),this.onEndingMove(),this.player.stop(),this.updateTarget(),ot=u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,nt),v.copy(t.viewCoords),this.view.getPickingPositionFromDepth(t.viewCoords,W)&&(H.radius=W.length(),tt.copy(W).normalize(),this.updateHelper(W,Z.picking)),I.copy(t.viewCoords),M.copy(t.viewCoords)):this.handleEndMovement(t)}handleRotation(t){this.player.stop(),this.handlePanoramic(t)}handleDrag(t){const e=this.view.viewToNormalizedCoords(t.viewCoords);this.camera.updateMatrixWorld(),rt.setFromCamera(e,this.camera),rt.ray.intersectSphere(H,q)?(et.copy(q).normalize(),P.setFromUnitVectors(et,tt),F=Date.now(),this.update()):this.states.onPointerUp()}handleDolly(t){R.copy(t.viewCoords),B.subVectors(R,I),this.dolly(-B.y),I.copy(R),this.update()}handlePan(t){t.viewCoords?(S.copy(t.viewCoords),C.subVectors(S,M),M.copy(S)):t.direction&&C.copy(y[t.direction]).multiplyScalar(this.keyPanSpeed),this.mouseToPan(C.x,C.y),this.update(this.states.PAN)}handlePanoramic(t){x.copy(t.viewCoords),b.subVectors(x,v);const e=this.view.mainLoop.gfxEngine;w.theta-=2*Math.PI*b.x/e.width*this.rotateSpeed,w.phi-=2*Math.PI*b.y/e.height*this.rotateSpeed,v.copy(x),this.update()}handleEndMovement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dispatchEvent(this.endEvent),this.player.stop(),this.enableDamping?t.previous===this.states.ORBIT&&(w.theta>A||w.phi>A)?(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.play(60),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):t.previous===this.states.MOVE_GLOBE&&Date.now()-F<50?(this.player.setCallback((()=>{this.update(this.states.MOVE_GLOBE)})),this.player.play(120),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):this.onEndingMove():this.onEndingMove()}updateTarget(){if(this.view.getPickingPositionFromDepth(null,nt)){const t=isNaN(nt.x)?100:this.camera.position.distanceTo(nt);it.set(0,0,-t),this.camera.localToWorld(it),N(it,D),D.matrixWorldInverse.copy(D.matrixWorld).invert(),it.copy(this.camera.position),it.applyMatrix4(D.matrixWorldInverse),_.setFromVector3(it)}}handlingEvent(t){t=t||u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera);const e=u.ZP.getDiffParams(ot,t);if(e&&(e.range&&this.dispatchEvent({type:Y.RANGE_CHANGED,previous:e.range.previous,new:e.range.new}),e.coord&&this.dispatchEvent({type:Y.CAMERA_TARGET_CHANGED,previous:e.coord.previous,new:e.coord.new}),e.tilt||e.heading)){const t={type:Y.ORIENTATION_CHANGED};e.tilt&&(t.previous={tilt:e.tilt.previous},t.new={tilt:e.tilt.new}),e.heading&&(t.previous=t.previous||{},t.new=t.new||{},t.new.heading=e.heading.new,t.previous.heading=e.heading.previous),this.dispatchEvent(t)}}travel(t){this.player.stop();const e=this.view.getPickingPositionFromDepth(t.viewCoords),r=this.getRange(e);if(e&&r>this.minDistance)return this.lookAtCoordinate({coord:new c.Z("EPSG:4978",e),range:r*("out"===t.direction?1/.6:.6),time:1500})}handleZoom(t){this.player.stop(),u.ZP.stop(this.view,this.camera),this.updateTarget();const e=-t.delta;this.dolly(e);const r=this.getRange(nt);this.update();const i=this.getRange(nt);Math.abs(i-r)/r>.001&&this.dispatchEvent({type:Y.RANGE_CHANGED,previous:r,new:i}),this.dispatchEvent(this.startEvent),this.dispatchEvent(this.endEvent)}onTouchStart(t){if(this.player.stop(),!1!==this.states.enabled&&(this.state=this.states.touchToState(t.touches.length),this.updateTarget(),this.state!==this.states.NONE)){switch(this.state){case this.states.MOVE_GLOBE:{const e=this.view.eventToViewCoords(t);this.view.getPickingPositionFromDepth(e,W)?(H.radius=W.length(),tt.copy(W).normalize(),this.updateHelper(W,Z.picking)):this.state=this.states.NONE;break}case this.states.ORBIT:case this.states.DOLLY:{const e=t.touches[0].pageX,r=t.touches[0].pageY,i=e-t.touches[1].pageX,n=r-t.touches[1].pageY,s=Math.sqrt(i*i+n*n);I.set(0,s),v.set(e,r);break}case this.states.PAN:M.set(t.touches[0].pageX,t.touches[0].pageY)}this.dispatchEvent(this.startEvent)}}onTouchMove(t){if(this.player.isPlaying()&&this.player.stop(),!1!==this.states.enabled){switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case this.states.MOVE_GLOBE.finger:{const e=this.view.eventToViewCoords(t),r=this.view.viewToNormalizedCoords(e);this.camera.updateMatrixWorld(),rt.setFromCamera(r,this.camera),rt.ray.intersectSphere(H,q)?(et.copy(q).normalize(),P.setFromUnitVectors(et,tt),F=Date.now()):this.onTouchEnd();break}case this.states.ORBIT.finger:case this.states.DOLLY.finger:{const e=this.view.mainLoop.gfxEngine;x.set(t.touches[0].pageX,t.touches[0].pageY),b.subVectors(x,v),this.rotateLeft(2*Math.PI*b.x/e.width*this.rotateSpeed),this.rotateUp(2*Math.PI*b.y/e.height*this.rotateSpeed),v.copy(x);const r=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(r*r+i*i);R.set(0,n),B.subVectors(R,I),this.dolly(B.y),I.copy(R);break}case this.states.PAN.finger:S.set(t.touches[0].pageX,t.touches[0].pageY),C.subVectors(S,M),this.mouseToPan(C.x,C.y),M.copy(S);break;default:this.state=this.states.NONE}this.state!==this.states.NONE&&this.update(this.state)}}onTouchEnd(){this.handleEndMovement({previous:this.state}),this.state=this.states.NONE}dispose(){this.view.domElement.removeEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.removeEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.removeEventListener("touchmove",this._onTouchMove,!1),this.states.dispose(),this.states.removeEventListener("state-changed",this._onStateChange,!1),this.states.removeEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.removeEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.removeEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.removeEventListener(this.states.PAN._event,this._onPan,!1),this.states.removeEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.removeEventListener("zoom",this._onZoom,!1),this.states.removeEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.removeEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),this.dispatchEvent({type:"dispose"})}setTilt(t,e){return this.lookAtCoordinate({tilt:t},e)}setHeading(t,e){return this.lookAtCoordinate({heading:t},e)}setRange(t,e){return this.lookAtCoordinate({range:t},e)}getCameraTargetPosition(){return D.position}getRange(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).range}getTilt(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).tilt}getHeading(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).heading}pan(t){return this.mouseToPan(t.x,t.y),this.update(this.states.PAN),Promise.resolve()}getCameraOrientation(){return this.view.getPickingPositionFromDepth(null,nt),[this.getTilt(nt),this.getHeading(nt)]}getCameraCoordinate(){return new c.Z("EPSG:4978",this.camera.position).as("EPSG:4326")}getLookAtCoordinate(){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera).coord}setAnimationEnabled(t){z=t}isAnimationEnabled(){return z}getZoom(){return this.view.tileLayer.computeTileZoomFromDistanceCamera(this.getRange(),this.view.camera)}setZoom(t,e){return this.lookAtCoordinate({zoom:t},e)}getScale(t){return console.warn("Deprecated, use View#getScale instead."),this.view.getScale(t)}pixelsToMeters(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;return console.warn("Deprecated use View#getPixelsToMeters instead."),t*e/this.getScale(e)/1e3}pixelsToDegrees(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.");const r=this.pixelsToMeters(t,e);return i.MathUtils.radToDeg(2*Math.asin(r/(2*h.c.x)))}metersToPixels(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getMetersToPixels instead.");const r=this.getScale(e);return e/=1e3,t*r/e}setScale(t,e,r){return this.lookAtCoordinate({scale:t,pitch:e},r)}lookAtCoordinate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isAnimationEnabled();if(this.player.stop(),!t.isExtent&&(t.zoom?t.range=this.view.tileLayer.computeDistanceCameraFromTileZoom(t.zoom,this.view.camera):t.scale&&(t.range=this.view.getScaleFromDistance(t.pitch,t.scale),(t.rangethis.maxDistance)&&(console.warn(`This scale ${t.scale} can not be reached`),t.range=i.MathUtils.clamp(t.range,this.minDistance,this.maxDistance))),void 0!==t.tilt)){const e=90-i.MathUtils.radToDeg(this.maxPolarAngle),r=90-i.MathUtils.radToDeg(this.minPolarAngle);(t.tiltr)&&(t.tilt=i.MathUtils.clamp(t.tilt,e,r),console.warn("Tilt was clamped to ",t.tilt,` the interval is between ${e} and ${r} degree`))}return ot=u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera),e?(t.callback=t=>D.position.copy(t.targetWorldPosition),this.dispatchEvent({type:"animation-started"}),u.ZP.animateCameraToLookAtTarget(this.view,this.camera,t).then((t=>(this.dispatchEvent({type:"animation-ended"}),this.handlingEvent(t),t)))):u.ZP.transformCameraToLookAtTarget(this.view,this.camera,t).then((t=>(D.position.copy(t.targetWorldPosition),this.handlingEvent(t),t)))}pickGeoPosition(t){const e=this.view.getPickingPositionFromDepth(t);if(e)return new c.Z("EPSG:4978",e).as("EPSG:4326")}}const lt=at},29571:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>Q,uZ:()=>z});var i=r(99477),n=r(99617);const s=i.MOUSE.LEFT,o=i.MOUSE.MIDDLE,a=i.MOUSE.RIGHT;let l;const c=new i.Vector3,h=new i.Quaternion;let u=0;const d=new i.Vector3,p=-1,f={default:"auto",drag:"move",pan:"cell",travel:"wait",rotate:"move",ortho_zoom:"wait"},m=new i.Vector3,g=new i.Vector2,A=new i.Vector2,y=new i.Vector2(0,0),v=new i.Vector3,x=new i.Vector3,b=new i.Vector3,_=new i.Vector3(0,0,0);let w=0;const E=new i.Vector3,M=new i.Quaternion,S=new i.Vector2,C=new i.Vector3,T=new i.Vector3,I=new i.Quaternion,R=new i.Quaternion;let B=0,L=0,P=!1,D=!1,O=0,k=0;const U=new i.Raycaster,N=new i.Plane(new i.Vector3(0,0,-1)),F={enabled:!0,enableRotation:!0,rotateSpeed:2,minPanSpeed:.05,maxPanSpeed:15,zoomTravelTime:.2,zoomFactor:2,maxResolution:0,minResolution:1/0,maxAltitude:5e7,groundLevel:200,autoTravelTimeMin:1.5,autoTravelTimeMax:4,autoTravelTimeDist:5e4,smartTravelHeightMin:75,smartTravelHeightMax:500,instantTravel:!1,minZenithAngle:0,maxZenithAngle:82.5,handleCollision:!0,minDistanceCollision:30,enableSmartTravel:!0,enablePan:!0},z={MOVED:"moved"};class G extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.camera=t.camera3D,this.enabled="boolean"==typeof e.enabled?e.enabled:F.enabled,this.camera.isOrthographicCamera?(u=this.camera.zoom,this.enableRotation=!1,this.enablePan=!1,this.maxAltitude=1/0,this.zoomTravelTime="number"==typeof e.zoomTravelTime?e.zoomTravelTime:F.zoomTravelTime):(this.enableRotation=void 0===e.enableRotation?F.enableRotation:e.enableRotation,this.rotateSpeed=e.rotateSpeed||F.rotateSpeed,this.enablePan=void 0===e.enablePan?F.enablePan:e.enablePan,this.minPanSpeed=e.minPanSpeed||F.minPanSpeed,this.maxPanSpeed=e.maxPanSpeed||F.maxPanSpeed,this.maxAltitude=e.maxAltitude||F.maxAltitude,this.zoomTravelTime=e.zoomTravelTime||F.zoomTravelTime),e.zoomInFactor&&(console.warn("Controls zoomInFactor parameter is deprecated. Use zoomFactor instead."),e.zoomFactor=e.zoomFactor||e.zoomInFactor),e.zoomOutFactor&&(console.warn("Controls zoomOutFactor parameter is deprecated. Use zoomFactor instead."),e.zoomFactor=e.zoomFactor||e.zoomInFactor||1/e.zoomOutFactor),0===e.zoomFactor&&(console.warn("Controls zoomFactor parameter can not be equal to 0. Its value will be set to default."),e.zoomFactor=F.zoomFactor),this.zoomInFactor=e.zoomFactor||F.zoomFactor,this.zoomOutFactor=1/(e.zoomFactor||F.zoomFactor),this.maxResolution=e.maxResolution||F.maxResolution,this.minResolution=e.minResolution||F.minResolution,this.groundLevel=e.groundLevel||F.groundLevel,this.autoTravelTimeMin=e.autoTravelTimeMin||F.autoTravelTimeMin,this.autoTravelTimeMax=e.autoTravelTimeMax||F.autoTravelTimeMax,this.autoTravelTimeDist=e.autoTravelTimeDist||F.autoTravelTimeDist,e.smartZoomHeightMin&&(console.warn("Controls smartZoomHeightMin parameter is deprecated. Use smartTravelHeightMin instead."),e.smartTravelHeightMin=e.smartTravelHeightMin||e.smartZoomHeightMin),e.smartZoomHeightMax&&(console.warn("Controls smartZoomHeightMax parameter is deprecated. Use smartTravelHeightMax instead."),e.smartTravelHeightMax=e.smartTravelHeightMax||e.smartZoomHeightMax),this.smartTravelHeightMin=e.smartTravelHeightMin||F.smartTravelHeightMin,this.smartTravelHeightMax=e.smartTravelHeightMax||F.smartTravelHeightMax,this.instantTravel=e.instantTravel||F.instantTravel,this.minZenithAngle=(e.minZenithAngle||F.minZenithAngle)*Math.PI/180,this.maxZenithAngle=(e.maxZenithAngle||F.maxZenithAngle)*Math.PI/180,e.focusOnMouseOver&&console.warn("Planar controls 'focusOnMouseOver' optional parameter has been removed."),e.focusOnMouseClick&&console.warn("Planar controls 'focusOnMouseClick' optional parameter has been removed."),this.handleCollision=void 0===e.handleCollision?F.handleCollision:e.handleCollision,this.minDistanceCollision=F.minDistanceCollision,this.enableSmartTravel=void 0===e.enableSmartTravel?F.enableSmartTravel:e.enableSmartTravel,c.copy(this.camera.position),h.copy(this.camera.quaternion),this.state=p,this.cursor=f,this.view.controls&&(console.warn("Deprecated use of PlanarControls. See examples to correct PlanarControls implementation."),this.view.controls.dispose()),this.view.controls=this,this._handlerOnKeyDown=this.onKeyDown.bind(this),this._handlerOnMouseDown=this.onMouseDown.bind(this),this._handlerOnMouseUp=this.onMouseUp.bind(this),this._handlerOnMouseMove=this.onMouseMove.bind(this),this._handlerOnMouseWheel=this.onMouseWheel.bind(this),this._handlerContextMenu=this.onContextMenu.bind(this),this._handlerUpdate=this.update.bind(this),this.view.addFrameRequester(n.Ao.AFTER_CAMERA_UPDATE,this._handlerUpdate),this.addInputListeners()}dispose(){this.removeInputListeners(),this.view.removeFrameRequester(n.Ao.AFTER_CAMERA_UPDATE,this._handlerUpdate)}update(t,e){e&&(t=16);const r=this.state!==p;switch(this.state){case 3:this.handleTravel(t),this.view.notifyChange(this.camera);break;case 4:this.handleZoomOrtho(t),this.view.notifyChange(this.camera);break;case 0:this.handleDragMovement(),this.view.notifyChange(this.camera);break;case 2:this.handleRotation(),this.view.notifyChange(this.camera);break;case 1:this.handlePanMovement(),this.view.notifyChange(this.camera)}this.handleCollision&&this.view.camera.adjustAltitudeToAvoidCollisionWithLayer(this.view,this.view.tileLayer,this.minDistanceCollision),r&&this.view.dispatchEvent({type:z.MOVED}),y.set(0,0)}initiateDrag(){this.state=0,v.copy(this.getWorldPointAtScreenXY(g)),b.set(0,0,0)}handleDragMovement(){this.getWorldPointFromMathPlaneAtScreenXY(g,v.z,x),b.subVectors(v,x),this.camera.position.add(b),b.set(0,0,0)}initiatePan(){this.state=1}handlePanMovement(){E.set(-y.x,y.y,0),this.camera.localToWorld(E),this.camera.position.copy(E)}initiateRotation(){this.state=2,_.copy(this.getWorldPointAtScreenXY(new i.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height)));const t=this.camera.position.distanceTo(_);w=Math.acos((this.camera.position.z-_.z)/t)}handleRotation(){const t=-this.rotateSpeed*y.x/this.view.mainLoop.gfxEngine.width,e=-this.rotateSpeed*y.y/this.view.mainLoop.gfxEngine.height,r=this.camera.position.clone().sub(_);0===t&&0===e||(w+e>=this.minZenithAngle&&w+e<=this.maxZenithAngle&&0!==e&&(w+=e,E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E),r.applyQuaternion(M),E.setFromMatrixColumn(this.camera.matrix,0),M.setFromAxisAngle(E,e),r.applyQuaternion(M),E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E).invert(),r.applyQuaternion(M)),0!==t&&(E.set(0,0,1),M.setFromAxisAngle(E,t),r.applyQuaternion(M))),this.camera.position.copy(r),this.camera.lookAt(m),this.camera.position.add(_),this.camera.updateMatrixWorld()}initiateZoom(t){const e=-t.deltaY;d.copy(this.getWorldPointAtScreenXY(g));const r=new i.Vector3;if(e>0||e<0&&this.maxAltitude>this.camera.position.z){const t=e>0?this.zoomInFactor:this.zoomOutFactor,i=this.view.getPixelsToMeters()/t;if(this.maxResolution>i||i>this.minResolution)return;this.camera.isOrthographicCamera?(this.state=4,this.view.notifyChange(this.camera),O=this.camera.zoom,k=O*t,d.z=this.camera.position.z,B=0,L=this.zoomTravelTime,this.updateMouseCursorType()):(r.lerpVectors(this.camera.position,d,1-1/t),this.initiateTravel(r,this.zoomTravelTime,null,!1))}}handleZoomOrtho(t){B=Math.min(B+t/1e3/L,1);const e=O+B*(k-O);this.camera.zoom!==e&&(this.camera.zoom=e,this.camera.updateProjectionMatrix(),this.view.viewToNormalizedCoords(g,E),E.z=0,E.unproject(this.camera),this.camera.position.x+=d.x-E.x,this.camera.position.y+=d.y-E.y,this.camera.updateMatrixWorld(!0)),this.testAnimationEnd()}initiateSmartTravel(){const t=this.getWorldPointAtScreenXY(g),e=new i.Vector3;e.copy(t).sub(this.camera.position),e.z=0,e.normalize();const r=this.camera.position.distanceTo(t),n=i.MathUtils.lerp(this.smartTravelHeightMin,this.smartTravelHeightMax,Math.min(r/5e3,1)),s=new i.Vector3;s.copy(t),this.enableRotation&&s.add(e.multiplyScalar(2*-n)),s.z=t.z+n,this.camera.isOrthographicCamera&&(O=this.camera.zoom,k=O*(1+Math.min(r/5e3,1)),s.z=this.camera.position.z),this.initiateTravel(s,"auto",t,!0)}initiateTravel(t,e,r,n){if(this.state=3,this.view.notifyChange(this.camera),B=0,this.updateMouseCursorType(),P=this.enableRotation&&r&&(r.isQuaternion||r.isVector3),D=n,T.copy(this.camera.position),I.copy(this.camera.quaternion),P&&(r.isQuaternion?R.copy(r):r.isVector3&&(t===r?(this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I)):(this.camera.position.copy(t),this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I),this.camera.position.copy(T)))),C.copy(t),this.instantTravel)L=0;else if("auto"===e){const e=Math.min(1,t.distanceTo(this.camera.position)/this.autoTravelTimeDist);if(L=i.MathUtils.lerp(this.autoTravelTimeMin,this.autoTravelTimeMax,e),P){const t=.5-.5*R.normalize().dot(this.camera.quaternion.normalize());L*=1+2*t,L=Math.min(L,this.autoTravelTimeMax)}}else L=e}handleTravel(t){B=Math.min(B+t/1e3/L,1);const e=D?this.smooth(B):B;this.camera.position.lerpVectors(T,C,e);const r=O+e*(k-O);this.camera.isOrthographicCamera&&this.camera.zoom!==r&&(this.camera.zoom=r,this.camera.updateProjectionMatrix()),!0===P&&this.camera.quaternion.slerpQuaternions(I,R,e),this.testAnimationEnd()}testAnimationEnd(){1===B&&(this.state=p,this.updateMouseCursorType())}goToTopView(){const t=new i.Vector3,e=new i.Quaternion;t.copy(this.getWorldPointAtScreenXY(new i.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height))),t.z+=Math.min(this.maxAltitude,this.camera.position.distanceTo(t)),e.setFromAxisAngle(new i.Vector3(1,0,0),0),this.initiateTravel(t,"auto",e,!0)}goToStartView(){this.camera.isOrthographicCamera&&(O=this.camera.zoom,k=u),this.initiateTravel(c,"auto",h,!0)}getWorldPointFromMathPlaneAtScreenXY(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Vector3;return S.copy(this.view.viewToNormalizedCoords(t)),U.setFromCamera(S,this.camera),N.constant=e,U.ray.intersectPlane(N,r),r}getWorldPointAtScreenXY(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;return this.view.getPickingPositionFromDepth(t,e)||this.getWorldPointFromMathPlaneAtScreenXY(t,this.groundLevel,e),e}addInputListeners(){this.view.domElement.addEventListener("keydown",this._handlerOnKeyDown,!1),this.view.domElement.addEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.addEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.addEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.addEventListener("contextmenu",this._handlerContextMenu,!1)}removeInputListeners(){this.view.domElement.removeEventListener("keydown",this._handlerOnKeyDown,!0),this.view.domElement.removeEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.removeEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.removeEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._handlerContextMenu,!1)}updateMouseCursorType(){switch(this.state){case p:this.view.domElement.style.cursor=this.cursor.default;break;case 0:this.view.domElement.style.cursor=this.cursor.drag;break;case 1:this.view.domElement.style.cursor=this.cursor.pan;break;case 3:this.view.domElement.style.cursor=this.cursor.travel;break;case 4:this.view.domElement.style.cursor=this.cursor.ortho_zoom;break;case 2:this.view.domElement.style.cursor=this.cursor.rotate}}updateMousePositionAndDelta(t){this.view.eventToViewCoords(t,g),y.copy(g).sub(A),A.copy(g)}setCursor(t,e){this.cursor[t]=e,this.updateMouseCursorType()}onMouseDown(t){if(this.enabled&&(t.preventDefault(),this.view.domElement.focus(),p===this.state)){if(l=t.button,this.updateMousePositionAndDelta(t),s===t.button)if(t.ctrlKey){if(!this.enableRotation)return;this.initiateRotation()}else this.initiateDrag();else if(o===t.button){if(!this.enableSmartTravel)return;this.initiateSmartTravel()}else if(a===t.button){if(!this.enablePan)return;this.initiatePan()}this.updateMouseCursorType()}}onMouseUp(t){t.preventDefault(),3!==this.state&&4!==this.state&&l===t.button&&(this.state=p),this.updateMouseCursorType()}onMouseMove(t){this.enabled&&(t.preventDefault(),this.updateMousePositionAndDelta(t),p!==this.state&&this.view.notifyChange())}onKeyDown(t){if(p===this.state&&this.enabled)switch(t.keyCode){case 84:this.camera.isOrthographicCamera||this.goToTopView();break;case 89:this.goToStartView();break;case 32:this.enableSmartTravel&&this.initiateSmartTravel(t)}}onMouseWheel(t){this.enabled&&(t.preventDefault(),t.stopPropagation(),p===this.state&&this.initiateZoom(t))}onContextMenu(t){t.preventDefault()}smooth(t){return(t**2*(3-2*t))**1.2}}const Q=G},5626:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var i=r(99477);const n={BYTE:1,UNSIGNED_BYTE:1,SHORT:2,UNSIGNED_SHORT:2,INT:4,UNSIGNED_INT:4,FLOAT:4,DOUBLE:8},s={BYTE:Int8Array,UNSIGNED_BYTE:Uint8Array,SHORT:Int16Array,UNSIGNED_SHORT:Uint16Array,INT:Int32Array,UNSIGNED_INT:Uint32Array,FLOAT:Float32Array,DOUBLE:Float64Array},o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},a={VEC2:i.Vector2,VEC3:i.Vector3,VEC4:i.Vector4},l=function(t,e,r,i,l){if(!t)throw new Error("Buffer is mandatory to parse binary property.");if(null==e)throw new Error("batchLength is mandatory to parse binary property.");if(null==r)throw new Error("byteOffset is mandatory to parse binary property.");if(!n[i])throw new Error(`Uknown component type: ${i}. Cannot access binary property.`);if(!o[l])throw new Error(`Uknown type: ${l}. Cannot access binary property.`);const c=o[l],h=new s[i](t,r,e*c);if("SCALAR"===l)return Array.from(h);{const t=[];for(let e=0;e<=h.length-c;e+=c){const r=new a[l];r.fromArray(h,e),t.push(r)}return t}};var c=r(39865);const h=new TextDecoder,u=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ArrayBuffer,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4?arguments[4]:void 0;4!==arguments.length||"object"!=typeof i||Array.isArray(i)||null===i||console.warn("You most likely used a deprecated constructor of C3DTBatchTable."),e+r!==t.byteLength&&console.error("3DTiles batch table json length and binary length are not consistent with total buffer length. The batch table may be wrong."),this.type=c.h.batchtable,this.batchLength=i;const s=t.slice(0,e),o=h.decode(new Uint8Array(s)),a=""===o?null:JSON.parse(o);if(r>0){const i=t.slice(e,e+r);for(const t in a){if(!Object.prototype.hasOwnProperty.call(a,t))continue;const e=a[t];Array.isArray(e)||(void 0!==(null==e?void 0:e.byteOffset)&&void 0!==(null==e?void 0:e.componentType)&&void 0!==(null==e?void 0:e.type)?a[t]=l(i,this.batchLength,e.byteOffset,e.componentType,e.type):console.error("Invalid 3D Tiles batch table property that is neither a JSON array nor a valid accessor to a binary body"))}}a&&a.extensions&&(this.extensions=n.parseExtensions(a.extensions,this.type),delete a.extensions),this.content=a}getInfoById(t){if(t<0&&t{"use strict";r.d(e,{Z:()=>g});var i=r(99477),n=r(2359),s=r(62310),o=r(39865);const a=new n.Z,l=new i.Vector3,c=new i.Vector3,h=new s.Z("EPSG:4326"),u=new i.Vector3,d=new s.Z("EPSG:4326"),p=new i.Vector3,f=new i.Vector3,m=new i.Vector3,g=class{constructor(t,e,r){if(this.type=o.h.boundingVolume,t.region)this.initialVolumeType=o.D.region,this.volume=function(t,e){const r=t[2],n=t[0],s=t[1],o=t[3],l=t[4],c=t[5],m=i.MathUtils.radToDeg(r),g=i.MathUtils.radToDeg(n),A=i.MathUtils.radToDeg(s),y=i.MathUtils.radToDeg(o);d.setFromValues(g,y,l),a.cartographicToCartesian(d,p),h.setFromValues(m,A,c),a.cartographicToCartesian(h,u);const v=new i.Vector3;v.lerpVectors(p,u,.5);const x=f.subVectors(p,u).length()/2,b=new i.Sphere(v,x);return b.applyMatrix4(e),b}(t.region,e);else if(t.box)this.initialVolumeType=o.D.box,this.volume=function(t){c.set(t[0],t[1],t[2]),l.set(t[3],t[7],t[11]).multiplyScalar(2);const e=new i.Box3;return e.setFromCenterAndSize(c,l),e}(t.box);else{if(!t.sphere)throw new Error(`Unknown bounding volume type: ${t}. 3D Tiles nodes must have a bounding volume of type\n region, box or sphere.`);this.initialVolumeType=o.D.sphere,this.volume=function(t){const e=new i.Vector3;return e.set(t[0],t[1],t[2]),new i.Sphere(e,t[3])}(t.sphere)}t.extensions&&(this.extensions=r.parseExtensions(t.extensions,this.type))}boundingVolumeCulling(t,e){if(this.initialVolumeType===o.D.box)return!t.isBox3Visible(this.volume,e);if(this.initialVolumeType===o.D.sphere||this.initialVolumeType===o.D.region)return!t.isSphereVisible(this.volume,e);throw new Error("Unknown bounding volume type.")}viewerRequestVolumeCulling(t,e){return this.initialVolumeType===o.D.region?(console.warn("Region viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.D.box?(console.warn("Bounding box viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.D.sphere&&(m.copy(this.volume.center),m.applyMatrix4(e),!(t.camera3D.position.distanceTo(m)<=this.volume.radius))}}},83214:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const i=class{registerExtension(t,e){this[t]=e}getExtension(t,e){if(this[t]&&this[t][e])return this[t][e];console.error(`No extension manager registered for extension ${t} and for class ${e}`)}isExtensionRegistered(t){return this[t]}parseExtensions(t,e){const r={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=new(this.getExtension(i,e))(t[i]));return r}}},84607:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var i=r(99477);function n(t){return t.batchTable?t.batchTable:t.parent?n(t.parent):null}const s=class{#t;constructor(t,e,r,i,n){this.object3d=n,this.batchId=e,this.groups=r,this.userData=i,this.tileId=t,this.#t=null}computeWorldBox3(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Box3;return t.max.x=-1/0,t.max.y=-1/0,t.max.z=-1/0,t.min.x=1/0,t.min.y=1/0,t.min.z=1/0,this.groups.forEach((e=>{const r=3*e.start,i=3*(e.start+e.count);for(let e=r;e{"use strict";r.d(e,{D:()=>n,h:()=>i});const i={tileset:"tileset",batchtable:"batchtable",boundingVolume:"boundingVolume"},n={region:"region",box:"box",sphere:"sphere"}},47274:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var i=r(99477),n=r(27245),s=r(39865);const o=new i.Matrix4,a=class{constructor(t,e,r){this.type=s.h.tileset,this.asset=t.asset,this.properties=t.properties,this.geometricError=t.geometricError,this.extensionsUsed=t.extensionsUsed,this.extensionsRequired=t.extensionsRequired,this.tiles=[],this.parseTiles(t.root,e,void 0,r),t.extensions&&(this.extensions=r.parseExtensions(t.extensions,this.type))}parseTiles(t,e,r,s){if(t.transform=t.transform?(new i.Matrix4).fromArray(t.transform):void 0,t._worldFromLocalTransform=t.transform,r&&r._worldFromLocalTransform&&(t.transform?t._worldFromLocalTransform=(new i.Matrix4).multiplyMatrices(r._worldFromLocalTransform,t.transform):t._worldFromLocalTransform=r._worldFromLocalTransform),(t.viewerRequestVolume&&t.viewerRequestVolume.region||t.boundingVolume&&t.boundingVolume.region)&&(t._worldFromLocalTransform?o.copy(t._worldFromLocalTransform).invert():o.identity()),t.viewerRequestVolume=t.viewerRequestVolume?new n.Z(t.viewerRequestVolume,o,s):null,t.boundingVolume=t.boundingVolume?new n.Z(t.boundingVolume,o,s):null,this.tiles.push(t),t.tileId=this.tiles.length-1,t.baseURL=e,t.children)for(const r of t.children)this.parseTiles(r,e,t,s)}extendTileset(t,e,r,i){this.parseTiles(t.root,r,this.tiles[e],i),this.tiles[e].children=[t.root],this.tiles[e].isTileset=!0}}},53175:(t,e,r)=>{"use strict";r.d(e,{Dx:()=>a,S_:()=>n,_F:()=>s,ie:()=>o});var i=r(5199);const n=t=>(t.fx&&(console.warn("ColorLayer fx is deprecated, use ColorLayer.effect_type and ColorLayer.effect_parameter instead."),t.fx>2?(t.effect_parameter=t.fx,t.effect_type=i.pO.removeLightColor):t.fx>0&&(t.effect_parameter=t.fx,t.effect_type=i.pO.removeWhiteColor)),t),s=t=>{if(t.crsOut||t.crsIn){console.warn("Parsing options with crsIn and crsOut are deprecated, use { in, out } structure.");const e={in:{},out:{}};return e.in.crs=t.crsIn,e.in.isInverted=t.isInverted,e.in.styles=t.styles,e.in.layers=t.layers,e.in.filter=t.filter,e.out.crs=t.crsOut,e.out.mergeFeatures=t.mergeFeatures,t.withAltitude&&t.withNormal?(console.warn("Parsing options withAltitude and withNormal is deprecated, use out.structure: 2d or 3d."),e.out.structure="3d"):e.out.structure="2d",e.out.filteringExtent=t.filteringExtent,e.out.style=t.style,void 0!==t.crsOut.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead"),e.out.filter=t.filter,e}return t.out&&(void 0===t.out.withAltitude&&void 0===t.out.withNormal||(console.warn("Parsing options out.withAltitude and out.withNormal is deprecated, use out.structure: 2d or 3d."),t.out.withAltitude&&t.out.withNormal?t.out.structure="3d":t.out.structure="2d"),void 0!==t.out.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead")),t},o=t=>{t.color&&console.error("Color convert option is removed, use Style.xxx.color"),t.extrude&&console.error("extrude convert option is removed, use Style.fill.extrusion_height instead"),t.altitude&&console.error("altitude convert option is removed, use Style.xxx.base_altitude instead")},a=t=>{!1===t.isWebGL2&&console.error("WebGL1 support ended in 2.43.0. Falling-back to the WebGL2 renderer.")}},5167:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>g,iL:()=>d,t1:()=>_,tg:()=>u});var i=r(99477),n=r(71440),s=r(62310),o=r(79323),a=r(49075);function l(t){return new n.ZP(t,1/0,-1/0,1/0,-1/0)}function c(t,e){t.normals&&e.geodesicNormal.toArray(t.normals,t._pos),t._pushValues(e.x,e.y,e.z)}const h=new s.Z("EPSG:4326",0,0,0),u={POINT:0,LINE:1,POLYGON:2};class d{#e;constructor(t){this.indices=[],this.properties={},this.size=t.size,t.extent&&(this.extent=l(t.extent.crs),this.#e=l(t.extent.crs))}startSubGeometry(t,e){const r=this.indices.length-1,i=this.extent?l(this.extent.crs):void 0,n=r>-1?this.indices[r].offset+this.indices[r].count:e.vertices.length/this.size;this.indices.push({offset:n,count:t,extent:i}),this.#e=i,function(t,e){t.vertices.length+=e*t.size,t.normals&&(t.normals.length=t.vertices.length)}(e,t)}closeSubGeometry(t,e){const r=this.indices.length-1,i=r>-1?this.indices[r].offset+this.indices[r].count:e.vertices.length/this.size-t;this.indices.push({offset:i,count:t,extent:this.#e}),this.extent&&(this.extent.union(this.#e),this.#e=l(this.extent.crs))}getLastSubGeometry(){const t=this.indices.length-1;return this.indices[t]}pushCoordinates(t,e){if(t.isCoordinates)return console.warn("Deprecated: change in arguments order, use pushCoordinates(feature, coordIn) instead"),void this.pushCoordinates(e,t);e.as(t.crs,h),t.transformToLocalSystem(h),c(t,h),this.#e&&this.#e.expandByCoordinates(t.useCrsOut?h:e)}pushCoordinatesValues(t,e,r){if((arguments.length<=3?0:arguments.length-3)>0)return console.warn("Deprecated: change in arguments, use pushCoordinatesValues(feature, {x: long, y: lat, normal}, coordProj) instead"),void this.pushCoordinatesValues(t,{x:e,y:r,normal:arguments.length<=3?void 0:arguments[3]},arguments.length<=4?void 0:arguments[4]);c(t,e),this.#e&&this.#e.expandByValuesCoordinates(e.x,e.y)}updateExtent(){if(this.extent){const t=this.indices[this.indices.length-1];t&&this.extent.union(t.extent)}}}function p(t,e){this.vertices[this._pos++]=t,this.vertices[this._pos++]=e}function f(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.vertices[this._pos++]=t,this.vertices[this._pos++]=e,this.vertices[this._pos++]=r}class m{constructor(t,e){if(!Object.keys(u).find((e=>u[e]===t)))throw new Error(`Unsupported Feature type: ${t}`);this.type=t,this.geometries=[],this.vertices=[],this.crs=e.crs,this.size=e.size,this.normals="EPSG:4978"==e.crs?[]:void 0,this.hasRawElevationData=!1,this.transformToLocalSystem=e.transformToLocalSystem.bind(e),e.extent&&(this.extent=l(e.extent.crs),this.useCrsOut=this.extent.crs==this.crs),this._pos=0,this._pushValues=(3===this.size?f:p).bind(this),this.style=a.ZP.setFromProperties}bindNewGeometry(){const t=new d(this);return this.geometries.push(t),t}updateExtent(t){this.extent&&this.extent.union(t.extent)}get geometryCount(){return this.geometries.length}}const g=m,A=()=>{},y=(t,e)=>(t.geodesicNormal.applyNormalMatrix(e.normalMatrixInverse),t.applyMatrix4(e.matrixWorldInverse)),v=(t,e)=>t.applyMatrix4(e.matrixWorldInverse),x=new i.Vector3(0,0,1),b=new i.Quaternion;class _ extends i.Object3D{#r=v;#i=A;constructor(t){var e;super(),this.isFeatureCollection=!0,this.crs=o.Z.formatToEPSG(t.accurate||null===(e=t.source)||void 0===e||!e.crs?t.crs:t.source.crs),this.features=[],this.mergeFeatures=void 0===t.mergeFeatures||t.mergeFeatures,this.size="3d"==t.structure?3:2,this.filterExtent=t.filterExtent,this.style=t.style,this.isInverted=!1,this.matrixWorldInverse=new i.Matrix4,this.center=new s.Z("EPSG:4326",0,0),2==this.size?(this.extent=!1===t.buildExtent?void 0:l(t.forcedExtentCrs||this.crs),this.#i=t=>{t.as(this.crs,this.center),this.position.copy(t),this.updateMatrixWorld(),this.#i=A}):(this.extent=t.buildExtent?l(t.forcedExtentCrs||this.crs):void 0,this.#i=t=>{t.as("EPSG:4326",this.center),"EPSG:4978"==this.crs&&(this.quaternion.setFromUnitVectors(x,t.geodesicNormal),b.setFromAxisAngle(x,i.MathUtils.degToRad(90+this.center.longitude)),this.quaternion.multiply(b)),this.position.copy(t),this.updateMatrixWorld(),this.normalMatrix.getNormalMatrix(this.matrix),this.normalMatrixInverse=(new i.Matrix3).copy(this.normalMatrix).invert(),this.#i=A},this.#r=y)}transformToLocalSystem(t){return this.#i(t),this.#r(t,this)}updateExtent(t){if(this.extent){const e=t?[t]:this.features.map((t=>t.extent));for(const t of e)this.extent.union(t)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}removeEmptyFeature(){this.features=this.features.filter((t=>t.geometries.length))}pushFeature(t){this.features.push(t),this.updateExtent(t.extent)}requestFeature(t,e){const r=this.features.find(e);if(r&&this.mergeFeatures)return r;{const e=new m(t,this);return this.features.push(e),e}}requestFeatureByType(t){return this.requestFeature(t,(e=>e.type===t))}requestFeatureById(t,e){return this.requestFeature(e,(e=>e.id===t))}newFeatureByReference(t){const e=new m(t.type,this);return e.extent=t.extent,e.geometries=t.geometries,e.normals=t.normals,e.size=t.size,e.vertices=t.vertices,e._pos=t._pos,this.features.push(e),e}}},62310:(t,e,r)=>{"use strict";r.d(e,{Z:()=>f});var i=r(99477),n=r(24472),s=r(79323),o=r(2359);n.default.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const a=new o.Z,l={},c=new i.Vector3,h=new i.Vector3;let u,d;class p{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.isCoordinates=!0,s.Z.isValid(t),this.crs=t,this.x=0,this.y=0,this.z=0,this._normal=new i.Vector3,e.length>0?this.setFromArray(e):e.isVector3||e.isCoordinates?this.setFromVector3(e):this.setFromValues(e,r,n),this._normalNeedsUpdate=!0}setCrs(t){s.Z.isValid(t),this.crs=t}setFromValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.x=null==t?0:t,this.y=null==e?0:e,this.z=null==r?0:r,this._normalNeedsUpdate=!0,this}setFromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.setFromValues(t[e],t[e+1],t[e+2])}setFromVector3(t){return this.setFromValues(t.x,t.y,t.z)}clone(){return new p(this.crs,this)}copy(t){return this.crs=t.crs,this.setFromVector3(t)}get longitude(){return this.x}get latitude(){return this.y}get altitude(){return this.z}set altitude(t){this.z=t}get geodesicNormal(){return this._normalNeedsUpdate&&(this._normalNeedsUpdate=!1,s.Z.is4326(this.crs)?a.geodeticSurfaceNormalCartographic(this,this._normal):"EPSG:4978"==this.crs?a.geodeticSurfaceNormal(this,this._normal):this._normal.set(0,0,1)),this._normal}toVector3(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector3).copy(this)}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i.Vector3.prototype.toArray.call(this,t,e)}planarDistanceTo(t){return this.toVector3(c).setZ(0),t.toVector3(h).setZ(0),c.distanceTo(h)}geodeticDistanceTo(t){return this.as("EPSG:4326",u),t.as("EPSG:4326",d),a.geodesicDistance(u,d)}spatialEuclideanDistanceTo(t){return this.as("EPSG:4978",u).toVector3(c),t.as("EPSG:4978",d).toVector3(h),c.distanceTo(h)}applyMatrix4(t){return i.Vector3.prototype.applyMatrix4.call(this,t)}as(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new p(t);var r,o;return this.crs==t?e.copy(this):(s.Z.is4326(this.crs)&&"EPSG:3857"==t&&(this.y=i.MathUtils.clamp(this.y,-89.999999,89.999999)),e.setFromArray((r=this.crs,o=t,l[r]||(l[r]={}),l[r][o]||(l[r][o]=(0,n.default)(r,o)),l[r][o]).forward([this.x,this.y,this.z]))),e.crs=t,e}}u=new p("EPSG:4326",0,0,0),d=new p("EPSG:4326",0,0,0);const f=p},79323:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var i=r(24472);function n(t){return"string"==typeof t||t instanceof String}function s(t){if(!n(t))throw new Error(`Crs parameter value must be a string: '${t}'`)}function o(t){return n(t)&&t.startsWith("TMS")}function a(t){return n(t)&&t.startsWith("EPSG")}function l(t){return s(t),a(t)?t:`EPSG:${t.match(/\d+/)[0]}`}i.default.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const c={DEGREE:1,METER:2};function h(t){return"EPSG:4326"===t}function u(t){switch(s(t),t){case"EPSG:4326":return c.DEGREE;case"EPSG:4978":return c.METER;default:{const r=i.default.defs(l(t));if(!r)return;return"degrees"===(e=r.units)?c.DEGREE:"m"===e?c.METER:void 0}}var e}function d(t){s(t);const e=u(t);if(void 0===e)throw new Error(`No unit found for crs: '${t}'`);return e}const p={UNIT:c,isValid(t){d(t)},isGeographic:t=>d(t)==c.DEGREE,isMetricUnit:t=>u(t)==c.METER,toUnit:u,is4326:h,isGeocentric:function(t){s(t);const e=i.default.defs(t);return!!e&&"geocent"==e.projName},reasonnableEpsilon:t=>h(t)?.01:.001,formatToEPSG:l,formatToTms:function(t){return s(t),o(t)?t:`TMS:${t.match(/\d+/)[0]}`},isTms:o,isEpsg:a,tms_3857:"TMS:3857",tms_4326:"TMS:4326",defs:(t,e)=>i.default.defs(t,e)}},71440:(t,e,r)=>{"use strict";r.d(e,{Mh:()=>E,ZP:()=>R,dS:()=>M});var i=r(99477),n=r(62310),s=r(79323);const o=new i.Vector2,a=new i.Vector2,l=new i.Vector2,c=new i.Box3,h=new i.Vector2,u=new i.Vector2,d=new i.Vector2(2,2),p={row:0,col:0,invDiff:0},f=new n.Z("EPSG:4326",0,0,0),m=new n.Z("EPSG:4326",0,0,0),g=new n.Z("EPSG:4326",0,0,0),A=new i.Vector3,y=new i.Vector3;function v(t,e){const r=2**(t.zoom-e);return p.invDiff=1/r,p.row=(t.row-t.row%r)*p.invDiff,p.col=(t.col-t.col%r)*p.invDiff,p}let x,b;const _=new Array(8);for(let t=_.length-1;t>=0;t--)_[t]=new n.Z("EPSG:4326",0,0,0,0);const w=new n.Z("EPSG:4326",0,0),E=new Map,M=new Map;function S(t){const e=s.Z.formatToEPSG(t),r=E.get(e),i=r.planarDimensions(a),n=s.Z.formatToTms(t);return{epsg:e,globalExtent:r,globalDimension:i,sTs:M.get(n)||M.get("default"),isInverted:!n.includes(":NI")}}function C(t,e){const r=M.get(s.Z.formatToTms(t))||M.get("default"),i=2**e;return l.set(i,i).multiply(r),l}class T{constructor(t,e,r,i,n){if(s.Z.isGeocentric(t))throw new Error(`${t} is a geocentric projection, it doesn't make sense with a geographical extent`);this.isExtent=!0,this.crs=t,this.zoom=0,s.Z.isTms(this.crs)?(this.row=0,this.col=0):(this.west=0,this.east=0,this.south=0,this.north=0),this.set(e,r,i,n)}clone(){return s.Z.isTms(this.crs)?new T(this.crs,this.zoom,this.row,this.col):new T(this.crs,this.west,this.east,this.south,this.north)}tiledCovering(t){if("EPSG:4326"==this.crs&&t==s.Z.tms_3857){const e=[],r=x.copy(this).as(s.Z.formatToEPSG(t),b),{globalExtent:i,globalDimension:n,sTs:o}=S(s.Z.formatToEPSG(t));r.clampByExtent(i),r.planarDimensions(u);const a=this.zoom+1||Math.floor(Math.log2(Math.round(n.x/(u.x*o.x)))),l=C(t,a),c=r.center(w);h.x=c.x-i.west,h.y=i.north-r.north,h.divide(n).multiply(l).floor();for(let s=Math.ceil((i.north-r.south)/n.x*l.y)-1;s>=h.y;s--)e.push(new T(t,a,s,h.x));return e}{const e=new T(t,0,0,0),{globalExtent:r,globalDimension:i,sTs:n,isInverted:s}=S(this.crs),o=this.center(w);this.planarDimensions(u);const a=Math.floor(Math.log2(Math.round(i.x/(u.x*n.x)))),l=C(t,a);return h.x=o.x-r.west,h.y=s?r.north-o.y:o.y-r.south,h.divide(i).multiply(l).floor(),e.set(a,h.y,h.x),[e]}}as(t,e){if(s.Z.isValid(t),e=e||new T("EPSG:4326",[0,0,0,0]),s.Z.isTms(this.crs)){const{epsg:r,globalExtent:i,globalDimension:n}=S(this.crs),s=C(this.crs,this.zoom);return u.set(1,1).divide(s).multiply(n),e.west=i.west+(n.x-u.x*(s.x-this.col)),e.east=e.west+u.x,e.south=i.south+u.y*(s.y-this.row-1),e.north=e.south+u.y,e.crs=r,e.zoom=this.zoom,t==r?e:e.as(t,e)}if(s.Z.isEpsg(t)){if(this.crs!=t){const r=this.center(w);_[0].setFromValues(this.west,this.north),_[1].setFromValues(r.x,this.north),_[2].setFromValues(this.east,this.north),_[3].setFromValues(this.east,r.y),_[4].setFromValues(this.east,this.south),_[5].setFromValues(r.x,this.south),_[6].setFromValues(this.west,this.south),_[7].setFromValues(this.west,r.y),e.set(1/0,-1/0,1/0,-1/0);for(let r=0;r<_.length;r++)_[r].crs=this.crs,_[r].as(t,w),e.north=Math.max(e.north,w.y),e.south=Math.min(e.south,w.y),e.east=Math.max(e.east,w.x),e.west=Math.min(e.west,w.x);return e.zoom=this.zoom,e.crs=t,e}return e.crs=t,e.zoom=this.zoom,e.set(this.west,this.east,this.south,this.north),e}}center(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Z(this.crs);if(s.Z.isTms(this.crs))throw new Error("Invalid operation for WMTS bbox");return this.planarDimensions(o),t.crs=this.crs,t.setFromValues(this.west+.5*o.x,this.south+.5*o.y),t}dimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return console.warn("Extent.dimensions is deprecated, use planarDimensions, geodeticDimensions or spatialEuclideanDimensions"),t.x=Math.abs(this.east-this.west),t.y=Math.abs(this.north-this.south),t}planarDimensions(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2).set(Math.abs(this.east-this.west),Math.abs(this.north-this.south))}geodeticDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return f.crs=this.crs,m.crs=this.crs,g.crs=this.crs,f.setFromValues(this.west,this.north,0),m.setFromValues(this.west,this.south,0),g.setFromValues(this.east,this.north,0),t.set(f.geodeticDistanceTo(g),f.geodeticDistanceTo(m))}spatialEuclideanDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return f.crs=this.crs,m.crs=this.crs,g.crs=this.crs,f.setFromValues(this.west,this.north,0),m.setFromValues(this.west,this.south,0),g.setFromValues(this.east,this.north,0),t.set(f.spatialEuclideanDistanceTo(g),f.spatialEuclideanDistanceTo(m))}isPointInside(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.crs==t.crs?w.copy(t):t.as(this.crs,w),w.x<=this.east+e&&w.x>=this.west-e&&w.y<=this.north+e&&w.y>=this.south-e}isInside(t,e){return s.Z.isTms(this.crs)?this.zoom==t.zoom?this.row==t.row&&this.col==t.col:!(this.zoom1&&void 0!==arguments[1]?arguments[1]:new i.Vector4;if(this.crs!=t.crs)throw new Error("unsupported mix");if(s.Z.isTms(this.crs))return v(this,t.zoom),e.set(this.col*p.invDiff-p.col,this.row*p.invDiff-p.row,p.invDiff,p.invDiff);t.planarDimensions(o),this.planarDimensions(a);const r=(this.west-t.west)/o.x,n=(t.north-this.north)/o.y,l=a.x/o.x,c=a.y/o.y;return e.set(r,n,l,c)}tiledExtentParent(t){return t&&t=r.east||t.east<=r.west||t.south>=r.north||t.north<=r.south)}intersect(t){return this.intersectsExtent(t)?(t.crs!=this.crs&&(t=t.as(this.crs,x)),new T(this.crs,Math.max(this.west,t.west),Math.min(this.east,t.east),Math.max(this.south,t.south),Math.min(this.north,t.north))):new T(this.crs,0,0,0,0)}set(t,e,r,i){if(null==t)throw new Error("No values to set in the extent");return t.isExtent&&(s.Z.isTms(t.crs)?(e=t.row,r=t.col,t=t.zoom):(e=t.east,r=t.south,i=t.north,t=t.west)),s.Z.isTms(this.crs)?(this.zoom=t,this.row=e,this.col=r):t.isCoordinates?(this.west=t.x,this.east=e.x,this.south=t.y,this.north=e.y):void 0!==t.west?(this.west=t.west,this.east=t.east,this.south=t.south,this.north=t.north):4==t.length?(this.west=t[0],this.east=t[1],this.south=t[2],this.north=t[3]):void 0!==i&&(this.west=t,this.east=e,this.south=r,this.north=i),this}copy(t){return this.crs=t.crs,this.set(t)}union(t){if(t.crs!=this.crs)throw new Error("unsupported union between 2 diff crs");if(this.west===1/0)this.copy(t);else{const e=t.west;ethis.east&&(this.east=r);const i=t.south;ithis.north&&(this.north=n)}}expandByCoordinates(t){const e=t.crs==this.crs?t:t.as(this.crs,w);this.expandByValuesCoordinates(e.x,e.y)}expandByValuesCoordinates(t,e){tthis.east&&(this.east=t),ethis.north&&(this.north=e)}static fromBox3(t,e){return s.Z.isGeocentric(t)&&(t="EPSG:4326",e=c.copy(e),m.crs=t,m.setFromVector3(e.min).as(t,m).toVector3(e.min),g.crs=t,g.setFromVector3(e.max).as(t,g).toVector3(e.max)),new T(t,{west:e.min.x,east:e.max.x,south:e.min.y,north:e.max.y})}toString(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return s.Z.isTms(this.crs)?`${this.zoom}${t}${this.row}${t}${this.col}`:`${this.east}${t}${this.north}${t}${this.west}${t}${this.south}`}subdivision(){return this.subdivisionByScheme()}subdivisionByScheme(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;const e=[],r=this.planarDimensions(o).divide(t);for(let i=t.x-1;i>=0;i--)for(let n=t.y-1;n>=0;n--){const t=this.west+i*r.x,s=this.south+n*r.y;e.push(new T(this.crs,t,t+r.x,s,s+r.y))}return e}applyMatrix4(t){if(!s.Z.isTms(this.crs)){if(A.set(this.west,this.south,0).applyMatrix4(t),y.set(this.east,this.north,0).applyMatrix4(t),this.west=A.x,this.east=y.x,this.south=A.y,this.north=y.y,this.west>this.east){const t=this.west;this.west=this.east,this.east=t}if(this.south>this.north){const t=this.south;this.south=this.north,this.north=t}return this}}clampSouthNorth(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.south,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.north;return this.south=Math.max(this.south,t),this.north=Math.min(this.north,e),this}clampWestEast(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.west,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.east;return this.west=Math.max(this.west,t),this.east=Math.min(this.east,e),this}clampByExtent(t){return this.clampSouthNorth(t.south,t.north),this.clampWestEast(t.west,t.east)}}x=new T("EPSG:4326",[0,0,0,0]),b=new T("EPSG:4326",[0,0,0,0]),E.set("EPSG:4326",new T("EPSG:4326",-180,180,-90,90));const I=E.get("EPSG:4326").as("EPSG:3857");I.clampSouthNorth(I.west,I.east),E.set("EPSG:3857",I),M.set("default",new i.Vector2(1,1)),M.set(s.Z.tms_3857,M.get("default")),M.set(s.Z.tms_4326,new i.Vector2(2,1));const R=T},2362:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477),n=r(62310),s=r(79323);const o=new n.Z("EPSG:4326"),a=new i.Vector2,l=class{constructor(t,e,r){s.Z.isGeographic(t.crs),this.extent=t,this.step=new i.Vector2(e.x,e.y||e.x),this.dimensions=this.extent.planarDimensions(),this.dataSize=(new i.Vector2).addVectors(this.step,this.dimensions).divide(this.step).round(),this.getData=r}getHeightAtCoordinates(t){return t.as(this.extent.crs,o),a.set((this.dataSize.x-1)*(o.x-this.extent.west)/this.dimensions.x,(this.dataSize.y-1)*(o.y-this.extent.south)/this.dimensions.y),a.x<0||a.x>=this.dataSize.x-1||a.y<0||a.y>=this.dataSize.y-1?0:function(t,e){const r=Math.floor(t.x),i=Math.floor(t.y),n=t.x-r,s=t.y-i;return(1-n)*((1-s)*e(i,r)+s*e(i+1,r))+n*((1-s)*e(i,r+1)+s*e(i+1,r+1))}(a,this.getData)}}},59947:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var i=r(99477),n=r(86541);const s=new(r(62310).Z)("EPSG:4326");let o,a="";a=void 0!==document.documentElement.style.transform?"transform":void 0!==document.documentElement.style.webkitTransform?"webkitTransform":void 0!==document.documentElement.style.mozTransform?"mozTransform":void 0!==document.documentElement.style.oTransform?"oTransform":"transform";class l extends i.Object3D{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)throw new Error("coordinates are mandatory to add a Label");arguments.length>3&&console.warn("Deprecated argument sprites in Label constructor. Sprites must be configured in style argument."),super();let i=this.visible;Object.defineProperty(this,"visible",{set(t){t!=i&&(i=t,this.content.style.display=t?"block":"none")},get:()=>i}),this.isLabel=!0,this.coordinates=e,this.projectedPosition={x:0,y:0},this.boundaries={left:0,right:0,top:0,bottom:0},"string"==typeof t?(this.content=document.createElement("div"),this.content.textContent=r.text.field):this.content=t.cloneNode(!0),this.content.classList.add("itowns-label"),this.content.style.userSelect="none",this.content.style.position="absolute",r.isStyle?(this.anchor=r.getTextAnchorPosition(),this.styleOffset=r.text.offset,"string"==typeof t&&(r.text.haloWidth>0&&this.content.classList.add("itowns-stroke-single"),r.applyToHTML(this.content).then((t=>{t&&(this.icon=t)})))):(this.anchor=[0,0],this.styleOffset=[0,0]),this.iconOffset={left:0,right:0,top:0,bottom:0},this.zoom={min:r.zoom&&null!=r.zoom.min?r.zoom.min:2,max:r.zoom&&null!=r.zoom.max?r.zoom.max:24},this.order=r.order||0,this.padding=2}updateProjectedPosition(t,e){const r=Math.round(t),i=Math.round(e);r==this.projectedPosition.x&&i==this.projectedPosition.y||(this.projectedPosition.x=r,this.projectedPosition.y=i,this.boundaries.left=t+this.offset.left-this.padding,this.boundaries.right=t+this.offset.right+this.padding,this.boundaries.top=e+this.offset.top-this.padding,this.boundaries.bottom=e+this.offset.bottom+this.padding,0===this.iconOffset.left&&0===this.iconOffset.right&&0===this.iconOffset.top&&0===this.iconOffset.bottom||(this.boundaries.left=Math.min(this.boundaries.left,t+this.iconOffset.left),this.boundaries.right=Math.max(this.boundaries.right,t+this.iconOffset.right),this.boundaries.top=Math.min(this.boundaries.top,e+this.iconOffset.top),this.boundaries.bottom=Math.max(this.boundaries.bottom,e+this.iconOffset.bottom)))}updateCSSPosition(){this.content.style[a]=`translate(${this.projectedPosition.x+this.offset.left}px, ${this.projectedPosition.y+this.offset.top}px)`,this.icon&&(this.icon.style[a]=`translate(${-this.offset.left}px, ${-this.offset.top}px)`)}initDimensions(){if(!this.offset){o=this.content.getBoundingClientRect();const t=Math.round(o.width),e=Math.round(o.height);this.offset={left:t*this.anchor[0]+this.styleOffset[0],top:e*this.anchor[1]+this.styleOffset[1]},this.offset.right=this.offset.left+t,this.offset.bottom=this.offset.top+e,this.icon&&(o=this.icon.getBoundingClientRect(),this.iconOffset={left:Math.floor(o.x),top:Math.floor(o.y),right:Math.ceil(o.x+o.width),bottom:Math.ceil(o.y+o.height)})}}update3dPosition(t){this.coordinates.as(t,s).toVector3(this.position),this.updateMatrixWorld()}updateElevationFromLayer(t,e){if(0==t.attachedLayers.filter((t=>t.isElevationLayer)).length)return;let r=Math.max(0,n.Z.getElevationValueAt(t,this.coordinates,n.Z.FAST_READ_Z,e));isNaN(r)&&(r=Math.max(0,n.Z.getElevationValueAt(t,this.coordinates,n.Z.FAST_READ_Z))),isNaN(r)||r==this.coordinates.z||(this.coordinates.z=r)}updateHorizonCullingPoint(){this.horizonCullingPoint&&this.getWorldPosition(this.horizonCullingPoint)}}const c=l},99617:(t,e,r)=>{"use strict";r.d(e,{Ao:()=>s,HR:()=>n,ZP:()=>c});var i=r(99477);const n=0,s={UPDATE_START:"update_start",BEFORE_CAMERA_UPDATE:"before_camera_update",AFTER_CAMERA_UPDATE:"after_camera_update",BEFORE_LAYER_UPDATE:"before_layer_update",AFTER_LAYER_UPDATE:"after_layer_update",BEFORE_RENDER:"before_render",AFTER_RENDER:"after_render",UPDATE_END:"update_end"};function o(t,e,r){if(r)for(const i of r){const r=e.update(t,e,i),n=e.getObjectToUpdateForAttachedLayers(i);if(n)if(n.element)for(const r of e.attachedLayers)r.ready&&(r.update(t,r,n.element,n.parent),r.cache.flush());else if(n.elements)for(let r=0;r{t===e||t.isCamera?(e.info.clear(),r=!0):t.layer===e&&i.add(t)})),r?new Set([e]):i}class l extends i.EventDispatcher{#n=!1;#s=!0;#o=0;constructor(t,e){super(),this.renderingState=n,this.scheduler=t,this.gfxEngine=e}scheduleViewUpdate(t,e){this.#n|=e,1!==this.renderingState&&(this.renderingState=1,this.gfxEngine.renderer.xr.isPresenting||requestAnimationFrame((e=>{this.step(t,e)})))}#a(t,e,r){const i={camera:t.camera,engine:this.gfxEngine,scheduler:this.scheduler,view:t};e.forEach((t=>{const r=t.layer||t;r.isLayer&&r.parent&&e.add(r.parent)}));for(const n of t.getLayers(((t,e)=>!e)))if(i.geometryLayer=n,n.ready&&n.visible&&!n.frozen){t.execFrameRequesters(s.BEFORE_LAYER_UPDATE,r,this.#s,n);const l=a(e,n);if(l.size>0){for(const t of n.attachedLayers)t.ready&&t.preUpdate&&t.preUpdate(i,l);const t=n.preUpdate(i,l);o(i,n,t),n.postUpdate(i,n,e)}n.cache.flush(),t.execFrameRequesters(s.AFTER_LAYER_UPDATE,r,this.#s,n)}}step(t,e){const r=e-this.#o;t._executeFrameRequestersRemovals(),t.execFrameRequesters(s.UPDATE_START,r,this.#s);const i=this.#n;this.#o=e,this.#n=!1,this.renderingState=n;const o=new Set(t._changeSources);t._changeSources.clear();const a=this.gfxEngine.getWindowSize();t.execFrameRequesters(s.BEFORE_CAMERA_UPDATE,r,this.#s),t.camera.update(a.x,a.y),t.execFrameRequesters(s.AFTER_CAMERA_UPDATE,r,this.#s);const l=t.camera3D.matrixAutoUpdate;t.camera3D.matrixAutoUpdate=!1,this.#a(t,o,r),0==this.scheduler.commandsWaitingExecutionCount()&&this.dispatchEvent({type:"command-queue-empty"}),i&&this.#l(t,r),this.#s=this.renderingState===n,t.camera3D.matrixAutoUpdate=l,t.execFrameRequesters(s.UPDATE_END,r,this.#s)}#l(t,e){t.execFrameRequesters(s.BEFORE_RENDER,e,this.#s),t.render?t.render():this.gfxEngine.renderView(t),t.execFrameRequesters(s.AFTER_RENDER,e,this.#s)}}const c=l},2359:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l,c:()=>o});var i=r(99477),n=r(24472),s=r(62310);const o=new i.Vector3(n.default.WGS84.a,n.default.WGS84.a,n.default.WGS84.b),a=new i.Vector3,l=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;this.size=new i.Vector3,this._radiiSquared=new i.Vector3,this._invRadiiSquared=new i.Vector3,this.eccentricity=0,this.setSize(t)}geodeticSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;return t.toVector3(e).multiply(this._invRadiiSquared).normalize()}geodeticSurfaceNormalCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;const r=i.MathUtils.degToRad(t.longitude),n=i.MathUtils.degToRad(t.latitude),s=Math.cos(n);return e.set(s*Math.cos(r),s*Math.sin(r),Math.sin(n))}setSize(t){this.size.set(t.x,t.y,t.z),this._radiiSquared.multiplyVectors(t,t),this._invRadiiSquared.x=0==t.x?0:1/this._radiiSquared.x,this._invRadiiSquared.y=0==t.y?0:1/this._radiiSquared.y,this._invRadiiSquared.z=0==t.z?0:1/this._radiiSquared.z,this.eccentricity=Math.sqrt(this._radiiSquared.x-this._radiiSquared.z)/this.size.x}cartographicToCartesian(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;a.copy(t.geodesicNormal),e.multiplyVectors(this._radiiSquared,a);const r=Math.sqrt(a.dot(e));return e.divideScalar(r),a.multiplyScalar(t.altitude),e.add(a)}cartesianToCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.Z("EPSG:4326",0,0,0);const r=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),n=this.size.x,o=this.size.z,a=Math.abs((n*n-o*o)/(n*n)),l=1-Math.sqrt(1-a),c=Math.sqrt(t.x*t.x+t.y*t.y),h=Math.atan2(t.y,t.x),u=Math.atan(t.z/c*(1-l+a*n/r)),d=Math.sin(u),p=Math.cos(u),f=Math.atan((t.z*(1-l)+a*n*d*d*d)/((1-l)*(c-a*n*p*p*p))),m=c*Math.cos(f)+t.z*Math.sin(f)-n*Math.sqrt(1-a*Math.sin(f)*Math.sin(f));return e.setFromValues(i.MathUtils.radToDeg(h),i.MathUtils.radToDeg(f),m)}cartographicToCartesianArray(t){const e=[];for(let r=0;r{"use strict";r.d(e,{Z:()=>g});var i=r(99477),n=r(14625),s=r(5199),o=r(62310);const a=new i.Vector4;function l(t,e){let r;for(let i=0;i<=t;i++){const t=i*i;for(let n=-i;n<=i;n++){const s=n*n;for(let o=-i;o<=i;o++){const i=s+o*o;if(!(i>t||i<=r||!1!==e(n,o)))return}}r=t}}function c(t){return t.layer?t.layer:t.parent?c(t.parent):void 0}const h=new i.Raycaster,u=new i.Vector2,d=new i.Vector3,p=new o.Z("EPSG:4978"),f=new i.Vector3,m=new o.Z("EPSG:4978"),g={pickTilesAt(t,e,r,o){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const h=function(t,e,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const c=t.mainLoop.gfxEngine.getWindowSize();r=r||new i.Vector2(Math.floor(c.x/2),Math.floor(c.y/2));const h=e.level0Nodes.map((t=>n.Z.push(t,n.Z.MODES.ID))),u=t.mainLoop.gfxEngine.renderViewToBuffer({camera:t.camera,scene:e.object3d},{x:r.x-o,y:r.y-o,width:1+2*o,height:1+2*o});h.forEach((t=>t()));const d=[];return l(o,((t,e)=>{const r=4*(2*e*o+t),i=u.slice(r,r+4||void 0);a.fromArray(i).divideScalar(255);const n=(0,s.On)(a,256**3),l=Math.round(n);d.includes(l)||d.push(l)})),d}(t,o,e,r),u=t=>{h.includes(t.id)&&t.isTileMesh&&c.push({object:t,layer:o})};for(const t of o.level0Nodes)t.traverse(u);return c},pickPointsAt(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!i.root)return;i.object3d.traverse((t=>{t.isPoints&&t.baseId&&t.material.enablePicking(!0)}));const s=t.mainLoop.gfxEngine.renderViewToBuffer({camera:t.camera,scene:i.object3d},{x:e.x-r,y:e.y-r,width:1+2*r,height:1+2*r}),o=[];return l(r,((t,e)=>{const i=4*(2*e*r+t),n=s.slice(i,i+4),a={objId:n[0]<<8|n[1],index:n[2]<<8|n[3]};for(let t=0;t{if(e.isPoints&&e.baseId){e.material.enablePicking(!1);for(let r=0;r4&&void 0!==arguments[4]?arguments[4]:[];if(t.viewToNormalizedCoords(e,u),r<0){h.setFromCamera(u,t.camera3D);const e=h.intersectObject(n,!0);for(const t of e)t.layer=c(t.object),s.push(t);return s}const o={x:e.x-r,y:e.y-r,width:1+2*r,height:1+2*r},a=t.mainLoop.gfxEngine.renderViewToBuffer({scene:n,camera:t.camera},o),d=new i.Color;t.mainLoop.gfxEngine.renderer.getClearColor(d);const p=Math.round(255*d.r),f=Math.round(255*d.g),m=Math.round(255*d.b),g=u.clone();return l(r,((e,i)=>{const o=4*((i+r)*(2*r+1)+(e+r)),l=a[o],d=a[o+1],A=a[o+2];if(Math.abs(p-l)<=1&&Math.abs(f-d)<=1&&Math.abs(m-A)<=1)return;g.setX(u.x+e/t.camera.width).setY(u.y+i/t.camera.height),h.setFromCamera(g,t.camera3D);const y=h.intersectObject(n,!0);for(const t of y)t.layer=c(t.object),s.push(t);return 0==s.length})),s}}},51969:(t,e,r)=>{"use strict";r.d(e,{Z:()=>f});var i=r(99477),n=r(62310),s=r(71440);const o=Math.PI/4,a=1/(2*Math.PI),l=new i.Vector3(0,0,1),c=new i.Vector3(0,1,0),h=new i.Quaternion,u=new i.Quaternion,d=new i.Quaternion;function p(t){return 1-(.5-Math.log(Math.tan(o+.5*i.MathUtils.degToRad(t)))*a)}const f=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.tmp={coords:[new n.Z("EPSG:4326",0,0),new n.Z("EPSG:4326",0,0)],position:new i.Vector3,dimension:new i.Vector2},this.crs=t.crs,this.uvCount=t.uvCount,this.computeUvs=[()=>{},t=>{const e=p(t.projected.latitude)*t.nbRow;return(isFinite(e)?e:0)-t.deltaUV1}]}prepare(t){t.nbRow=2**(t.level+1);let e=p(t.extent.south);isFinite(e)||(e=0);const r=e%(1/t.nbRow);t.deltaUV1=(e-r)*t.nbRow,t.quatNormalToZ=d.setFromAxisAngle(c,-(.5*Math.PI-i.MathUtils.degToRad(t.extent.center().latitude))),t.projected={longitude:0,latitude:0},t.extent.planarDimensions(this.tmp.dimension)}center(t){return t.center(this.tmp.coords[0]).as(this.crs,this.tmp.coords[1]).toVector3()}vertexPosition(t){return this.tmp.coords[0].setFromValues(t.projected.longitude,t.projected.latitude),this.tmp.coords[0].as(this.crs,this.tmp.coords[1]).toVector3(this.tmp.position),this.tmp.position}vertexNormal(){return this.tmp.coords[1].geodesicNormal}uProjecte(t,e){e.projected.longitude=e.extent.west+t*this.tmp.dimension.x}vProjecte(t,e){e.projected.latitude=e.extent.south+t*this.tmp.dimension.y}computeSharableExtent(t){const e=Math.abs(t.west-t.east)/2,r=new s.ZP(t.crs,-e,e,t.south,t.north),n=i.MathUtils.degToRad(t.west-r.west),o=i.MathUtils.degToRad(90-t.center(this.tmp.coords[0]).latitude);return h.setFromAxisAngle(l,n),u.setFromAxisAngle(c,o),h.multiply(u),{sharableExtent:r,quaternion:h.clone(),position:this.center(t)}}}},49401:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(99477),n=r(96021),s=r(2359),o=r(71440),a=r(51969),l=r(81189),c=r(79323);const h=new i.Matrix4,u=new i.Vector3;let d=0;const p=new i.Vector3;class f extends n.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=o.dS.get(c.Z.tms_4326),l=o.Mh.get("EPSG:4326").subdivisionByScheme(n);r.tileMatrixSets=[c.Z.tms_4326,c.Z.tms_3857];const u=r.tileMatrixSets.length,d=new a.Z({crs:"EPSG:4978",uvCount:u});super(t,e||new i.Group,l,d,r),this.isGlobeLayer=!0,this.options.defaultPickingRadius=5,this.minSubdivisionLevel=null==this.minSubdivisionLevel?2:this.minSubdivisionLevel,this.maxSubdivisionLevel=null==this.maxSubdivisionLevel?19:this.maxSubdivisionLevel,this.maxDeltaElevationLevel=this.maxDeltaElevationLevel||4,this.extent=this.schemeTile[0].clone();for(let t=1;t0:d{"use strict";r.d(e,{b:()=>R,Z:()=>L});var i=r(99477),n=r(73502),s=r(61861),o=r(62310),a=r(49401),l=r(45222),c=r(2359);const h={getSunPosition(){const t=Math,e=t.PI,r=t.sin,i=t.cos,n=t.tan,s=t.asin,o=t.atan2,a=e/180,l=23.4397*a;function c(t,e,s){return o(r(t),i(t)*r(e)-n(s)*i(e))}function h(t,e,n){return s(r(e)*r(n)+i(e)*i(n)*i(t))}return function(t,u,d){const p=a*u,f=function(t){return function(t){return t.valueOf()/864e5-.5+2440588}(t)-2451545}(t),m=function(t){return a*(357.5291+.98560028*t)}(f),g=function(t){return a*(1.9148*r(t)+.02*r(2*t)+3e-4*r(3*t))}(m),A=function(t,r){return t+r+102.9372*a+e}(m,g),y=(v=A,s(r(0)*i(l)+i(0)*r(l)*r(v)));var v;const x=function(t,e){return o(r(t)*i(l)-n(0)*r(l),i(t))}(A),b=function(t,e){return a*(280.16+360.9856235*t)-e}(f,a*-d),_=b-x;return{EclipticLongitude:A,declinaison:y,ascension:x,H:_,SiderealTime:b,altitude:h(_,p,y),azimuth:c(_,p,y)+e/2}}},getSunPositionInScene(t,e,r){const i=864e5,n=h.getSunPosition()(t,e,r).ascension+t%i/i*-360+180;return new o.Z("EPSG:4326",n,e,5e7).as("EPSG:4978").toVector3()}},u=h,d={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},v3LightPosition:{type:"v3",value:new i.Vector3},up:{type:"v3",value:new i.Vector3(0,1,0)}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( cameraPosition + position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( cameraPosition + position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 v3LightPosition;","uniform vec3 up;","varying vec3 vWorldPosition;","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","vec3 up2 = normalize(cameraPosition.xyz);","float sunfade = 1.0-clamp(1.0-exp((v3LightPosition.y/450000.0)),0.0,1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(v3LightPosition);","float sunE = sunIntensity(dot(sunDirection, up2));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up2, normalize(vWorldPosition - cameraPosition))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPosition), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up2, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPosition);","float theta = acos(direction.y); // elevation --\x3e y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --\x3e x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPosition).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1. - ( (length(cameraPosition) - 6400000.) / 1000.);","}"].join("\n")};class p extends i.Mesh{constructor(){const t=i.UniformsUtils.clone(d.uniforms),e=new i.ShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:t,side:i.BackSide,transparent:!0,depthWrite:!1});super(new i.SphereGeometry(4e4,32,15),e)}}const f=p,m="#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvec4 glowColor = vec4(0.45, 0.74, 1. ,1.0);\n\nvoid main() {\n #include \n gl_FragColor = glowColor * intensity;\n}\n\n",g="#include \n#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvoid main()\n{\n vec3 normalES = normalize( normalMatrix * normal );\n vec3 normalCAMES = normalize( normalMatrix * cameraPosition );\n\n if(atmoIN == 0) {\n intensity = pow(0.666 - dot(normalES, normalCAMES), 4. );\n } else {\n intensity = pow( 1. - dot(normalES, normalCAMES), 0.8 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n #include \n}\n\n\n",A=new i.Vector3(1,0,0),y=new i.Vector3,v=new o.Z("EPSG:4326"),x=new o.Z("EPSG:4326"),b=new i.Color(9688568),_=new i.Color,w=new i.Color(197896),E=6e5,M=160*c.c.x;class S extends l.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"atmosphere",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.source=!1,super(t,new i.Object3D,e),this.isAtmosphere=!0;const r=new i.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:0},screenSize:{type:"v2",value:new i.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:i.BackSide,blending:i.AdditiveBlending,transparent:!0,wireframe:!1}),n=new i.SphereGeometry(1,64,64),s=new i.Mesh(n,r);s.scale.copy(c.c).multiplyScalar(1.14),this.basicAtmosphere=new i.Object3D,this.realisticAtmosphere=new i.Object3D,this.realisticAtmosphere.visible=!1,this.object3d.add(this.basicAtmosphere),this.object3d.add(this.realisticAtmosphere),this.basicAtmosphere.add(s);const o=new i.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:1},screenSize:{type:"v2",value:new i.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:i.FrontSide,blending:i.AdditiveBlending,transparent:!0,depthWrite:!1}),a=new i.Mesh(n,o);a.scale.copy(c.c).multiplyScalar(1.002),this.basicAtmosphere.add(a),this.realisticLightingPosition={x:-.5,y:0,z:1},this.fog={enable:!0,distance:M},this.realisticAtmosphereInitParams=e.Kr?e:{Kr:.0025,Km:.0015,ESun:20,g:-.95,innerRadius:64e5,outerRadius:67e5,wavelength:[.65,.57,.475],scaleDepth:.25},this.object3d.updateMatrixWorld()}update(t,e,r){r.material.fogDistance=this.fog.distance,r.material.lightingEnabled=this.realisticAtmosphere.visible,r.material.lightPosition=this.realisticLightingPosition}preUpdate(t){const e=t.view.camera3D.position;if(this.fog.enable){y.setFromMatrixPosition(t.view.tileLayer.object3d.matrixWorld);const r=y.distanceTo(e);this.fog.distance=M*(.25*(r-.99*c.c.x)/c.c.x)**1.5}else this.fog.distance=1e11;const r=t.view.mainLoop.gfxEngine.renderer;v.crs=t.view.referenceCrs,v.setFromVector3(e).as("EPSG:4326",x);const i=x.altitude;it.material.uniforms.v3LightPosition.value.copy(this.realisticLightingPosition)))),this.basicAtmosphere.visible=!t,this.realisticAtmosphere.visible=t}}const C=S;var T=r(32533),I=r(79323);const R={GLOBE_INITIALIZED:n.b.INITIALIZED,LAYER_ADDED:n.b.LAYER_ADDED,LAYER_REMOVED:n.b.LAYER_REMOVED,COLOR_LAYERS_ORDER_CHANGED:n.b.COLOR_LAYERS_ORDER_CHANGED};class B extends n.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.Object3D.DEFAULT_UP.set(0,0,1),super("EPSG:4978",t,r),this.isGlobeView=!0,this.camera3D.near=Math.max(15,2352e-9*c.c.x),this.camera3D.far=10*c.c.x;const n=new a.Z("globe",r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=n.info;const l=new i.DirectionalLight;l.position.set(-.5,0,1),l.updateMatrixWorld(!0),this.scene.add(l),this.addLayer(n),this.tileLayer=n,e.isExtent||(e.coord=e.coord||new o.Z("EPSG:4326",0,0),e.tilt=e.tilt||89.5,e.heading=e.heading||0,e.range=e.range||2*c.c.x),r.noControls?T.ZP.transformCameraToLookAtTarget(this,this.camera3D,e):(this.controls=new s.Z(this,e,r.controls),this.controls.handleCollision=void 0===r.handleCollision||r.handleCollision),this.addLayer(new C("atmosphere",r.atmosphere)),this.camera.resize(t.clientWidth,t.clientHeight)}addLayer(t){if(!t||!t.isLayer)return Promise.reject(new Error("Add Layer type object"));if(t.isColorLayer){if(!this.tileLayer.tileMatrixSets.includes(I.Z.formatToTms(t.source.crs)))return t._reject(`Only ${this.tileLayer.tileMatrixSets} tileMatrixSet are currently supported for color layers`)}else if(t.isElevationLayer&&I.Z.formatToTms(t.source.crs)!==this.tileLayer.tileMatrixSets[0])return t._reject(`Only ${this.tileLayer.tileMatrixSets[0]} tileMatrixSet is currently supported for elevation layers`);return super.addLayer(t,this.tileLayer)}getPixelsToDegrees(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.getMetersToDegrees(this.getPixelsToMeters(t,e))}getPixelsToDegreesFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.getMetersToDegrees(this.getPixelsToMetersFromDistance(t,e))}getMetersToDegrees(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return i.MathUtils.radToDeg(2*Math.asin(t/(2*c.c.x)))}}const L=B},16670:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var i=r(99477),n=r(96021),s=r(71440),o=r(79323),a=r(62310);const l=new i.Quaternion,c=new i.Vector3;class h extends n.Z{constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const h=o.Z.formatToTms(e.crs);s.Mh.get(e.crs)||s.Mh.set(e.crs,e),n.tileMatrixSets=[h],super(t,r||new i.Group,[e],new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.projection&&(console.warn("PlanarTileBuilder projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs)throw new Error("options.crs is mandatory for PlanarTileBuilder");this.crs=t.crs,this.tmp={coords:new a.Z("EPSG:4326",0,0),position:new i.Vector3,normal:new i.Vector3(0,0,1)},this.uvCount=t.uvCount||1}prepare(t){t.nbRow=2**(t.zoom+1),t.projected=new i.Vector3}center(t){return t.center(this.tmp.coords),c.set(this.tmp.coords.x,this.tmp.coords.y,0),c}vertexPosition(t){return this.tmp.position.set(t.projected.x,t.projected.y,0),this.tmp.position}vertexNormal(){return this.tmp.normal}uProjecte(t,e){e.projected.x=e.extent.west+t*(e.extent.east-e.extent.west)}vProjecte(t,e){e.projected.y=e.extent.south+t*(e.extent.north-e.extent.south)}computeSharableExtent(t){return{sharableExtent:new s.ZP(t.crs,0,Math.abs(t.west-t.east),0,Math.abs(t.north-t.south)),quaternion:l,position:this.center(t).clone()}}}({crs:e.crs}),n),this.isPlanarLayer=!0,this.extent=e,this.minSubdivisionLevel=null==this.minSubdivisionLevel?0:this.minSubdivisionLevel,this.maxSubdivisionLevel=null==this.maxSubdivisionLevel?5:this.maxSubdivisionLevel,this.maxDeltaElevationLevel=this.maxDeltaElevationLevel||4}}const u=h},39510:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var i=r(99477),n=r(73502),s=r(32533),o=r(29571),a=r(16670);class l extends n.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.Object3D.DEFAULT_UP.set(0,0,1),super(e.crs,t,r),this.isPlanarView=!0;const n=e.planarDimensions(),l=Math.max(n.x,n.y);this.camera3D.near=.1,this.camera3D.far=this.camera3D.isOrthographicCamera?2e3:2*l,this.camera3D.updateProjectionMatrix();const c=new a.Z("planar",e,r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=c.info,this.addLayer(c);const h=r.placement||{};h.isExtent||(h.coord=h.coord||e.center(),h.tilt=h.tilt||90,h.heading=h.heading||0,h.range=h.range||l),s.ZP.transformCameraToLookAtTarget(this,this.camera3D,h),r.noControls||(this.controls=new o.ZP(this,r.controls)),this.tileLayer=c}addLayer(t){return super.addLayer(t,this.tileLayer)}}const c=l},74593:(t,e,r)=>{"use strict";r.d(e,{N:()=>n,Z:()=>s});var i=r(99477);function n(t,e){return 3*(t*t*2+(e?0:4*t*2))}function s(t){const e={index:null,position:null,normal:null,uvs:[]},r=[],s=t.builder,o=t.segments,a=(o+1)*(o+1)+(t.disableSkirt?0:4*o);if(a>2**32)throw new Error("Tile segments count is too big");e.position=new Float32Array(3*a),e.normal=new Float32Array(3*a);const l=t.builder.uvCount;l>1&&(e.uvs[1]=new Float32Array(a)),r[0]=()=>{};const c=n(o,t.disableSkirt);t.buildIndexAndUv_0&&(a<256?e.index=new Uint8Array(c):a<65536?e.index=new Uint16Array(c):a<2**32&&(e.index=new Uint32Array(c)),e.uvs[0]=new Float32Array(2*a),r[0]=(t,r,i)=>{e.uvs[0][2*t+0]=r,e.uvs[0][2*t+1]=i});const h=Math.max(2,Math.floor(o)||2),u=Math.max(2,Math.floor(o)||2);let d=0;const p=[];let f=[];const m=[];s.prepare(t);for(let i=0;i<=u;i++){const n=[],o=i/u;if(s.vProjecte(o,t),l>1){const i=s.computeUvs[1](t);r[1]=t=>{e.uvs[1][t]=i}}for(let a=0;a<=h;a++){const l=a/h,c=3*d;s.uProjecte(l,t);const p=s.vertexPosition(t,t.projected),g=s.vertexNormal(t);p.sub(t.center),t.quatNormalToZ&&(p.applyQuaternion(t.quatNormalToZ),g.applyQuaternion(t.quatNormalToZ)),p.toArray(e.position,c),g.toArray(e.normal,c);for(const t of r)t(d,l,o);t.disableSkirt||0!==i&&i!==u&&(a===h?f.push(d):0===a&&m.push(d)),n.push(d),d++}p.push(n),0===i?f=f.concat(n):i===u&&(f=f.concat(n.slice().reverse()))}function g(t,r,i,n){return e.index[n+0]=t,e.index[n+1]=r,e.index[n+2]=i,n+3}t.disableSkirt||(f=f.concat(m.reverse()));let A=0;if(t.buildIndexAndUv_0)for(let t=0;t1&&(e.uvs[1][d]=e.uvs[1][i]);const c=(t+1)%f.length;A=n(A,i,d,0===c?y:d+1,f[c]),d++}}return e}},55086:(t,e,r)=>{"use strict";let i;r.d(e,{D:()=>n,Z:()=>s});const n={INFINITE:1/0,TEXTURE:9e5,GEOMETRY:9e5},s=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.INFINITE;this.lifeTime=t,this.lastTimeFlush=Date.now(),this.data=new Map}getByArray(t){return this.get(t[0],t[1],t[2])}setByArray(t,e){return this.set(t,e[0],e[1],e[2])}get(t,e,r){const n=this.data.get(t);if(null!=n){if(null!=n.lastTimeUsed)i=n;else{const t=n.get(e);if(null==t)return;if(null!=t.lastTimeUsed)i=t;else{const e=t.get(r);if(null==e)return;i=e}}return i.value?(i.lastTimeUsed=Date.now(),i.value):void 0}}set(t,e,r,n){if(i={value:t,lastTimeUsed:Date.now()},null==r)return this.data.set(e,i),t;this.data.get(e)||this.data.set(e,new Map);const s=this.data.get(e);return null==n?(s.set(r,i),t):(s.get(r)||s.set(r,new Map),s.get(r).set(n,i),t)}delete(t,e,r){const i=this.data.get(t);if(void 0!==i)if(null!=i.lastTimeUsed)this.data.get(t),this.data.delete(t);else{const n=i.get(e);if(void 0===n)return;if(null!=n.lastTimeUsed)i.get(e),i.delete(e),0==i.size&&this.data.delete(t);else{if(void 0===n.get(r))return;n.get(r),n.delete(r),0==n.size&&(i.delete(e),0==i.size&&this.data.delete(t))}}}clear(){this.data.clear()}flush(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.lifeTime==n.INFINITE||this.lifeTime>t-this.lastTimeFlush||!this.data.size||(this.lastTimeFlush=1/0,this.data.forEach(((e,r)=>{this.lifeTime{this.lifeTime{this.lifeTime{"use strict";r.d(e,{uP:()=>_,ZP:()=>S,Lu:()=>m});var i=r(5167),n=r(55086),s=r(45340),o=r(92294),a=r(99477);function l(t){let e,r,i,n=t.r||t[0]/255,s=t.g||t[1]/255,o=t.b||t[2]/255;return n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,e=(.4124*n+.3576*s+.1805*o)/.95047,r=(.2126*n+.7152*s+.0722*o)/1,i=(.0193*n+.1192*s+.9505*o)/1.08883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(e-r),200*(r-i)]}function c(t,e){const r=l(t),i=l(e),n=r[0]-i[0],s=r[1]-i[1],o=r[2]-i[2],a=Math.sqrt(r[1]*r[1]+r[2]*r[2]),c=a-Math.sqrt(i[1]*i[1]+i[2]*i[2]);let h=s*s+o*o-c*c;h=h<0?0:Math.sqrt(h);const u=n/1,d=c/(1+.045*a),p=h/(1+.015*a),f=u*u+d*d+p*p;return f<0?0:Math.sqrt(f)}var h=r(62310);const u=new n.Z,d=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),p=document.createElement("canvas");function f(t,e){var r;return(null==e||null===(r=e.coordinates)||void 0===r?void 0:r.z)||0}function m(t,e){if(null!=t){if(t.expression)return t.expression.evaluate(e);if(t.stops){for(let r=t.stops.length-1;r>=0;r--){const i=t.stops[r];if(e.zoom>=i[0])return i[1]}return t.stops[0][1]}return("string"==typeof t||t instanceof String)&&(t=t.replace(/\{(.+?)\}/g,((t,r)=>e.properties[r]||"")).trim()),t instanceof Function?t(e.properties,e):t}}function g(t){if(!t)return{};if(t.stops||t.expression)return{color:t};if("string"==typeof t){const e=t.match(/(?:((hsl|rgb)a? *\(([\d.%]+(?:deg|g?rad|turn)?)[ ,]*([\d.%]+)[ ,]*([\d.%]+)[ ,/]*([\d.%]*)\))|(#((?:[\d\w]{3}){1,2})([\d\w]{1,2})?))/i);if(!e)return{color:t,opacity:1};if(e[7]){let t=1;return e[9]&&(t=.00392156862745098*parseInt(1==e[9].length?`${e[9]}${e[9]}`:e[9],16)),{color:`#${e[8]}`,opacity:t}}if(e[0])return{color:`${e[2]}(${e[3]},${e[4]},${e[5]})`,opacity:Number(e[6])||1}}}function A(t,e){if(null!=t)return o.th.isExpression(t)?o.th.createExpression(t,e).value:t}async function y(t){let e=u.get(t,"null");return e||(e=s.Z.texture(t,{crossOrigin:"anonymous"}),u.set(e,t,"null")),(await e).image}function v(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:t.naturalWidth,height:t.naturalHeight};p.width=e.width,p.height=e.height;const r=p.getContext("2d",{willReadFrequently:!0});return r.drawImage(t,e.x||0,e.y||0,e.width,e.height,0,0,e.width,e.height),r.getImageData(0,0,e.width,e.height)}const x={left:[0,-.5],right:[-1,-.5],top:[-.5,0],bottom:[-.5,-1],"top-right":[-1,0],"bottom-left":[0,-1],"bottom-right":[-1,-1],center:[-.5,-.5],"top-left":[0,0]};function b(t,e,r,i,n){let s;Object.defineProperty(t[e],r,{enumerable:!0,get:()=>{var o,a;if(null!=s)return s;if(null!=i)return m(i,t.context);const l=null===(o=t.context.featureStyle)||void 0===o||null===(a=o[e])||void 0===a?void 0:a[r];return null!=l?m(l,t.context):n instanceof Function?n(t.context.properties,t.context):n},set:t=>{s=t}})}class _{#c=new h.Z("EPSG:4326",0,0,0);#h=new h.Z("EPSG:4326",0,0,0);#u=!0;#d={};#p={};setZoom(t){this.zoom=t}setFeature(t){this.#d=t}setGeometry(t){this.#p=t}setCollection(t){this.collection=t,this.#h.setCrs(t.crs)}setLocalCoordinatesFromArray(t,e){return this.#u=!1,this.#h.setFromArray(t,e)}get properties(){return this.#p.properties}get type(){return this.#d.type}get featureStyle(){let t=this.#d.style;return t instanceof Function&&(t=t(this.properties,this)),t}get coordinates(){return this.#u||(this.#u=!0,this.#c.copy(this.#h).applyMatrix4(this.collection.matrixWorld),"EPSG:4978"!=this.#h.crs)?this.#c:this.#c.as("EPSG:4326",this.#c)}}class w{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isStyle=!0,this.context=new _,this.order=t.order||0,t.zoom=t.zoom||{},t.fill=t.fill||{},t.stroke=t.stroke||{},t.point=t.point||{},t.text=t.text||{},t.icon=t.icon||{},this.zoom={},b(this,"zoom","min",t.zoom.min),b(this,"zoom","max",t.zoom.max),this.fill={},b(this,"fill","color",t.fill.color),b(this,"fill","opacity",t.fill.opacity,1),b(this,"fill","pattern",t.fill.pattern),b(this,"fill","base_altitude",t.fill.base_altitude,f),t.fill.extrusion_height&&b(this,"fill","extrusion_height",t.fill.extrusion_height),this.stroke={},b(this,"stroke","color",t.stroke.color),b(this,"stroke","opacity",t.stroke.opacity,1),b(this,"stroke","width",t.stroke.width,1),b(this,"stroke","dasharray",t.stroke.dasharray,[]),b(this,"stroke","base_altitude",t.stroke.base_altitude,f),this.point={},b(this,"point","color",t.point.color),b(this,"point","line",t.point.line),b(this,"point","opacity",t.point.opacity,1),b(this,"point","radius",t.point.radius,2),b(this,"point","width",t.point.width,0),b(this,"point","base_altitude",t.point.base_altitude,f),t.point.model&&b(this,"point","model",t.point.model),this.text={},b(this,"text","field",t.text.field),b(this,"text","zOrder",t.text.zOrder,"auto"),b(this,"text","color",t.text.color,"#000000"),b(this,"text","anchor",t.text.anchor,"center"),b(this,"text","offset",t.text.offset,[0,0]),b(this,"text","padding",t.text.padding,2),b(this,"text","size",t.text.size,16),b(this,"text","placement",t.text.placement,"point"),b(this,"text","rotation",t.text.rotation,"auto"),b(this,"text","wrap",t.text.wrap,10),b(this,"text","spacing",t.text.spacing,0),b(this,"text","transform",t.text.transform,"none"),b(this,"text","justify",t.text.justify,"center"),b(this,"text","opacity",t.text.opacity,1),b(this,"text","font",t.text.font,["Open Sans Regular","Arial Unicode MS Regular","sans-serif"]),b(this,"text","haloColor",t.text.haloColor,"#000000"),b(this,"text","haloWidth",t.text.haloWidth,0),b(this,"text","haloBlur",t.text.haloBlur,0),this.icon={},b(this,"icon","source",t.icon.source),t.icon.key&&(console.warn("'icon.key' is deprecated: use 'icon.id' instead"),t.icon.id=t.icon.key),b(this,"icon","id",t.icon.id),b(this,"icon","cropValues",t.icon.cropValues),b(this,"icon","anchor",t.icon.anchor,"center"),b(this,"icon","size",t.icon.size,1),b(this,"icon","color",t.icon.color),b(this,"icon","opacity",t.icon.opacity,1)}copy(t){return Object.assign(this.fill,t.fill),Object.assign(this.stroke,t.stroke),Object.assign(this.point,t.point),Object.assign(this.text,t.text),Object.assign(this.icon,t.icon),this}clone(){return(new w).copy(this)}setContext(t){this.context=t}static setFromProperties(t,e){const r=e.type,n={};if(r===i.tg.POINT){const e={...void 0!==t.fill&&{color:t.fill},...void 0!==t["fill-opacity"]&&{opacity:t["fill-opacity"]},...void 0!==t.stroke&&{line:t.stroke},...void 0!==t.radius&&{radius:t.radius}};Object.keys(e).length&&(n.point=e);const r={...void 0!==t["label-color"]&&{color:t["label-color"]},...void 0!==t["label-opacity"]&&{opacity:t["label-opacity"]},...void 0!==t["label-size"]&&{size:t["label-size"]}};Object.keys(e).length&&(n.text=r);const i={...void 0!==t.icon&&{source:t.icon},...void 0!==t["icon-scale"]&&{size:t["icon-scale"]},...void 0!==t["icon-opacity"]&&{opacity:t["icon-opacity"]},...void 0!==t["icon-color"]&&{color:t["icon-color"]}};Object.keys(i).length&&(n.icon=i)}else{const e={...void 0!==t.stroke&&{color:t.stroke},...void 0!==t["stroke-width"]&&{width:t["stroke-width"]},...void 0!==t["stroke-opacity"]&&{opacity:t["stroke-opacity"]}};if(Object.keys(e).length&&(n.stroke=e),r!==i.tg.LINE){const e={...void 0!==t.fill&&{color:t.fill},...void 0!==t["fill-opacity"]&&{opacity:t["fill-opacity"]}};Object.keys(e).length&&(n.fill=e)}}return n}static setFromVectorTileLayer(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n={fill:{},stroke:{},point:{},text:{},icon:{}};if(t.layout=t.layout||{},t.paint=t.paint||{},n.order=r,"fill"===t.type){const{color:r,opacity:i}=g(A(t.paint["fill-color"]||t.paint["fill-pattern"],{type:"color"}));if(n.fill.color=r,n.fill.opacity=A(t.paint["fill-opacity"])||i,t.paint["fill-pattern"])try{n.fill.pattern={id:t.paint["fill-pattern"],source:e.source,cropValues:e[t.paint["fill-pattern"]]}}catch(e){throw e.message=`VTlayer '${t.id}': argument sprites must not be null when using layer.paint['fill-pattern']`,e}if(t.paint["fill-outline-color"]){const{color:e,opacity:r}=g(A(t.paint["fill-outline-color"],{type:"color"}));n.stroke.color=e,n.stroke.opacity=r,n.stroke.width=1,n.stroke.dasharray=[]}}else if("line"===t.type){const e=A(t.paint["line-color"],{type:"color"}),{color:r,opacity:i}=g(e);n.stroke.dasharray=A(t.paint["line-dasharray"]),n.stroke.color=r,n.stroke.lineCap=t.layout["line-cap"],n.stroke.width=A(t.paint["line-width"]),n.stroke.opacity=A(t.paint["line-opacity"])||i}else if("circle"===t.type||i){const{color:e,opacity:r}=g(A(t.paint["circle-color"],{type:"color"}));n.point.color=e,n.point.opacity=r,n.point.radius=A(t.paint["circle-radius"])}else if("symbol"===t.type){n.text.zOrder=A(t.layout["symbol-z-order"]),"auto"==n.text.zOrder?n.text.zOrder=A(t.layout["symbol-sort-key"])||"Y":"viewport-y"==n.text.zOrder?n.text.zOrder="Y":"source"==n.text.zOrder&&(n.text.zOrder=0),n.text.anchor=A(t.layout["text-anchor"]),n.text.offset=A(t.layout["text-offset"]),n.text.padding=A(t.layout["text-padding"]),n.text.size=A(t.layout["text-size"]),n.text.placement=A(t.layout["symbol-placement"]),n.text.rotation=A(t.layout["text-rotation-alignment"]),n.text.field=A(t.layout["text-field"]),n.text.wrap=A(t.layout["text-max-width"]),n.text.spacing=A(t.layout["text-letter-spacing"]),n.text.transform=A(t.layout["text-transform"]),n.text.justify=A(t.layout["text-justify"]);const{color:r,opacity:i}=g(A(t.paint["text-color"],{type:"color"}));n.text.color=r,n.text.opacity=A(t.paint["text-opacity"])||void 0!==i&&i,n.text.font=A(t.layout["text-font"]);const s=A(t.paint["text-halo-color"],{type:"color"});s&&(n.text.haloColor=s.color||s,n.text.haloWidth=A(t.paint["text-halo-width"]),n.text.haloBlur=A(t.paint["text-halo-blur"]));const o=A(t.layout["icon-image"]);if(o)try{n.icon.id=o,n.icon.source=e.source,n.icon.cropValues=e[o],n.icon.size=A(t.layout["icon-size"])||1;const{color:r,opacity:i}=g(A(t.paint["icon-color"],{type:"color"}));n.icon.color=r,n.icon.opacity=A(t.paint["icon-opacity"])||void 0!==i&&i}catch(e){throw e.message=`VTlayer '${t.id}': argument sprites must not be null when using layer.layout['icon-image']`,e}}return n.zoom={min:t.minzoom||0,max:t.maxzoom||24},n}applyToCanvasPolygon(t,e,r,i){const n=this.context;this.stroke&&this._applyStrokeToPolygon(t,r,e,n),i&&this.fill&&this._applyFillToPolygon(t,r,e,n)}_applyStrokeToPolygon(t,e,r){t.strokeStyle!==this.stroke.color&&(t.strokeStyle=this.stroke.color);const i=(this.stroke.width||2)*e;t.lineWidth!==i&&(t.lineWidth=i);const n=null==this.stroke.opacity?1:this.stroke.opacity;n!==t.globalAlpha&&"number"==typeof n&&(t.globalAlpha=n),t.lineCap!==this.stroke.lineCap&&(t.lineCap=this.stroke.lineCap),t.setLineDash(this.stroke.dasharray.map((t=>t*e*2))),t.stroke(r)}async _applyFillToPolygon(t,e,r){if(this.fill.pattern){let r=this.fill.pattern;const i=this.fill.pattern.cropValues;this.fill.pattern.source&&(r=await y(this.fill.pattern.source)),v(r,i),t.fillStyle=t.createPattern(p,"repeat"),t.fillStyle.setTransform?t.fillStyle.setTransform(d.scale(e)):console.warn("Raster pattern isn't completely supported on Ie and edge",t.fillStyle)}else t.fillStyle!==this.fill.color&&(t.fillStyle=this.fill.color);this.fill.opacity!==t.globalAlpha&&(t.globalAlpha=this.fill.opacity),t.fill(r)}async applyToHTML(t){if(arguments.length>1&&console.warn("Deprecated argument sprites. Sprites must be configured in style."),t.style.padding=`${this.text.padding}px`,t.style.maxWidth=`${this.text.wrap}em`,t.style.color=this.text.color,this.text.size>0&&(t.style.fontSize=`${this.text.size}px`),t.style.fontFamily=this.text.font.join(","),t.style.textTransform=this.text.transform,t.style.letterSpacing=`${this.text.spacing}em`,t.style.textAlign=this.text.justify,t.style["white-space"]="pre-line",this.text.haloWidth>0&&(t.style.setProperty("--text_stroke_display","block"),t.style.setProperty("--text_stroke_width",`${this.text.haloWidth}px`),t.style.setProperty("--text_stroke_color",this.text.haloColor),t.setAttribute("data-before",t.textContent)),!this.icon.source)return;const e=document.createElement("img"),r=new Promise(((r,i)=>{const n={size:this.icon.size,color:this.icon.color,opacity:this.icon.opacity,anchor:this.icon.anchor};e.onload=()=>r(function(t,e,r){const i=t.cloneNode();switch(i.setAttribute("class","itowns-icon"),i.width=t.width*r.size,i.height=t.height*r.size,i.style.color=r.color,i.style.opacity=r.opacity,i.style.position="absolute",i.style.top="0",i.style.left="0",r.anchor){case"left":i.style.top=-.5*i.height+"px";break;case"right":i.style.top=-.5*i.height+"px",i.style.left=-i.width+"px";break;case"top":i.style.left=-.5*i.width+"px";break;case"bottom":i.style.top=-i.height+"px",i.style.left=-.5*i.width+"px";break;case"bottom-left":i.style.top=-i.height+"px";break;case"bottom-right":i.style.top=-i.height+"px",i.style.left=-i.width+"px";break;case"top-left":break;case"top-right":i.style.left=-i.width+"px";break;default:i.style.top=-.5*i.height+"px",i.style.left=-.5*i.width+"px"}return i.style["z-index"]=-1,e.appendChild(i),i}(e,t,n)),e.onerror=t=>i(t)}));if(this.icon.cropValues||this.icon.color){const t=this.icon.cropValues,r=this.icon.color,i=this.icon.id||this.icon.source,n=function(t,e,r){if(!e)return t;const i=u.get(r,e);if(!i){const i=t.data,n=new a.Color(e),s=new a.Color("white");for(let t=0,e=i.length;t{M.innerHTML+=`${E[t]}\n\n`})),"undefined"!=typeof document&&document.getElementsByTagName("head")[0].appendChild(M);const S=w},28448:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});let i=!1,n=8,s=4096;function o(t,e,r){const i=t.getContext(),n=i.createShader(e);return i.shaderSource(n,r),i.compileShader(n),n}function a(){return navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}const l={isLogDepthBufferSupported:()=>i,isFirefox:a,getMaxTextureUnitsCount:()=>n,getMaxTextureSize:()=>s,updateCapabilities(t){const e=t.getContext();n=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),s=e.getParameter(e.MAX_TEXTURE_SIZE);const r=e.createProgram(),l=o(t,e.VERTEX_SHADER,"void main() {\n gl_Position = vec4( 0.0, 0.0, 0.0, 1.0 );\n}");let c=`#define SAMPLE ${n}\n`;c+="uniform sampler2D uni[SAMPLE];\nvoid main() {\n gl_FragColor += texture2D(uni[SAMPLE-1], vec2(0));\n}";const h=o(t,e.FRAGMENT_SHADER,c);if(e.attachShader(r,l),e.attachShader(r,h),e.linkProgram(r),!1===e.getProgramParameter(r,e.LINK_STATUS)){if(!(n>16))throw new Error(`The GPU capabilities could not be determined accurately.\n Impossible to link a shader with the Maximum texture units ${n}`);{const t=e.getProgramInfoLog(r);console.warn(`${t}: using a maximum of 16 texture units instead of the reported value (${n})`),a()&&console.warn("It can come from a Mesa/Firefox bug;\n the shader compiles to an error when using more than 16 sampler uniforms,\n see https://bugzilla.mozilla.org/show_bug.cgi?id=777028"),n=16}}e.deleteProgram(r),e.deleteShader(l),e.deleteShader(h),i=t.capabilities.logarithmicDepthBuffer}}},42423:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(99477),n=r(74593);class s extends i.BufferGeometry{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){t.buildIndexAndUv_0=!0,t.center=t.builder.center(t.extent).clone();const e=(0,n.Z)(t);e.index=new i.BufferAttribute(e.index,1),e.uvs[0]=new i.BufferAttribute(e.uvs[0],2),e.position=new i.BufferAttribute(e.position,3),e.normal=new i.BufferAttribute(e.normal,3);for(let r=1;r{"use strict";r.d(e,{b:()=>K,Z:()=>ct});var i=r(99477),n=r(232);var s=r(99617),o=r(28448),a=r(97112),l=r(5199);const c=class{static isWebGLAvailable(){try{const t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}static isWebGL2Available(){try{const t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(t){return!1}}static isColorSpaceAvailable(t){try{const e=document.createElement("canvas"),r=window.WebGL2RenderingContext&&e.getContext("webgl2");return r.drawingBufferColorSpace=t,r.drawingBufferColorSpace===t}catch(t){return!1}}static getWebGLErrorMessage(){return this.getErrorMessage(1)}static getWebGL2ErrorMessage(){return this.getErrorMessage(2)}static getErrorMessage(t){const e={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let r='Your $0 does not seem to support $1';const i=document.createElement("div");return i.id="webglmessage",i.style.fontFamily="monospace",i.style.fontSize="13px",i.style.fontWeight="normal",i.style.textAlign="center",i.style.background="#fff",i.style.color="#000",i.style.padding="1.5em",i.style.width="400px",i.style.margin="5em auto 0",r=e[t]?r.replace("$0","graphics card"):r.replace("$0","browser"),r=r.replace("$1",{1:"WebGL",2:"WebGL 2"}[t]),i.innerHTML=r,i}};var h=r(49652),u=r(53175);const d=new i.Vector4,p=class{constructor(t){let e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,u.Dx)(n),void 0===n.antialias&&(n.antialias=!0),void 0===n.alpha&&(n.alpha=!0),void 0===n.logarithmicDepthBuffer&&(n.logarithmicDepthBuffer=!0),t.domElement?(e=t,r=e.domElement instanceof HTMLDivElement?e.domElement:e.domElement.parentElement):r=t,this.width=r.clientWidth,this.height=r.clientHeight,this.positionBuffer=null,this._nextThreejsLayer=1,this.fullSizeRenderTarget=new i.WebGLRenderTarget(this.width,this.height),this.fullSizeRenderTarget.texture.minFilter=i.LinearFilter,this.fullSizeRenderTarget.texture.magFilter=i.NearestFilter,this.fullSizeRenderTarget.depthBuffer=!0,this.fullSizeRenderTarget.depthTexture=new i.DepthTexture,this.fullSizeRenderTarget.depthTexture.type=i.UnsignedShortType,this.renderView=function(t){this.renderer.clear(),this.renderer.render(t.scene,t.camera3D),t.tileLayer&&this.label2dRenderer.render(t.tileLayer.object3d,t.camera3D)}.bind(this),this.onWindowResize=function(t,e){this.width=t,this.height=e,this.fullSizeRenderTarget.setSize(this.width,this.height),this.renderer.setSize(this.width,this.height),this.label2dRenderer.setSize(this.width,this.height)}.bind(this);try{this.label2dRenderer=new h.Z,this.label2dRenderer.setSize(this.width,this.height),r.appendChild(this.label2dRenderer.domElement),this.renderer=e||new i.WebGLRenderer({canvas:document.createElement("canvas"),antialias:n.antialias,alpha:n.alpha,logarithmicDepthBuffer:n.logarithmicDepthBuffer}),this.renderer.domElement.style.position="relative",this.renderer.domElement.style.zIndex=0,this.renderer.domElement.style.top=0}catch(t){throw c.isWebGL2Available()||r.appendChild(c.getErrorMessage(2)),t}-1===this.renderer.domElement.tabIndex&&(this.renderer.domElement.tabIndex=-1),o.Z.updateCapabilities(this.renderer),this.renderer.setClearColor(197896),this.renderer.autoClear=!1,this.renderer.sortObjects=!0,this.renderer.debug.checkShaderErrors=!1,e||(this.renderer.setPixelRatio(r.devicePixelRatio),this.renderer.setSize(r.clientWidth,r.clientHeight),r.appendChild(this.renderer.domElement))}getWindowSize(){return new i.Vector2(this.width,this.height)}getRenderer(){return this.renderer}renderViewToBuffer(t,e){return e||(e={x:0,y:0,width:this.width,height:this.height}),e.buffer=e.buffer||new Uint8Array(4*e.width*e.height),this.renderViewToRenderTarget(t,this.fullSizeRenderTarget,e),this.renderer.readRenderTargetPixels(this.fullSizeRenderTarget,e.x,this.height-(e.y+e.height),e.width,e.height,e.buffer),e.buffer}renderViewToRenderTarget(t,e,r){e||(e=this.fullSizeRenderTarget);const i=this.renderer.getRenderTarget();return r&&(this.fullSizeRenderTarget.scissor.set(r.x,e.height-(r.y+r.height),r.width,r.height),this.fullSizeRenderTarget.scissorTest=!0),this.renderer.setRenderTarget(e),this.renderer.clear(!0,!0,!1),this.renderer.render(t.scene,t.camera.camera3D),this.renderer.setRenderTarget(i),this.fullSizeRenderTarget.scissorTest=!1,e}bufferToImage(t,e,r){const i=document.createElement("canvas"),n=i.getContext("2d",{willReadFrequently:!0});i.width=e,i.height=r;const s=n.getImageData(0,0,e,r);s.data.set(t),n.putImageData(s,0,0);const o=new Image;return o.src=i.toDataURL(),o}depthBufferRGBAValueToOrthoZ(t,e){if(d.fromArray(t).divideScalar(255),o.Z.isLogDepthBufferSupported()&&"PerspectiveCamera"==e.type)return 2**(2*(0,l.On)(d)/(2/(Math.log(e.far+1)/Math.LN2)));{let t=(0,l.On)(d);return t=2*t-1,t}}};var f=r(14625),m=r(79323),g=r(62310),A=r(29372),y=r(95307);const v={executeCommand(t){const e=t.layer,r=t.extentsSource,i=t.extentsDestination||r;return Promise.all(r.map(((t,r)=>e.getData(t,i[r]))))}},x=class{constructor(t){this.command=t,this.isCancelledCommandException=!0}toString(){return`Cancelled command ${this.command.requester.id}/${this.command.layer.id}`}},b={executeCommand(t){const e=[],r=t.layer,i=t.requester,n=t.extentsSource;if(i&&!i.material)return Promise.reject(new x(t));for(const t of n)e.push(r.convert(i,t));return Promise.all(e)}};var _=r(5626),w=r(59099),E=r(43195),M=r(61366),S=r(25542);const C=(new i.Matrix4).makeRotationX(-Math.PI/2),T=(new i.Matrix4).makeRotationZ(-Math.PI/2),I=new TextDecoder;function R(t){const e=["MODELVIEW","MODELVIEWINVERSETRANSPOSE","PROJECTION","JOINTMATRIX"];if(t.gltfShader){const r=[];for(const e in t.gltfShader.boundUniforms)r.push(e);for(const i of r){const r=t.gltfShader.boundUniforms[i].semantic;e.includes(r)||delete t.gltfShader.boundUniforms[i]}}}const B={parse(t,e){const r=!0===e.frustumCulled;if(!t)throw new Error("No array buffer provided.");const n=new DataView(t,4);let s=0;const a={};if(a.magic=I.decode(new Uint8Array(t,0,4)),a.magic){a.version=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.byteLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.FTJSONLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.FTBinaryLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.BTJSONLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.BTBinaryLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT;const l=s+4,c=[];let h={};const u=new i.Vector3;if(a.FTJSONLength>0){const e=l,r=t.slice(e,a.FTJSONLength+e),i=I.decode(new Uint8Array(r));h=JSON.parse(i),h.RTC_CENTER?u.fromArray(h.RTC_CENTER):u.set(0,0,0)}if(a.FTBinaryLength>0&&console.warn("3D Tiles feature table binary not supported yet."),a.BTJSONLength>0){const r=l+a.FTJSONLength+a.FTBinaryLength,i=t.slice(r,r+a.BTJSONLength+a.BTBinaryLength);c.push(Promise.resolve(new _.Z(i,a.BTJSONLength,a.BTBinaryLength,h.BATCH_LENGTH,e.registeredExtensions)))}else c.push(Promise.resolve(new _.Z));const d=l+a.FTJSONLength+a.FTBinaryLength+a.BTJSONLength+a.BTBinaryLength,p=t.slice(d),f=new DataView(p,0,20),m=function(t){if(t.frustumCulled=r,t.material){if(e.overrideMaterials){const r=t.material;"object"==typeof e.overrideMaterials&&e.overrideMaterials.isMaterial?t.material=e.overrideMaterials:t.material=new i.MeshBasicMaterial,(0,w.Z)(r)}else o.Z.isLogDepthBufferSupported()&&t.material.isRawShaderMaterial&&!e.doNotPatchMaterial&&(E.Z.patchMaterialForLogDepthSupport(t.material),console.warn("glTF shader has been patched to add log depth buffer support"));(0,M.Z)(t.material,e.layer)}};return c.push(S.ZP.parse(p,e).then((t=>{for(const e of t.scenes)e.traverse(R);var r,i;r=t.scene,"Z"===(i=e.gltfUpAxis)?r.applyMatrix4(C):"X"===i&&(r.applyMatrix4(C),r.applyMatrix4(T));const n=o.Z.isLogDepthBufferSupported()&&!e.doNotPatchMaterial;(!1===e.frustumCulling||e.overrideMaterials||n||e.layer)&&t.scene.traverse(m),t.scene.position.copy(u);const s=new Uint8Array(p,20,f.getUint32(12,!0)),a=I.decode(new Uint8Array(s)),l=JSON.parse(a);return l.extensions&&l.extensions.CESIUM_RTC&&(t.scene.position.fromArray(l.extensions.CESIUM_RTC.center),t.scene.updateMatrixWorld(!0)),t})).catch((t=>{throw new Error(t)}))),Promise.all(c).then((t=>({gltf:t[1],batchTable:t[0]}))).catch((t=>{throw new Error(t)}))}throw new Error("Invalid b3dm file.")}},L=new TextDecoder,P=function(t,e){if(!t)throw new Error("No array buffer provided.");const r=new DataView(t);let n=0;const s={};let o={},a={};if(s.magic=L.decode(new Uint8Array(t,n,4)),n+=4,s.magic){s.version=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.byteLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.FTJSONLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.FTBinaryLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.BTBinaryLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT;let l={};if(s.FTJSONLength>0){const e=n,r=t.slice(e,s.FTJSONLength+e),i=L.decode(new Uint8Array(r));l=JSON.parse(i)}if(s.FTBinaryLength>0&&(a=function(t,e,r){const n=new i.BufferGeometry,s=L.decode(new Uint8Array(t,e,r)),o=JSON.parse(s);let a;if(o.POINTS_LENGTH&&(a=o.POINTS_LENGTH),o.POSITION){const r=o.POSITION.byteOffset+s.length+e,l=new Float32Array(t,r,3*a);n.setAttribute("position",new i.BufferAttribute(l,3))}if(o.RGB){const r=o.RGB.byteOffset+s.length+e,l=new Uint8Array(t,r,3*a);n.setAttribute("color",new i.BufferAttribute(l,3,!0))}if(o.POSITION_QUANTIZED)throw new Error("For pnts loader, POSITION_QUANTIZED: not yet managed");if(o.RGBA)throw new Error("For pnts loader, RGBA: not yet managed");if(o.RGB565)throw new Error("For pnts loader, RGB565: not yet managed");if(o.NORMAL)throw new Error("For pnts loader, NORMAL: not yet managed");if(o.NORMAL_OCT16P)throw new Error("For pnts loader, NORMAL_OCT16P: not yet managed");if(o.BATCH_ID)throw new Error("For pnts loader, BATCH_ID: not yet managed");return{geometry:n,offset:o.RTC_CENTER?(new i.Vector3).fromArray(o.RTC_CENTER):void 0}}(t,n,s.FTJSONLength)),s.BTJSONLength>0){const r=n+s.FTJSONLength+s.FTBinaryLength,c=t.slice(r,s.BTJSONLength+s.BTBinaryLength+r);o=new _.Z(c,s.BTJSONLength,s.BTBinaryLength,l.BATCH_ID&&l.BATCH_LENGTH?l.BATCH_LENGTH:l.POINTS_LENGTH,e),a=function(t,e){if(t.geometry)return e.content&&e.content.Classification&&t.geometry.setAttribute("classification",new i.BufferAttribute(new Uint8Array(e.content.Classification),1,!0)),t}(a,o)}const c={point:a,batchTable:o};return Promise.resolve(c)}throw new Error("Invalid pnts file.")};var D=r(45340),O=r(25033);const k=new TextDecoder;function U(t,e,r){const n=i.LoaderUtils.extractUrlBase(r),s={gltfUpAxis:e.tileset.asset.gltfUpAxis,urlBase:n,overrideMaterials:e.overrideMaterials,doNotPatchMaterial:e.doNotPatchMaterial,registeredExtensions:e.registeredExtensions,layer:e};return B.parse(t,s).then((t=>({batchTable:t.batchTable,object3d:t.gltf.scene})))}function N(t,e,r){const n=i.LoaderUtils.extractUrlBase(r);return S.ZP.parse(t,n).then((t=>({object3d:t.scene})))}function F(t,e){return P(t,e.registeredExtensions).then((t=>{const r=e.material?e.material.clone():new O.ZP({size:.05,mode:e.pntsMode,shape:e.pntsShape,classification:e.classification,sizeMode:e.pntsSizeMode,minAttenuatedSize:e.pntsMinAttenuatedSize,maxAttenuatedSize:e.pntsMaxAttenuatedSize});(0,M.Z)(r,e);const n=new i.Points(t.point.geometry,r);return t.point.offset&&n.position.copy(t.point.offset),{object3d:n,batchTable:t.batchTable}}))}const z={executeCommand:function(t){const e=t.layer,r=t.metadata,n=new i.Object3D;!function(t,e,r,i){t.frustumCulled=!1,t.layer=e,r.transform&&t.applyMatrix4(r.transform),t.geometricError=r.geometricError,t.tileId=r.tileId,r.refine?t.additiveRefinement="ADD"===r.refine.toUpperCase():t.additiveRefinement=!!i&&i.additiveRefinement,t.viewerRequestVolume=r.viewerRequestVolume,t.boundingVolume=r.boundingVolume,t.updateMatrixWorld()}(n,e,r,t.requester);const s=r.content&&(r.content.url||r.content.uri),o=t=>{t.userData.metadata=r,t.layer=e};if(s){let t=s.startsWith("http")?s:r.baseURL+s;e.source.isC3DTilesGoogleSource&&(t=e.source.getTileUrl(t));const i={b3dm:U,pnts:F,gltf:N};return D.Z.arrayBuffer(t,e.source.networkOptions).then((s=>{if(void 0!==s){let a;const l=k.decode(new Uint8Array(s,0,4));if("{"===l[0]){s=JSON.parse(k.decode(new Uint8Array(s)));const i=e.source.isC3DTilesGoogleSource?e.source.baseUrl:t.slice(0,t.lastIndexOf("/")+1);e.tileset.extendTileset(s,r.tileId,i,e.registeredExtensions)}else if("b3dm"==l)a=i.b3dm;else if("pnts"==l)a=i.pnts;else{if("glTF"!=l)return Promise.reject(`Unsupported magic code ${l}`);a=i.gltf}if(a)return a(s,e,t).then((t=>(n.content=t.object3d,t.batchTable&&(n.batchTable=t.batchTable),n.add(t.object3d),n.traverse(o),n)))}return n.traverse(o),n}))}return n.traverse(o),Promise.resolve(n)}};var G=r(71440);let Q=1;const j={executeCommand(t){const e=t.layer,r=t.requester;return r.load().then((n=>{const s=new i.Points(n,e.material);return function(t){const e=t.geometry.attributes.position.count,r=new Uint8Array(4*e),n=Q++;if(e>65535||n>65535)return console.warn("Currently picking is limited to Points with less than 65535 elements and less than 65535 Points instances"),t;for(let t=0;t>24,r[4*t+1]=(16711680&e)>>16,r[4*t+2]=(65280&e)>>8,r[4*t+3]=(255&e)>>0}t.baseId=n,t.geometry.setAttribute("unique_id",new i.BufferAttribute(r,4,!0))}(s),s.frustumCulled=!1,s.matrixAutoUpdate=!1,s.position.copy(n.userData.origin||r.bbox.min),s.scale.copy(e.scale),s.updateMatrix(),s.tightbbox=n.boundingBox.applyMatrix4(s.matrix),s.layer=e,s.extent=G.ZP.fromBox3(t.view.referenceCrs,r.bbox),s.userData.node=r,s}))}};var V=r(4380);function H(t,e){const r=e.priority-t.priority;return 0===r?e.timestamp-t.timestamp:r}function W(){return{queue(t){const e=t.layer;let r=this.storages.get(e.id);r||(r={q:new y({comparator:H}),priority:1,accumulator:0},this.storages.set(e.id,r)),r.priority=e.priority||1,r.q.queue(t),this.counters.pending++},storages:new Map,counters:{executing:0,executed:0,failed:0,cancelled:0,pending:0},execute(t,e){return this.counters.pending--,this.counters.executing++,e.executeCommand(t).then((e=>{this.counters.executing--,t.resolve(e),this.counters.executed++}),(e=>{this.counters.executing--,t.reject(e),this.counters.failed++}))}}}function q(){this.defaultQueue=W(),this.hostQueues=new Map,this.providers={},this.maxCommandsPerHost=6,this.initDefaultProviders()}q.prototype.constructor=q,q.prototype.initDefaultProviders=function(){this.addProtocolProvider("tile",b),this.addProtocolProvider("3d-tiles",z),this.addProtocolProvider("pointcloud",j)},q.prototype.runCommand=function(t,e,r){const i=this.getProtocolProvider(t.layer.protocol);if(!i)throw new Error(`No known provider for layer ${t.layer.id}`);e.execute(t,i,r).then((()=>{if(t.view.notifyChange(t.requester,t.redraw),e.counters.executing{t.resolve=e,t.reject=r})),r&&!this.hostQueues.has(r)&&this.hostQueues.set(r,W());const i=r?this.hostQueues.get(r):this.defaultQueue;return t.timestamp=Date.now(),i.queue(t),i.counters.executing{if(i.counters.executing0&&(i+=t.priority,t.accumulator+=t.priority,(!e||t.accumulator>r)&&(e=t,r=t.accumulator))}if(e)return e.accumulator-=i,e.q}(t.storages);for(;e&&e.length>0;){const r=e.dequeue();if(!r.earlyDropFunction||!r.earlyDropFunction(r))return r;t.counters.pending--,t.counters.cancelled++,r.reject(new x(r))}};const Z=q;var Y=r(98675),X=r(76257),J=r(70991);const K={LAYERS_INITIALIZED:"layers-initialized",LAYER_REMOVED:"layer-removed",LAYER_ADDED:"layer-added",INITIALIZED:"initialized",COLOR_LAYERS_ORDER_CHANGED:a.i,CAMERA_MOVED:"camera-moved"},$=new i.Vector2,tt=new i.Matrix4,et=new i.Vector2,rt=new i.Ray,it=new i.Vector3,nt=new i.Vector3,st=new g.Z("EPSG:4326"),ot=[];let at;class lt extends i.EventDispatcher{#f=[];#m=new Uint8Array(4);#g;constructor(t,e){let r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("Invalid viewerDiv parameter (must non be null/undefined)");super(),this.domElement=e,this.referenceCrs=t,r=o.renderer&&o.renderer.domElement?new p(o.renderer):new p(e,o.renderer),this.mainLoop=o.mainLoop||new s.ZP(new Z,r),this.scene=o.scene3D||new i.Scene,o.scene3D||(this.scene.matrixWorldAutoUpdate=!1),this.camera=new n.Z(this.referenceCrs,this.mainLoop.gfxEngine.getWindowSize().x,this.mainLoop.gfxEngine.getWindowSize().y,o.camera),this._frameRequesters={},this._resizeListener=()=>this.resize(),window.addEventListener("resize",this._resizeListener,!1),this._changeSources=new Set,this._delayedFrameRequesterRemoval=[],this._allLayersAreReadyCallback=()=>{this.getLayers().every((t=>t.ready))&&0==this.mainLoop.scheduler.commandsWaitingExecutionCount()&&this.mainLoop.renderingState==s.HR&&(this.dispatchEvent({type:K.LAYERS_INITIALIZED}),this.removeFrameRequester(s.Ao.UPDATE_END,this._allLayersAreReadyCallback))},this.camera.resize(this.domElement.clientWidth,this.domElement.clientHeight);const a=()=>{this.removeEventListener(K.LAYERS_INITIALIZED,a),this.dispatchEvent({type:K.INITIALIZED})};let l;this.addEventListener(K.LAYERS_INITIALIZED,a),this.#g=new Uint8Array(4*this.camera.width*this.camera.height),this.domElement.tabIndex=-1,o.disableFocusOnStart||this.domElement.focus(),this.domElement.addEventListener("mouseup",(t=>{2===t.button&&(l&&t.timeStamp-l<500&&this.domElement.dispatchEvent(new MouseEvent("dblclick-right",t)),l=t.timeStamp)})),ot.push(this),o.webXR&&((t,e)=>{const r=e.scale||1,n=t.mainLoop.gfxEngine.renderer.xr;n.addEventListener("sessionstart",(()=>{const e=t.camera.camera3D,s=i=>{"Escape"===i.key&&(document.removeEventListener("keydown",s),n.enabled=!1,t.camera.camera3D=e,t.scene.scale.multiplyScalar(1/r),t.scene.updateMatrixWorld(),async function(t){t&&await t.end()}(n.getSession()),t.notifyChange(t.camera.camera3D,!0))};t.scene.scale.multiplyScalar(r),t.scene.updateMatrixWorld(),n.enabled=!0,n.getReferenceSpace("local");const o=t.camera.position(),a=(new i.Quaternion).setFromUnitVectors(new i.Vector3(0,0,1),o.geodesicNormal).invert(),l=new i.Quaternion(-1,0,0,1).normalize().multiply(a),c=e.position.clone().multiplyScalar(-r).applyQuaternion(l),h=new XRRigidTransform(c,l),u=n.getReferenceSpace().getOffsetReferenceSpace(h);n.setReferenceSpace(u),t.camera.camera3D=n.getCamera(),t.camera.resize(t.camera.width,t.camera.height),document.addEventListener("keydown",s,!1),n.setAnimationLoop((e=>{n.isPresenting&&t.camera.camera3D.cameras[0]&&(t.camera.camera3D.updateMatrix(),t.camera.camera3D.updateMatrixWorld(!0),t.notifyChange(t.camera.camera3D,!0)),t.mainLoop.step(t,e)}))}))})(this,o.webXR)}get renderer(){var t,e;return null===(t=this.mainLoop)||void 0===t||null===(e=t.gfxEngine)||void 0===e?void 0:e.getRenderer()}get camera3D(){var t;return null===(t=this.camera)||void 0===t?void 0:t.camera3D}dispose(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=ot.indexOf(this);if(-1==e)return void console.warn("View already disposed");window.removeEventListener("resize",this._resizeListener),this.controls&&("function"==typeof this.controls.dispose&&this.controls.dispose(),delete this.controls),this.removeAllFrameRequesters(),this.removeAllEvents();const r=this.getLayers((t=>!t.isTiledGeometryLayer&&!t.isAtmosphere));for(const e of r)this.removeLayer(e.id,t);const i=this.getLayers((t=>t.isAtmosphere));for(const e of i)this.removeLayer(e.id,t);const n=this.getLayers((t=>t.isTiledGeometryLayer));for(const e of n)this.removeLayer(e.id,t);ot.splice(e,1),this.scene.traverse(J.Z.cleanup)}addLayer(t,e){if(!t||!t.isLayer)return Promise.reject(new Error("Add Layer type object"));if(this.getLayerById(t.id))return t._reject(new Error(`Invalid id '${t.id}': id already used`));if(t=function(t,e,r){const i=e.source;if(r&&!e.extent&&(e.extent=r.extent,i&&!i.extent&&(i.extent=r.extent)),e.isGeometryLayer&&!e.isLabelLayer?e.crs=t.referenceCrs:e.crs||(r&&r.tileMatrixSets&&r.tileMatrixSets.includes(m.Z.formatToTms(i.crs))?e.crs=i.crs:e.crs=r&&r.extent.crs),e.isLabelLayer)t.mainLoop.gfxEngine.label2dRenderer.registerLayer(e);else if(e.labelEnabled||e.addLabelLayer){e.labelEnabled&&console.info("layer.labelEnabled is deprecated use addLabelLayer, instead of"),e.buildExtent=!0,e.structure="3d";const r=new X.Z(`${e.id}-label`,{source:i,style:e.style,zoom:e.zoom,performance:e.addLabelLayer.performance,crs:i.crs,visible:e.visible,margin:15,forceClampToTerrain:e.addLabelLayer.forceClampToTerrain});e.addEventListener("visible-property-changed",(()=>{r.visible=e.visible}));const n=i=>{i.layerId===e.id&&t.removeLayer(r.id),t.removeEventListener(K.LAYER_REMOVED,n)};t.addEventListener(K.LAYER_REMOVED,n),e.whenReady=e.whenReady.then((()=>(t.addLayer(r),e)))}return e}(this,t,e),e)if(t.isColorLayer){const r=this.getLayers((t=>t.isColorLayer));if(t.sequence=r.length,!(e.countColorLayersTextures(...r,t)<=(0,l.dn)()))return t._reject(new Error(`Cant add color layer ${t.id}: the maximum layer is reached`));e.attach(t)}else e.attach(t);else{if("function"!=typeof t.update)return t._reject(new Error("Cant add GeometryLayer: missing a update function"));if("function"!=typeof t.preUpdate)return t._reject(new Error("Cant add GeometryLayer: missing a preUpdate function"));this.#f.push(t)}return t.object3d&&!t.object3d.parent&&t.object3d!==this.scene&&this.scene.add(t.object3d),Promise.all(t._promises).then((()=>{t._resolve(),this.notifyChange(e||t,!1),this._frameRequesters[s.Ao.UPDATE_END]&&this._frameRequesters[s.Ao.UPDATE_END].includes(this._allLayersAreReadyCallback)||this.addFrameRequester(s.Ao.UPDATE_END,this._allLayersAreReadyCallback),this.dispatchEvent({type:K.LAYER_ADDED,layerId:t.id})}),t._reject),t.whenReady}removeLayer(t,e){const r=this.getLayerById(t);if(r){const i=r.parent;if(r.delete(e),i&&!i.detach(r))throw new Error(`Error to detach ${t} from ${i.id}`);if(null==i&&this.#f.splice(this.#f.findIndex((e=>e.id==t)),1),r.isColorLayer){const t=this.getLayers((t=>t.isColorLayer));for(const e of t)e.sequence>r.sequence&&e.sequence--}let n=0;for(const t of ot)n+=t.getLayers((t=>t.source.uid==r.source.uid&&t.crs==r.crs)).length;return r.source.onLayerRemoved({unusedCrs:0==n?r.crs:void 0}),this.notifyChange(this.camera),this.dispatchEvent({type:K.LAYER_REMOVED,layerId:t}),!0}throw new Error(`${t} doesn't exist`)}notifyChange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&(this._changeSources.add(t),this.mainLoop.gfxEngine.renderer.xr.isPresenting||!t.isTileMesh&&!t.isCamera||(this.#g.needsUpdate=!0)),this.mainLoop.scheduleViewUpdate(this,e)}getLayers(t){const e=[];for(const r of this.#f)if(t&&!t(r)||e.push(r),r.attachedLayers)for(const i of r.attachedLayers)t&&!t(i,r)||e.push(i);return e}getLayerById(t){return this.getLayers((e=>e.id===t))[0]}addFrameRequester(t,e){if("function"!=typeof e)throw new Error("frameRequester must be a function");this._frameRequesters[t]?this._frameRequesters[t].push(e):this._frameRequesters[t]=[e]}removeFrameRequester(t,e){this._frameRequesters[t].includes(e)?this._delayedFrameRequesterRemoval.push({when:t,frameRequester:e}):console.error("Invalid call to removeFrameRequester: frameRequester isn't registered")}removeAllFrameRequesters(){for(const t in this._frameRequesters)if(Object.prototype.hasOwnProperty.call(this._frameRequesters,t)){const e=this._frameRequesters[t];for(const r of e)this.removeFrameRequester(t,r)}this._executeFrameRequestersRemovals()}removeAllEvents(){if(void 0!==this._listeners){for(const t in this._listeners)Object.prototype.hasOwnProperty.call(this._listeners,t)&&delete this._listeners[t];this._listeners=void 0}}_executeFrameRequestersRemovals(){for(const t of this._delayedFrameRequesterRemoval){const e=this._frameRequesters[t.when].indexOf(t.frameRequester);e>=0?this._frameRequesters[t.when].splice(e,1):console.warn("FrameReq has already been removed")}this._delayedFrameRequesterRemoval.length=0}execFrameRequesters(t,e,r){if(this._frameRequesters[t]){this._delayedFrameRequesterRemoval.length>0&&this._executeFrameRequestersRemovals();for(var i=arguments.length,n=new Array(i>3?i-3:0),s=3;s1&&void 0!==arguments[1]?arguments[1]:$,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.domElement.getBoundingClientRect();if(t.touches&&t.touches.length)return e.set(t.touches[r].clientX-i.x,t.touches[r].clientY-i.y);if(void 0!==t.offsetX&&void 0!==t.offsetY){const r=t.target.getBoundingClientRect();return e.set(r.x+t.offsetX-i.x,r.y+t.offsetY-i.y)}}eventToNormalizedCoords(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewToNormalizedCoords(this.eventToViewCoords(t,$,e))}viewToNormalizedCoords(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$;return e.x=t.x/this.camera.width*2-1,e.y=t.y/this.camera.height*-2+1,e}normalizedToViewCoords(t){return $.x=.5*(t.x+1)*this.camera.width,$.y=-.5*(t.y-1)*this.camera.height,$}pickObjectsAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;const i=[];if(r&&0!==r.length||(r=this.getLayers((t=>t.isGeometryLayer))),Array.isArray(r)||(r=[r]),r.forEach((t=>{"string"==typeof t&&(t=this.getLayerById(t)),t&&(t.isGeometryLayer||t.isObject3D)&&i.push(t)})),0==i.length)return[];const n=[],s=t instanceof Event?this.eventToViewCoords(t):t;for(const t of i)if(!t.isAtmosphere)if(t.isGeometryLayer){if(!t.ready){console.warn("view.pickObjectAt : layer is not ready : ",t);continue}t.pickObjectsAt(this,s,e,n)}else Y.Z.pickObjectsAt(this,s,e,t,n);return n}getScale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28;return this.camera3D.isOrthographicCamera?.001*t/this.getPixelsToMeters():this.getScaleFromDistance(t,this.getDistanceFromCamera())}getScaleFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t/=1e3;const r=i.MathUtils.degToRad(this.camera3D.fov);return t*(this.camera.height/(2*e*Math.tan(.5*r)))}getDistanceFromCamera(t){return this.getPickingPositionFromDepth(t,nt),this.camera3D.position.distanceTo(nt)}getPixelsToMeters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(at=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,t*at/this.camera.width):this.getPixelsToMetersFromDistance(t,this.getDistanceFromCamera(e))}getPixelsToMetersFromDistance(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)/this.camera._preSSE}getMetersToPixels(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(at=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,t*this.camera.width/at):this.getMetersToPixelsFromDistance(t,this.getDistanceFromCamera(e))}getMetersToPixelsFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.camera._preSSE*t/e}pickFeaturesAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;nt.isColorLayer||t.isGeometryLayer)):i).forEach((t=>{"string"==typeof t&&(t=this.getLayerById(t)),t&&t.isLayer&&(o[t.id]=[],t.isColorLayer&&s.push(t.id))}));const a=t instanceof Event?this.eventToViewCoords(t,$):t,l=this.pickObjectsAt(a,e,...i);if(l.length>0&&l.forEach((t=>o[t.layer.id].push(t))),0==s.length)return o;let c;this.getPickingPositionFromDepth(a,nt),st.crs=this.referenceCrs,st.setFromVector3(nt);const h={M:this.getPixelsToMeters(e,a),D:.001*e};this.isPlanarView?h.D=h.M:this.getPixelsToDegrees&&(h.D=this.getMetersToDegrees(h.M));const u=Y.Z.pickTilesAt(this,a,e,this.tileLayer);for(const t of u)if(t.object.material)for(const e of t.object.material.getLayers(s))for(const t of e.textures)t.features&&(c=m.Z.isMetricUnit(t.features.crs)?h.M:h.D,A.Z.filterFeaturesUnderCoordinate(st,t.features,c).forEach((t=>{o[e.id].find((e=>e.geometry===t.geometry))||o[e.id].push(t)})));return o}readDepthBuffer(t,e,r,i,n){const s=this.mainLoop.gfxEngine,o=this.tileLayer.wireframe,a=this.tileLayer.opacity,l=this.tileLayer.visible;o&&(this.tileLayer.wireframe=!1),a<1&&(this.tileLayer.opacity=1),l||(this.tileLayer.visible=!0);const c=this.tileLayer.level0Nodes.map((t=>f.Z.push(t,f.Z.MODES.DEPTH)));return n=s.renderViewToBuffer({camera:this.camera,scene:this.tileLayer.object3d},{x:t,y:e,width:r,height:i,buffer:n}),c.forEach((t=>t())),this.tileLayer.wireframe!==o&&(this.tileLayer.wireframe=o),this.tileLayer.opacity!==a&&(this.tileLayer.opacity=a),this.tileLayer.visible!==l&&(this.tileLayer.visible=l),n}getPickingPositionFromDepth(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;if(!this.tileLayer||0==this.tileLayer.level0Nodes.length||!this.tileLayer.level0Nodes[0])return void(e=void 0);const r=this.mainLoop,n=0==r.scheduler.commandsWaitingExecutionCount()&&r.renderingState==s.HR,a=r.gfxEngine,l=a.getWindowSize();let c;if((t=t||l.clone().multiplyScalar(.5)).x=Math.floor(t.x),t.y=Math.floor(t.y),n){this.#g.needsUpdate&&(this.readDepthBuffer(0,0,l.x,l.y,this.#g),this.#g.needsUpdate=!1);const e=4*((l.y-t.y-1)*l.x+t.x);c=this.#g.slice(e,e+4)}else c=this.readDepthBuffer(t.x,t.y,1,1,this.#m);if(et.x=t.x/l.x*2-1,et.y=-t.y/l.y*2+1,o.Z.isLogDepthBufferSupported()&&"PerspectiveCamera"==this.camera3D.type){rt.origin.copy(this.camera3D.position),rt.direction.set(et.x,et.y,.5),tt.multiplyMatrices(this.camera3D.matrixWorld,tt.copy(this.camera3D.projectionMatrix).invert()),rt.direction.applyMatrix4(tt),rt.direction.sub(rt.origin),it.set(0,0,1),it.applyMatrix4(tt),it.sub(rt.origin);const t=it.angleTo(rt.direction),r=a.depthBufferRGBAValueToOrthoZ(c,this.camera3D)/Math.cos(t);e.addVectors(this.camera3D.position,rt.direction.setLength(r))}else{const t=a.depthBufferRGBAValueToOrthoZ(c,this.camera3D);e.set(et.x,et.y,t),e.unproject(this.camera3D)}return e.length()>1e7?void 0:e}pickTerrainCoordinates(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.Z(this.referenceCrs);return t instanceof Event?this.eventToViewCoords(t):t&&void 0!==t.x&&void 0!==t.y?$.copy(t):$.set(this.mainLoop.gfxEngine.width/2,this.mainLoop.gfxEngine.height/2),this.getPickingPositionFromDepth($,nt),st.crs=this.referenceCrs,st.setFromVector3(nt),st.as(e.crs,e),e}pickCoordinates(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.Z(this.referenceCrs);return console.warn("Deprecated, use View#pickTerrainCoordinates instead."),this.pickTerrainCoordinates(t,e)}resize(t,e){t<0||e<0?console.warn(`Trying to resize the View with negative height (${e}) or width (${t}). Skipping resize.`):(null==t&&(t=this.domElement.clientWidth),null==e&&(e=this.domElement.clientHeight),this.#g=new Uint8Array(4*t*e),this.mainLoop.gfxEngine.onWindowResize(t,e),0!==t&&0!==e&&(this.camera.resize(t,e),this.notifyChange(this.camera3D)))}}const ct=lt},11707:(t,e,r)=>{"use strict";r.d(e,{Z:()=>g,y:()=>u});var i=r(99477),n=r(45222),s=r(66014),o=r(47274),a=r(83214),l=r(25033),c=(r(49075),r(84607)),h=r(59099);const u={ON_TILE_CONTENT_LOADED:"on-tile-content-loaded",ON_TILE_REQUESTED:"on-tile-requested"},d=(0,s.Ti)();function p(t){let e=t,r=e.tileId;for(;isNaN(r)&&e.parent;)e=e.parent,r=e.tileId;return r}function f(t){return t.geometry&&t.geometry.attributes._BATCHID}class m extends n.Z{#A;constructor(t,e,r){super(t,new i.Group,{source:e.source}),this.isC3DTilesLayer=!0,this.sseThreshold=e.sseThreshold||16,this.cleanupDelay=e.cleanupDelay||1e3,this.protocol="3d-tiles",this.name=e.name,this.registeredExtensions=e.registeredExtensions||new a.Z,this.pntsMode=l.vj.COLOR,this.pntsShape=l.Uz.CIRCLE,this.classification=e.classification,this.pntsSizeMode=l.E7.VALUE,this.pntsMinAttenuatedSize=e.pntsMinAttenuatedSize||3,this.pntsMaxAttenuatedSize=e.pntsMaxAttenuatedSize||10,e.pntsMode&&(Object.values(l.vj).includes(e.pntsMode)?this.pntsMode=e.pntsMode:console.warn("The points cloud mode doesn't exist. Use 'COLOR' or 'CLASSIFICATION' instead.")),e.pntsShape&&(Object.values(l.Uz).includes(e.pntsShape)?this.pntsShape=e.pntsShape:console.warn("The points cloud point shape doesn't exist. Use 'CIRCLE' or 'SQUARE' instead.")),e.pntsSizeMode&&(Object.values(l.E7).includes(e.pntsSizeMode)?this.pntsSizeMode=e.pntsSizeMode:console.warn("The points cloud size mode doesn't exist. Use 'VALUE' or 'ATTENUATED' instead.")),this._style=e.style||null,this.#A=new Map,this.tilesC3DTileFeatures=new Map,e.onTileContentLoaded&&(console.warn("DEPRECATED onTileContentLoaded should not be passed at the contruction, use C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED event instead"),this.addEventListener(u.ON_TILE_CONTENT_LOADED,e.onTileContentLoaded)),e.overrideMaterials&&(console.warn("overrideMaterials is deprecated, use style API instead"),this.overrideMaterials=e.overrideMaterials),this._cleanableTiles=[];const n=this.addInitializationStep();this.source.whenReady.then((t=>{if(this.tileset=new o.Z(t,this.source.baseUrl,this.registeredExtensions),this.tileset.extensionsUsed)for(const t of this.tileset.extensionsUsed)this.registeredExtensions.isExtensionRegistered(t)||(this.tileset.extensionsRequired&&this.tileset.extensionsRequired.includes(t)?console.error(`3D Tiles tileset required extension "${t}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`):console.warn(`3D Tiles tileset used extension "${t}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`));(0,s.SR)(r,r.mainLoop.scheduler,this,t.root).then(n)}))}preUpdate(){return s.SY.bind(this)()}update(t,e,r){return d(t,e,r)}getObjectToUpdateForAttachedLayers(t){if(t.content){const e=[];t.content.traverse((r=>{r.isObject3D&&r.material&&r.layer==t.layer&&e.push(r)}));const r=t.parent;return r&&r.content?{elements:e,parent:r.content}:{elements:e}}}getC3DTileFeatureFromIntersectsArray(t){let e=null;for(let r=0;r{if(f(e)){const r=e.geometry.getAttribute("_BATCHID");let i=r.getX(0),n=0,s=0;const o=()=>{if(this.tilesC3DTileFeatures.get(t.tileId).has(i))this.tilesC3DTileFeatures.get(t.tileId).get(i).groups.push({start:n,count:s});else{const r=new c.Z(t.tileId,i,[{start:n,count:s}],{},e);this.tilesC3DTileFeatures.get(t.tileId).set(i,r)}},a=e.geometry.getAttribute("position"),l=a.count*a.itemSize;for(let t=0;t=l&&o()}}}))}updateStyle(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this._style)return!1;if(!this.object3d)return!1;const e=[],r=new Map;this.object3d.traverse((e=>{if(f(e)){const i=p(e);if(t&&!t.includes(i))return;r.has(i)||r.set(i,[]),r.get(i).push(e)}}));for(const[t,n]of r){const r=this.tilesC3DTileFeatures.get(t);n.forEach((t=>{t.geometry.clearGroups(),t.material=[];for(const[,e]of r){if(e.object3d!=t)continue;let r=null;r="function"==typeof this._style.fill.color?new i.Color(this._style.fill.color(e)):new i.Color(this._style.fill.color);let n=null;n="function"==typeof this._style.fill.opacity?this._style.fill.opacity(e):this._style.fill.opacity;const s=r.getHexString()+n;let o=null;this.#A.has(s)?o=this.#A.get(s):(o=new i.MeshStandardMaterial({color:r,opacity:n,transparent:n<1,alphaTest:.09}),this.#A.set(s,o));let a=-1;for(let e=0;e{t.geometry.addGroup(e.start,e.count,a)}))}(0,h.O)(t),t.material instanceof Array?t.material.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(t.material)||e.push(t.material)}))}for(const[t,r]of this.#A)e.includes(r)||(r.dispose(),this.#A.delete(t));return!0}get materialCount(){return this.#A.size}set style(t){this._style=t,this.updateStyle()}get style(){return this._style}}const g=m},96836:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a,c:()=>s});var i=r(78025),n=r(81590);function s(t){var e;return null==t||null===(e=t.attachedLayers.filter((t=>t.isGeoidLayer))[0])||void 0===e?void 0:e.visible}class o extends i.Z{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.isGeoidLayer=!0,this.defineLayerProperty("visible",!0)}updateNodeZ(t){t.material.geoidHeight=this.visible?t.geoidHeight:0,t.obb.updateZ({geoidHeight:t.material.geoidHeight})}update(t,e,r,i){if(!i||!r.material)return;const s=r.getExtentsByProjection(e.crs),o=s[0].zoom;if(!(o>e.zoom.max||othis.updateNodeZ(r);e.addEventListener("visible-property-changed",t),r.addEventListener("dispose",(()=>{e.removeEventListener("visible-property-changed",t)}))}if(!e.frozen&&e.visible&&r.material.visible&&r.layerUpdateState[e.id].canTryUpdate())return r.layerUpdateState[e.id].newTry(),this.getData(r.extent,s).then((t=>{r.geoidHeight=t.getHeightAtCoordinates(r.extent.center()),this.updateNodeZ(r),r.layerUpdateState[e.id].noMoreUpdatePossible()}))}}}const a=o},45222:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(78025),n=r(98675),s=r(55086),o=r(70991);class a extends i.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.cacheLifeTime=r.cacheLifeTime??s.D.GEOMETRY;const i=r.visible;if(delete r.visible,super(t,r),this.isGeometryLayer=!0,!e||!e.isObject3D)throw new Error("Missing/Invalid object3d parameter (must be a\n three.js Object3D instance)");"Group"===e.type&&""===e.name&&(e.name=t),Object.defineProperty(this,"object3d",{value:e,writable:!1,configurable:!0}),this.opacity=1,this.wireframe=!1,this.attachedLayers=[],this.visible=i??!0,Object.defineProperty(this.zoom,"max",{value:1/0,writable:!1}),this.filteringExtent=!this.source.isFileSource,this.structure="3d"}get visible(){return this.object3d.visible}set visible(t){if(this.object3d.visible!==t){const e={type:"visible-property-changed",previous:{},new:{}};e.previous.visible=this.object3d.visible,e.new.visible=t,this.dispatchEvent(e),this.object3d.visible=t}}getObjectToUpdateForAttachedLayers(t){if(t.parent&&t.material)return{element:t,parent:t.parent}}postUpdate(){}culling(){return!0}attach(t){if(!t.update)throw new Error(`Missing 'update' function -> can't attach layer\n ${t.id}`);this.attachedLayers.push(t),t.parent=this}detach(t){const e=this.attachedLayers.length;return this.attachedLayers=this.attachedLayers.filter((e=>e.id!=t.id)),t.parent=void 0,this.attachedLayers.length2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return n.Z.pickObjectsAt(t,e,r,this.object3d,i)}}const l=a},81616:(t,e,r)=>{"use strict";r.d(e,{$:()=>s,Z:()=>n});var i=r(71440);class n{constructor(t){this.layer=t}clear(){}update(){}}class s extends n{constructor(t){super(t),this.displayed={tiles:new Set},Object.defineProperty(this.displayed,"layers",{get:()=>{let t=[];return this.displayed.tiles.forEach((e=>{const r=e.material;t=[...new Set([...t,...r.colorLayerIds.filter((t=>r.getLayer(t))),...r.elevationLayerIds])]})),this.layer.attachedLayers.filter((e=>t.includes(e.id)))}}),Object.defineProperty(this.displayed,"extent",{get:()=>{const t=new i.ZP(this.layer.extent.crs,1/0,-1/0,1/0,-1/0);return t.min=1/0,t.max=-1/0,this.displayed.tiles.forEach((e=>{t.union(e.extent),t.min=Math.min(e.obb.z.min,t.min),t.max=Math.max(e.obb.z.max,t.max)})),t}})}clear(){this.displayed.tiles.clear()}update(t){t.material.visible?this.displayed.tiles.add(t):this.displayed.tiles.delete(t)}}},76257:(t,e,r)=>{"use strict";r.d(e,{Z:()=>_});var i=r(99477),n=r(81590),s=r(70991),o=r(45222),a=r(62310),l=r(71440),c=r(59947),h=r(5167),u=r(49075),d=r(49652);const p=new u.uP,f=new a.Z("EPSG:4326",0,0,0),m=new l.ZP("EPSG:4326",0,0,0,0),g=new i.Vector2,A=new i.Vector2,y=new i.Vector2;class v{#y=!1;constructor(){this.dom=document.createElement("div"),this.dom.style.display="none",this.visible=!0}get visible(){return this.#y}set visible(t){t!==this.#y&&(this.#y=t,this.dom.style.display=t?"block":"none")}hide(){this.visible=!1}show(){this.visible=!0}add(t){this.dom.append(t.dom)}}class x extends i.Group{constructor(t){super(),this.nodeParent=t,this.needsUpdate=!0}initializeDom(){this.domElements=new v,this.domElements.labels=new v,this.domElements.add(this.domElements.labels),this.domElements.labels.dom.style.opacity="0"}addLabel(t){this.add(t),this.domElements.labels.dom.append(t.content),t.initDimensions(),this.nodeParent.layer.isGlobeLayer&&this.nodeParent.level<4&&(t.horizonCullingPoint=new i.Vector3)}removeLabel(t){this.remove(t),this.domElements.labels.dom.removeChild(t.content)}updatePosition(t){this.needsUpdate&&(this.needsAltitude&&t.updateElevationFromLayer(this.nodeParent.layer,[this.nodeParent]),t.update3dPosition(this.nodeParent.layer.crs),t.updateHorizonCullingPoint())}count(){return this.children.length}get labels(){return this.children}}class b extends o.Z{#v=new d.R;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.domElement;delete e.domElement,super(t,e.object3d||new i.Group,e),this.isLabelLayer=!0,this.domElement=new v,this.domElement.show(),this.domElement.dom.id=`itowns-label-${this.id}`,this.buildExtent=!0,this.crs=e.source.crs,this.performance=e.performance||!0,this.forceClampToTerrain=e.forceClampToTerrain||!1,this.toHide=new i.Group,this.labelDomelement=r,this.margin=e.margin}get visible(){return super.visible}set visible(t){var e,r;super.visible=t,t?null===(e=this.domElement)||void 0===e||e.show():null===(r=this.domElement)||void 0===r||r.hide()}get submittedLabelNodes(){return this.object3d.children}convert(t,e){const r=[];return e.as(t.crs,m),f.crs=t.crs,p.setZoom(e.zoom),t.features.forEach((e=>{var i,n,s,o;if(e.type!==h.tg.POINT)return;p.setFeature(e);const a=null===(i=e.style)||void 0===i||null===(n=i.text)||void 0===n?void 0:n.field,l=null===(s=e.style)||void 0===s||null===(o=s.point)||void 0===o?void 0:o.base_altitude,d=l instanceof Function&&"baseAltitudeDefault"==l.name;r.needsAltitude=r.needsAltitude||!0===this.forceClampToTerrain||d&&!e.hasRawElevationData,e.geometries.forEach((i=>{if(f.setFromArray(e.vertices,i.size*i.indices[0].offset),f.applyMatrix4(t.matrixWorld),!m.isPointInside(f))return;const n=i.properties.style&&i.properties.style.text&&i.properties.style.text.field;let s;p.setGeometry(i),this.style.setContext(p);const o=this.style.text&&this.style.text.field;if(this.labelDomelement)s=(0,u.Lu)(this.labelDomelement,p);else if(!(n||a||o||i.properties.style&&(i.properties.style.icon.source||i.properties.style.icon.key)||e.style&&e.style.icon&&(e.style.icon.source||e.style.icon.key)||this.style.icon&&(this.style.icon.source||this.style.icon.key)))return;const l=new c.Z(s,f.clone(),this.style);l.layerId=this.id,l.padding=this.margin||l.padding,r.push(l)}))})),r}preUpdate(t,e){e.has(this.parent)&&(this.object3d.clear(),this.#v.width=.5*this.parent.maxScreenSizeNode,this.#v.height=.5*this.parent.maxScreenSizeNode,this.#v.resize())}#x(t){this.object3d.add(t)}#b(t){this.toHide.add(t)}#_(t){var e,r;return null!==(e=t.parent)&&void 0!==e&&e.isTileMesh?(null===(r=t.parent.link[this.id])||void 0===r?void 0:r.domElements)||this.#_(t.parent):this.domElement}#w(t){return t.children.every((t=>{var e;return t.layerUpdateState&&(null===(e=t.layerUpdateState[this.id])||void 0===e?void 0:e.hasFinished())}))}#E(t){const e=t.children.slice();this.#v.reset(),e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{t.nodeParent.extent.planarDimensions(g),f.crs=t.nodeParent.extent.crs,f.setFromValues(t.nodeParent.extent.west,t.nodeParent.extent.north,0).toVector3(A),f.copy(e.coordinates).as(t.nodeParent.extent.crs,f).toVector3(y),y.sub(A),y.y+=g.y,y.divide(g).multiplyScalar(this.#v.width),e.updateProjectedPosition(y.x,y.y),this.#v.insert(e)||t.removeLabel(e)}))}update(t,e,r,i){if(!i&&r.link[e.id])return void s.Z.removeChildrenAndCleanupRecursively(this,r);const o=r.link[e.id]||new x(r);if(r.link[e.id]=o,this.frozen||!r.visible||!this.visible)return;if(!r.material.visible&&this.#w(r))return this.#b(o);const a=r.getExtentsByProjection(this.source.crs)||[r.extent],l=a[0].zoom;if(le.zoom.max)return this.#b(o);if(void 0===r.layerUpdateState[this.id]&&(r.layerUpdateState[this.id]=new n.Z),!this.source.extentInsideLimit(r.extent,l))return void r.layerUpdateState[this.id].noMoreUpdatePossible();if(this.#w(r.parent))return r.material.visible||(o.needsUpdate=!0),void this.#x(o);if(!r.layerUpdateState[this.id].canTryUpdate())return;r.layerUpdateState[this.id].newTry();const c={layer:this,extentsSource:a,view:t.view,requester:r};return t.scheduler.execute(c).then((e=>{if(!e)return;const i=t.view.mainLoop.gfxEngine.label2dRenderer;o.initializeDom(),this.#_(r).add(o.domElements),e.forEach((t=>{r.parent?(o.needsAltitude=o.needsAltitude||t.needsAltitude,t.forEach((t=>{r.extent.isPointInside(t.coordinates)&&o.addLabel(t)}))):t.forEach((t=>{s.Z.removeChildrenAndCleanupRecursively(this,t),i.removeLabelDOM(t)}))})),o.count()&&(o.domElements.labels.hide(),o.domElements.labels.dom.style.opacity="1.0",r.addEventListener("show",(()=>o.domElements.labels.show())),r.addEventListener("hidden",(()=>this.#b(o))),r.addEventListener("removed",(()=>this.removeNodeDomElement(r))),o.needsAltitude&&r.material.getElevationLayer()&&r.material.getElevationLayer().addEventListener("rasterElevationLevelChanged",(()=>{o.needsUpdate=!0})),this.performance&&this.#E(o)),r.layerUpdateState[this.id].noMoreUpdatePossible()}))}removeLabelsFromNodeRecursive(t){t.children.forEach((t=>{t.link[this.id]&&delete t.link[this.id],this.removeLabelsFromNodeRecursive(t)})),this.removeNodeDomElement(t)}removeNodeDomElement(t){var e;if(null!==(e=t.link[this.id])&&void 0!==e&&e.domElements){const e=t.link[this.id].domElements.dom;e.parentElement.removeChild(e),delete t.link[this.id].domElements}}delete(t){t&&this.cache.clear(),this.domElement.dom.parentElement.removeChild(this.domElement.dom),this.parent.level0Nodes.forEach((t=>this.removeLabelsFromNodeRecursive(t)))}}const _=b},78025:(t,e,r)=>{"use strict";r.d(e,{M:()=>u,Z:()=>h});var i=r(99477),n=r(60465),s=r(81616),o=r(72726),a=r(55086),l=r(49075);class c extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.projection&&(console.warn("Layer projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),void 0===e.source||!0===e.source)throw new Error(`Layer ${t} needs Source`);var r;super(),this.isLayer=!0,!e.style||e.style instanceof l.ZP||("string"==typeof(null===(r=e.style.fill)||void 0===r?void 0:r.pattern)&&(console.warn("Using style.fill.pattern = { source: Img|url } is adviced"),e.style.fill.pattern={source:e.style.fill.pattern}),e.style=new l.ZP(e.style)),this.style=e.style||new l.ZP,Object.assign(this,e),Object.defineProperty(this,"id",{value:t,writable:!1}),this.options=e.options||{},this.updateStrategy||(this.updateStrategy={type:n.R3,options:{}}),this.defineLayerProperty("frozen",!1),e.zoom?(this.zoom={max:e.zoom.max,min:e.zoom.min||0},null==this.zoom.max&&(this.zoom.max=1/0)):this.zoom={max:1/0,min:0},this.info=new s.Z(this),this.source=this.source||new o.Z({url:"none"}),this.ready=!1,this._promises=[],this.whenReady=new Promise(((t,e)=>{this._resolve=t,this._reject=e})).then((()=>(this.ready=!0,this.source.onLayerAdded({out:this}),this))),this._promises.push(this.source.whenReady),this.cache=new a.Z(e.cacheLifeTime),this.mergeFeatures=void 0===this.mergeFeatures||e.mergeFeatures,this.filter=this.filter||this.source.filter}addInitializationStep(){let t;return this._promises.push(new Promise((e=>{t=e}))),t}defineLayerProperty(t,e,r){const i=Object.getOwnPropertyDescriptor(this,t);if(!i||!i.set){let i=null==this[t]?e:this[t];Object.defineProperty(this,t,{get:()=>i,set:e=>{if(i!==e){const n={type:`${t}-property-changed`,previous:{},new:{}};n.previous[t]=i,n.new[t]=e,i=e,r&&r(this,t),this.dispatchEvent(n)}}})}}convert(t){return t}getData(t,e){const r=this.source.requestToKey(this.source.isVectorSource?e:t);let i=this.cache.getByArray(r);return i||(i=this.source.loadData(t,this).then((t=>this.convert(t,e)),(t=>{throw t})),this.cache.setByArray(i,r)),i}isValidData(){}delete(){console.warn("Function delete doesn't exist for this layer")}}const h=c,u={moveLayerToIndex:function(t,e,r){e=Math.min(e,r.length-1),e=Math.max(e,0);const i=t.sequence;for(const n of r)n.id===t.id?n.sequence=e:n.sequence>i&&n.sequence<=e?n.sequence--:n.sequence>=e&&n.sequence0&&this.moveLayerToIndex(t,t.sequence-1,e)},moveLayerUp:function(t,e){const r=e.length-1;t.sequencet.sequence-e.sequence)),e.map((t=>t.id))}}},81590:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=[1,3,7,60],n=class{constructor(){this.state=0,this.lastErrorTimestamp=0,this.errorCount=0,this.failureParams={lowestLevelError:1/0}}hasFinished(){return 4==this.state}canTryUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();switch(this.state){case 0:return!0;case 3:case 1:case 4:return!1;default:return 1e3*this.secondsUntilNextTry()<=t-this.lastErrorTimestamp}}secondsUntilNextTry(){if(2!==this.state)return 0;const t=Math.max(0,Math.min(this.errorCount,i.length)-1);return i[t]}newTry(){this.state=1}success(){this.lastErrorTimestamp=0,this.state=0}noMoreUpdatePossible(){this.state=4}noData(t){this.state=0,this.failureParams.lowestLevelError=Math.min(t.targetLevel,this.failureParams.lowestLevelError)}failure(t,e,r){r&&null!=r.targetLevel&&(this.failureParams.lowestLevelError=Math.min(r.targetLevel,this.failureParams.lowestLevelError)),this.lastErrorTimestamp=t,this.state=e?3:2,this.errorCount++}inError(){return 3==this.state||2==this.state}}},60465:(t,e,r)=>{"use strict";r.d(e,{AE:()=>s,ET:()=>a,R3:()=>n,c:()=>o,k5:()=>h});var i=r(43412);const n=0,s=1,o=2,a=3;function l(t,e){const r=e.groups.filter((e=>e<=t));return r.length?r[r.length-1]:e.groups[0]}function c(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e==i.pL?r.zoom?r.zoom.min:0:Math.min(t,Math.ceil((e+t)/2))}function h(t,e){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.level,n=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0;const d=h.source.zoom?h.source.zoom.max:1/0;if(u.lowestLevelError!=1/0)r=c(u.lowestLevelError,n,h.source),r=u.lowestLevelError==r?r-1:r,t==s&&(r=l(r,h.updateStrategy.options));else{switch(t){case s:r=l(i,h.updateStrategy.options);break;case o:r=function(t,e,r){return Math.min(t,e+(r.increment||1))}(i,n,h.updateStrategy.options);break;case a:r=c(i,n,h.source);break;default:r=function(t,e,r,i){return t.pendingSubdivision&&!i.isVectorTileSource?r:e}(e,i,n,h.source)}r=Math.min(r,d)}return r}},61366:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const i=function(t,e){if(e&&e.isGeometryLayer){let r=t.transparent;t.layer=e,t.uniforms&&null!=t.uniforms.opacity?Object.defineProperty(t.uniforms.opacity,"value",{get:()=>t.layer.opacity}):null!=t.opacity&&Object.defineProperty(t,"opacity",{get:()=>t.layer.opacity}),t.uniforms&&null!=t.uniforms.mode&&Object.defineProperty(t.uniforms.mode,"value",{get:()=>t.layer.pntsMode}),t.uniforms&&null!=t.uniforms.shape&&Object.defineProperty(t.uniforms.shape,"value",{get:()=>t.layer.pntsShape}),t.uniforms&&null!=t.uniforms.sizeMode&&Object.defineProperty(t.uniforms.sizeMode,"value",{get:()=>t.layer.pntsSizeMode}),t.uniforms&&null!=t.uniforms.minAttenuatedSize&&Object.defineProperty(t.uniforms.minAttenuatedSize,"value",{get:()=>t.layer.pntsMinAttenuatedSize}),t.uniforms&&null!=t.uniforms.maxAttenuatedSize&&Object.defineProperty(t.uniforms.maxAttenuatedSize,"value",{get:()=>t.layer.pntsMaxAttenuatedSize}),Object.defineProperty(t,"wireframe",{get:()=>t.layer.wireframe}),Object.defineProperty(t,"transparent",{get:()=>(r!=t.layer.opacity<1&&(t.needsUpdate=!0,r=t.layer.opacity<1),r)})}return t}},96021:(t,e,r)=>{"use strict";r.d(e,{Z:()=>C});var i=r(99477),n=r(45222),s=r(81616),o=r(98675),a=r(79323),l=r(96836);class c extends i.Mesh{#M=new Map;#S=!0;constructor(t,e,r,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(super(t,e),!n)throw new Error("extent is mandatory to build a TileMesh");this.layer=r,this.extent=n,this.extent.zoom=s,this.level=s,this.material.objectId=this.id,this.obb=this.geometry.OBB.clone(),this.boundingSphere=new i.Sphere,this.obb.box3D.getBoundingSphere(this.boundingSphere);for(const t of r.tileMatrixSets)this.#M.set(t,this.extent.tiledCovering(t));this.frustumCulled=!1,this.matrixAutoUpdate=!1,this.rotationAutoUpdate=!1,this.layerUpdateState={},this.isTileMesh=!0,this.geoidHeight=0,this.link={},Object.defineProperty(this,"visible",{get(){return this.#S},set(t){this.#S!=t&&(this.#S=t,this.dispatchEvent({type:t?"shown":"hidden"}))}})}setBBoxZ(t){t.geoidHeight=(0,l.c)(this.layer)?this.geoidHeight:0,this.obb.updateZ(t),this.horizonCullingPointElevationScaled&&this.horizonCullingPointElevationScaled.setLength(this.obb.z.delta+this.horizonCullingPoint.length()),this.obb.box3D.getBoundingSphere(this.boundingSphere)}getExtentsByProjection(t){return this.#M.get(a.Z.formatToTms(t))}findCommonAncestor(t){if(t)return t.level==this.level?t.id==this.id?t:0!=t.level?this.parent.findCommonAncestor(t.parent):void 0:t.level{c=t})),A.set(l,o,e.level,a),e.extent=r,e.center=t.center(e.extent).clone();let h,u=g.get(a);e.buildIndexAndUv_0=!u,e.builder=t;try{h=(0,f.Z)(e)}catch(t){return Promise.reject(t)}u||(u={},u.index=new i.BufferAttribute(h.index,1),u.uv=new i.BufferAttribute(h.uvs[0],2),g.set(a,u)),h.index=u.index,h.uvs[0]=u.uv,h.position=new i.BufferAttribute(h.position,3),h.normal=new i.BufferAttribute(h.normal,3),e.builder.uvCount>1&&(h.uvs[1]=new i.BufferAttribute(h.uvs[1],1));const p=new d.Z(e,h);return p.OBB=new m.Z(p.boundingBox.min,p.boundingBox.max),p._count=0,p.dispose=()=>{p._count--,p._count<=0&&(p.index=null,delete p.attributes.uv,i.BufferGeometry.prototype.dispose.call(p),A.delete(o,e.level,a))},c(p),Promise.resolve({geometry:p,quaternion:n,position:s})}return l.then((t=>({geometry:t,quaternion:n,position:s})))}(n,a).then((t=>{t.geometry._count++;const a=r.tileMatrixSets.length,c=new u.ZP(r.materialOptions,a);(0,y.Z)(c,r);const d=new h(t.geometry,c,r,e,o);if(s&&s.isTileMesh){const e=n.computeSharableExtent(s.extent);t.position.sub(e.position).applyQuaternion(e.quaternion.invert()),t.quaternion.premultiply(e.quaternion)}if(d.position.copy(t.position),d.quaternion.copy(t.quaternion),d.visible=!1,d.updateMatrix(),function(t,e){if(e.diffuse&&(t.material.diffuse=e.diffuse),e.isGlobeLayer){t.horizonCullingPoint=t.extent.center().as("EPSG:4978").toVector3(),t.extent.planarDimensions(v).multiplyScalar(i.MathUtils.DEG2RAD);const e=v.length(),r=Math.abs(1/Math.cos(.5*e));t.horizonCullingPoint.setLength(r*t.horizonCullingPoint.length()),t.horizonCullingPointElevationScaled=t.horizonCullingPoint.clone()}}(d,r),s){d.geoidHeight=s.geoidHeight;const t=(0,l.c)(r)?d.geoidHeight:0;d.setBBoxZ({min:s.obb.z.min,max:s.obb.z.max,geoidHeight:t}),d.material.geoidHeight=t}return d}))}};var b=r(70991),_=r(81189),w=r(78025);const E=new i.Vector3,M=new i.Vector3;class S extends n.Z{constructor(t,e,r,i,n){if(n.cacheLifeTime=p.D.INFINITE,n.source=!1,super(t,e,n),this.isTiledGeometryLayer=!0,this.object3d.geoidHeight=0,this.protocol="tile",this._hideSkirt=!1,this.sseSubdivisionThreshold=this.sseSubdivisionThreshold||1,this.schemeTile=r,this.builder=i,this.info=new s.$(this),!this.schemeTile)throw new Error(`Cannot init tiled layer without schemeTile for layer ${this.id}`);if(!this.builder)throw new Error(`Cannot init tiled layer without builder for layer ${this.id}`);this.level0Nodes=[];const o=[];for(const t of this.schemeTile)o.push(this.convert(void 0,t));this._promises.push(Promise.all(o).then((t=>{this.level0Nodes=t,this.object3d.add(...t),this.object3d.updateMatrixWorld()}))),this.maxScreenSizeNode=this.sseSubdivisionThreshold*(2*_.kE)}get hideSkirt(){return this._hideSkirt}set hideSkirt(t){this._hideSkirt=t;for(const e of this.level0Nodes)e.traverse((e=>{e.isTileMesh&&(e.geometry.hideSkirt=t)}))}pickObjectsAt(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return o.Z.pickTilesAt(t,e,r,this,i)}preUpdate(t,e){if(e.has(void 0)||0==e.size)return this.level0Nodes;t.colorLayers=t.view.getLayers(((t,e)=>e&&e.id==this.id&&t.isColorLayer)),t.elevationLayers=t.view.getLayers(((t,e)=>e&&e.id==this.id&&t.isElevationLayer)),t.maxElevationLevel=-1;for(const e of t.elevationLayers)t.maxElevationLevel=Math.max(e.source.zoom.max,t.maxElevationLevel);let r;-1==t.maxElevationLevel&&(t.maxElevationLevel=1/0),this.colorLayersOrder=w.M.getColorLayersIdOrderedBySequence(t.colorLayers);for(const t of e.values()){if(t.isCamera)return this.level0Nodes;if(t.layer===this){if(r){if(r=t.findCommonAncestor(r),!r)return this.level0Nodes}else r=t;null==r.material&&(r=void 0)}}return r?[r]:this.level0Nodes}update(t,e,r){if(!r.parent)return b.Z.removeChildrenAndCleanup(this,r);if(r.parent.pendingSubdivision)return r.visible=!1,r.material.visible=!1,void this.info.update(r);if(r.visible=!this.culling(r,t.camera),r.visible){let e=!1;return r.material.visible=!0,this.info.update(r),(r.pendingSubdivision||S.hasEnoughTexturesToSubdivide(t,r)&&this.subdivision(t,this,r))&&(this.subdivideNode(t,r),r.material.visible=r.pendingSubdivision,this.info.update(r),e=!0),r.material.visible&&!e?b.Z.removeChildren(this,r):e?r.children.filter((t=>t.layer==this)):void 0}return r.material.visible=!1,this.info.update(r),b.Z.removeChildren(this,r)}convert(t,e){return x.convert(t,e,this)}countColorLayersTextures(){return arguments.length}culling(t,e){return!e.isBox3Visible(t.obb.box3D,t.matrixWorld)}static hasEnoughTexturesToSubdivide(t,e){const r=e.layerUpdateState||{};let i=e.material.getElevationLayer();for(const n of t.elevationLayers){const t=e.getExtentsByProjection(n.crs)[0].zoom;if(!(t>n.zoom.max||tn.zoom.max||tt.layer==this))){const r=e.extent.subdivision();e.pendingSubdivision=!0;const i={view:t.view,requester:e,layer:this,priority:1e4,extentsSource:r,redraw:!1};return t.scheduler.execute(i).then((r=>{for(const t of r)e.add(t),t.updateMatrixWorld(!0);e.pendingSubdivision=!1,t.view.notifyChange(e,!1)}),(t=>{if(e.pendingSubdivision=!1,!t.isCancelledCommandException)throw new Error(t)}))}}subdivision(t,e,r){if(r.level{"use strict";r.r(e),r.d(e,{$3dTilesCulling:()=>Li.y,$3dTilesSubdivisionControl:()=>Li.Y0,C3DTBatchTable:()=>Ti.Z,C3DTBatchTableHierarchyExtension:()=>Bi,C3DTBoundingVolume:()=>Ci.Z,C3DTExtensions:()=>Ii.Z,C3DTFeature:()=>Mi.Z,C3DTILES_LAYER_EVENTS:()=>Xe.y,C3DTilesBoundingVolumeTypes:()=>Ri.D,C3DTilesGoogleSource:()=>hi,C3DTilesIonSource:()=>li,C3DTilesLayer:()=>Xe.Z,C3DTilesSource:()=>ai,C3DTilesTypes:()=>Ri.h,C3DTileset:()=>Si.Z,CAMERA_TYPE:()=>te.P,CONTROL_EVENTS:()=>C.Q,CRS:()=>l.Z,CameraCalibrationParser:()=>lr,CameraUtils:()=>Zt.ZP,Capabilities:()=>$t.Z,ClassificationScheme:()=>S.wy,ColorLayer:()=>Se,ColorLayersOrdering:()=>fr.Z,Coordinates:()=>o.Z,DEMUtils:()=>qt.Z,ElevationLayer:()=>Ce,Ellipsoid:()=>c.Z,EntwinePointTileLayer:()=>Sr,EntwinePointTileSource:()=>gi,Extent:()=>s.ZP,FEATURE_TYPES:()=>lt.tg,Feature:()=>lt.ZP,Feature2Mesh:()=>Ht,FeatureCollection:()=>lt.t1,FeatureGeometry:()=>lt.iL,FeatureGeometryLayer:()=>Re,FeatureProcessing:()=>x,FeaturesUtils:()=>Wt.Z,Fetcher:()=>d.Z,FileSource:()=>Ir,FirstPersonControls:()=>Z,FlyControls:()=>U,GDFParser:()=>_i.Z,GLOBE_VIEW_EVENTS:()=>h.b,GLTFParser:()=>Ei.ZP,GTXParser:()=>wi.ZP,GeoJsonParser:()=>sr.Z,GeoidGrid:()=>a.Z,GeoidLayer:()=>y.Z,GeometryLayer:()=>Te.Z,GlobeControls:()=>C.Z,GlobeLayer:()=>mr.Z,GlobeView:()=>h.Z,GpxParser:()=>Ai.Z,ISGParser:()=>bi.Z,ImageryLayers:()=>re.M,KMLParser:()=>yi.Z,LASParser:()=>fi,Label:()=>ee.Z,LabelLayer:()=>Ar.Z,Layer:()=>re.Z,MAIN_LOOP_EVENTS:()=>p.Ao,OrientationUtils:()=>xt,OrientedImageCamera:()=>M,OrientedImageLayer:()=>dr,OrientedImageSource:()=>ti,PLANAR_CONTROL_EVENT:()=>ot.uZ,PNTS_MODE:()=>S.vj,PNTS_SHAPE:()=>S.Uz,PNTS_SIZE_MODE:()=>S.E7,PlanarControls:()=>ot.ZP,PlanarLayer:()=>gr.Z,PlanarView:()=>u.Z,PointCloudLayer:()=>Ge,PointsMaterial:()=>S.ZP,PotreeLayer:()=>Ye,PotreeSource:()=>si,REVISION:()=>Pi,STRATEGY_DICHOTOMY:()=>pr.ET,STRATEGY_GROUP:()=>pr.AE,STRATEGY_MIN_NETWORK_TRAFFIC:()=>pr.R3,STRATEGY_PROGRESSIVE:()=>pr.c,ShaderChunk:()=>Jt,ShapefileParser:()=>xi,Source:()=>Cr.Z,StreetControls:()=>st,Style:()=>bt.ZP,THREE:()=>i,TMSSource:()=>Pr,TiledGeometryLayer:()=>Je.Z,VIEW_EVENTS:()=>f.b,VectorTilesSource:()=>Kr,View:()=>f.Z,WFSSource:()=>Or,WMSSource:()=>Ur,WMTSSource:()=>Nr,colorLayerEffects:()=>Kt.pO,ellipsoidSizes:()=>c.c,enableDracoLoader:()=>Ei.qw,enableKtx2Loader:()=>Ei.hu,getMaxColorSamplerUnitsCount:()=>Kt.dn,glTFLoader:()=>Ei.zL,legacyGLTFLoader:()=>Ei.mp,process3dTilesNode:()=>Li.Ti,proj4:()=>n.default,updateLayeredMaterialNodeElevation:()=>b.pN,updateLayeredMaterialNodeImagery:()=>b.XP});var i=r(99477),n=r(24472),s=r(71440),o=r(62310),a=r(2362),l=r(79323),c=r(2359),h=r(70378),u=r(39510),d=r(45340),p=r(99617),f=r(73502),m=r(81590),g=r(70991),A=r(79159),y=r(96836);const v=new o.Z("EPSG:4326",0,0,0),x={update(t,e,r){if(!r.parent&&r.children.length)return void g.Z.removeChildrenAndCleanupRecursively(e,r);if(!r.visible)return;if(void 0===r.layerUpdateState[e.id])r.layerUpdateState[e.id]=new m.Z;else if(!r.layerUpdateState[e.id].canTryUpdate()){var i;return void(null===(i=r.link[e.id])||void 0===i||i.forEach((t=>{t.layer.object3d.add(t),t.meshes.position.z=(0,y.c)(e.parent)?r.geoidHeight:0,t.meshes.updateMatrixWorld()})))}const n=r.getExtentsByProjection(e.source.crs)||[r.extent],s=n[0].zoom;if(s!=e.zoom.min||!this.source.extentInsideLimit(r.extent,s)||e.source.isFileSource&&!r.extent.isPointInside(e.source.extent.center(v)))return void r.layerUpdateState[e.id].noMoreUpdatePossible();r.layerUpdateState[e.id].newTry();const o={layer:e,extentsSource:n,view:t.view,requester:r};return t.scheduler.execute(o).then((i=>{r.layerUpdateState[e.id].noMoreUpdatePossible(),i.forEach((i=>{i?(r.link[e.id]=r.link[e.id]||[],i.as(t.view.referenceCrs),i.meshes.position.z=(0,y.c)(e.parent)?r.geoidHeight:0,i.updateMatrixWorld(),e.onMeshCreated&&e.onMeshCreated(i,t),r.parent?(e.object3d.add(i),r.link[e.id].push(i)):g.Z.removeChildrenAndCleanupRecursively(e,i),i.layer=e):r.layerUpdateState[e.id].failure(1,!0)}))}),(i=>(0,A.Z)(i,r,e,r.level,t.view)))}};var b=r(81189);class _{constructor(t){this.size=t,this.pps=null,this.polynom=null,this.l1l2=null}setFromMicmacCalibration(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.pps=(new i.Vector2).fromArray(t.pps),this.polynom=(new i.Vector4).fromArray(t.poly357),this.l1l2=new i.Vector3,this.pps.y=e?this.size.y-this.pps.y:this.pps.y,this.polynom.w=t.limit**2,t.l1l2&&(this.l1l2.fromArray(t.l1l2),this.l1l2.z=t.etats)}clone(){const t=new _(this.size.clone());return t.pps=this.pps.clone(),t.polynom=this.polynom.clone(),t.l1l2=this.l1l2.clone(),t}}const w=new i.Vector3;class E extends i.PerspectiveCamera{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e4,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;t=t.isVector2?t:new i.Vector2(t,t),a=a||t.x/t.y,super(void 0,a,n,s),this.size=t,this.focal=e.isVector2?e:new i.Vector2(e,e),this.center=r||t.clone().multiplyScalar(.5),this.skew=o||0,this.textureMatrixWorldInverse=new i.Matrix4,Object.defineProperty(this,"fov",{get:()=>2*i.MathUtils.radToDeg(Math.atan2(this.size.y,2*this.focal.y)),set:t=>{const e=.5*this.size.y/Math.tan(i.MathUtils.degToRad(.5*t));this.focal.x=e,this.focal.y=e}}),this.distortion=new _(this.size),this.maskPath=void 0,this.mask=void 0,this.updateProjectionMatrix()}updateProjectionMatrix(){if(!this.focal)return;const t=this.near,e=t/this.focal.x,r=t/this.focal.y,i=-e*this.center.x,n=-r*this.center.y,s=i+e*this.size.x,o=n+r*this.size.y;this.projectionMatrix.makePerspective(i,s,o,n,t,this.far),this.projectionMatrix.elements[4]=2*this.skew/this.size.x;const a=this.size.x/this.size.y,l=this.aspect/a;w.set(this.zoom,this.zoom,1),l>1?w.x/=l:w.y*=l,this.projectionMatrix.scale(w)}copy(t,e){return super.copy(t,e),this.size=t.size.clone(),this.focal=t.focal.clone(),this.center=t.center.clone(),this.distortion=t.distortion.clone(),this.textureMatrixWorldInverse=t.textureMatrixWorldInverse.clone(),this.skew=t.skew,this.maskPath=t.maskPath,this.mask=t.mask,this}}const M=E;var S=r(25033),C=r(61861);const T={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"rotateZ",sign:1,noSpeed:!0},34:{method:"rotateZ",sign:-1,noSpeed:!0},wheelup:{method:"translateZ",sign:1,oneshot:!0},wheeldown:{method:"translateZ",sign:-1,oneshot:!0}};function I(t){t.preventDefault(),this._isMouseDown=!0;const e=this.view.eventToViewCoords(t);this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y}function R(t){t.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=t.touches[0].pageX,this._onMouseDownMouseY=t.touches[0].pageY}function B(t){if(!0===this._isMouseDown){const e=this.view.eventToViewCoords(t),r=i.MathUtils.degToRad(this._camera3D.fov)/this.view.mainLoop.gfxEngine.height;this._camera3D.rotateY((e.x-this._onMouseDownMouseX)*r),this._camera3D.rotateX((e.y-this._onMouseDownMouseY)*r),this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y,this.view.notifyChange(this._camera3D,!1)}}function L(){this._isMouseDown=!1}function P(t){const e=T[t.keyCode];e&&(this.moves.delete(e),t.preventDefault())}function D(t){const e=T[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(this._camera3D,!1),t.preventDefault())}function O(t){-t.deltaY<0?this.moves.add(T.wheelup):this.moves.add(T.wheeldown),this.view.notifyChange(this._camera3D,!1)}class k extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.options=e,this._camera3D=t.camera3D,this.moves=new Set,this.moveSpeed=10,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._isMouseDown=!1,t.domElement.addEventListener("mousedown",I.bind(this),!1),t.domElement.addEventListener("touchstart",R.bind(this),!1);const r=B.bind(this);t.domElement.addEventListener("mousemove",r,!1),t.domElement.addEventListener("touchmove",r,!1),t.domElement.addEventListener("mouseup",L.bind(this),!1),t.domElement.addEventListener("touchend",L.bind(this),!1),t.domElement.addEventListener("wheel",O.bind(this),!1),t.domElement.addEventListener("keyup",P.bind(this),!0),t.domElement.addEventListener("keydown",D.bind(this),!0),this.view.addFrameRequester(p.Ao.AFTER_CAMERA_UPDATE,this.update.bind(this)),e.focusOnMouseOver&&t.domElement.addEventListener("mouseover",(()=>t.domElement.focus())),e.focusOnClick&&t.domElement.addEventListener("click",(()=>t.domElement.focus()))}isUserInteracting(){return 0!==this.moves.size||this._isMouseDown}update(t,e){e&&(t=16);for(const e of this.moves)this._camera3D[e.method](e.sign*(e.noSpeed?1:this.moveSpeed)*t/1e3);if(this.moves.size>0||this._isMouseDown){this.view.notifyChange(this._camera3D);for(const t of this.moves)t.oneshot&&this.moves.delete(t)}}}const U=k;function N(t,e,r){const n=.5*i.MathUtils.degToRad(r-t.fov);return i.MathUtils.clamp(e,-n,n)}const F=new i.Vector3(0,1,0);function z(t,e,r){e.quaternion.setFromUnitVectors(F,e.up),e.rotateY(r.rotateY),e.rotateX(r.rotateX),t.notifyChange(t.camera3D)}const G={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"translateY",sign:1},34:{method:"translateY",sign:-1}};function Q(t){this.camera.position.z+=t}const j=new i.Vector3,V=new i.Quaternion,H=new i.Euler(0,0,0,"YXZ");function W(t){j.copy(this.camera.position),j.normalize(),this.camera.position.add(j.multiplyScalar(t))}class q extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.isFirstPersonControls=!0,this.camera=t.camera3D,this.view=t,this.moves=new Set,e.panoramaRatio){const t=200*e.panoramaRatio/(2*Math.PI);e.verticalFOV=2==e.panoramaRatio?180:i.MathUtils.radToDeg(2*Math.atan(200/(2*t)))}e.verticalFOV=e.verticalFOV||180,e.moveSpeed=void 0===e.moveSpeed?10:e.moveSpeed,this.options=e,this._isMouseDown=!1,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._state={rotateX:0,rotateY:0,snapshot(){return{rotateX:this.rotateX,rotateY:this.rotateY}}},this.reset(),this.eventListeners=e.disableEventListeners,e.disableEventListeners||(this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseUp=this.onMouseUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onContextMenu=this.onContextMenu.bind(this),t.domElement.addEventListener("mousedown",this._onMouseDown,!1),t.domElement.addEventListener("touchstart",this._onMouseDown,!1),t.domElement.addEventListener("mousemove",this._onMouseMove,!1),t.domElement.addEventListener("touchmove",this._onMouseMove,!1),t.domElement.addEventListener("mouseup",this._onMouseUp,!1),t.domElement.addEventListener("touchend",this._onMouseUp,!1),t.domElement.addEventListener("wheel",this._onMouseWheel,!1),t.domElement.addEventListener("contextmenu",this._onContextMenu,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)),this.view.addFrameRequester(p.Ao.AFTER_CAMERA_UPDATE,this.update.bind(this)),this._onFocus=()=>t.domElement.focus(),this.focusOnMouseOver=e.focusOnMouseOver,e.focusOnMouseOver&&t.domElement.addEventListener("mouseover",this._onFocus),this.focusOnClick=e.focusOnClick,e.focusOnClick&&t.domElement.addEventListener("click",this._onFocus),"EPSG:4978"==t.referenceCrs?this.moveCameraVertical=W:this.moveCameraVertical=Q}isUserInteracting(){return 0!==this.moves.size&&!this._isMouseDown}reset(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];V.setFromUnitVectors(F,this.camera.up),V.invert(),V.multiply(this.camera.quaternion),H.setFromQuaternion(V),t||(this._state.rotateX=H.x),this._state.rotateY=H.y}update(t,e,r){if(0!=this.enabled){e&&(t=16);for(const e of this.moves)"translateY"===e.method?this.moveCameraVertical(e.sign*this.options.moveSpeed*t/1e3):this.camera[e.method](e.sign*this.options.moveSpeed*t/1e3);!0!==this._isMouseDown&&!0!==r||z(this.view,this.camera,this._state),this.moves.size&&this.view.notifyChange(this.camera)}}onMouseDown(t){if(0==this.enabled)return;this._isMouseDown=!0;const e=this.view.eventToViewCoords(t);this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y,this._stateOnMouseDown=this._state.snapshot()}onMouseUp(){0!=this.enabled&&(this._isMouseDown=!1)}onMouseMove(t){if(0!=this.enabled&&!0===this._isMouseDown){const e=i.MathUtils.degToRad(this.camera.fov)/this.view.mainLoop.gfxEngine.height,r=this.view.eventToViewCoords(t);this._state.rotateY=(r.x-this._onMouseDownMouseX)*e+this._stateOnMouseDown.rotateY,this._state.rotateX=N(this.camera,(r.y-this._onMouseDownMouseY)*e+this._stateOnMouseDown.rotateX,this.options.verticalFOV),z(this.view,this.camera,this._state)}}onMouseWheel(t){if(0==this.enabled)return;const e=t.deltaY;this.camera.fov=i.MathUtils.clamp(this.camera.fov+Math.sign(e),10,Math.min(100,this.options.verticalFOV)),this.camera.updateProjectionMatrix(),this._state.rotateX=N(this.camera,this._state.rotateX,this.options.verticalFOV),z(this.view,this.camera,this._state)}onKeyUp(t){if(0==this.enabled)return;const e=G[t.keyCode];e&&(this.moves.delete(e),this.view.notifyChange(void 0,!1),t.preventDefault())}onKeyDown(t){if(0==this.enabled)return;const e=G[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(void 0,!1),t.preventDefault())}onContextMenu(t){t.preventDefault()}dispose(){this.eventListeners||(this.view.domElement.removeEventListener("mousedown",this._onMouseDown,!1),this.view.domElement.removeEventListener("touchstart",this._onMouseDown,!1),this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("touchmove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("touchend",this._onMouseUp,!1),this.view.domElement.removeEventListener("wheel",this._onMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._onContextMenu,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)),this.focusOnMouseOver&&this.view.domElement.removeEventListener("mouseover",this._onFocus),this.focusOnClick&&this.view.domElement.removeEventListener("click",this._onFocus),this.dispatchEvent({type:"dispose"})}}const Z=q;var Y=r(36194);const X=new i.MeshBasicMaterial({color:16777215,depthTest:!1,transparent:!0,opacity:.5});function J(t,e,r){t.position.copy(e),t.up.copy(e).normalize(),t.lookAt(r),t.updateMatrixWorld(!0)}const K=new i.Vector3,$=new i.Vector3,tt=new i.Matrix3,et=new i.Vector3,rt=new i.Quaternion;function it(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{},n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{};e.getPickingPositionFromDepth(e.eventToViewCoords(t),K);const o=e.camera3D.position.distanceTo(K),a=r?e.pickObjectsAt(t,-1,r):[];a.length&&a[0].distance1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.isStreetControls=!0,this._onMouseOut=super.onMouseUp.bind(this),t.domElement.addEventListener("mouseout",this._onMouseOut),this.previousPosition=void 0,this.currentPosition=void 0,this.nextPosition=void 0,this.keyGoToNextPosition=90,this.keyGoToPreviousPosition=83,this.keySetCameraToCurrentPositionAndLookAtNext=65,this.keySetCameraToCurrentPositionAndLookAtPrevious=81,this.tweenGroup=new Y.ZP.Group,this.surfaceGround=e.surfaceGround||function(){const t=new i.CircleGeometry(1,32);return new i.Mesh(t,X)}(),this.surfaceWall=e.surfaceWall||function(){const t=new i.PlaneGeometry(4,2,1),e=new i.Mesh(t,X);return e.rotateX(.5*-Math.PI),e}(),this.surfaces=new i.Object3D,this.surfaces.add(this.surfaceGround),this.surfaces.add(this.surfaceWall),this.view.scene.add(this.surfaces),this.wallMaxDistance=e.wallMaxDistance||1e3,this.animationDurationWall=e.animationDurationWall||200,this.buildingsLayer=e.buildingsLayer,this.computeTime=e.computeTime||nt,this.offset=e.offset||4,this.transformationPositionPickOnTheGround=e.transformationPositionPickOnTheGround||(t=>t),this.end=this.camera.clone()}setCurrentPosition(t){this.currentPosition=t}setNextPosition(t){this.nextPosition=t}setPreviousPosition(t){this.previousPosition=t}onMouseUp(t){0!=this.enabled&&(super.onMouseUp(),this._stateOnMouseDrag?this._stateOnMouseDrag=!1:it(t,this.view,this.buildingsLayer,this.onClickOnGround.bind(this),this.onClickOnWall.bind(this)))}onMouseMove(t){0!=this.enabled&&(super.onMouseMove(t),this._isMouseDown?(this._stateOnMouseDrag=!0,this.stopAnimations()):this.tween||(it(t,this.view,this.buildingsLayer,((t,e)=>{J(this.surfaces,t,e),this.surfaceGround.visible=!0,this.surfaceWall.visible=!1}),((t,e)=>{J(this.surfaces,t,e),this.surfaceWall.visible=!0,this.surfaceGround.visible=!1})),this.view.notifyChange(this.surfaces)))}setCameraToCurrentPosition(t){t?this.setCameraOnPosition(this.currentPosition,this.previousPosition):this.setCameraOnPosition(this.currentPosition,this.nextPosition)}setCameraOnPosition(t,e){t&&e&&(this.camera.position.copy(t),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?this.camera.up.copy(t).normalize():this.camera.up.set(0,0,1),this.camera.lookAt(e),this.camera.updateMatrixWorld(),this.reset())}onClickOnGround(t){t=this.transformationPositionPickOnTheGround(t),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?et.copy(t).normalize():et.set(0,0,1),t.add(et.multiplyScalar(this.offset));const e=this.camera.position.distanceTo(t),r=this.computeTime(e);this.moveCameraTo(t,r)}onClickOnWall(t){this.camera.position.distanceTo(t){this.stopAnimations()})).onUpdate((t=>{this.camera.quaternion.slerpQuaternions(rt,this.end.quaternion,t.t)})).start(),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.reset(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera)}moveCameraTo(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;if(!t)return Promise.resolve();const i=new Promise((t=>{e=t}));return this.stopAnimations(),this.tween=new Y.ZP.Tween(this.camera.position,this.tweenGroup).to(t.clone(),r).easing(Y.ZP.Easing.Quadratic.Out).onComplete((()=>{this.stopAnimations(),e()})).start(),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera),i}stopAnimations(){this.tween&&(this.tween.stop(),this.tween=void 0),this.animationFrameRequester&&(this.view.removeFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.animationFrameRequester=null)}moveCameraToCurrentPosition(){this.moveCameraTo(this.currentPosition)}onKeyDown(t){0!=this.enabled&&(super.onKeyDown(t),t.keyCode==this.keyGoToNextPosition&&this.moveCameraTo(this.nextPosition),t.keyCode==this.keyGoToPreviousPosition&&this.moveCameraTo(this.previousPosition),t.keyCode==this.keySetCameraToCurrentPositionAndLookAtNext&&(this.setCameraToCurrentPosition(),this.view.notifyChange(this.view.camera3D)),t.keyCode==this.keySetCameraToCurrentPositionAndLookAtPrevious&&(this.setCameraToCurrentPosition(!0),this.view.notifyChange(this.view.camera3D)))}dispose(){this.view.domElement.removeEventListener("mouseout",this._onMouseOut,!1),super.dispose()}};var ot=r(29571),at=r(9187),lt=r(5167),ct=r(61366),ht=r(53175);const ut=i.MathUtils.DEG2RAD,dt=new i.Matrix4,pt=new i.Vector3,ft=new i.Vector3,mt=(new i.Vector3).set(0,0,1),gt=new o.Z("EPSG:4326",0,0,0),At=new i.Euler,yt=new i.Quaternion;function vt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return t?e.set(0,0,0,1):vt}const xt={quaternionFromRollPitchHeading(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;return t*=ut,e*=ut,r*=ut,n.setFromEuler(At.set(-e,-t,-r,"YXZ"))},quaternionFromOmegaPhiKappa(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;return t*=ut,e*=ut,r*=ut,n.setFromEuler(At.set(t,e,r,"XYZ")),n.set(n.w,n.z,-n.y,-n.x),n},quaternionFromAttitude(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return void 0!==t.roll||void 0!==t.pitch||void 0!==t.heading?this.quaternionFromRollPitchHeading(t.roll,t.pitch,t.heading,e):void 0!==t.omega||void 0!==t.phi||void 0!==t.kappa?this.quaternionFromOmegaPhiKappa(t.omega,t.phi,t.kappa,e):e.set(0,0,0,1)},quaternionFromEnuToGeocent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return t?this.quaternionFromEnuToGeocent()(t,e):function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;const r=t.geodesicNormal;return 0==r.x&&0==r.y?e.set(0,0,0,1):(ft.set(-r.y,r.x,0).normalize(),pt.crossVectors(r,ft),dt.makeBasis(ft,pt,r),e.setFromRotationMatrix(dt))}},quaternionFromGeocentToEnu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;if(t)return this.quaternionFromGeocentToEnu()(t,e);const r=this.quaternionFromEnuToGeocent();return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return r(t,e).conjugate()}},quaternionFromLCCToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromLCCToEnu(t)(e,r);const n=Math.sin(t.lat0);return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;const s=e.as(gt.crs,gt).longitude*ut;return r.setFromAxisAngle(mt,n*(t.long0-s))}},quaternionFromEnuToLCC(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToLCC(t)(e,r);const n=this.quaternionFromLCCToEnu(t);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return n(t,e).conjugate()}},quaternionFromTMercToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromTMercToEnu(t)(e,r);const n=t.a*t.a,s=t.b*t.b,o=t.e*t.e,a=t.e?o/(1-o):n/s-1;return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;e.as(gt.crs,gt);const n=gt.longitude*ut,s=gt.latitude*ut,o=t.long0-n,l=Math.cos(s),c=Math.sin(s),h=l*l,u=o*o*h,d=a*h;return r.setFromAxisAngle(mt,o*c*(1+u/3*(1+3*d+2*d*d)+u*u*(2-c/l)/15))}},quaternionFromEnuToTMerc(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToTMerc(t)(e,r);const n=this.quaternionFromTMercToEnu(t);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return n(t,e).conjugate()}},quaternionFromLongLatToEnu(t){return vt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion)},quaternionFromEnuToLongLat(t){return vt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion)},quaternionUnimplemented(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;return console.warn("This quaternion function is not implemented for projections of type",t.projName),vt(e,r)},quaternionFromEnuToCRS(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToCRS(t)(e,r);const s=t.projName?t:n.default.defs(t);switch(s.projName){case"geocent":return this.quaternionFromEnuToGeocent();case"lcc":return this.quaternionFromEnuToLCC(s);case"tmerc":return this.quaternionFromEnuToTMerc(s);case"longlat":return this.quaternionFromEnuToLongLat();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromCRSToEnu(t)(e,r);const s=t.projName?t:n.default.defs(t);switch(s.projName){case"geocent":return this.quaternionFromGeocentToEnu();case"lcc":return this.quaternionFromLCCToEnu(s);case"tmerc":return this.quaternionFromTMercToEnu(s);case"longlat":return this.quaternionFromLongLatToEnu();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToCRS(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;if(r)return this.quaternionFromCRSToCRS(t,e)(r,n);if(t==e)return function(){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion).set(0,0,0,1)};const s=this.quaternionFromCRSToEnu(t),o=this.quaternionFromEnuToCRS(e);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return o(t,e).multiply(s(t,yt))}}};var bt=r(49075);const _t=new o.Z("EPSG:4326",0,0,0),wt=new bt.uP,Et=new bt.ZP;let Mt;const St=new i.Vector2,Ct=new i.Vector2,Tt=new i.Vector3,It=new i.Vector3,Rt=new i.Vector3,Bt=new i.Vector3,Lt=new s.ZP("EPSG:4326",0,0,0,0),Pt=new i.Color,Dt=255,Ot=65535,kt="EPSG:4326";class Ut extends i.Group{#C;#T;#I=new i.Group;#R=new i.Group;constructor(t,e){super(),this.meshes=(new i.Group).add(...t),this.#I=(new i.Group).add(this.meshes),this.#I.quaternion.copy(e.quaternion),this.#I.position.copy(e.position),this.#I.scale.copy(e.scale),this.#I.updateMatrix(),this.#T=e.crs,this.#C=this.#T,this.extent=e.extent,this.add(this.#R.add(this.#I))}as(t){if(this.#C!==t)if(this.#C=t,t==this.#T)this.place.position.set(0,0,0),this.position.set(0,0,0),this.scale.set(1,1,1),this.quaternion.identity();else{_t.crs=l.Z.formatToEPSG(this.#T),Lt.copy(this.extent).applyMatrix4(this.#I.matrix),Lt.as(_t.crs,Lt),Lt.spatialEuclideanDimensions(St),Lt.planarDimensions(Ct),Ct.x&&Ct.y&&this.scale.copy(St).divide(Ct).setZ(1),this.#R.position.copy(this.#I.position).negate(),_t.setFromVector3(this.#I.position);const e="EPSG:3857"==this.#T?kt:this.#T;xt.quaternionFromCRSToCRS(e,t)(_t.as(kt),this.quaternion),_t.as(t,_t).toVector3(this.position)}return this}}function Nt(t){return t?"Color"==t.type?t:Pt.set(t):Pt.set(16777215*Math.random())}function Ft(t,e){return e<=Dt?new Uint8Array(t):e<=Ot?new Uint16Array(t):new Uint32Array(t)}function zt(t,e,r,i,n){const s=t.length;t.length+=6*(i-1);for(let o=r,a=s;oe);let a=0;const l=new Float32Array(r);Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);const c=[];wt.setFeature(t);for(const e of t.geometries){const r=e.indices[0].offset,i=e.indices[0].count,h=o(e.properties,a);wt.setGeometry(e);for(let e=3*r,o=r;o1&&console.warn("Too many differents point.radius, only the first one will be used"),new i.Points(h,e.pointMaterial)}function Qt(t,e,r){const i=(e*=3)+3*r;let n=0;for(let r=i-3,s=e;s{t instanceof i.Mesh&&(t.updateMatrixWorld(),t.geometry.applyMatrix4(t.matrixWorld),e.push(t))})),e}(n).forEach((i=>t.add(jt(i,r,e)))),t}throw new Error("The format of the model object provided in the style (layer.style.point.model.object) is not supported. Only THREE.Mesh or THREE.Object3D are supported.")}(t),s.isInstancedMesh=!0}catch(r){s=Gt(t,e)}else s=Gt(t,e);break;case lt.tg.LINE:s=function(t,e){const r=t.vertices,n=new Uint8Array(r.length),s=r.length/3,o=new Uint32Array(s),a=e.batchId||((t,e)=>e);let l=0;const c=new Float32Array(r.length),h=new i.BufferGeometry,u=[];wt.setFeature(t);const d=Ft(2*(s-t.geometries.length),s);let p=0;Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);for(const e of t.geometries){wt.setGeometry(e);const r=a(e.properties,l),i=e.indices[0].offset;if(i>65535){console.warn("Feature to Line: integer overflow, too many points in lines");break}const s=i+e.indices[0].count;for(let e=3*i,a=i;a1&&console.warn("Too many differents stroke.width, only the first one will be used"),h.setAttribute("position",new i.BufferAttribute(c,3)),h.setAttribute("color",new i.BufferAttribute(n,3,!0)),h.setAttribute("batchId",new i.BufferAttribute(o,1)),h.setIndex(new i.BufferAttribute(d,1)),new i.LineSegments(h,e.lineMaterial)}(t,e);break;case lt.tg.POLYGON:s=Mt.fill&&Object.keys(Mt.fill).includes("extrusion_height")?function(t,e){const r=t.vertices,n=new Float32Array(2*r.length),s=r.length/3,o=new Uint8Array(2*r.length),a=[],l=new Uint32Array(n.length/3),c=e.batchId||((t,e)=>e);let h=0;wt.setFeature(t),Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt),_t.setCrs(wt.collection.crs);for(const e of t.geometries){wt.setGeometry(e);const i=e.indices[0].offset,u=e.indices.slice(-1)[0],d=u.offset+u.count,p=d-i,f=e.indices[0].ccw??Qt(r,i,p)<0,m=3*i,g=i+s,A=c(e.properties,h);for(let e=m,a=m+r.length,c=i;et.offset-i)).slice(1),x=at(y,v,3),b=a.length;a.length+=x.length;for(let t=0;te);wt.setFeature(t),Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);let l=0;for(const e of t.geometries){const i=e.indices[0].offset;if(i>4294967295){console.warn("Feature to Polygon: integer overflow, too many points in polygons");break}wt.setGeometry(e);const c=e.indices.slice(-1)[0],h=c.offset+c.count,u=3*i,d=a(e.properties,l);for(let e=u,s=i;et.offset-i)).slice(1),m=at(p,f,3),g=s.length;s.length+=m.length;for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};return(0,ht.ie)(t),function(e){if(!e)return;t.pointMaterial||(t.pointMaterial=(0,ct.Z)(new i.PointsMaterial,this),t.lineMaterial=(0,ct.Z)(new i.LineBasicMaterial,this),t.polygonMaterial=(0,ct.Z)(new i.MeshBasicMaterial,this)),Mt=(null==this?void 0:this.style)||(t.style?new bt.ZP(t.style):Et),wt.setCollection(e);const r=e.features;if(!r||0==r.length)return;const n=r.map((e=>{const r=Vt(e,t);return r.layer=this,r}));return new Ut(n,e)}}};var Wt=r(29372),qt=r(86541),Zt=r(32533);const Yt={color_layers_pars_fragment:"struct Layer {\n int textureOffset;\n int crs;\n int effect_type;\n float effect_parameter;\n float opacity;\n bool transparent;\n};\n\n#include \n\nuniform sampler2D colorTextures[NUM_FS_TEXTURES];\nuniform vec4 colorOffsetScales[NUM_FS_TEXTURES];\nuniform Layer colorLayers[NUM_FS_TEXTURES];\nuniform int colorTextureCount;\n\nvec3 uvs[NUM_CRS];\n\nfloat getBorderDistance(vec2 uv) {\n vec2 p2 = min(uv, 1. -uv);\n return min(p2.x, p2.y);\n}\n\nfloat tolerance = 0.99;\n\nvec4 applyWhiteToInvisibleEffect(vec4 color) {\n float a = dot(color.rgb, vec3(0.333333333));\n if (a >= tolerance) {\n color.a = 0.0;\n }\n return color;\n}\n\nvec4 applyLightColorToInvisibleEffect(vec4 color, float intensity) {\n float a = max(0.05,1. - length(color.xyz - 1.));\n color.a *= 1.0 - pow(abs(a), intensity);\n color.rgb *= color.rgb * color.rgb;\n return color;\n}\n\n#if defined(DEBUG)\nuniform bool showOutline;\nuniform vec3 outlineColors[NUM_CRS];\nuniform float outlineWidth;\n\nvec4 getOutlineColor(vec3 outlineColor, vec2 uv) {\n float alpha = 1. - clamp(getBorderDistance(uv) / outlineWidth, 0., 1.);\n return vec4(outlineColor, alpha);\n}\n#endif\n\nuniform float minBorderDistance;\nvec4 getLayerColor(int textureOffset, sampler2D tex, vec4 offsetScale, Layer layer) {\n if ( textureOffset >= colorTextureCount ) return vec4(0);\n\n vec3 uv;\n // #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++ ) {\n if ( i == layer.crs ) uv = uvs[ i ];\n }\n\n float borderDistance = getBorderDistance(uv.xy);\n if (textureOffset != layer.textureOffset + int(uv.z) || borderDistance < minBorderDistance ) return vec4(0);\n vec4 color = texture2D(tex, pitUV(uv.xy, offsetScale));\n if (layer.effect_type == 3) {\n #include \n } else {\n if (layer.transparent && color.a != 0.0) {\n color.rgb /= color.a;\n }\n\n if (layer.effect_type == 1) {\n color = applyLightColorToInvisibleEffect(color, layer.effect_parameter);\n } else if (layer.effect_type == 2) {\n color = applyWhiteToInvisibleEffect(color);\n }\n }\n color.a *= layer.opacity;\n return color;\n}\n",custom_body_colorLayer:"// no custom body",custom_header_colorLayer:"// no custom header",elevation_pars_vertex:"#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n uniform float geoidHeight;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n return texture2D( tex, uv ).r;\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n // Elevation textures are inverted along the y-axis\n uv = vec2(uv.x, 1.0 - uv.y);\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = clamp(getElevationMode(uv, tex, layer.mode), layer.zmin, layer.zmax);\n return d * layer.scale + layer.bias;\n }\n#endif\n",elevation_vertex:"#if NUM_VS_TEXTURES > 0\n if(elevationTextureCount > 0) {\n float elevation = getElevation(uv, elevationTextures[0], elevationOffsetScales[0], elevationLayers[0]);\n transformed += elevation * normal;\n }\n#endif\n",geoid_vertex:"transformed += geoidHeight * normal;\n",fog_fragment:"#if defined(USE_FOG)\n float fogFactor = 1. - min( exp(-vFogDepth / fogDistance), 1.);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n",fog_pars_fragment:"#if defined(USE_FOG)\nuniform vec3 fogColor;\nuniform float fogDistance;\nvarying float vFogDepth;\n#endif\n",lighting_fragment:"if (lightingEnabled) {\n float light = min(2. * dot(vNormal, lightPosition), 1.);\n gl_FragColor.rgb *= light;\n}\n",lighting_pars_fragment:"uniform bool lightingEnabled;\nuniform vec3 lightPosition;\nvarying vec3 vNormal;\n",mode_depth_fragment:"#if defined(USE_LOGDEPTHBUF)\ngl_FragColor = packDepthToRGBA(gl_FragDepthEXT);\n#else\nfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\ngl_FragColor = packDepthToRGBA(fragCoordZ);\n#endif\n",mode_id_fragment:"// 16777216.0 == 256.0 * 256.0 * 256.0\ngl_FragColor = packDepthToRGBA(float(objectId) / 16777216.0);\n",mode_pars_fragment:"#if MODE == MODE_ID || MODE == MODE_DEPTH\n#include \n#endif\n\n#if MODE == MODE_ID\nuniform int objectId;\n#endif\n",overlay_fragment:"gl_FragColor.rgb = mix(gl_FragColor.rgb, overlayColor, overlayAlpha);\n",overlay_pars_fragment:"uniform vec3 overlayColor;\nuniform float overlayAlpha;\n",pitUV:"vec2 pitUV(vec2 uv, vec4 pit)\n{\n return uv * pit.zw + vec2(pit.x, 1.0 - pit.w - pit.y);\n}\n\n",precision_qualifier:"precision highp float;\nprecision highp int;\n",projective_texturing_vertex:"for(int i = 0; i < ORIENTED_IMAGES_COUNT; ++i)\n projectiveTextureCoords[i] = projectiveTextureMatrix[i] * mvPosition;\n",projective_texturing_pars_vertex:"uniform mat4 projectiveTextureMatrix[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\n",projective_texturing_pars_fragment:"uniform sampler2D projectiveTexture[ORIENTED_IMAGES_COUNT];\nuniform sampler2D mask[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\nuniform float projectiveTextureAlphaBorder;\nuniform float opacity;\nuniform bool boostLight;\n\nstruct Distortion {\n vec2 size;\n#if USE_DISTORTION\n vec2 pps;\n vec4 polynom;\n vec3 l1l2;\n#endif\n};\n\nuniform Distortion projectiveTextureDistortion[ORIENTED_IMAGES_COUNT];\n\nfloat getAlphaBorder(vec2 p)\n{\n vec2 d = clamp(projectiveTextureAlphaBorder * min(p, 1. - p), 0., 1.);\n return min(d.x, d.y);\n}\n\n#if USE_DISTORTION\nvoid distort(inout vec2 p, vec4 polynom, vec2 pps)\n{\n vec2 v = p - pps;\n float v2 = dot(v, v);\n if (v2 > polynom.w) {\n p = vec2(-1.);\n }\n else {\n p += (v2 * (polynom.x + v2 * (polynom.y + v2 * polynom.z) ) ) * v;\n }\n}\n\nvoid distort(inout vec2 p, vec4 polynom, vec3 l1l2, vec2 pps)\n{\n if ((l1l2.x == 0.) && (l1l2.y == 0.)) {\n distort(p, polynom, pps);\n } else {\n vec2 AB = (p - pps) / l1l2.z;\n float R = length(AB);\n float lambda = atan(R) / R;\n vec2 ab = lambda * AB;\n float rho2 = dot(ab, ab);\n float r357 = 1. + rho2* (polynom.x + rho2* (polynom.y + rho2 * polynom.z));\n p = pps + l1l2.z * (r357 * ab + vec2(dot(l1l2.xy, ab), l1l2.y * ab.x));\n }\n}\n#endif\n\nvec4 mixBaseColor(vec4 aColor, vec4 baseColor) {\n #ifdef USE_BASE_MATERIAL\n baseColor.rgb = aColor.a == 1.0 ? aColor.rgb : mix(baseColor, aColor, aColor.a).rgb;\n baseColor.a = min(1.0, aColor.a + baseColor.a);\n #else\n baseColor.rgb += aColor.rgb * aColor.a;\n baseColor.a += aColor.a;\n #endif\n return baseColor;\n}\n\nvec4 projectiveTextureColor(vec4 coords, Distortion distortion, sampler2D tex, sampler2D mask, vec4 baseColor) {\n vec3 p = coords.xyz / coords.w;\n if(p.z * p.z < 1.) {\n#if USE_DISTORTION\n p.xy *= distortion.size;\n distort(p.xy, distortion.polynom, distortion.l1l2, distortion.pps);\n p.xy /= distortion.size;\n#endif\n\n float d = getAlphaBorder(p.xy) * texture2D(mask, p.xy).r;\n\n if(d > 0.) {\n\n#if DEBUG_ALPHA_BORDER\n vec3 r = texture2D(tex, p.xy).rgb;\n return mixBaseColor(vec4( r.r * d, r.g, r.b, 1.0), baseColor);\n#else\n vec4 color = texture2D(tex, p.xy);\n color.a *= d;\n if (boostLight) {\n return mixBaseColor(vec4(sqrt(color.rgb), color.a), baseColor);\n } else {\n return mixBaseColor(color, baseColor);\n }\n#endif\n\n }\n }\n return mixBaseColor(vec4(0.), baseColor);\n}\n"},Xt=new class{constructor(t,e){this.path=e,this.target=t,this.install()}customHeaderColorLayer(t){Yt.custom_header_colorLayer=t,this.target[`${this.path}custom_header_colorLayer`]=t}customBodyColorLayer(t){Yt.custom_body_colorLayer=t,this.target[`${this.path}custom_body_colorLayer`]=t}install(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.target,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.path;return Object.keys(e).forEach((i=>{Object.defineProperty(this,i,{get:()=>e[i]}),t[r+i]=e[i]})),t}}(i.ShaderChunk,"itowns/"),Jt=Xt;var Kt=r(5199),$t=r(28448),te=r(232),ee=r(59947),re=r(78025);const ie=new bt.ZP,ne=new bt.uP;let se;function oe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{offset:0,count:1}],i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;if(0===e.length)return;const l=new Path2D;for(const t of r)if(t.extent&&s.ZP.intersectsExtent(t.extent,n)){const r=t.offset*i,n=r+t.count*i;l.moveTo(e[r],e[r+1]);for(let t=r+i;t(t.generateMipmaps=!1,t.magFilter=e.magFilter||i.LinearFilter,t.minFilter=e.minFilter||i.LinearFilter,t),be={convert(t,e,r){let n;if(t.isFeatureCollection){const s=r.source.backgroundLayer,o=s&&s.paint?new i.Color(s.paint["background-color"]):void 0;e.as(l.Z.formatToEPSG(r.crs),ve),n=ye.createTextureFromFeature(t,ve,256,r.style,o),n.features=t,n.extent=e}else{if(!t.isTexture)throw new Error("Data type is not supported to convert into texture");n=t}return r.isColorLayer?function(t,e){return t.anisotropy=16,t.premultiplyAlpha=e.transparent,xe(t,e)}(n,r):r.isElevationLayer?(n.flipY&&(n.flipY=!1),xe(n,r)):void 0}};var _e=r(55086);class we extends re.Z{constructor(t,e){e.cacheLifeTime=e.cacheLifeTime??_e.D.TEXTURE,super(t,e)}convert(t,e){return be.convert(t,e,this)}delete(t){t&&this.cache.clear();for(const t of this.parent.level0Nodes)t.traverse((0,b.U8)(this.id))}}const Ee=we;var Me=r(43412);const Se=class extends Ee{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,ht.S_)(e),super(t,e),this.isColorLayer=!0,this.defineLayerProperty("visible",!0),this.defineLayerProperty("opacity",1),this.defineLayerProperty("sequence",0),this.transparent=e.transparent||this.opacity<1,this.noTextureParentOutsideLimit=!!e.source&&e.source.isFileSource,this.effect_type=e.effect_type??0,this.effect_parameter=e.effect_parameter??1,this.buildExtent=!0,this.structure="2d"}setupRasterNode(t){const e=new Me.AN(t.material,this);return t.material.addLayer(e),t.material.setSequence(this.parent.colorLayersOrder),e}update(t,e,r,i){return(0,b.XP)(t,this,r,i)}},Ce=class extends Ee{constructor(t){var e,r;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,i),(i.zmin||i.zmax)&&console.warn("Config using zmin and zmax are deprecated, use {clampValues: {min, max}} structure."),this.zmin=(null===(e=i.clampValues)||void 0===e?void 0:e.min)??i.zmin,this.zmax=(null===(r=i.clampValues)||void 0===r?void 0:r.max)??i.zmax,this.isElevationLayer=!0,this.defineLayerProperty("scale",this.scale||1)}setupRasterNode(t){const e=new Me.NO(t.material,this);t.material.addLayer(e),t.material.setSequenceElevation(this.id);const r=()=>t.setBBoxZ({min:e.min,max:e.max,scale:this.scale});return r(),e.addEventListener("rasterElevationLevelChanged",r),this.addEventListener("scale-property-changed",r),t.addEventListener("dispose",(()=>{this.removeEventListener("scale-property-changed",r)})),e}update(t,e,r,i){return(0,b.pN)(t,this,r,i)}};var Te=r(45222);class Ie extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.update=x.update,e.convert=Ht.convert({batchId:e.batchId}),super(t,e.object3d||new i.Group,e),this.isFeatureGeometryLayer=!0,this.accurate=e.accurate??!0,this.buildExtent=!this.accurate}preUpdate(t,e){e.has(this.parent)&&this.object3d.clear()}}const Re=Ie;var Be=r(98675);const Le=new i.Vector3,Pe=new i.Mesh,De=new i.Box3;function Oe(t,e,r,n,s){return t.camera.camera3D.isOrthographicCamera?function(t,e,r,n){const s=r/2**n.depth,o=new i.Vector4(s);o.applyMatrix4(t.camera.camera3D.projectionMatrix);const a=.5*o.x*t.camera.width,l=.5*o.y*t.camera.height,c=Math.sqrt(a*a+l*l);return Math.max(0,c-e)}(t,e,r,n):function(t,e,r,i,n){if(n<=0)return 1/0;const s=r/2**i.depth,o=t.camera.preSSE*s/n;return Math.max(0,o-e)}(t,e,r,n,s)}function ke(t){t.obj&&(t.obj.visible=!1),t.notVisibleSince||(t.notVisibleSince=Date.now(),t.sse=-1);for(const e of t.children)ke(e)}function Ue(t){var e;null===(e=t.material.intensityRange)||void 0===e||e.set(t.minIntensityRange,t.maxIntensityRange)}function Ne(t){var e;null===(e=t.material.elevationRange)||void 0===e||e.set(t.minElevationRange,t.maxElevationRange)}function Fe(t){var e;null===(e=t.material.angleRange)||void 0===e||e.set(t.minAngleRange,t.maxAngleRange)}Pe.geometry.boundingBox=De;class ze extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,new i.Group,e),this.isPointCloudLayer=!0,this.protocol="pointcloud",this.group=e.group||new i.Group,this.object3d.add(this.group),this.bboxes=e.bboxes||new i.Group,this.bboxes.visible=!1,this.object3d.add(this.bboxes),this.group.updateMatrixWorld(),this.octreeDepthLimit=e.octreeDepthLimit||-1,this.pointBudget=e.pointBudget||2e6,this.pointSize=0!==e.pointSize&&isNaN(e.pointSize)?4:e.pointSize,this.sseThreshold=e.sseThreshold||2,this.defineLayerProperty("minIntensityRange",e.minIntensityRange||1,Ue),this.defineLayerProperty("maxIntensityRange",e.maxIntensityRange||65536,Ue),this.defineLayerProperty("minElevationRange",e.minElevationRange||0,Ne),this.defineLayerProperty("maxElevationRange",e.maxElevationRange||1e3,Ne),this.defineLayerProperty("minAngleRange",e.minAngleRange||-90,Fe),this.defineLayerProperty("maxAngleRange",e.maxAngleRange||90,Fe),this.material=e.material||{},this.material.isMaterial||(e.material=e.material||{},e.material.intensityRange=new i.Vector2(this.minIntensityRange,this.maxIntensityRange),e.material.elevationRange=new i.Vector2(this.minElevationRange,this.maxElevationRange),e.material.angleRange=new i.Vector2(this.minAngleRange,this.maxAngleRange),this.material=new S.ZP(e.material)),this.material.defines=this.material.defines||{},this.mode=e.mode||S.vj.COLOR}preUpdate(t,e){let r;t.camera.preSSE=t.camera.height/(2*Math.tan(.5*i.MathUtils.degToRad(t.camera.camera3D.fov))),this.material&&(this.material.visible=this.visible,this.material.opacity=this.opacity,this.material.transparent=this.opacity<1,this.material.size=this.pointSize,this.material.scale=t.camera.preSSE,this.material.updateUniforms&&this.material.updateUniforms());for(const t of e.values()){if(t.isCamera||t==this)return[this.root];if(void 0!==t.obj&&t.obj.isPoints&&t.obj.layer==this)if(r){if(r=t.findCommonAncestor(r),!r)return[this.root]}else r=t}return r?[r]:[this.root]}update(t,e,r){if(r.visible=!1,this.octreeDepthLimit>=0&&this.octreeDepthLimit!t.requester.visible||!this.visible}).then((t=>{this.onPointsCreated&&this.onPointsCreated(e,t),r.obj=t,r.tightbbox=t.tightbbox,this.group.add(r.obj),r.obj.updateMatrixWorld(!0),r.promise=null}),(t=>{t.isCancelledCommandException&&(r.promise=null)}))}if(r.children&&r.children.length){const n=i.distanceToPoint(Le);if(r.sse=Oe(t,e.pointSize,e.spacing,r,n)/this.sseThreshold,r.sse>=1)return r.children;for(const t of r.children)ke(t)}}else ke(r)}postUpdate(){this.displayedCount=0;for(const t of this.group.children)if(t.visible){const e=t.geometry.attributes.position.count;t.geometry.setDrawRange(0,e),this.displayedCount+=e}if(this.displayedCount>this.pointBudget)if(this.supportsProgressiveDisplay){const t=this.pointBudget/this.displayedCount;for(const e of this.group.children)if(e.visible){const r=Math.floor(e.geometry.drawRange.count*t);r>0?e.geometry.setDrawRange(0,r):e.visible=!1}this.displayedCount*=t}else{this.group.children.sort(((t,e)=>e.userData.node.sse-t.userData.node.sse));let t=!1;this.displayedCount=0;for(const e of this.group.children){const r=e.geometry.attributes.position.count;t||this.displayedCount+r>this.pointBudget?(e.visible=!1,t=!0):this.displayedCount+=r}}const t=Date.now();for(let e=this.group.children.length-1;e>=0;e--){const r=this.group.children[e];!r.visible&&t-r.userData.node.notVisibleSince>1e4&&(this.group.children.splice(e,1),r.geometry.dispose(),r.material=null,r.geometry=null,r.userData.node.obj=null)}}pickObjectsAt(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Be.Z.pickPointsAt(t,e,r,this,i)}getObjectToUpdateForAttachedLayers(t){if(t.obj){const e=t.parent;return e&&e.obj?{element:t.obj,parent:e.obj}:{element:t.obj}}}}const Ge=ze;class Qe extends i.EventDispatcher{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;super(),this.numPoints=t,this.layer=e,this.children=[],this.bbox=new i.Box3,this.sse=-1}add(t,e){this.children.push(t),t.parent=this,this.createChildAABB(t,e)}load(){return this.octreeIsLoaded||this.loadOctree(),this.layer.source.fetcher(this.url,this.layer.source.networkOptions).then((t=>this.layer.source.parse(t,{out:this.layer,in:this.layer.source})))}findCommonAncestor(t){return t.depth!=this.depth?t.depth1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e),this.childrenBitField=t,this.id="",this.depth=0,this.baseurl=e.source.baseurl}add(t,e,r){super.add(t,e),t.id=this.id+e,t.depth=t.id.length,t.id.length%this.layer.hierarchyStepSize==0?t.baseurl=`${r.baseurl}/${t.id.substr(r.id.length)}`:t.baseurl=r.baseurl}createChildAABB(t,e){t.bbox.copy(this.bbox),this.bbox.getCenter(t.bbox.max),Ve.copy(t.bbox.max).sub(this.bbox.min),1===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z):3===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z,t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y):0===e||(2===e?(t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y):5===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z,t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x):7===e?(t.bbox.min.add(Ve),t.bbox.max.add(Ve)):4===e?(t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x):6===e&&(t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y,t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x))}get octreeIsLoaded(){return!(this.childrenBitField&&0===this.children.length)}get url(){return`${this.baseurl}/r${this.id}.${this.layer.source.extension}`}loadOctree(){const t=`${this.baseurl}/r${this.id}.${this.layer.source.extensionOctree}`;return this.layer.source.fetcher(t,this.layer.source.networkOptions).then((t=>{const e=new DataView(t),r=[];let i=0;for(this.childrenBitField=e.getUint8(0),i+=1,this.numPoints=e.getUint32(1,!0),i+=4,r.push(this);r.length&&i{this.scale=(new i.Vector3).addScalar(t.scale),this.spacing=t.spacing,this.hierarchyStepSize=t.hierarchyStepSize;const e=Array.isArray(t.pointAttributes)&&t.pointAttributes.find((t=>t.startsWith("NORMAL")));return e&&(this.material.defines[e]=1),this.supportsProgressiveDisplay="cin"===this.source.extension,this.root=new We(0,0,this),this.root.bbox.min.set(t.boundingBox.lx,t.boundingBox.ly,t.boundingBox.lz),this.root.bbox.max.set(t.boundingBox.ux,t.boundingBox.uy,t.boundingBox.uz),this.extent=s.ZP.fromBox3(this.source.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r)}))}};var Xe=r(11707),Je=r(96021),Ke=r(43195);const $e=new i.Matrix4(1,0,0,1,0,1,0,1,0,0,2,0,0,0,0,2),tr=new i.DataTexture(new Uint8Array([255,255,255,255]),1,1,i.RGBAFormat,i.UnsignedByteType);tr.needsUpdate=!0;const er=new i.Texture,rr=new i.ShaderMaterial;class ir extends i.ShaderMaterial{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.side=e.side??i.DoubleSide,e.transparent=e.transparent??!0,e.opacity=e.opacity??1;const r={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&void 0!==rr[t]&&(r[t]=e[t]);super(r),this.defines.ORIENTED_IMAGES_COUNT=e.OrientedImagesCount??t.length;const n=$t.Z.getMaxTextureUnitsCount();this.defines.ORIENTED_IMAGES_COUNT>n&&(console.warn(`OrientedImageMaterial: Can't project ${t.length} textures, because it's more than GPU capabilities maximum texture units (${n})`),this.defines.ORIENTED_IMAGES_COUNT=n-1,console.warn(`OrientedImageMaterial: We'll use only the first ${this.defines.ORIENTED_IMAGES_COUNT} cameras.`)),e.useBaseMaterial&&(this.defines.USE_BASE_MATERIAL=!0),this.defines.USE_DISTORTION=Number(t.some((t=>null!==t.distortion.pps))),this.alphaBorder=20|e.alphaBorder,this.defines.DEBUG_ALPHA_BORDER=0|e.debugAlphaBorder,this.cameras=t;const s=[],o=[],a=[],l=[];this.group=new i.Group;for(let e=0;e\n#include \n#include \nvarying vec3 vNormal;\n\n#ifdef USE_BASE_MATERIAL\nstruct noPT {\n vec3 lightDirection;\n vec3 ambient;\n float opacity;\n};\n\nuniform noPT noProjectiveMaterial;\n#endif\n\nvoid main(void)\n{\n #include \n #ifdef USE_BASE_MATERIAL\n float nDotVP = (max(0.1, dot(vNormal, normalize(noProjectiveMaterial.lightDirection))));\n vec4 color = vec4(noProjectiveMaterial.ambient + nDotVP, 0.0);\n #else\n vec4 color = vec4(0.0);\n #endif\n\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n\n #ifdef USE_BASE_MATERIAL\n color.a = color.a < 1.0 ? max(noProjectiveMaterial.opacity, color.a) : 1.0 ;\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n #else\n gl_FragColor = vec4(color.rgb / color.a, opacity);\n #endif\n\n}\n",this.defines)}setTextures(t,e,r){if(t){this.group.position.copy(e.position),this.group.quaternion.copy(e.quaternion);for(let e=0;et.name===r[e]));this.uniforms.mask.value[e]=t.maskTexture||tr,this.uniforms.mask.value[e].needsUpdate=!0,this.uniforms.projectiveTextureDistortion.value[e]=t.distortion,this.group.children[e]=t,t.parent=this.group}}this.group.children[e].needsUpdate=!0}this.group.updateMatrixWorld(!0)}}updateUniforms(t){for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=JSON.parse(t)),Promise.all(t.map((t=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=null==e.useMask||e.useMask,n=null==e.imageYDown||e.imageYDown,s=t.projection,o=(new i.Vector2).fromArray(t.size),a=new i.Vector2(s[0],s[4]),l=new i.Vector2(s[2],n?o.y-s[5]:s[5]),c=s[1],h=new M(o,a,l,e.near,e.far,c);h.position.fromArray(t.position);const u=ar.fromArray(t.rotation);let d;h.matrix.setFromMatrix3(u),h.quaternion.setFromRotationMatrix(h.matrix),h.rotateX(Math.PI),t.distortion&&h.distortion.setFromMicmacCalibration(t.distortion,n),h.maskPath=t.mask,h.name=t.id;const p=new Promise((t=>{d=t}));return r&&h.maskPath?or.load(h.maskPath,(t=>{h.maskTexture=t,d(h)})):d(h),p}(t,e))))}},cr=new o.Z("EPSG:4978",0,0,0),hr=t=>t.requester.id!==t.layer.currentPano.id;class ur extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.projection&&(console.warn("OrientedImageLayer projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),super(t,new i.Group,e),this.isOrientedImageLayer=!0,this.background=e.background||function(t){if(!t||t<=0)return;const e=new i.SphereGeometry(t,32,32),r=new i.MeshPhongMaterial({color:7829503,side:i.DoubleSide,transparent:!0,opacity:.5,wireframe:!0}),n=new i.Mesh(e,r);return n.visible=!0,n.name="OrientedImageBackground",n}(e.backgroundDistance),this.background&&(this.background.layer=this.background.layer??{},this.background.layer.id=this.background.layer.id??t,this.object3d.add(this.background)),this.currentPano=void 0,this.onPanoChanged=e.onPanoChanged||(()=>{}),this.getCamerasNameFromFeature=e.getCamerasNameFromFeature||(()=>{});const r=this.addInitializationStep();this.mergeFeatures=!1,this.filteringExtent=!1,this.accurate=!0;const n={out:this};this.source.whenReady.then((t=>sr.Z.parse(e.orientation||t.orientation,n).then((t=>{this.panos=t.features;const r=n.in.crs,s=e.crs,o=xt.quaternionFromCRSToCRS(r,s),a=new i.Quaternion;let l=0;for(const e of this.panos)cr.crs=e.crs,cr.setFromArray(e.vertices).applyMatrix4(t.matrix),e.position=cr.toVector3(),o(cr,a),e.quaternion=xt.quaternionFromAttitude(e.geometries[0].properties).premultiply(a),e.id=e.geometries[0].properties.id,e.index=l++})).then((()=>{lr.parse(e.calibration||t.calibration,e).then((t=>{this.cameras=t,this.material=new nr(this.cameras,e),r()}))}))))}update(){}set boostLight(t){this.material.uniforms.boostLight.value=t}get boostLight(){return this.material.uniforms.boostLight.value}preUpdate(t){var e;!function(t,e,r){const i=r.mostNearPano(e.position),n=r.currentPano?r.currentPano.id:void 0;if(i&&n!=i.id){r.currentPano=i,r.onPanoChanged({previousPanoPosition:r.getPreviousPano()?r.getPreviousPano().position:void 0,currentPanoPosition:r.getCurrentPano().position,nextPanoPosition:r.getNextPano().position});const e=i.geometries[0].properties.idSensors,n=r.cameras.map((t=>({cameraId:t.name,panoId:i.id,as:()=>{}}))).filter((t=>!e||e.includes(t.cameraId))),s={layer:r,extentsSource:n,view:t.view,requester:i,earlyDropFunction:hr};t.scheduler.execute(s).then((e=>{i.id===r.currentPano.id&&(r.material.setTextures(e,i,r.getCamerasNameFromFeature(i)),r.material.updateUniforms(t.camera.camera3D),t.view.notifyChange(r,!0))}),(()=>{}))}}(t,t.camera.camera3D,this),this.material.updateUniforms(t.camera.camera3D),(e=this).background&&e.currentPano&&(e.background.position.copy(e.currentPano.position),e.background.updateMatrixWorld(),e.background.material=e.material||e.background.material)}getNextPano(){const t=(this.currentPano.index+1)%this.panos.length;return this.panos[t]}getCurrentPano(){return this.currentPano}getPreviousPano(){const t=(this.currentPano.index-1)%this.panos.length;return this.panos[t]}delete(t){this.background&&super.delete(),t&&this.cache.clear(),this.material.visible=!1,console.warn("You need to replace OrientedImageLayer.material applied on each object. This issue will be fixed when OrientedImageLayer will be a ColorLayer. the material visibility is set to false. To follow issue see https://github.com/iTowns/itowns/issues/1018")}mostNearPano(t){let e,r=1/0;for(const i of this.panos){const n=t.distanceTo(i.position);n5&&void 0!==arguments[5]?arguments[5]:0,n),this.isEntwinePointTileNode=!0,this.depth=t,this.x=e,this.y=r,this.z=i,this.id=br(t,e,r,i),this.url=`${this.layer.source.url}/ept-data/${this.id}.${this.layer.source.extension}`}createChildAABB(t){const e=2**(t.depth-this.depth);this.bbox.getSize(yr).divideScalar(e),t.bbox.min.copy(this.bbox.min),vr.copy(this).multiplyScalar(e),xr.subVectors(t,vr).multiply(yr),t.bbox.min.add(xr),t.bbox.max.copy(t.bbox.min).add(yr)}get octreeIsLoaded(){return this.numPoints>=0}loadOctree(){return d.Z.json(`${this.layer.source.url}/ept-hierarchy/${this.id}.json`,this.layer.source.networkOptions).then((t=>{this.numPoints=t[this.id];const e=[];for(e.push(this);e.length;){const r=e.shift(),i=r.depth+1,n=2*r.x,s=2*r.y,o=2*r.z;r.findAndCreateChild(i,n,s,o,t,e),r.findAndCreateChild(i,n+1,s,o,t,e),r.findAndCreateChild(i,n,s+1,o,t,e),r.findAndCreateChild(i,n+1,s+1,o,t,e),r.findAndCreateChild(i,n,s,o+1,t,e),r.findAndCreateChild(i,n+1,s,o+1,t,e),r.findAndCreateChild(i,n,s+1,o+1,t,e),r.findAndCreateChild(i,n+1,s+1,o+1,t,e)}}))}findAndCreateChild(t,e,r,i,n,s){const o=n[br(t,e,r,i)];if("number"==typeof o){const n=new _r(t,e,r,i,this.layer,o);this.add(n),s.push(n)}}}const wr=_r,Er=new i.Mesh,Mr=new i.Box3;Er.geometry.boundingBox=Mr;const Sr=class extends Ge{constructor(t,e){super(t,e),this.isEntwinePointTileLayer=!0,this.scale=new i.Vector3(1,1,1);const r=this.addInitializationStep();this.whenReady=this.source.whenReady.then((()=>(this.root=new wr(0,0,0,0,this,-1),this.root.bbox.min.fromArray(this.source.boundsConforming,0),this.root.bbox.max.fromArray(this.source.boundsConforming,3),this.minElevationRange=this.source.boundsConforming[2],this.maxElevationRange=this.source.boundsConforming[5],this.extent=s.ZP.fromBox3(e.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r))))}get spacing(){return this.source.spacing}};var Cr=r(72726);class Tr extends Cr.Z{constructor(t){if(t.parsedData&&(console.warn("FileSource parsedData parameter is deprecated, use features instead of."),t.features=t.features||t.parsedData),t.projection&&(console.warn("FileSource projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs){if(!t.features||!t.features.crs)throw new Error("source.crs is required in FileSource");t.crs=t.features.crs}if(!t.url&&!t.fetchedData&&!t.features)throw new Error("url, fetchedData and features are not set in\n FileSource; at least one needs to be present");t.url=t.url||"fake-file-url",super(t),this.isFileSource=!0,this.fetchedData=t.fetchedData,this.fetchedData||t.features?t.features&&(this._featuresCaches[t.features.crs]=new _e.Z,this._featuresCaches[t.features.crs].setByArray(Promise.resolve(t.features),[0])):this.whenReady=this.fetcher(this.urlFromExtent(),this.networkOptions).then((t=>{this.fetchedData=t})),this.whenReady.then((()=>this.fetchedData)),this.zoom={min:0,max:1/0}}urlFromExtent(){return this.url}onLayerAdded(t){t.in=this,super.onLayerAdded(t);let e=this._featuresCaches[t.out.crs].getByArray([0]);e||(t.out.buildExtent="EPSG:4978"!=this.crs,t.out.buildExtent&&(t.out.forcedExtentCrs="EPSG:4978"!=t.out.crs?t.out.crs:l.Z.formatToEPSG(this.crs)),e=this.parser(this.fetchedData,t),this._featuresCaches[t.out.crs].setByArray(e,[0])),e.then((t=>{t.extent&&(this.extent=t.extent.clone(),this.extent.crs==t.crs&&this.extent.applyMatrix4(t.matrixWorld))}))}loadData(t,e){return this._featuresCaches[e.crs].getByArray([0])}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Ir=Tr;var Rr=r(4380);const Br=new s.ZP(l.Z.tms_4326,0,0,0);class Lr extends Cr.Z{constructor(t){if(t.format=t.format||"image/png",super(t),!t.crs)throw new Error("New TMSSource/WMTSSource: crs is required");if(this.isTMSSource=!0,t.extent||(this.extent=s.Mh.get(t.crs)),this.zoom=t.zoom,this.isInverted=t.isInverted||!1,this.crs=l.Z.formatToTms(t.crs),this.tileMatrixSetLimits=t.tileMatrixSetLimits,this.extentSetlimits={},this.tileMatrixCallback=t.tileMatrixCallback||(t=>t),!this.zoom)if(this.tileMatrixSetLimits){const t=Object.keys(this.tileMatrixSetLimits),e=t.length,r=Number(t[e-1]);this.zoom={min:r-e+1,max:r}}else this.zoom={min:0,max:1/0}}urlFromExtent(t){return Rr.Z.xyz(t,this)}onLayerAdded(t){super.onLayerAdded(t);const e=t.out.parent,r=e?e.extent.crs:t.out.crs;if(this.tileMatrixSetLimits&&!this.extentSetlimits[r]){this.extentSetlimits[r]={},Br.crs=this.crs;for(let t=this.zoom.max;t>=this.zoom.min;t--){const e=this.tileMatrixSetLimits[t],{west:i,north:n}=Br.set(t,e.minTileRow,e.minTileCol).as(r),{east:o,south:a}=Br.set(t,e.maxTileRow,e.maxTileCol).as(r);this.extentSetlimits[r][t]=new s.ZP(r,i,o,a,n)}}}extentInsideLimit(t,e){return e>=this.zoom.min&&e<=this.zoom.max&&(null==this.extentSetlimits[t.crs]||this.extentSetlimits[t.crs][e].intersectsExtent(t))}}const Pr=Lr;class Dr extends Cr.Z{constructor(t){if(t.projection&&(console.warn("WFSSource projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.typeName)throw new Error("source.typeName is required in wfs source.");if(!t.crs)throw new Error("source.crs is required in wfs source");t.format=t.format||"application/json",super(t),this.isWFSSource=!0,this.typeName=t.typeName,this.version=t.version||"2.0.2",this.bboxDigits=t.bboxDigits,this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${t.url}SERVICE=WFS&REQUEST=GetFeature&typeName=${this.typeName}&VERSION=${this.version}&SRSNAME=${this.crs}&outputFormat=${this.format}&BBOX=%bbox,${this.crs}`,this.zoom={min:0,max:1/0},this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}handlingError(t){return t.response&&400==t.response.status?t.response.text().then((e=>{const r=`${this.url}SERVICE=WFS&REQUEST=GetCapabilities&VERSION=${this.version}`,i=(new DOMParser).parseFromString(e,"application/xml").querySelector("Exception"),n=i.getAttribute("exceptionCode"),s=i.querySelector("ExceptionText").textContent;console.error(`Source ${this.typeName}: bad request when fetching data. Server says: "${n}: ${s}". \nReviewing ${r} may help.`,t)})):super.handlingError(t)}requestToKey(t){return l.Z.isTms(t.crs)?super.requestToKey(t):[t.zoom,t.south,t.west]}urlFromExtent(t){return Rr.Z.bbox(t,this)}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Or=Dr;class kr extends Cr.Z{constructor(t){if(!t.name)throw new Error("source.name is required.");if(!t.extent)throw new Error("source.extent is required");if(!t.crs&&!t.projection)throw new Error("source.crs is required");t.format=t.format||"image/png",super(t),this.isWMSSource=!0,this.name=t.name,this.zoom={min:0,max:1/0},this.style=t.style||"",this.width=t.width||t.height||256,this.height=t.height||t.width||256,this.version=t.version||"1.3.0",this.transparent=t.transparent||!1,this.bboxDigits=t.bboxDigits,t.axisOrder||("EPSG:4326"==this.crs?this.axisOrder="1.1.0"===this.version?"wsen":"swne":this.axisOrder="wsen");const e="1.3.0"===this.version?"CRS":"SRS";this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${this.url}SERVICE=WMS&REQUEST=GetMap&LAYERS=${this.name}&VERSION=${this.version}&STYLES=${this.style}&FORMAT=${this.format}&TRANSPARENT=${this.transparent}&BBOX=%bbox&${e}=${this.crs}&WIDTH=${this.width}&HEIGHT=${this.height}`,this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}urlFromExtent(t){return Rr.Z.bbox(t,this)}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Ur=kr,Nr=class extends Pr{constructor(t){if(!t.name)throw new Error("New WMTSSource: name is required");super(t),this.isWMTSSource=!0,this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${this.url}LAYER=${t.name}&FORMAT=${this.format}&SERVICE=WMTS&VERSION=${t.version||"1.0.0"}&REQUEST=GetTile&STYLE=${t.style||"normal"}&TILEMATRIXSET=${t.tileMatrixSet}&TILEMATRIX=%TILEMATRIX&TILEROW=%ROW&TILECOL=%COL`,this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}};var Fr=r(92294);const zr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/,Gr="https://api.mapbox.com",Qr=!0,jr=null;function Vr(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}function Hr(t,e){const r=qr(Gr);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==r.path&&(t.path=`${r.path}${t.path}`),!Qr)return Vr(t);if(!(e=e||jr))throw new Error("An API access token is required");if("s"===e[0])throw new Error("Use a public access token (pk.*), not a secret access token (sk.*).");return t.params=t.params.filter((t=>-1===t.indexOf("access_token"))),t.params.push(`access_token=${e}`),Vr(t)}function Wr(t){return 0===t.indexOf("mapbox:")}function qr(t){const e=t.match(zr);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}const Zr=function(t,e){if(!Wr(t))return t;const r=qr(t);return r.path=`/styles/v1${r.path}`,Hr(r,e)},Yr=function(t,e){if(!Wr(t))return t;const r=qr(t);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),Hr(r,e)},Xr=function(t,e,r,i){const n=qr(t);return Wr(t)?(n.path=`/styles/v1${n.path}/sprite${e}${r}`,Hr(n,i)):(n.path+=`${e}${r}`,Vr(n))};function Jr(t){return t.replace(/\{/g,"${")}const Kr=class extends Pr{constructor(t){t.format="application/x-protobuf;type=mapbox-vector",t.crs="EPSG:3857",t.isInverted=!0,t.url=t.url||".",super(t);const e=t.filter||(()=>!0);let r;if(this.urls=[],this.layers={},this.styles={},this.isVectorTileSource=!0,this.accessToken=t.accessToken,!t.style)throw new Error("New VectorTilesSource: style is required");if("string"==typeof t.style){const e=Zr(t.style,this.accessToken);r=d.Z.json(e,this.networkOptions)}else r=Promise.resolve(t.style);this.whenReady=r.then((e=>{this.jsonStyle=e;const r=t.sprite||e.sprite;if(r){const t=Xr(r,"",".json",this.accessToken);return d.Z.json(t,this.networkOptions).then((t=>{this.sprites=t;const i=Xr(r,"",".png",this.accessToken);return this.sprites.source=i,e}))}return e})).then((t=>{if(t.layers.forEach(((t,r)=>{if(t.sourceUid=this.uid,"background"===t.type)this.backgroundLayer=t;else if(e(t)){const e=bt.ZP.setFromVectorTileLayer(t,this.sprites,r,this.symbolToCircle);this.styles[t.id]=e,this.layers[t["source-layer"]]||(this.layers[t["source-layer"]]=[]),this.layers[t["source-layer"]].push({id:t.id,order:r,filterExpression:(0,Fr.TE)(t.filter),zoom:{min:t.minzoom||0,max:t.maxzoom||24}})}})),"."==this.url){const e=Object.values(t.sources).map((t=>{if(t.url){const e=Yr(t.url,this.accessToken);return d.Z.json(e,this.networkOptions).then((t=>{if(t.tiles[0])return Jr(t.tiles[0])}))}return t.tiles?Promise.resolve(Jr(t.tiles[0])):Promise.reject()}));return Promise.all(e)}return Promise.resolve([this.url])})).then((t=>{this.urls=Array.from(new Set(t))}))}urlFromExtent(t,e){return Rr.Z.xyz(t,{tileMatrixCallback:this.tileMatrixCallback,url:e})}onLayerAdded(t){super.onLayerAdded(t),t.out.style&&t.out.isFeatureGeometryLayer&&t.out.accurate&&(console.warn("With VectorTilesSource and FeatureGeometryLayer, the accurate option is always false"),t.out.accurate=!1)}loadData(t,e){const r=this._featuresCaches[e.crs],i=this.requestToKey(t);let n=r.getByArray(i);return n||(n=r.setByArray(Promise.all(this.urls.map((r=>this.fetcher(this.urlFromExtent(t,r),this.networkOptions).then((r=>this.parser(r,{out:e,in:this,extent:t})))))).then((t=>function(t){const e=t[0];return t.forEach(((t,r)=>{0!==r&&t.features.forEach((t=>{e.features.push(t)}))})),e}(t))).catch((t=>this.handlingError(t))),i),this.onParsedFile&&n.then((t=>(this.onParsedFile(t),console.warn("Source.onParsedFile was deprecated"),t)))),n}};class $r extends Cr.Z{constructor(t){super(t),this.isOrientedImageSource=!0;const e=[];e.push(t.orientationsUrl?d.Z.json(t.orientationsUrl,this.networkOptions):Promise.resolve()),e.push(t.calibrationUrl?d.Z.json(t.calibrationUrl,this.networkOptions):Promise.resolve()),this.whenReady=Promise.all(e).then((t=>({orientation:t[0],calibration:t[1]})))}urlFromExtent(t){return this.imageUrl(t.cameraId,t.panoId)}requestToKey(t){return[t.cameraId,t.panoId]}imageUrl(t,e){return this.url.replace("{cameraId}",t).replace("{panoId}",e)}}const ti=$r,ei={POSITION_CARTESIAN:{numElements:3,arrayType:Float32Array,attributeName:"position"},COLOR_PACKED:{numElements:4,arrayType:Uint8Array,attributeName:"color",normalized:!0},INTENSITY:{numElements:1,numByte:2,arrayType:Uint16Array,attributeName:"intensity",normalized:!0},CLASSIFICATION:{numElements:1,arrayType:Uint8Array,attributeName:"classification",normalized:!0},NORMAL_SPHEREMAPPED:{numElements:2,arrayType:Uint8Array,attributeName:"sphereMappedNormal"},NORMAL_OCT16:{numElements:2,arrayType:Uint8Array,attributeName:"oct16Normal"},NORMAL:{numElements:3,arrayType:Float32Array,attributeName:"normal"}};for(const t of Object.keys(ei)){const e=ei[t];e.potreeName=t,e.numByte=e.numByte||e.arrayType.BYTES_PER_ELEMENT,e.byteSize=e.numElements*e.numByte,e.normalized=e.normalized||!1;const r="getUint"+8*e.numByte;e.getValue=1===e.numByte?function(t,e){return t[r](e)}:function(t,e){return t[r](e,!0)}}const ri={parse:function(t,e){if(!t)throw new Error("No array buffer provided.");const r=new DataView(t);let n=0;for(const t of e.in.pointAttributes)n+=ei[t].byteSize;const s=Math.floor(t.byteLength/n),o=new i.BufferGeometry;let a=0,l=0;for(const t of e.in.pointAttributes){const e=ei[t],c=e.numElements*s,h=new e.arrayType(c);for(let t=0;t(this.pointAttributes=t.pointAttributes,this.baseurl=`${this.url}/${t.octreeDir}/r`,this.extension="CIN"===t.pointAttributes?"cin":"bin",this.parse="cin"===this.extension?ii.parse:ri.parse,t)))}}const si=ni;class oi extends Cr.Z{constructor(t){super(t),this.isC3DTilesSource=!0,this.baseUrl=this.url.slice(0,this.url.lastIndexOf("/")+1),this.whenReady=d.Z.json(this.url,this.networkOptions)}}const ai=oi,li=class extends ai{constructor(t){if(!t.accessToken)throw new Error("New 3D Tiles Ion Source: access token is required");if(!t.assetId)throw new Error("New 3D Tiles Ion Source: asset id is required");t.url=`https://api.cesium.com/v1/assets/${t.assetId}/endpoint?access_token=${t.accessToken}`,super(t),this.isC3DTilesIonSource=!0,this.accessToken=t.accessToken,this.assetId=t.assetId,this.whenReady=d.Z.json(t.url,this.networkOptions).then((t=>{if("3DTILES"!==t.type)throw new Error(`${t.type} datasets from Cesium ion are not supported with C3DTilesIonSource. Only 3D Tiles datasets are supported.`);return this.url=t.url,this.baseUrl=t.url.slice(0,t.url.lastIndexOf("/")+1),this.networkOptions.headers={},this.networkOptions.headers.Authorization=`Bearer ${t.accessToken}`,this.attribution=t.attributions,d.Z.json(this.url,this.networkOptions)}))}};function ci(t){if(!t)return null;if(t.content&&t.content.uri)return new URLSearchParams(t.content.uri.slice(t.content.uri.indexOf("?")+1)).get("session");if(t.children&&t.children.length>0)for(const e of t.children){const t=ci(e);if(t)return t}return null}const hi=class extends ai{constructor(t){if(!t.key)throw new Error("[C3DTilesGoogleSource]: A API key for the google map tiles API is required");t.url=`https://tile.googleapis.com/v1/3dtiles/root.json?key=${t.key}`,super(t),this.isC3DTilesGoogleSource=!0,this.baseUrl="https://tile.googleapis.com",this.key=t.key,this.whenReady=d.Z.json(t.url,this.networkOptions).then((t=>{if(t&&t.root&&(this.sessionId=ci(t.root),null===this.sessionId))throw new Error("[C3DTilesGoogleSource]: Cannot find sessionId from the tileset while it is mandatory to request tiles.");return t}))}getTileUrl(t){const e=`key=${this.key}&session=${this.sessionId}`;return/\?/.test(t)?`${t}&${e}`:`${t}?${e}`}};var ui=r(42622),di=r(37830);const pi=new class{constructor(){this._wasmPath="https://cdn.jsdelivr.net/npm/laz-perf@0.0.6/lib/",this._wasmPromise=null}_initDecoder(){return this._wasmPromise||(this._wasmPromise=ui.LazPerf.create({locateFile:t=>`${this._wasmPath}/${t}`})),this._wasmPromise}_parseView(t,e){const r=e.colorDepth??16,i=["X","Y","Z"].map(t.getter),n=t.getter("Intensity"),s=t.getter("ReturnNumber"),o=t.getter("NumberOfReturns"),a=t.getter("Classification"),l=t.getter("PointSourceId"),c=t.dimensions.Red?["Red","Green","Blue"].map(t.getter):void 0,h=t.getter("ScanAngle"),u=new Float32Array(3*t.pointCount),d=new Uint16Array(t.pointCount),p=new Uint8Array(t.pointCount),f=new Uint8Array(t.pointCount),m=new Uint8Array(t.pointCount),g=new Uint16Array(t.pointCount),A=c?new Uint8Array(4*t.pointCount):void 0,y=new Float32Array(t.pointCount),v=i.map((t=>t(0))).map((t=>Math.floor(t)));for(let e=0;et(e)));if(u[3*e]=t-v[0],u[3*e+1]=x-v[1],u[3*e+2]=b-v[2],d[e]=n(e),p[e]=s(e),f[e]=o(e),c){let[t,i,n]=c.map((t=>t(e)));16===r&&(t/=256,i/=256,n/=256),A[4*e]=t,A[4*e+1]=i,A[4*e+2]=n,A[4*e+3]=255}m[e]=a(e),g[e]=l(e),y[e]=h(e)}return{position:u,intensity:d,returnNumber:p,numberOfReturns:f,classification:m,pointSourceID:g,color:A,scanAngle:y,origin:v}}set lazPerf(t){this._wasmPath=t,this._wasmPromise=null}async parseFile(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new Uint8Array(t),i=await di.Las.PointData.decompressFile(r,this._initDecoder()),n=di.Las.Header.parse(r),s=e.colorDepth??(1===n.majorVersion&&n.minorVersion<=2?8:16),o=async(t,e)=>r.slice(t,e),a=await di.Las.Vlr.walk(o,n),l=di.Las.Vlr.find(a,"LASF_Spec",4),c=l&&di.Las.ExtraBytes.parse(await di.Las.Vlr.fetch(o,l)),h=di.Las.View.create(i,n,c);return{header:n,attributes:this._parseView(h,{colorDepth:s})}}},fi={enableLazPerf(t){if(!t)throw new Error("Path to laz-perf is mandatory");pi.lazPerf=t},parse(t){var e,r;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=n.out)&&void 0!==e&&e.skip&&console.warn("Warning: options 'skip' not supported anymore"),pi.parseFile(t,{colorDepth:null===(r=n.in)||void 0===r?void 0:r.colorDepth}).then((t=>{const e=new i.BufferGeometry,r=t.attributes;e.userData=t.header;const n=new i.BufferAttribute(r.position,3);e.setAttribute("position",n);const s=new i.BufferAttribute(r.intensity,1);e.setAttribute("intensity",s);const o=new i.BufferAttribute(r.returnNumber,1);e.setAttribute("returnNumber",o);const a=new i.BufferAttribute(r.numberOfReturns,1);e.setAttribute("numberOfReturns",a);const l=new i.BufferAttribute(r.classification,1);e.setAttribute("classification",l);const c=new i.BufferAttribute(r.pointSourceID,1);if(e.setAttribute("pointSourceID",c),r.color){const t=new i.BufferAttribute(r.color,4,!0);e.setAttribute("color",t)}const h=new i.BufferAttribute(r.scanAngle,1);return e.setAttribute("scanAngle",h),e.computeBoundingBox(),e.userData.origin=(new i.Vector3).fromArray(r.origin),e}))}};class mi extends Cr.Z{constructor(t){super(t),this.isEntwinePointTileSource=!0,this.colorDepth=t.colorDepth,this.url=this.url.replace("/ept.json",""),this.whenReady=d.Z.json(`${this.url}/ept.json`,this.networkOptions).then((t=>(this.parse="laszip"===t.dataType?fi.parse:ri.parse,this.extension="laszip"===t.dataType?"laz":"bin",t.srs&&t.srs.authority&&t.srs.horizontal&&(this.crs=`${t.srs.authority}:${t.srs.horizontal}`,n.default.defs(this.crs)||n.default.defs(this.crs,t.srs.wkt),t.srs.vertical&&t.srs.vertical!==t.srs.horizontal&&console.warn("EntwinePointTileSource: Vertical coordinates system code is not yet supported.")),this.spacing=(Math.abs(t.boundsConforming[3]-t.boundsConforming[0])+Math.abs(t.boundsConforming[4]-t.boundsConforming[1]))/(2*t.span),this.boundsConforming=t.boundsConforming,this.span=t.span,this))),this.fetcher=d.Z.arrayBuffer}}const gi=mi;var Ai=r(50810),yi=r(56178),vi=r(79003);const xi={parse(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=(0,ht._F)(r),t.zip?e=vi.parseZip(t.zip):t.shp&&t.shx&&t.dbf&&(e=Promise.all([vi.parseShp(t.shp,t.prj),vi.parseDbf(t.dbf)]).then(vi.combine)),r.in=r.in||{},r.in.crs=t.prj?(0,n.default)(t.prj).oProj.datumName:r.in.crs,Promise.resolve(e).then((t=>sr.Z.parse(t,r)))}};var bi=r(4090),_i=r(84612),wi=r(15344),Ei=r(25542),Mi=r(84607),Si=r(47274),Ci=r(27245),Ti=r(5626),Ii=r(83214),Ri=r(39865);const Bi=class{constructor(t){this.classes=t.classes,this.inverseHierarchy={},this.instancesIdxs=[];const e={};let r=0,i=t.parentCounts;void 0===i&&(i=new Array(t.instancesLength),i.fill(1));for(let n=0;n{"use strict";r.d(e,{S:()=>a,Z:()=>l});var i=r(99477),n=r(2362),s=r(71440),o=r(15344);function a(t,e){const r=t[t.indexOf(t.find((t=>t.includes(e))))].split(" ").filter((t=>""!==t));return parseFloat(r[r.length-1])}const l={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.split("\n"),l=r.indexOf(r.find((t=>t.includes("end_of_head"))))+1,c=r.slice(0,l),h={minX:a(c,"longlimit_west"),maxX:a(c,"longlimit_east"),minY:a(c,"latlimit_south"),maxY:a(c,"latlimit_north"),stepX:a(c,"gridstep"),stepY:a(c,"gridstep"),nRows:a(c,"latitude_parallels"),nColumns:a(c,"longitude_parallels")},u=new DataView(new ArrayBuffer(o.h8*h.nRows*h.nColumns));let d=0;for(let t of r.slice(l,r.length))t=t.split(" ").filter((t=>""!==t)),t.length&&(u.setFloat64(d*o.h8,parseFloat(t[2])),d++);const p=new s.ZP(e.in.crs||"EPSG:4326",h.minX,h.maxX,h.minY,h.maxY),f=new i.Vector2(h.stepX,h.stepY);return Promise.resolve(new n.Z(p,f,((t,e)=>u.getFloat64((h.nColumns*(h.nRows-t-1)+e)*o.h8))))}}},25542:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>Mt,qw:()=>wt,hu:()=>Et,zL:()=>bt,mp:()=>_t});var i=r(99477);function n(t,e){if(e===i.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===i.TriangleFanDrawMode||e===i.TriangleStripDrawMode){let r=t.getIndex();if(null===r){const e=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t=2.0 are supported.")));const h=new Z(n,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let t=0;t=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}h.setExtensions(s),h.setPlugins(o),h.parse(r,i)}parseAsync(t,e){const r=this;return new Promise((function(i,n){r.parse(t,e,i,n)}))}}function o(){let t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const a={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class l{constructor(t){this.parser=t,this.name=a.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let r=0,i=e.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,n.source,s)}}class b{constructor(t){this.parser=t,this.name=a.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,r=this.parser,i=r.json,n=i.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=i.images[s.source];let a=r.textureLoader;if(o.uri){const t=r.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(t,s.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class _{constructor(t){this.parser=t,this.name=a.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,r=this.parser,i=r.json,n=i.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=i.images[s.source];let a=r.textureLoader;if(o.uri){const t=r.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(t,s.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class w{constructor(t){this.name=a.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,r=e.bufferViews[t];if(r.extensions&&r.extensions[this.name]){const t=r.extensions[this.name],i=this.parser.getDependency("buffer",t.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then((function(e){const r=t.byteOffset||0,i=t.byteLength||0,s=t.count,o=t.byteStride,a=new Uint8Array(e,r,i);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(s,o,a,t.mode,t.filter).then((function(t){return t.buffer})):n.ready.then((function(){const e=new ArrayBuffer(s*o);return n.decodeGltfBuffer(new Uint8Array(e),s,o,a,t.mode,t.filter),e}))}))}return null}}class E{constructor(t){this.name=a.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,r=e.nodes[t];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const n=e.meshes[r.mesh];for(const t of n.primitives)if(t.mode!==P.TRIANGLES&&t.mode!==P.TRIANGLE_STRIP&&t.mode!==P.TRIANGLE_FAN&&void 0!==t.mode)return null;const s=r.extensions[this.name].attributes,o=[],a={};for(const t in s)o.push(this.parser.getDependency("accessor",s[t]).then((e=>(a[t]=e,a[t]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(t)),Promise.all(o).then((t=>{const e=t.pop(),r=e.isGroup?e.children:[e],n=t[0].count,s=[];for(const t of r){const e=new i.Matrix4,r=new i.Vector3,o=new i.Quaternion,l=new i.Vector3(1,1,1),c=new i.InstancedMesh(t.geometry,t.material,n);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new o,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,s=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=navigator.userAgent.indexOf("Firefox")>-1,s=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&s<98?this.textureLoader=new i.TextureLoader(this.options.manager):this.textureLoader=new i.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new i.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const r=this,i=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(t){return t._markDefs&&t._markDefs()})),Promise.all(this._invokeAll((function(t){return t.beforeRoot&&t.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(e){const s={scene:e[0][i.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:i.asset,parser:r,userData:{}};return G(n,s,i),Q(s,i),Promise.all(r._invokeAll((function(t){return t.afterRoot&&t.afterRoot(s)}))).then((function(){t(s)}))})).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[];for(let r=0,i=e.length;r{const r=this.associations.get(t);null!=r&&this.associations.set(e,r);for(const[r,i]of t.children.entries())n(i,e.children[r])};return n(r,i),i.name+="_instance_"+t.uses[e]++,i}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let r=0;r=2&&p.setY(e,u[t*o+1]),o>=3&&p.setZ(e,u[t*o+2]),o>=4&&p.setW(e,u[t*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(t){const e=this.json,r=this.options,i=e.textures[t].source,n=e.images[i];let s=this.textureLoader;if(n.uri){const t=r.manager.getHandler(n.uri);null!==t&&(s=t)}return this.loadTextureImage(t,i,s)}loadTextureImage(t,e,r){const n=this,s=this.json,o=s.textures[t],a=s.images[e],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(e,r).then((function(e){e.flipY=!1,e.name=o.name||a.name||"",""===e.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(e.name=a.uri);const r=(s.samplers||{})[o.sampler]||{};return e.magFilter=O[r.magFilter]||i.LinearFilter,e.minFilter=O[r.minFilter]||i.LinearMipmapLinearFilter,e.wrapS=k[r.wrapS]||i.RepeatWrapping,e.wrapT=k[r.wrapT]||i.RepeatWrapping,n.associations.set(e,{textures:t}),e})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(t,e){const r=this.json,n=this.options;if(void 0!==this.sourceCache[t])return this.sourceCache[t].then((t=>t.clone()));const s=r.images[t],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=this.getDependency("bufferView",s.bufferView).then((function(t){l=!0;const e=new Blob([t],{type:s.mimeType});return a=o.createObjectURL(e),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(t){return new Promise((function(r,s){let o=r;!0===e.isImageBitmapLoader&&(o=function(t){const e=new i.Texture(t);e.needsUpdate=!0,r(e)}),e.load(i.LoaderUtils.resolveURL(t,n.path),o,void 0,s)}))})).then((function(t){var e;return!0===l&&o.revokeObjectURL(a),t.userData.mimeType=s.mimeType||((e=s.uri).search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"),t})).catch((function(t){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),t}));return this.sourceCache[t]=c,c}assignTexture(t,e,r,i){const n=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),n.extensions[a.KHR_TEXTURE_TRANSFORM]){const t=void 0!==r.extensions?r.extensions[a.KHR_TEXTURE_TRANSFORM]:void 0;if(t){const e=n.associations.get(s);s=n.extensions[a.KHR_TEXTURE_TRANSFORM].extendTexture(s,t),n.associations.set(s,e)}}return void 0!==i&&(s.colorSpace=i),t[e]=s,s}))}assignFinalMaterial(t){const e=t.geometry;let r=t.material;const n=void 0===e.attributes.tangent,s=void 0!==e.attributes.color,o=void 0===e.attributes.normal;if(t.isPoints){const t="PointsMaterial:"+r.uuid;let e=this.cache.get(t);e||(e=new i.PointsMaterial,i.Material.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,e.sizeAttenuation=!1,this.cache.add(t,e)),r=e}else if(t.isLine){const t="LineBasicMaterial:"+r.uuid;let e=this.cache.get(t);e||(e=new i.LineBasicMaterial,i.Material.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,this.cache.add(t,e)),r=e}if(n||s||o){let t="ClonedMaterial:"+r.uuid+":";n&&(t+="derivative-tangents:"),s&&(t+="vertex-colors:"),o&&(t+="flat-shading:");let e=this.cache.get(t);e||(e=r.clone(),s&&(e.vertexColors=!0),o&&(e.flatShading=!0),n&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(t,e),this.associations.set(e,this.associations.get(r))),r=e}t.material=r}getMaterialType(){return i.MeshStandardMaterial}loadMaterial(t){const e=this,r=this.json,n=this.extensions,s=r.materials[t];let o;const l={},c=[];if((s.extensions||{})[a.KHR_MATERIALS_UNLIT]){const t=n[a.KHR_MATERIALS_UNLIT];o=t.getMaterialType(),c.push(t.extendParams(l,s,e))}else{const r=s.pbrMetallicRoughness||{};if(l.color=new i.Color(1,1,1),l.opacity=1,Array.isArray(r.baseColorFactor)){const t=r.baseColorFactor;l.color.setRGB(t[0],t[1],t[2],i.LinearSRGBColorSpace),l.opacity=t[3]}void 0!==r.baseColorTexture&&c.push(e.assignTexture(l,"map",r.baseColorTexture,i.SRGBColorSpace)),l.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,l.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(c.push(e.assignTexture(l,"metalnessMap",r.metallicRoughnessTexture)),c.push(e.assignTexture(l,"roughnessMap",r.metallicRoughnessTexture))),o=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),c.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,l)}))))}!0===s.doubleSided&&(l.side=i.DoubleSide);const h=s.alphaMode||"OPAQUE";if("BLEND"===h?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,"MASK"===h&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==i.MeshBasicMaterial&&(c.push(e.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new i.Vector2(1,1),void 0!==s.normalTexture.scale)){const t=s.normalTexture.scale;l.normalScale.set(t,t)}if(void 0!==s.occlusionTexture&&o!==i.MeshBasicMaterial&&(c.push(e.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==i.MeshBasicMaterial){const t=s.emissiveFactor;l.emissive=(new i.Color).setRGB(t[0],t[1],t[2],i.LinearSRGBColorSpace)}return void 0!==s.emissiveTexture&&o!==i.MeshBasicMaterial&&c.push(e.assignTexture(l,"emissiveMap",s.emissiveTexture,i.SRGBColorSpace)),Promise.all(c).then((function(){const r=new o(l);return s.name&&(r.name=s.name),Q(r,s),e.associations.set(r,{materials:t}),s.extensions&&G(n,r,s),r}))}createUniqueName(t){const e=i.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,r=this.extensions,n=this.primitiveCache;function s(t){return r[a.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(r){return Y(r,t,e)}))}const o=[];for(let r=0,l=t.length;r0&&j(p,o),p.name=e.createUniqueName(o.name||"mesh_"+t),Q(p,o),d.extensions&&G(s,p,d),e.assignFinalMaterial(p),h.push(p)}for(let r=0,i=h.length;r1?new i.Group:1===e.length?e[0]:new i.Object3D,a!==e[0])for(let t=0,r=e.length;t{const e=new Map;for(const[t,r]of n.associations)(t instanceof i.Material||t instanceof i.Texture)&&e.set(t,r);return t.traverse((t=>{const r=n.associations.get(t);null!=r&&e.set(t,r)})),e})(s),s}))}_createAnimationTracks(t,e,r,n,s){const o=[],a=t.name?t.name:t.uuid,l=[];let c;switch(F[s.path]===F.weights?t.traverse((function(t){t.morphTargetInfluences&&l.push(t.name?t.name:t.uuid)})):l.push(a),F[s.path]){case F.weights:c=i.NumberKeyframeTrack;break;case F.rotation:c=i.QuaternionKeyframeTrack;break;case F.position:case F.scale:c=i.VectorKeyframeTrack;break;default:c=1===r.itemSize?i.NumberKeyframeTrack:i.VectorKeyframeTrack}const h=void 0!==n.interpolation?z[n.interpolation]:i.InterpolateLinear,u=this._getArrayFromAccessor(r);for(let t=0,r=l.length;t{this.parse(t,e,n)}),r,n)}parse(t,e,r){this.decodeDracoFile(t,e,null,null,i.SRGBColorSpace).catch(r)}decodeDracoFile(t,e,r,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.LinearSRGBColorSpace;const o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:s};return this.decodeGeometry(t,o).then(e)}decodeGeometry(t,e){const r=JSON.stringify(e);if(X.has(t)){const e=X.get(t);if(e.key===r)return e.promise;if(0===t.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const n=this.workerNextTaskID++,s=t.byteLength,o=this._getWorker(n,s).then((r=>(i=r,new Promise(((r,s)=>{i._callbacks[n]={resolve:r,reject:s},i.postMessage({type:"decode",id:n,taskConfig:e,buffer:t},[t])}))))).then((t=>this._createGeometry(t.geometry)));return o.catch((()=>!0)).then((()=>{i&&n&&this._releaseTask(i,n)})),X.set(t,{key:r,promise:o}),o}_createGeometry(t){const e=new i.BufferGeometry;t.index&&e.setIndex(new i.BufferAttribute(t.index.array,1));for(let r=0;r{r.load(t,e,void 0,i)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then((e=>{const r=e[0];t||(this.decoderConfig.wasmBinary=e[1]);const i=K.toString(),n=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending}_getWorker(t,e){return this._initDecoder().then((()=>{if(this.workerPool.lengthe._taskLoad?-1:1}));const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[t]=e,r._taskLoad+=e,r}))}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map((t=>t._taskLoad)))}dispose(){for(let t=0;t{const e=t.draco,o=new e.Decoder;try{const t=function(t,e,i,n){const s=n.attributeIDs,o=n.attributeTypes;let a,l;const c=e.GetEncodedGeometryType(i);if(c===t.TRIANGULAR_MESH)a=new t.Mesh,l=e.DecodeArrayToMesh(i,i.byteLength,a);else{if(c!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new t.PointCloud,l=e.DecodeArrayToPointCloud(i,i.byteLength,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const i in s){const l=self[o[i]];let c,u;if(n.useUniqueIDs)u=s[i],c=e.GetAttributeByUniqueId(a,u);else{if(u=e.GetAttributeId(a,t[s[i]]),-1===u)continue;c=e.GetAttribute(a,u)}const d=r(t,e,a,i,l,c);"color"===i&&(d.vertexColorSpace=n.vertexColorSpace),h.attributes.push(d)}return c===t.TRIANGULAR_MESH&&(h.index=function(t,e,r){const i=3*r.num_faces(),n=4*i,s=t._malloc(n);e.GetTrianglesUInt32Array(r,n,s);const o=new Uint32Array(t.HEAPF32.buffer,s,i).slice();return t._free(s),{array:o,itemSize:1}}(t,e,a)),t.destroy(a),h}(e,o,new Int8Array(i),s),a=t.attributes.map((t=>t.array.buffer));t.index&&a.push(t.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:t},a)}catch(t){console.error(t),self.postMessage({type:"error",id:n.id,error:t.message})}finally{e.destroy(o)}}))}}}class ${constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(t){if(!this.workers[t]){const e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,t)),this.workers[t]=e}}_getIdleWorker(){for(let t=0;t{const i=this._getIdleWorker();-1!==i?(this._initWorker(i),this.workerStatus|=1<t.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class tt{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class et{constructor(t,e,r,i){this._dataView=new DataView(t.buffer,t.byteOffset+e,r),this._littleEndian=i,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_nextInt32(){const t=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,t}_skip(t){return this._offset+=t,this}_scan(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==e&&it.arrayBuffer())).then((t=>WebAssembly.instantiate(t,at))).then(this._init):WebAssembly.instantiate(Buffer.from(ct,"base64"),at).then(this._init),nt)}_init(t){st=t.instance,at.env.emscripten_notify_memory_growth(0)}decode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!st)throw new Error("ZSTDDecoder: Await .init() before decoding.");const r=t.byteLength,i=st.exports.malloc(r);ot.set(t,i),e=e||Number(st.exports.ZSTD_findDecompressedSize(i,r));const n=st.exports.malloc(e),s=st.exports.ZSTD_decompress(n,e,i,r),o=ot.slice(n,n+s);return st.exports.free(i),st.exports.free(n),o}}const ct="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",ht=new WeakMap;let ut,dt=0;class pt extends i.Loader{constructor(t){super(t),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new $,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(t){return this.transcoderPath=t,this}setWorkerLimit(t){return this.workerPool.setWorkerLimit(t),this}detectSupport(t){return!0===t.isWebGPURenderer?this.workerConfig={astcSupported:t.hasFeature("texture-compression-astc"),etc1Supported:!1,etc2Supported:t.hasFeature("texture-compression-etc2"),dxtSupported:t.hasFeature("texture-compression-bc"),bptcSupported:!1,pvrtcSupported:!1}:(this.workerConfig={astcSupported:t.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:t.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:t.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:t.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:t.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:t.extensions.has("WEBGL_compressed_texture_pvrtc")||t.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},t.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const t=new i.FileLoader(this.manager);t.setPath(this.transcoderPath),t.setWithCredentials(this.withCredentials);const e=t.loadAsync("basis_transcoder.js"),r=new i.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const n=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([e,n]).then((t=>{let[e,r]=t;const i=pt.BasisWorker.toString(),n=["/* constants */","let _EngineFormat = "+JSON.stringify(pt.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(pt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(pt.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n])),this.transcoderBinary=r,this.workerPool.setWorkerCreator((()=>{const t=new Worker(this.workerSourceURL),e=this.transcoderBinary.slice(0);return t.postMessage({type:"init",config:this.workerConfig,transcoderBinary:e},[e]),t}))})),dt>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),dt++}return this.transcoderPending}load(t,e,r,n){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new i.FileLoader(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(t,(t=>{if(ht.has(t))return ht.get(t).promise.then(e).catch(n);this._createTexture(t).then((t=>e?e(t):null)).catch(n)}),r,n)}_createTextureFrom(t,e){const{faces:r,width:n,height:s,format:o,type:a,error:l,dfdFlags:c}=t;if("error"===a)return Promise.reject(l);let h;if(6===e.faceCount)h=new i.CompressedCubeTexture(r,o,i.UnsignedByteType);else{const t=r[0].mipmaps;h=e.layerCount>1?new i.CompressedArrayTexture(t,n,s,e.layerCount,o,i.UnsignedByteType):new i.CompressedTexture(t,n,s,o,i.UnsignedByteType)}return h.minFilter=1===r[0].mipmaps.length?i.LinearFilter:i.LinearMipmapLinearFilter,h.magFilter=i.LinearFilter,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=At(e),h.premultiplyAlpha=!!(1&c),h}async _createTexture(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,rt.length);if(e[0]!==rt[0]||e[1]!==rt[1]||e[2]!==rt[2]||e[3]!==rt[3]||e[4]!==rt[4]||e[5]!==rt[5]||e[6]!==rt[6]||e[7]!==rt[7]||e[8]!==rt[8]||e[9]!==rt[9]||e[10]!==rt[10]||e[11]!==rt[11])throw new Error("Missing KTX 2.0 identifier.");const r=new tt,i=17*Uint32Array.BYTES_PER_ELEMENT,n=new et(t,rt.length,i,!0);r.vkFormat=n._nextUint32(),r.typeSize=n._nextUint32(),r.pixelWidth=n._nextUint32(),r.pixelHeight=n._nextUint32(),r.pixelDepth=n._nextUint32(),r.layerCount=n._nextUint32(),r.faceCount=n._nextUint32();const s=n._nextUint32();r.supercompressionScheme=n._nextUint32();const o=n._nextUint32(),a=n._nextUint32(),l=n._nextUint32(),c=n._nextUint32(),h=n._nextUint64(),u=n._nextUint64(),d=new et(t,rt.length+i,3*s*8,!0);for(let e=0;e{const e=new lt;await e.init(),t(e)}))),r=await ut);const n=[];for(let s=0;s>s),a=Math.max(1,t.pixelHeight>>s),l=t.pixelDepth?Math.max(1,t.pixelDepth>>s):0,c=t.levels[s];let h,u;if(0===t.supercompressionScheme)h=c.levelData;else{if(2!==t.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");h=r.decode(c.levelData,c.uncompressedByteLength)}u=gt[e]===i.FloatType?new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):gt[e]===i.HalfFloatType?new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):h,n.push({data:u,width:o,height:a,depth:l})}let s;if(ft.has(mt[e]))s=0===t.pixelDepth?new i.DataTexture(n[0].data,t.pixelWidth,t.pixelHeight):new i.Data3DTexture(n[0].data,t.pixelWidth,t.pixelHeight,t.pixelDepth);else{if(t.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new i.CompressedTexture(n,t.pixelWidth,t.pixelHeight)}return s.mipmaps=n,s.type=gt[e],s.format=mt[e],s.colorSpace=At(t),s.needsUpdate=!0,Promise.resolve(s)}(r);const n=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:t,taskConfig:e},[t]))).then((t=>this._createTextureFrom(t.data,r)));return ht.set(t,{promise:n}),n}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),dt--,this}}pt.BasisFormat={ETC1S:0,UASTC_4x4:1},pt.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},pt.EngineFormat={RGBAFormat:i.RGBAFormat,RGBA_ASTC_4x4_Format:i.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:i.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:i.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:i.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:i.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:i.RGB_ETC1_Format,RGB_ETC2_Format:i.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:i.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:i.RGB_S3TC_DXT1_Format},pt.BasisWorker=function(){let t,e,r;const i=_EngineFormat,n=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",(function(o){const u=o.data;switch(u.type){case"init":t=u.config,d=u.transcoderBinary,e=new Promise((t=>{r={wasmBinary:d,onRuntimeInitialized:t},BASIS(r)})).then((()=>{r.initializeBasis(),void 0===r.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":e.then((()=>{try{const{faces:e,buffers:o,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g}=function(e){const o=new r.KTX2File(new Uint8Array(e));function u(){o.close(),o.delete()}if(!o.isValid())throw u(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=o.isUASTC()?s.UASTC_4x4:s.ETC1S,p=o.getWidth(),f=o.getHeight(),m=o.getLayers()||1,g=o.getLevels(),A=o.getFaces(),y=o.getHasAlpha(),v=o.getDFDFlags(),{transcoderFormat:x,engineFormat:b}=function(e,r,o,h){let u,d;const p=e===s.ETC1S?a:l;for(let i=0;i1?(n=a.origWidth,s=a.origHeight):(n=a.width,s=a.height);const l=new Uint8Array(o.getImageTranscodedSizeInBytes(r,e,0,x));if(!o.transcodeImage(l,r,e,t,x,0,-1,-1))throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");i.push(l)}const a=h(i);e.push({data:a,width:n,height:s}),w.push(a.buffer)}_.push({mipmaps:e,width:p,height:f,format:b})}return u(),{faces:_,buffers:w,width:p,height:f,hasAlpha:y,format:b,dfdFlags:v}}(u.buffer);self.postMessage({type:"transcode",id:u.id,faces:e,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g},o)}catch(t){console.error(t),self.postMessage({type:"error",id:u.id,error:t.message})}}))}var d}));const o=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.BC1,n.BC3],engineFormat:[i.RGB_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.ETC1],engineFormat:[i.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],a=o.sort((function(t,e){return t.priorityETC1S-e.priorityETC1S})),l=o.sort((function(t,e){return t.priorityUASTC-e.priorityUASTC}));function c(t){return t<=2||0==(t&t-1)&&0!==t}function h(t){if(1===t.length)return t[0];let e=0;for(let r=0;r=0&&(c[n.KHR_MATERIALS_COMMON]=new s(h)),new C(h,c,{crossOrigin:this.crossOrigin,manager:this.manager,path:e||this.resourcePath||""}).parse((function(t,e,i,n){r({scene:t,scenes:e,cameras:i,animations:n})}))}}function e(){var t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}},update:function(e,r){for(var i in t){var n=t[i];n.update&&n.update(e,r)}}}}function r(t,e){var r={},n=t.material.uniforms;for(var s in n){var o=n[s];if(o.semantic){var a=o.node,l=t;a&&(l=e[a]),r[s]={semantic:o.semantic,sourceNode:l,targetNode:t,uniform:o}}}this.boundUniforms=r,this._m4=new i.Matrix4}t.Shaders={update:function(){console.warn("threeExamples.LegacyGLTFLoader.Shaders has been deprecated, and now updates automatically.")}},r.prototype.update=function(t,e){var r=this.boundUniforms;for(var i in r){var n=r[i];switch(n.semantic){case"MODELVIEW":n.uniform.value.multiplyMatrices(e.matrixWorldInverse,n.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var s=n.uniform.value;this._m4.multiplyMatrices(e.matrixWorldInverse,n.sourceNode.matrixWorld),s.getNormalMatrix(this._m4);break;case"PROJECTION":n.uniform.value.copy(e.projectionMatrix);break;case"JOINTMATRIX":for(var o=n.uniform.value,a=0;anew Promise(((r,i)=>{if(!t||!e)return void i(new Error("[GLTFParser]: Buffer and path are mandatory to parse a glTF."));const n=t=>{t.scene.applyMatrix4(xt),r(t)},s=t=>{i(new Error(`[GLTFParser]: Failed to parse gltf with error: ${t}`))};1===new DataView(t,0,20).getUint32(4,!0)?_t.parse(t,e,n,s):bt.parse(t,e,n,s)}))}},15344:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>a,h8:()=>o});var i=r(99477),n=r(2362),s=r(71440);const o=8,a={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=e.in.dataType||"float";if(!["float","double"].includes(r))throw new Error("`dataType` parameter is incorrect for GTXParser.parse method. This parameter must be either `double` or `float`.");const a=new DataView(t,0,40),l={minX:a.getFloat64(8),minY:a.getFloat64(0),stepX:a.getFloat64(24),stepY:a.getFloat64(16),nColumns:a.getInt32(36),nRows:a.getInt32(32)},c=new DataView(t,40),h=l.minX+l.stepX*(l.nColumns-1),u=l.minY+l.stepY*(l.nRows-1),d=new s.ZP(e.in.crs||"EPSG:4326",l.minX,h,l.minY,u),p=new i.Vector2(l.stepX,l.stepY);return Promise.resolve(new n.Z(d,p,((t,e)=>"float"===r?c.getFloat32(4*(l.nColumns*t+e)):"double"===r?c.getFloat64((l.nColumns*t+e)*o):void 0)))}}},12679:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(62310),n=r(5167),s=r(53175);const o=new i.Z("EPSG:4978",0,0,0),a=new i.Z("EPSG:4978",0,0,0),l=new i.Z("EPSG:4978",0,0,0),c=(t,e,r)=>(o.crs=r,o.setFromArray(e[0]),!t.isPointInside(o)),h={populateGeometry(t,e,r,i){r.startSubGeometry(e.length,i),o.crs=t;for(const t of e)o.setFromValues(t[0],t[1],t[2]),r.pushCoordinates(i,o);r.updateExtent()},populateGeometryWithCCW(t,e,r,i){r.startSubGeometry(e.length,i),o.crs=t;let n=0;l.setFromValues(e[0][0],e[0][1],e[0][2]),a.copy(l);for(let t=0;tvoid 0===t||Array.isArray(t)&&!isNaN(t[0])?t:d(t[0]);function p(t,e,r){var i,s;if(null===(i=e.geometry)||void 0===i||!i.type)return console.warn("No geometry provided"),null;const o=e.geometry.type.toLowerCase(),a=function(t){switch(t){case"point":case"multipoint":return n.tg.POINT;case"linestring":case"multilinestring":return n.tg.LINE;case"polygon":case"multipolygon":return n.tg.POLYGON;default:throw new Error(`Unhandled geometry type ${t}`)}}(o),l=r.requestFeatureByType(a),c="point"!=o?e.geometry.coordinates:[e.geometry.coordinates],p=e.properties||{};l.hasRawElevationData=3===(null===(s=d(c))||void 0===s?void 0:s.length);for(const t of Object.keys(e))u.includes(t.toLowerCase())||(p.geojson=p.geojson||{},p.geojson[t]=e[t]);return function(t,e,r,i,n,s){if(0!=i.length)switch(t){case"point":case"linestring":return h.default(e,r,i,n,s);case"multipoint":return h.multi("point",e,r,i,n,s);case"multilinestring":return h.multi("default",e,r,i,n,s);case"polygon":return h.polygon(e,r,i,n,s);case"multipolygon":return h.multi("polygon",e,r,i,n,s);default:throw new Error(`Unhandled geojson type ${e.type}`)}}(o,l,t,c,r,p),l}function f(t,e,r){const i=new n.t1(r),s=r.filter||(()=>!0);for(const r of e)s(r.properties,r.geometry)&&p(t,r,i);return i.removeEmptyFeature(),i.updateExtent(),i}const m={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=(0,s._F)(e),e.in=e.in||{};const r=e.out,i=e.in;switch("string"==typeof t&&(t=JSON.parse(t)),i.crs=i.crs||function(t){if(t.crs){if("epsg"==t.crs.type.toLowerCase())return`EPSG:${t.crs.properties.code}`;if("name"==t.crs.type.toLowerCase()){if(t.crs.properties.name.toLowerCase().includes("epsg:")){const e=t.crs.properties.name.lastIndexOf(":");if(e>0)return`EPSG:${t.crs.properties.name.substr(e+1)}`}throw new Error(`Unsupported CRS authority '${t.crs.properties.name}'`)}throw new Error(`Unsupported CRS type '${t.crs}'`)}return"EPSG:4326"}(t),r.filteringExtent&&("boolean"==typeof r.filteringExtent?r.filterExtent=e.extent.as(i.crs):r.filteringExtent.isExtent&&(r.filterExtent=r.filteringExtent)),t.type.toLowerCase()){case"featurecollection":return Promise.resolve(f(i.crs,t.features,r));case"feature":return Promise.resolve(f(i.crs,[t],r));default:throw new Error(`Unsupported GeoJSON type: '${t.type}`)}}}},50810:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(75153),n=r(12679),s=r(53175);const o={parse:(t,e)=>(e=(0,s._F)(e),n.Z.parse((0,i.ng)(t),e))}},4090:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477),n=r(2362),s=r(71440),o=r(84612),a=r(15344);const l={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.split("\n"),l=r.indexOf(r.find((t=>t.includes("end_of_head"))))+1,c=r.slice(0,l),h={minX:(0,o.S)(c,"lon min"),maxX:(0,o.S)(c,"lon max"),minY:(0,o.S)(c,"lat min"),maxY:(0,o.S)(c,"lat max"),stepX:(0,o.S)(c,"delta lon"),stepY:(0,o.S)(c,"delta lat"),nRows:(0,o.S)(c,"nrows"),nColumns:(0,o.S)(c,"ncols")},u=new DataView(new ArrayBuffer(a.h8*h.nRows*h.nColumns));let d=0;for(let t of r.slice(l,r.length))if(t=t.split(" ").filter((t=>""!==t)),t.length)for(const e of t)u.setFloat64(d*a.h8,parseFloat(e)),d++;const p=new s.ZP(e.in.crs||"EPSG:4326",h.minX+h.stepX/2,h.maxX-h.stepX/2,h.minY+h.stepY/2,h.maxY-h.stepY/2),f=new i.Vector2(h.stepX,h.stepY);return Promise.resolve(new n.Z(p,f,((t,e)=>u.getFloat64((h.nColumns*t+e)*a.h8))))}}},56178:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(75153),n=r(12679),s=r(53175);const o={parse:(t,e)=>(e=(0,s._F)(e),n.Z.parse((0,i.DS)(t),e))}},66014:(t,e,r)=>{"use strict";r.d(e,{SR:()=>m,SY:()=>d,Ti:()=>y,Y0:()=>v,y:()=>h});var i=r(99477),n=r(70991),s=r(39865),o=r(11707);function a(t,e,r,i,n,s){const a={view:t,requester:n,layer:r,priority:n?1/(n.distance+1):100,metadata:i,redraw:s};return r.dispatchEvent({type:o.y.ON_TILE_REQUESTED,metadata:i}),e.execute(a)}function l(t){return t.children.filter((e=>e.layer==t.layer&&e.tileId))}const c=new i.Matrix4;function h(t,e,r,i){return!(!r.viewerRequestVolume||!r.viewerRequestVolume.viewerRequestVolumeCulling(e,i))||!(!r.boundingVolume||!r.boundingVolume.boundingVolumeCulling(e,i))}function u(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=e.additiveRefinement||r>0;for(let s=0;sthis.cleanupDelay){this.root.cleanableSince=void 0;let e=0;for(;ethis.cleanupDelay))break;u(this,r)}this._cleanableTiles.splice(0,e)}return[this.root]}const p=new i.Box3,f=new i.Sphere;function m(t,e,r,i){return a(t,e,r,i,void 0,!0).then((t=>{r.object3d.add(t),t.updateMatrixWorld(),r.tileset.tiles[t.tileId].loaded=!0,r.root=t,r.onTileContentLoaded(t)}))}function g(t,e){t.content&&(t.content.visible=e)}function A(t,e){e.cleanableSince||(e.cleanableSince=Date.now(),t._cleanableTiles.push(e))}function y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return function(r,i,n){if(n.parent.pendingSubdivision&&!n.parent.additiveRefinement)return void(n.visible=!1);const s=!t||!t(i,r.camera,n,n.matrixWorld);if(n.visible=s,s){let s;if(n.cleanableSince&&(i._cleanableTiles.splice(i._cleanableTiles.indexOf(n),1),n.cleanableSince=void 0),n.pendingSubdivision||e(r,i,n))(function(t,e,r,i){r.additiveRefinement?function(t,e,r,i){for(const n of e.tileset.tiles[r.tileId].children){if(n.promise||n.loaded)continue;let s=r.matrixWorld;n.transform&&(s=c.multiplyMatrices(r.matrixWorld,n.transform)),(!i||!i(e,t.camera,n,s))&&(n.promise=a(t.view,t.scheduler,e,n,r,!0).then((i=>{r.add(i),i.updateMatrixWorld(),e.onTileContentLoaded(i),t.view.notifyChange(n),n.loaded=!0,delete n.promise})))}}(t,e,r,i):function(t,e,r){if(!r.pendingSubdivision&&0==l(r).length){const i=e.tileset.tiles[r.tileId].children;if(void 0===i||0===i.length)return;r.pendingSubdivision=!0;const n=[];for(let s=0;s{i[s].loaded=!0,r.add(n),n.updateMatrixWorld(),r.additiveRefinement&&t.view.notifyChange(r),e.tileset.tiles[n.tileId].loaded=!0,e.onTileContentLoaded(n)})));Promise.all(n).then((()=>{r.pendingSubdivision=!1,t.view.notifyChange(r)}))}}(t,e,r)})(r,i,n,t),g(n,n.pendingSubdivision||n.additiveRefinement),s=l(n);else{g(n,!0);for(const t of l(n))t.visible=!1,A(i,t)}return s}A(i,n)}}function v(t,e,r){if(void 0===e.tileset.tiles[r.tileId].children)return!1;if(e.tileset.tiles[r.tileId].isTileset)return!0;const i=function(t,e){if(e.distance=0,e.boundingVolume.initialVolumeType===s.D.box)p.copy(e.boundingVolume.volume),p.applyMatrix4(e.matrixWorld),e.distance=p.distanceToPoint(t.camera3D.position);else{if(e.boundingVolume.initialVolumeType!==s.D.sphere&&e.boundingVolume.initialVolumeType!==s.D.region)return 1/0;f.copy(e.boundingVolume.volume),f.applyMatrix4(e.matrixWorld),e.distance=Math.max(0,f.distanceToPoint(t.camera3D.position))}return 0===e.distance?1/0:t._preSSE*(e.geometricError/e.distance)}(t.camera,r);return i>e.sseThreshold}},81189:(t,e,r)=>{"use strict";r.d(e,{U8:()=>u,XP:()=>c,kE:()=>o,pN:()=>h});var i=r(60465),n=r(81590),s=r(79159);const o=131072**.5;function a(t){return!(t.requester.parent&&t.requester.material&&!(t.layer.isElevationLayer&&t.requester.material.getElevationLayer()&&t.targetLevel<=t.requester.material.getElevationLayer().level)&&t.requester.layerUpdateState[t.layer.id]&&t.layer.source._featuresCaches[t.layer.crs]&&t.requester.material.visible)}function l(t,e,r,i,n){return{view:t,layer:e,extentsSource:r,extentsDestination:i,requester:n,priority:(s=n.material,s.visible?100:10),earlyDropFunction:a};var s}function c(t,e,r,o){const a=r.material;if(!o||!a)return;const c=r.getExtentsByProjection(e.crs),h=c[0].zoom;if(h>e.zoom.max||h=e.source.zoom.min)return void t.view.notifyChange(r,!1)}if(!a.visible)return;if(!e.visible||!r.layerUpdateState[e.id].canTryUpdate())return;if(u.level>=c[0].zoom)return void r.layerUpdateState[e.id].noMoreUpdatePossible();if(e.frozen)return;const p=r.layerUpdateState[e.id].failureParams,f=c[0].zoom||r.level,m=(0,i.k5)(e.updateStrategy.type,r,f,u.level,e,p);if(!e.source.isVectorSource&&m<=u.level||m>f)return void(p.lowestLevelError!=1/0&&r.layerUpdateState[e.id].noMoreUpdatePossible());if(!e.source.extentInsideLimit(r.extent,m))return r.layerUpdateState[e.id].noData({targetLevel:m}),void t.view.notifyChange(r,!1);const g=c.map((t=>t.tiledExtentParent(m)));r.layerUpdateState[e.id].newTry();const A=l(t.view,e,g,c,r);return t.scheduler.execute(A).then((t=>{if(!r.layerUpdateState[e.id])return;const i=c.map(((e,r)=>e.offsetToParent(t[r].extent,u.offsetScales[r])));u.setTextures(t,i),r.layerUpdateState[e.id].success()}),(i=>(0,s.Z)(i,r,e,m,t.view)))}function h(t,e,r,o){const a=r.material;if(!o||!a)return;const c=r.getExtentsByProjection(e.crs),h=c[0].zoom;if(h>e.zoom.max||h=e.source.zoom.min)return void t.view.notifyChange(r,!1)}if(e.frozen||!a.visible||!r.layerUpdateState[e.id].canTryUpdate())return;const p=r.layerUpdateState[e.id].failureParams,f=(0,i.k5)(e.updateStrategy.type,r,c[0].zoom,u.level,e,p);if(f<=u.level||f>c[0].zoom)return void r.layerUpdateState[e.id].noMoreUpdatePossible();if(!e.source.extentInsideLimit(r.extent,f))return r.layerUpdateState[e.id].noData({targetLevel:f}),void t.view.notifyChange(r,!1);const m=c.map((t=>t.tiledExtentParent(f)));r.layerUpdateState[e.id].newTry();const g=l(t.view,e,m,c,r);return t.scheduler.execute(g).then((t=>{if(!r.layerUpdateState[e.id])return;if(f<=u.level)return void r.layerUpdateState[e.id].noMoreUpdatePossible();const i=c.map(((e,r)=>e.offsetToParent(t[r].extent,u.offsetScales[r])));u.setTextures(t,i),r.layerUpdateState[e.id].success()}),(i=>(0,s.Z)(i,r,e,f,t.view)))}function u(t){return function(e){var r;null!==(r=e.material)&&void 0!==r&&r.removeLayer&&(e.material.elevationLayerIds.indexOf(t)>-1&&e.setBBoxZ({min:0,max:0}),e.material.removeLayer(t)),e.layerUpdateState&&e.layerUpdateState[t]&&delete e.layerUpdateState[t]}}},70991:(t,e,r)=>{"use strict";function i(t){t.dispose();for(const e of Object.keys(t)){const r=t[e];r&&r.isTexture&&r.dispose()}}r.d(e,{Z:()=>n});const n={cleanup(t){if(t.layer=null,t.isScene||"function"!=typeof t.dispose){if(t.geometry&&t.geometry.dispose(),t.material)if(Array.isArray(t.material))for(const e of t.material)i(e);else i(t.material);t.dispatchEvent({type:"dispose"})}else t.dispose()},removeChildren(t,e){const r=e.children.filter((e=>(e.layer&&e.layer.id)===t.id));return e.remove(...r),r},removeChildrenAndCleanup(t,e){const r=e.children.filter((e=>(e.layer&&e.layer.id)===t.id));return e.remove(...r),e.layer===t&&this.cleanup(e),r},removeChildrenAndCleanupRecursively(t,e){let r=e.children.filter((e=>e.layer&&e.layer.id===t.id));const i=e.link&&e.link[t.id];null!=i&&i.children.length&&(r=r.concat(i.children),delete e.link[t.id]);for(const e of r)this.removeChildrenAndCleanupRecursively(t,e);return e.remove(...r),e.layer&&e.layer.id===t.id&&this.cleanup(e),r}}},79159:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=4;function n(t,e,r,n,s){if(e.layerUpdateState[r.id])if(t.isCancelledCommandException)e.layerUpdateState[r.id].success();else if(t instanceof SyntaxError)e.layerUpdateState[r.id].failure(0,!0);else{const t=e.layerUpdateState[r.id].errorCount>i;e.layerUpdateState[r.id].failure(Date.now(),t,{targetLevel:n}),t||window.setTimeout((()=>{s.notifyChange(e,!1)}),1e3*e.layerUpdateState[r.id].secondsUntilNextTry())}}},45340:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var i=r(99477);const n=new i.TextureLoader;function s(t){if(!t.ok){const e=new Error(`Error loading ${t.url}: status ${t.status}`);throw e.response=t,e}}const o=function(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.arrayBuffer())))},a={text(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.text())))},json(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.json())))},xml(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.text()))).then((t=>(new window.DOMParser).parseFromString(t,"text/xml")))},texture(t){let e,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.crossOrigin=i.crossOrigin;const s=new Promise(((t,i)=>{e=t,r=i}));return n.load(t,e,(()=>{}),r),s},arrayBuffer:o,textureFloat(t){return o(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>{const e=function(t){const e=new i.DataTexture(t,256,256,i.RedFormat,i.FloatType);return e.internalFormat="R32F",e.needsUpdate=!0,e}(new Float32Array(t));return e}))},multiple(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[];let n;for(const s in e){if(!this[s])throw new Error(`${s} is not a valid Fetcher method.`);for(const o of e[s])n=`${t}.${o}`,i.push(this[s](n,r).then((t=>({type:o,result:t}))))}return Promise.all(i).then((t=>{const e={};for(const r of t)e[r.type]=r.result;return Promise.resolve(e)}))},get(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[e,r]=t.split("/");switch(e){case"application":switch(r){case"geo+json":case"json":return this.json;case"kml":case"gpx":return this.xml;case"x-protobuf;type=mapbox-vector":case"gtx":return this.arrayBuffer;default:return this.text}case"image":return"x-bil;bits=32"===r?this.textureFloat:this.texture;default:return this.texture}}}},4380:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});const i=new(r(71440).ZP)("EPSG:4326",[0,0,0,0]);let n=0;function s(t){const e=/\$\{u:([\w-_.|]+)\}/.exec(t);if(!e)return t;const r=e[1].split("|");return t.replace(e[0],r[n++%r.length])}const o={subDomains:s,xyz:function(t,e){return s(e.url.replace(/(\$\{z\}|%TILEMATRIX)/,e.tileMatrixCallback(t.zoom)).replace(/(\$\{y\}|%ROW)/,t.row).replace(/(\$\{x\}|%COL)/,t.col))},bbox:function(t,e){let r="EPSG:4326"==e.crs?9:2;void 0!==e.bboxDigits&&(r=e.bboxDigits),t.as(e.crs,i);const n=i.west.toFixed(r),o=i.south.toFixed(r),a=i.east.toFixed(r),l=i.north.toFixed(r);let c=e.axisOrder||"wsen";return c=c.replace("w",`${n},`).replace("s",`${o},`).replace("e",`${a},`).replace("n",`${l},`).slice(0,-1),s(e.url.replace("%bbox",c))}}},232:(t,e,r)=>{"use strict";r.d(e,{P:()=>o,Z:()=>u});var i=r(99477),n=r(62310),s=r(86541);const o={PERSPECTIVE:0,ORTHOGRAPHIC:1},a={frustum:new i.Frustum,matrix:new i.Matrix4,box3:new i.Box3},l=new i.Box3(new i.Vector3(-1,-1,-1),new i.Vector3(1,1,1));function c(t,e,r){if(t.camera3D.isOrthographicCamera)t._preSSE=e;else{const n=i.MathUtils.degToRad(r);t._preSSE=e/(2*Math.tan(.5*n))}}const h=[new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3],u=class{#B=!0;#L=new i.Matrix4;constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(this.crs=t,n.isCamera)console.warn("options.camera parameter is deprecated. Use options.camera.cameraThree to place a custom camera as a parameter. See the documentation of Camera."),this.camera3D=n;else if(n.cameraThree)this.camera3D=n.cameraThree;else switch(n.type){case o.ORTHOGRAPHIC:this.camera3D=new i.OrthographicCamera;break;case o.PERSPECTIVE:default:this.camera3D=new i.PerspectiveCamera(30)}if(this.camera3D.aspect=this.camera3D.aspect??1,this.width=e,this.height=r,this.resize(e,r),this._preSSE=1/0,this.camera3D.isPerspectiveCamera){let t=this.camera3D.fov;Object.defineProperty(this.camera3D,"fov",{get:()=>t,set:e=>{t=e,c(this,this.height,t)}})}}resize(t,e){if(!t||t<=0||!e||e<=0)return void console.warn(`Trying to resize the Camera with invalid height (${e}) or width (${t}). Skipping resize.`);const r=t/e;if(this.camera3D.aspect!==r){if(this.camera3D.isOrthographicCamera){this.camera3D.zoom*=this.width/t;const e=this.camera3D.top*this.camera3D.aspect/r;this.camera3D.bottom=-e,this.camera3D.top=e}else this.camera3D.isPerspectiveCamera&&(this.camera3D.fov=2*i.MathUtils.radToDeg(Math.atan(e/this.height*Math.tan(i.MathUtils.degToRad(this.camera3D.fov)/2))));this.camera3D.aspect=r}this.width=t,this.height=e,c(this,this.height,this.camera3D.fov),this.camera3D.updateProjectionMatrix&&(this.camera3D.updateProjectionMatrix(),this.#B=!0)}update(){this.camera3D.updateMatrixWorld(),this.#B=!0}position(t){return new n.Z(this.crs,this.camera3D.position).as(t||this.crs)}setPosition(t){this.camera3D.position.copy(t.as(this.crs))}isBox3Visible(t,e){return this.box3SizeOnScreen(t,e).intersectsBox(l)}isSphereVisible(t,e){return this.#B&&(this.#L.multiplyMatrices(this.camera3D.projectionMatrix,this.camera3D.matrixWorldInverse),this.#B=!1),e?(a.matrix.multiplyMatrices(this.#L,e),a.frustum.setFromProjectionMatrix(a.matrix)):a.frustum.setFromProjectionMatrix(this.#L),a.frustum.intersectsSphere(t)}box3SizeOnScreen(t,e){const r=function(t,e,r){let i=t.camera3D.matrixWorldInverse;r&&(i=a.matrix.multiplyMatrices(t.camera3D.matrixWorldInverse,r)),h[0].set(e.min.x,e.min.y,e.min.z).applyMatrix4(i),h[1].set(e.min.x,e.min.y,e.max.z).applyMatrix4(i),h[2].set(e.min.x,e.max.y,e.min.z).applyMatrix4(i),h[3].set(e.min.x,e.max.y,e.max.z).applyMatrix4(i),h[4].set(e.max.x,e.min.y,e.min.z).applyMatrix4(i),h[5].set(e.max.x,e.min.y,e.max.z).applyMatrix4(i),h[6].set(e.max.x,e.max.y,e.min.z).applyMatrix4(i),h[7].set(e.max.x,e.max.y,e.max.z).applyMatrix4(i);let n=!1;for(let e=0;e<8;e++)h[e].z<=-t.camera3D.near?n=!0:h[e].z=-t.camera3D.near;return n?h:void 0}(this,t,e);if(!r)return a.box3.makeEmpty();for(let t=0;t<8;t++)r[t].applyMatrix4(this.camera3D.projectionMatrix);return a.box3.setFromPoints(r)}adjustAltitudeToAvoidCollisionWithLayer(t,e,r){const i=t.camera.position().as("EPSG:4326");if(void 0!==e){const n=s.Z.getElevationValueAt(e,i);void 0!==n&&i.altitude-(n+r)<0&&(i.altitude=n+r,t.camera3D.position.copy(i.as(t.referenceCrs)),t.notifyChange(this.camera3D))}}}},97112:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o,i:()=>s});var i=r(78025);function n(t,e){const r=i.M.getColorLayersIdOrderedBySequence(e),n=function(t){var e;null!==(e=t.material)&&void 0!==e&&e.setSequence&&t.material.setSequence(r)};for(const e of t.level0Nodes)e.traverse(n)}const s="layers-order-changed",o={moveLayerUp(t,e){const r=t.getLayers((t=>t.isColorLayer)),o=t.getLayerById(e);if(!o)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(r);i.M.moveLayerUp(o,r),n(t.tileLayer,r),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(t.tileLayer)}},moveLayerDown(t,e){const r=t.getLayers((t=>t.isColorLayer)),o=t.getLayerById(e);if(!o)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(r);i.M.moveLayerDown(o,r),n(t.tileLayer,r),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(t.tileLayer)}},moveLayerToIndex(t,e,r){const o=t.getLayers((t=>t.isColorLayer)),a=t.getLayerById(e);if(!a)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(o);i.M.moveLayerToIndex(a,r,o),n(t.tileLayer,o),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(o)}}),t.notifyChange(t.tileLayer)}}}},3725:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});var i=r(99477);const n={setDefineMapping(t,e,r){Object.keys(r).forEach((i=>{t.defines[`${e}_${i}`]=r[i]}))},setDefineProperty(t,e,r,i){t.defines[r]=i,Object.defineProperty(t,e,{get:()=>t.defines[r],set:e=>{t.defines[r]!=e&&(t.defines[r]=e,t.needsUpdate=!0)}})},setUniformProperty(t,e,r){t.uniforms[e]=new i.Uniform(r),Object.defineProperty(t,e,{get:()=>t.uniforms[e].value,set:r=>{t.uniforms[e].value!=r&&(t.uniforms[e].value=r)}})}}},49652:(t,e,r)=>{"use strict";r.d(e,{R:()=>o,Z:()=>l});var i=r(99477),n=r(49401);const s=new i.Frustum;class o{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=t,this.y=e,this.grid=[],this.visible=[],this.resize(),this.reset(),this.width=r,this.height=i}reset(){for(let t=0;t0&&this.grid[s][e].some((e=>{return r=e.boundaries,i=t.boundaries,!(r.left>i.right||r.righti.bottom||r.bottomt.isLabelLayer&&t.visible));0!=r.length&&(this.grid.reset(),s.setFromProjectionMatrix(e.projectionMatrix),r.forEach((t=>{t.submittedLabelNodes.forEach((t=>{t.labels.forEach((r=>{t.updatePosition(r),this.culling(r,e)})),t.domElements.labels.show(),t.needsUpdate=!1}))})),this.grid.visible.sort(((t,e)=>{const r=e.order-t.order;return 0==r?!t.visible&&e.visible?1:-1:r})),this.grid.visible.forEach((t=>{this.grid.insert(t)?(t.visible=!0,t.updateCSSPosition()):t.visible=!1})),r.forEach((t=>{t.toHide.children.forEach((t=>{var e;return null===(e=t.domElements)||void 0===e?void 0:e.labels.hide()})),t.toHide.clear()})))}culling(t,e){t.getWorldPosition(a),!s.containsPoint(a.applyMatrix4(e.matrixWorldInverse))||t.horizonCullingPoint&&n.Z.horizonCulling(t.horizonCullingPoint)||this.grid.visible.some((e=>{const r=t.content.textContent;return""!==r&&e.content.textContent.toLowerCase()==r.toLowerCase()}))?t.visible=!1:(a.applyMatrix4(e.projectionMatrix),t.updateProjectedPosition(a.x*this.halfWidth+this.halfWidth,-a.y*this.halfHeight+this.halfHeight),this.grid.visible.push(t))}removeLabelDOM(t){this.garbage.appendChild(t.content),this.garbage.innerHTML=""}}},5199:(t,e,r)=>{"use strict";r.d(e,{On:()=>d,ZP:()=>w,dn:()=>m,pO:()=>g,zQ:()=>v});var i=r(99477),n=r(43195),s=r(28448),o=r(14625),a=r(3725);const l=new i.Vector4(0,0,1,1),c=new i.Texture,h=255/256,u=new i.Vector4(5.9371814131736755e-8,h/65536,.0038909912109375,h);function d(t,e){return e?u.dot(t)*e:u.dot(t)}const p=15,f=1;function m(){const t=s.Z.getMaxTextureUnitsCount();return Math.min(t-f,p)}const g={noEffect:0,removeLightColor:1,removeWhiteColor:2,customEffect:3},A={bias:0,noDataValue:-99999,zmin:0,zmax:0,scale:0,mode:0,textureOffset:0,opacity:0,crs:0,effect_parameter:0,effect_type:g.noEffect,transparent:!1};function y(t,e,r){const i=t.layers.value,n=t.textures.value,s=t.offsetScales.value,o=t.textureCount;let a=0;for(const t of e){t.textureOffset=a;for(let e=0,o=t.textures.length;er&&console.warn(`LayeredMaterial: Not enough texture units (${r} < ${a}), excess textures have been discarded.`),o.value=a;for(let t=a;t1?arguments[1]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),x=x||[f,m()],this.defines.NUM_VS_TEXTURES=x[0],this.defines.NUM_FS_TEXTURES=x[1],this.defines.USE_FOG=1,this.defines.NUM_CRS=t,a.Z.setDefineMapping(this,"ELEVATION",v),a.Z.setDefineMapping(this,"MODE",o.Z.MODES),a.Z.setDefineProperty(this,"mode","MODE",o.Z.MODES.FINAL),this.vertexShader="#include \n#include \n#include \n#include \n#if NUM_CRS > 1\nattribute float uv_1;\n#endif\n\nuniform bool lightingEnabled;\nvarying vec2 vHighPrecisionZW;\n\n#if MODE == MODE_FINAL\n#include \nvarying vec3 vUv;\nvarying vec3 vNormal;\n#endif\nvoid main() {\n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n#if MODE == MODE_FINAL\n #include \n #if NUM_CRS > 1\n vUv = vec3(uv, (uv_1 > 0.) ? uv_1 : uv.y); // set uv_1 = uv if uv_1 is undefined\n #else\n vUv = vec3(uv, 0.0);\n #endif\n vNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\n#endif\n}\n",b[t]=b[t]||n.Z.unrollLoops("#include \n#include \n#include \n#include \n#if MODE == MODE_FINAL\n#include \n#include \n#include \n#endif\n#include \n\nuniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vUv; // uv.x/uv_1.x, uv.y, uv_1.y\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n #include \n\n#if MODE == MODE_ID\n\n #include \n\n#elif MODE == MODE_DEPTH\n\n #include \n\n#else\n\n gl_FragColor = vec4(diffuse, opacity);\n\n uvs[0] = vec3(vUv.xy, 0.);\n\n#if NUM_CRS > 1\n uvs[1] = vec3(vUv.x, fract(vUv.z), floor(vUv.z));\n#endif\n\n vec4 color;\n #pragma unroll_loop\n for ( int i = 0; i < NUM_FS_TEXTURES; i ++ ) {\n color = getLayerColor( i , colorTextures[ i ], colorOffsetScales[ i ], colorLayers[ i ]);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n\n #if defined(DEBUG)\n if (showOutline) {\n #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++) {\n color = getOutlineColor( outlineColors[ i ], uvs[ i ].xy);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n }\n #endif\n\n #include \n #include \n #include \n\n#endif\n}\n",this.defines),this.fragmentShader=b[t],a.Z.setUniformProperty(this,"diffuse",new i.Color(.04,.23,.35)),a.Z.setUniformProperty(this,"opacity",this.opacity),a.Z.setUniformProperty(this,"lightingEnabled",!1),a.Z.setUniformProperty(this,"lightPosition",new i.Vector3(-.5,0,1)),a.Z.setUniformProperty(this,"fogDistance",1e9),a.Z.setUniformProperty(this,"fogColor",new i.Color(.76,.85,1)),a.Z.setUniformProperty(this,"overlayAlpha",0),a.Z.setUniformProperty(this,"overlayColor",new i.Color(1,.3,0)),a.Z.setUniformProperty(this,"objectId",0),a.Z.setUniformProperty(this,"geoidHeight",0),a.Z.setUniformProperty(this,"minBorderDistance",-.01),this.layers=[],this.elevationLayerIds=[],this.colorLayerIds=[],this.uniforms.elevationLayers=new i.Uniform(new Array(x[0]).fill(A)),this.uniforms.elevationTextures=new i.Uniform(new Array(x[0]).fill(c)),this.uniforms.elevationOffsetScales=new i.Uniform(new Array(x[0]).fill(l)),this.uniforms.elevationTextureCount=new i.Uniform(0),this.uniforms.colorLayers=new i.Uniform(new Array(x[1]).fill(A)),this.uniforms.colorTextures=new i.Uniform(new Array(x[1]).fill(c)),this.uniforms.colorOffsetScales=new i.Uniform(new Array(x[1]).fill(l)),this.uniforms.colorTextureCount=new i.Uniform(0),Object.defineProperty(this,"visible",{get(){return this.#P},set(t){this.#P!=t&&(this.#P=t,this.dispatchEvent({type:t?"shown":"hidden"}))}})}getUniformByType(t){return{layers:this.uniforms[`${t}Layers`],textures:this.uniforms[`${t}Textures`],offsetScales:this.uniforms[`${t}OffsetScales`],textureCount:this.uniforms[`${t}TextureCount`]}}updateLayersUniforms(){const t=this.layers.filter((t=>this.colorLayerIds.includes(t.id)&&t.visible&&t.opacity>0));if(t.sort(((t,e)=>this.colorLayerIds.indexOf(t.id)-this.colorLayerIds.indexOf(e.id))),y(this.getUniformByType("color"),t,this.defines.NUM_FS_TEXTURES),this.elevationLayerIds.some((t=>this.getLayer(t)))||this.uniforms.elevationTextureCount.value&&!this.elevationLayerIds.length){const t=this.getElevationLayer()?[this.getElevationLayer()]:[];y(this.getUniformByType("elevation"),t,this.defines.NUM_VS_TEXTURES)}this.layersNeedUpdate=!1}dispose(){this.dispatchEvent({type:"dispose"}),this.layers.forEach((t=>t.dispose(!0))),this.layers.length=0,this.layersNeedUpdate=!0}setSequence(t){this.colorLayerIds=t,this.layersNeedUpdate=!0}setSequenceElevation(t){this.elevationLayerIds[0]=t,this.layersNeedUpdate=!0}removeLayer(t){const e=this.layers.findIndex((e=>e.id===t));if(e>-1){this.layers[e].dispose(),this.layers.splice(e,1);const r=this.colorLayerIds.indexOf(t);r>-1?this.colorLayerIds.splice(r,1):this.elevationLayerIds=[]}}addLayer(t){t.layer.id in this.layers&&console.warn('The "{layer.id}" layer was already present in the material, overwritting.'),this.layers.push(t)}getLayer(t){return this.layers.find((e=>e.id===t))}getLayers(t){return this.layers.filter((e=>t.includes(e.id)))}getElevationLayer(){return this.layers.find((t=>t.id===this.elevationLayerIds[0]))}setElevationScale(t){this.elevationLayerIds.length&&(this.getElevationLayer().scale=t)}}const w=_},67490:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(99477),n=r(42423),s=r(51969),o=r(62310),a=r(79323);const l=new s.Z({crs:"EPSG:4978",uvCount:1}),c=new i.Vector3,h=new i.Vector2,u=new i.Vector3,d=new o.Z("EPSG:4326",0,0,0);let p;class f extends i.Object3D{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector3(1/0,1/0,1/0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3(-1/0,-1/0,-1/0);super(),this.box3D=new i.Box3(t.clone(),e.clone()),this.natBox=this.box3D.clone(),this.z={min:0,max:0,scale:1}}clone(){return(new f).copy(this)}copy(t){return super.copy(t),this.box3D.copy(t.box3D),this.natBox.copy(t.natBox),this.z.min=t.z.min,this.z.max=t.z.max,this.z.scale=t.z.scale,this}updateZ(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.z.min=t.min??this.z.min,this.z.max=t.max??this.z.max,this.z.scale=t.scale>0?t.scale:this.z.scale,this.z.delta=Math.abs(this.z.max-this.z.min)*this.z.scale;const e=t.geoidHeight||0;this.box3D.min.z=this.natBox.min.z+this.z.min*this.z.scale+e,this.box3D.max.z=this.natBox.max.z+this.z.max*this.z.scale+e}isSphereAboveXYBox(t){const e=this.worldToLocal(t.center),r=Math.max(this.box3D.min.x,Math.min(e.x,this.box3D.max.x)),i=Math.max(this.box3D.min.y,Math.min(e.y,this.box3D.max.y));return Math.sqrt((r-e.x)*(r-e.x)+(i-e.y)*(i-e.y))1&&void 0!==arguments[1]?arguments[1]:t.min||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.max||0;if("EPSG:4326"==t.crs){const{sharableExtent:i,quaternion:s,position:o}=l.computeSharableExtent(t),a=Math.max(Math.floor(i.planarDimensions(h).x/90+1),2),c=new n.Z({extent:i,level:0,segments:a,disableSkirt:!0,builder:l});p.box3D.copy(c.boundingBox),p.natBox.copy(c.boundingBox),this.copy(p),this.updateZ({min:e,max:r}),this.position.copy(o),this.quaternion.copy(s),this.updateMatrixWorld(!0)}else{if(a.Z.isTms(t.crs)||!a.Z.isMetricUnit(t.crs))throw new Error("Unsupported extent crs");t.center(d).toVector3(this.position),t.planarDimensions(h),c.set(h.x,h.y,Math.abs(r-e)),this.box3D.setFromCenterAndSize(u,c),this.updateMatrixWorld(!0)}return this}}p=new f;const m=f},25033:(t,e,r)=>{"use strict";r.d(e,{wy:()=>d,vj:()=>l,Uz:()=>c,E7:()=>h,ZP:()=>g});var i=r(99477),n=r(43195),s=r(3725);const o={SPECTRAL:[[0,new i.Color(.3686,.3098,.6353)],[.1,new i.Color(.1961,.5333,.7412)],[.2,new i.Color(.4,.7608,.6471)],[.3,new i.Color(.6706,.8667,.6431)],[.4,new i.Color(.902,.9608,.5961)],[.5,new i.Color(1,1,.749)],[.6,new i.Color(.9961,.8784,.5451)],[.7,new i.Color(.9922,.6824,.3804)],[.8,new i.Color(.9569,.4275,.2627)],[.9,new i.Color(.8353,.2431,.3098)],[1,new i.Color(.6196,.0039,.2588)]],PLASMA:[[0,new i.Color(.241,.015,.61)],[.1,new i.Color(.387,.001,.654)],[.2,new i.Color(.524,.025,.653)],[.3,new i.Color(.651,.125,.596)],[.4,new i.Color(.752,.227,.513)],[.5,new i.Color(.837,.329,.431)],[.6,new i.Color(.907,.435,.353)],[.7,new i.Color(.963,.554,.272)],[.8,new i.Color(.992,.681,.195)],[.9,new i.Color(.987,.822,.144)],[1,new i.Color(.94,.975,.131)]],YELLOW_GREEN:[[0,new i.Color(.1647,.2824,.3451)],[.1,new i.Color(.1338,.3555,.4227)],[.2,new i.Color(.061,.4319,.4864)],[.3,new i.Color(0,.5099,.5319)],[.4,new i.Color(0,.5881,.5569)],[.5,new i.Color(.137,.665,.5614)],[.6,new i.Color(.2906,.7395,.5477)],[.7,new i.Color(.4453,.8099,.5201)],[.8,new i.Color(.6102,.8748,.485)],[.9,new i.Color(.7883,.9323,.4514)],[1,new i.Color(.9804,.9804,.4314)]],VIRIDIS:[[0,new i.Color(.267,.005,.329)],[.1,new i.Color(.283,.141,.458)],[.2,new i.Color(.254,.265,.53)],[.3,new i.Color(.207,.372,.553)],[.4,new i.Color(.164,.471,.558)],[.5,new i.Color(.128,.567,.551)],[.6,new i.Color(.135,.659,.518)],[.7,new i.Color(.267,.749,.441)],[.8,new i.Color(.478,.821,.318)],[.9,new i.Color(.741,.873,.15)],[1,new i.Color(.993,.906,.144)]],INFERNO:[[0,new i.Color(.077,.042,.206)],[.1,new i.Color(.225,.036,.388)],[.2,new i.Color(.373,.074,.432)],[.3,new i.Color(.522,.128,.42)],[.4,new i.Color(.665,.182,.37)],[.5,new i.Color(.797,.255,.287)],[.6,new i.Color(.902,.364,.184)],[.7,new i.Color(.969,.516,.063)],[.8,new i.Color(.988,.683,.072)],[.9,new i.Color(.961,.859,.298)],[1,new i.Color(.988,.998,.645)]],GRAYSCALE:[[0,new i.Color(0,0,0)],[1,new i.Color(1,1,1)]],TURBO:[[0,new i.Color(.18995,.07176,.23217)],[.07,new i.Color(.25107,.25237,.63374)],[.13,new i.Color(.27628,.42118,.89123)],[.2,new i.Color(.25862,.57958,.99876)],[.27,new i.Color(.15844,.73551,.92305)],[.33,new i.Color(.09267,.86554,.7623)],[.4,new i.Color(.19659,.94901,.59466)],[.47,new i.Color(.42778,.99419,.38575)],[.53,new i.Color(.64362,.98999,.23356)],[.6,new i.Color(.80473,.92452,.20459)],[.67,new i.Color(.93301,.81236,.22667)],[.73,new i.Color(.99314,.67408,.20348)],[.8,new i.Color(.9836,.49291,.12849)],[.87,new i.Color(.92105,.31489,.05475)],[.93,new i.Color(.81608,.18462,.01809)],[1,new i.Color(.66449,.08436,.00424)]],RAINBOW:[[0,new i.Color(.278,0,.714)],[1/6,new i.Color(0,0,1)],[2/6,new i.Color(0,1,1)],[.5,new i.Color(0,1,0)],[4/6,new i.Color(1,1,0)],[5/6,new i.Color(1,.64,0)],[1,new i.Color(1,0,0)]],CONTOUR:[[0,new i.Color(0,0,0)],[.03,new i.Color(0,0,0)],[.04,new i.Color(1,1,1)],[1,new i.Color(1,1,1)]]},a="#include \n#include \n#if defined(USE_TEXTURES_PROJECTIVE)\n#include \n#endif\n\nvarying vec4 vColor;\nuniform bool picking;\nuniform int shape;\n\nvoid main() {\n #include \n //square shape does not require any change.\n if (shape == PNTS_SHAPE_CIRCLE) {\n //circular rendering in glsl\n if ((length(gl_PointCoord - 0.5) > 0.5) || (vColor.a == 0.0)) {\n discard;\n }\n }\n\n#if defined(USE_TEXTURES_PROJECTIVE)\n vec4 color = vColor;\n if (!picking) {\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n } else {\n gl_FragColor = color;\n }\n#else\n gl_FragColor = vColor;\n#endif\n}\n",l={COLOR:0,INTENSITY:1,CLASSIFICATION:2,ELEVATION:3,RETURN_NUMBER:4,RETURN_TYPE:5,RETURN_COUNT:6,POINT_SOURCE_ID:7,SCAN_ANGLE:8,NORMAL:9},c={CIRCLE:0,SQUARE:1},h={VALUE:0,ATTENUATED:1},u=new i.Color(1,1,1),d={DEFAULT:{0:{visible:!0,name:"never classified",color:new i.Color(.5,.5,.5),opacity:1},1:{visible:!0,name:"unclassified",color:new i.Color(.5,.5,.5),opacity:1},2:{visible:!0,name:"ground",color:new i.Color(.63,.32,.18),opacity:1},3:{visible:!0,name:"low vegetation",color:new i.Color(0,1,0),opacity:1},4:{visible:!0,name:"medium vegetation",color:new i.Color(0,.8,0),opacity:1},5:{visible:!0,name:"high vegetation",color:new i.Color(0,.6,0),opacity:1},6:{visible:!0,name:"building",color:new i.Color(1,.66,0),opacity:1},7:{visible:!0,name:"low point(noise)",color:new i.Color(1,0,1),opacity:1},8:{visible:!0,name:"key-point",color:new i.Color(1,0,0),opacity:1},9:{visible:!0,name:"water",color:new i.Color(0,0,1),opacity:1},10:{visible:!0,name:"rail",color:new i.Color(.8,.8,1),opacity:1},11:{visible:!0,name:"road Surface",color:new i.Color(.4,.4,.7),opacity:1},12:{visible:!0,name:"overlap",color:new i.Color(1,1,0),opacity:1},DEFAULT:{visible:!0,name:"default",color:new i.Color(.3,.6,.6),opacity:.5}}},p={DEFAULT:{0:{visible:!0,name:"0",color:new i.Color("rgb(67, 99, 216)"),opacity:1},1:{visible:!0,name:"1",color:new i.Color("rgb(60, 180, 75);"),opacity:1},2:{visible:!0,name:"2",color:new i.Color("rgb(255, 255, 25)"),opacity:1},3:{visible:!0,name:"3",color:new i.Color("rgb(145, 30, 180)"),opacity:1},4:{visible:!0,name:"4",color:new i.Color("rgb(245, 130, 49)"),opacity:1},5:{visible:!0,name:"5",color:new i.Color("rgb(230, 25, 75)"),opacity:1},6:{visible:!0,name:"6",color:new i.Color("rgb(66, 212, 244)"),opacity:1},7:{visible:!0,name:"7",color:new i.Color("rgb(240, 50, 230)"),opacity:1},DEFAULT:{visible:!0,name:"default",color:u,opacity:.5}}};function f(t,e,r){const i=e.image.data,n=e.image.width;r||(r=Object.keys(t).length);for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{};const e=t.intensityRange||new i.Vector2(1,65536),r=t.elevationRange||new i.Vector2(0,1e3),u=t.angleRange||new i.Vector2(-90,90),f=t.orientedImageMaterial,m=t.classification||d.DEFAULT,g=t.discreteScheme||p.DEFAULT,A=null!=t.applyOpacityClassication&&t.applyOpacityClassication,y=t.size||0,v=t.mode||l.COLOR,x=t.shape||c.CIRCLE,b=0===y?h.ATTENUATED:t.sizeMode||h.VALUE,_=t.minAttenuatedSize||3,w=t.maxAttenuatedSize||10;let E=o;t.gradient&&(E={...t.gradient,...o}),delete t.intensityRange,delete t.elevationRange,delete t.angleRange,delete t.orientedImageMaterial,delete t.classificationScheme,delete t.discreteScheme,delete t.applyOpacityClassication,delete t.size,delete t.mode,delete t.shape,delete t.sizeMode,delete t.minAttenuatedSize,delete t.maxAttenuatedSize,delete t.gradient,super(t),this.gradients=E,this.gradientTexture=new i.CanvasTexture,this.vertexShader="#include \n#if defined(USE_TEXTURES_PROJECTIVE)\n#include \n#endif\n#include \n#include \n\n#define NB_CLASS 8.\n\nuniform float size;\nuniform float scale;\n\nuniform bool picking;\nuniform int mode;\nuniform float opacity;\nuniform vec4 overlayColor;\n\nuniform vec2 elevationRange;\nuniform vec2 intensityRange;\nuniform vec2 angleRange;\n\nuniform bool applyOpacityClassication;\n\nuniform sampler2D classificationTexture;\nuniform sampler2D discreteTexture;\nuniform sampler2D gradientTexture;\nuniform int sizeMode;\nuniform float minAttenuatedSize;\nuniform float maxAttenuatedSize;\n\nattribute vec3 color;\nattribute vec2 range;\nattribute vec4 unique_id;\nattribute float intensity;\nattribute float classification;\nattribute float pointSourceID;\n\nattribute float returnNumber;\nattribute float numberOfReturns;\nattribute float scanAngle;\n\n#if defined(NORMAL_OCT16)\nattribute vec2 oct16Normal;\n#elif defined(NORMAL_SPHEREMAPPED)\nattribute vec2 sphereMappedNormal;\n#endif\n\nvarying vec4 vColor;\n\n// see https://web.archive.org/web/20150303053317/http://lgdv.cs.fau.de/get/1602\n// and implementation in PotreeConverter (BINPointReader.cpp) and potree (BinaryDecoderWorker.js)\n#if defined(NORMAL_OCT16)\nvec3 decodeOct16Normal(vec2 encodedNormal) {\n vec2 nNorm = 2. * (encodedNormal / 255.) - 1.;\n vec3 n;\n n.z = 1. - abs(nNorm.x) - abs(nNorm.y);\n if (n.z >= 0.) {\n n.x = nNorm.x;\n n.y = nNorm.y;\n } else {\n n.x = sign(nNorm.x) - sign(nNorm.x) * sign(nNorm.y) * nNorm.y;\n n.y = sign(nNorm.y) - sign(nNorm.y) * sign(nNorm.x) * nNorm.x;\n }\n return normalize(n);\n}\n#elif defined(NORMAL_SPHEREMAPPED)\n// see http://aras-p.info/texts/CompactNormalStorage.html method #4\n// or see potree's implementation in BINPointReader.cpp\nvec3 decodeSphereMappedNormal(vec2 encodedNormal) {\n vec2 fenc = 2. * encodedNormal / 255. - 1.;\n float f = dot(fenc,fenc);\n float g = 2. * sqrt(1. - f);\n vec3 n;\n n.xy = fenc * g;\n n.z = 1. - 2. * f;\n return n;\n}\n#endif\n\nvoid main() {\n\n#if defined(NORMAL_OCT16)\n vec3 normal = decodeOct16Normal(oct16Normal);\n#elif defined(NORMAL_SPHEREMAPPED)\n vec3 normal = decodeSphereMappedNormal(sphereMappedNormal);\n#elif defined(NORMAL)\n // nothing to do\n#else\n // default to color\n vec3 normal = color;\n#endif\n\n if (picking) {\n vColor = unique_id;\n } else {\n vColor.a = opacity;\n if (applyOpacityClassication || mode == PNTS_MODE_CLASSIFICATION) {\n vec2 uv = vec2(classification/255., 0.5);\n vColor = texture2D(classificationTexture, uv);\n vColor.a *= opacity;\n }\n\n if (mode == PNTS_MODE_NORMAL) {\n vColor.rgb = abs(normal);\n } else if (mode == PNTS_MODE_COLOR) {\n // default to color mode\n vColor.rgb = mix(color, overlayColor.rgb, overlayColor.a);\n } else if (mode == PNTS_MODE_RETURN_NUMBER) {\n vec2 uv = vec2(returnNumber/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_TYPE) {\n float returnType;\n if (returnNumber > numberOfReturns) {\n returnType = 4.;\n } else if (returnNumber == 1.) {\n if (numberOfReturns == 1.) {\n // single\n returnType = 0.;\n } else {\n // first\n returnType = 1.;\n }\n } else {\n if (returnNumber == numberOfReturns) {\n // last\n returnType = 3.;\n } else {\n // intermediate\n returnType = 2.;\n }\n }\n vec2 uv = vec2(returnType/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_COUNT) {\n vec2 uv = vec2(numberOfReturns/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_POINT_SOURCE_ID) {\n vec2 uv = vec2(mod(pointSourceID, NB_CLASS)/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_SCAN_ANGLE) {\n float i = (scanAngle - angleRange.x) / (angleRange.y - angleRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_INTENSITY) {\n float i = (intensity - intensityRange.x) / (intensityRange.y - intensityRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_ELEVATION) {\n float i = (position.z - elevationRange.x) / (elevationRange.y - elevationRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n }\n }\n\n #include \n #include \n\n gl_PointSize = size;\n\n if (sizeMode == PNTS_SIZE_MODE_ATTENUATED) {\n bool isPerspective = isPerspectiveMatrix(projectionMatrix);\n\n if (isPerspective) {\n gl_PointSize *= scale / -mvPosition.z;\n gl_PointSize = clamp(gl_PointSize, minAttenuatedSize, maxAttenuatedSize);\n }\n }\n\n#if defined(USE_TEXTURES_PROJECTIVE)\n #include \n#endif\n #include \n}\n";const M=t.scale||.025/Math.tan(.5);s.Z.setDefineMapping(this,"PNTS_MODE",l),s.Z.setDefineMapping(this,"PNTS_SHAPE",c),s.Z.setDefineMapping(this,"PNTS_SIZE_MODE",h),s.Z.setUniformProperty(this,"size",y),s.Z.setUniformProperty(this,"mode",v),s.Z.setUniformProperty(this,"shape",x),s.Z.setUniformProperty(this,"picking",!1),s.Z.setUniformProperty(this,"opacity",this.opacity),s.Z.setUniformProperty(this,"overlayColor",t.overlayColor||new i.Vector4(0,0,0,0)),s.Z.setUniformProperty(this,"intensityRange",e),s.Z.setUniformProperty(this,"elevationRange",r),s.Z.setUniformProperty(this,"angleRange",u),s.Z.setUniformProperty(this,"applyOpacityClassication",A),s.Z.setUniformProperty(this,"sizeMode",b),s.Z.setUniformProperty(this,"scale",M),s.Z.setUniformProperty(this,"minAttenuatedSize",_),s.Z.setUniformProperty(this,"maxAttenuatedSize",w);const S=new Uint8Array(1024),C=new i.DataTexture(S,256,1,i.RGBAFormat);C.needsUpdate=!0,C.magFilter=i.NearestFilter,s.Z.setUniformProperty(this,"classificationTexture",C);const T=new Uint8Array(1024),I=new i.DataTexture(T,256,1,i.RGBAFormat);I.needsUpdate=!0,I.magFilter=i.NearestFilter,s.Z.setUniformProperty(this,"discreteTexture",I),this.classificationScheme=m,this.discreteScheme=g,this.recomputeClassification(),this.recomputeDiscreteTexture(),this.gradient=Object.values(E)[0],s.Z.setUniformProperty(this,"gradientTexture",this.gradientTexture),f?(this.uniforms.projectiveTextureAlphaBorder=f.uniforms.projectiveTextureAlphaBorder,this.uniforms.projectiveTextureDistortion=f.uniforms.projectiveTextureDistortion,this.uniforms.projectiveTextureMatrix=f.uniforms.projectiveTextureMatrix,this.uniforms.projectiveTexture=f.uniforms.projectiveTexture,this.uniforms.mask=f.uniforms.mask,this.uniforms.boostLight=f.uniforms.boostLight,this.defines.ORIENTED_IMAGES_COUNT=f.defines.ORIENTED_IMAGES_COUNT,this.defines.USE_DISTORTION=f.defines.USE_DISTORTION,this.defines.DEBUG_ALPHA_BORDER=f.defines.DEBUG_ALPHA_BORDER,this.defines.USE_TEXTURES_PROJECTIVE=!0,this.defines.USE_BASE_MATERIAL=!0,this.fragmentShader=n.Z.unrollLoops(a,this.defines)):this.fragmentShader=a}recomputeClassification(){f(this.classificationScheme,this.classificationTexture,32),this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}recomputeDiscreteTexture(){f(this.discreteScheme,this.discreteTexture),this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}copy(t){return super.copy(t),t.uniforms.projectiveTextureAlphaBorder&&(this.uniforms.projectiveTextureAlphaBorder=t.uniforms.projectiveTextureAlphaBorder,this.uniforms.projectiveTextureDistortion=t.uniforms.projectiveTextureDistortion,this.uniforms.projectiveTextureMatrix=t.uniforms.projectiveTextureMatrix,this.uniforms.projectiveTexture=t.uniforms.projectiveTexture,this.uniforms.mask=t.uniforms.mask,this.uniforms.boostLight=t.uniforms.boostLight),this}enablePicking(t){this.picking=t,this.blending=t?i.NoBlending:i.NormalBlending}update(t){return this.visible=t.visible,this.opacity=t.opacity,this.transparent=t.transparent,this.size=t.size,this.mode=t.mode,this.shape=t.shape,this.sizeMode=t.sizeMode,this.minAttenuatedSize=t.minAttenuatedSize,this.maxAttenuatedSize=t.maxAttenuatedSize,this.picking=t.picking,this.scale=t.scale,this.overlayColor.copy(t.overlayColor),this.intensityRange.copy(t.intensityRange),this.elevationRange.copy(t.elevationRange),this.angleRange.copy(t.angleRange),Object.assign(this.defines,t.defines),this}set gradient(t){this.gradientTexture=function(t){const e=64,r=document.createElement("canvas");r.width=e,r.height=e;const n=r.getContext("2d");n.rect(0,0,e,e);const s=n.createLinearGradient(0,0,e,e);for(let e=0;e{"use strict";r.d(e,{pL:()=>a,AN:()=>h,NO:()=>u});var i=r(99477),n=r(5199),s=r(86541);var o=r(79323);const a=-1,l=new i.Vector4;class c extends i.EventDispatcher{constructor(t,e){super(),this.layer=e,this.crs=e.parent.tileMatrixSets.indexOf(o.Z.formatToTms(e.crs)),-1==this.crs&&console.error("Unknown crs:",e.crs),this.textures=[],this.offsetScales=[],this.level=a,this.material=t,this._handlerCBEvent=()=>{this.material.layersNeedUpdate=!0},e.addEventListener("visible-property-changed",this._handlerCBEvent),e.addEventListener("opacity-property-changed",this._handlerCBEvent)}get id(){return this.layer.id}get opacity(){return this.layer.opacity}get visible(){return this.layer.visible}initFromParent(t,e){if(t&&t.level>this.level){let r=0;for(const i of e)for(const e of t.textures)if(i.isInside(e.extent)){this.setTexture(r++,e,i.offsetToParent(e.extent));break}}}dispose(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.layer.removeEventListener("visible-property-changed",this._handlerCBEvent),this.layer.removeEventListener("opacity-property-changed",this._handlerCBEvent),this._listeners={});for(const t of this.textures)t.isTexture&&t.dispose();this.level=a,this.textures=[],this.offsetScales=[],this.material.layersNeedUpdate=!0}setTexture(t,e,r){this.level=e&&e.extent&&0==t?e.extent.zoom:this.level,this.textures[t]=e||null,this.offsetScales[t]=r,this.material.layersNeedUpdate=!0}setTextures(t,e){this.dispose(!1);for(let r=0,i=t.length;rnull!=t));return a.length?{min:Math.min(...a),max:Math.max(...a)}:{min:1/0,max:-1/0}}(t,e,r);const c=Math.floor(e.z*i);if(c>2){const t=Math.floor(e.z*n),s=Math.floor(e.x*i),h=Math.floor(e.y*n),u=Math.max(Math.floor(c/32),2);for(let e=h;ea&&(a=r.zmin),r.zmaxe&&t[r-1]>e&&t[Math.sqrt(r)-1]>e&&t[r-Math.sqrt(r)]>e}(n,e)&&function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0,r=arguments.length>2?arguments[2]:void 0;for(let i=0,n=t.length;ir[function(t,e,r){const i=Math.floor(t/r)/r,n=e.x+t%r/r*e.z,s=e.y+i*e.w;return Math.floor(s*r)*r+Math.floor(n*r)}(t,i,256)]}(t,r,i,l),e)}}},14625:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i={FINAL:0,DEPTH:1,ID:2},n={MODES:i,push:function(t,e){const r=t.mode??i.FINAL;if(r==e)return()=>{};const n=t=>e=>{const r=e.material;r&&(r.mode=t)};return t.traverse(n(e)),()=>{t.traverse(n(r))}}}},43195:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});const i=new RegExp("gl_Position.*(?![^]*gl_Position)"),n=new RegExp("[^\\w]*main[^\\w]*(void)?[^\\w]*{"),s={patchMaterialForLogDepthSupport(t){if(t.vertexShader.includes("USE_LOGDEPTHBUF")||t.vertexShader.includes("logdepthbuf_pars_vertex"))return;t.vertexShader=`#include \n#define EPSILON 1e-6\n${t.vertexShader}`;let e=i.exec(t.vertexShader),r=e[0].length+e.index;t.vertexShader=`${t.vertexShader.slice(0,r)}\n#include \n${t.vertexShader.slice(r)}`,t.fragmentShader=`#include \n${t.fragmentShader}`,e=n.exec(t.fragmentShader),r=e[0].length+e.index,t.fragmentShader=`${t.fragmentShader.slice(0,r)}\n#include \n${t.fragmentShader.slice(r)}`,t.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}},unrollLoops:(t,e)=>t.replace(/#pragma unroll_loop\s+for\s*\(\s*int\s+i\s*=\s*([\w\d]+);\s*i\s+<\s+([\w\d]+);\s*i\s*\+\+\s*\)\s*\{\n([^}]*)\}/g,(function(t,r,i,n){let s="";r=r in e?e[r]:parseInt(r,10),i=i in e?e[i]:parseInt(i,10);for(let t=r;t{"use strict";r.d(e,{Z:()=>R});var i=r(71440),n=r(12679),s=r(56178),o=r(84612),a=r(50810),l=r(15344),c=r(4090),h=r(99477),u=r(3614),d=r(38929),p=r(5167),f=r(53175),m=r(62310);const g=i.Mh.get("EPSG:3857").planarDimensions(),A=new h.Vector3(g.x,g.y,1),y=new h.Vector2,v=new h.Vector2;function x(t,e,r,i){const n=i*2**r.z,s=i*r.x,o=i*r.y;return new m.Z("EPSG:4326",360*(t+s)/n-180,360/Math.PI*Math.atan(Math.exp((180-360*(e+o)/n)*Math.PI/180))-90)}function b(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.bindNewGeometry();const n=e.type===p.tg.POLYGON;r=r&&n,i.properties=t.properties;const s=t._pbf;s.pos=t._geometry;const o=s.readVarint()+s.pos;let a=1,l=0,c=0,h=0,u=0,d=0;for(;s.pos>3}if(l--,1===a||2===a){c+=s.readSVarint(),h+=s.readSVarint(),1===a&&(u&&(r&&d>0&&i.indices.length>0&&(e.updateExtent(i),i=e.bindNewGeometry(),i.properties=t.properties),i.closeSubGeometry(u,e),i.getLastSubGeometry().ccw=d<0),u=0,d=0),u++;const o=x(c,h,t.tileNumbers,t.extent);i.pushCoordinatesValues(e,{x:c,y:h},o),1==u?(v.set(c,h),v.coordProj=o,y.set(c,h)):n&&u>1&&(d+=(y.x-c)*(y.y+h),y.set(c,h))}else{if(7!==a)throw new Error(`unknown command ${a}`);u&&(u++,i.pushCoordinatesValues(e,{x:v.x,y:v.y},v.coordProj),n&&(d+=(y.x-v.x)*(y.y+v.y)))}}u&&(r&&d>0&&i.indices.length>0&&(e.updateExtent(i),i=e.bindNewGeometry(),i.properties=t.properties),i.closeSubGeometry(u,e),i.getLastSubGeometry().ccw=d<0),e.updateExtent(i)}const _={parse:(t,e)=>(e=(0,f._F)(e),Promise.resolve(function(t,e){e.out=e.out||{};const r=new d.VectorTile(new u(t)),i=Object.keys(r.layers);if(i.length<1)return;const n=e.extent.col,s=e.extent.zoom,o=e.in.isInverted?e.extent.row:(1<{if(!e.in.layers[t])return;const i=r.layers[t];for(let r=i.length-1;r>=0;r--){const o=i.feature(r);o.tileNumbers={x:n,y:e.extent.row,z:s};const l=e.in.layers[t].filter((t=>t.filterExpression.filter({zoom:s},o)&&s>=t.zoom.min&&se.id===t.id))||(c=a.newFeatureByReference(c),c.id=t.id,c.order=t.order,c.style=e.in.styles[c.id]):(c=a.requestFeatureById(t.id,o.type-1),c.id=t.id,c.order=t.order,c.style=e.in.styles[c.id],b(o,c))}})),a.removeEmptyFeature(),a.features.sort(((t,e)=>t.order-e.order)),a.updateExtent(),a.extent=e.extent,a.isInverted=e.in.isInverted,Promise.resolve(a)}(t,e)))};var w=r(45340),E=r(55086),M=r(79323);const S=new Map([["application/geo+json",n.Z.parse],["application/json",n.Z.parse],["application/kml",s.Z.parse],["application/gpx",a.Z.parse],["application/x-protobuf;type=mapbox-vector",_.parse],["application/gtx",l.ZP.parse],["application/isg",c.Z.parse],["application/gdf",o.Z.parse]]),C={getByArray:()=>{},setByArray:t=>t,clear:()=>{}};class T{constructor(t){t.projection&&(console.warn("Source projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),t.crs&&M.Z.isValid(t.crs),this.crs=t.crs}}let I=0;const R=class extends T{constructor(t){if(super(t),this.isSource=!0,!t.url)throw new Error("New Source: url is required");this.uid=I++,this.url=t.url,this.format=t.format,this.fetcher=t.fetcher||w.Z.get(t.format),this.parser=t.parser||S.get(t.format)||((t,e)=>(t.extent=e.extent,t)),this.isVectorSource=null!=(t.parser||S.get(t.format)),this.networkOptions=t.networkOptions||{crossOrigin:"anonymous"},this.attribution=t.attribution,this.whenReady=Promise.resolve(),this._featuresCaches={},t.extent&&!t.extent.isExtent?this.extent=new i.ZP(this.crs,t.extent):this.extent=t.extent}handlingError(t){throw new Error(t)}urlFromExtent(){throw new Error("In extended Source, you have to implement the method urlFromExtent!")}requestToKey(t){return[t.zoom,t.row,t.col]}loadData(t,e){const r=this._featuresCaches[e.crs],i=this.requestToKey(t);let n=r.getByArray(i);return n||(n=r.setByArray(this.fetcher(this.urlFromExtent(t),this.networkOptions).then((r=>this.parser(r,{out:e,in:this,extent:t}))).catch((t=>this.handlingError(t))),i),this.onParsedFile&&n.then((t=>(this.onParsedFile(t),console.warn("Source.onParsedFile was deprecated"),t)))),n}onLayerAdded(t){this._featuresCaches[t.out.crs]||(this._featuresCaches[t.out.crs]=this.isVectorSource?new E.Z:C)}onLayerRemoved(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._featuresCaches[t.unusedCrs];e&&(e.clear(),delete this._featuresCaches[t.unusedCrs])}extentInsideLimit(){throw new Error("In extented Source, you have to implement the method extentInsideLimit!")}}},32533:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>b});var i=r(99477),n=r(36194),s=r(86541),o=r(99617),a=r(62310),l=r(2359),c=r(67490),h=r(73502);i.Object3D.DEFAULT_UP.set(0,0,1);const u=new i.Vector3,d=new a.Z("EPSG:4326",0,0,0),p=new l.Z,f=[],m=new c.Z,g=new i.Vector3;function A(t){return t-360*Math.floor((t+180)/360)}function y(t){return t.getLayers((t=>t.isTiledGeometryLayer))[0]}class v extends i.Object3D{constructor(){super(),this.seaLevel=new i.Object3D,this.target=new i.Object3D,this.target.rotation.order="ZXY",this.camera=new i.Camera,this.add(this.seaLevel),this.seaLevel.add(this.target),this.target.add(this.camera),this.coord=new a.Z("EPSG:4978",0,0),this.targetWorldPosition=new i.Vector3,this.removeAll=()=>{},this._onChangeCallback=null}applyTransformToCamera(t,e){this.proxy?(e.quaternion._onChange(this._onChangeCallback),this.camera.matrixWorld.decompose(this.proxy.position,e.quaternion,e.scale),e.quaternion._onChange((()=>this.removeProxy(t,e)))):this.camera.matrixWorld.decompose(e.position,e.quaternion,e.scale),t.dispatchEvent({type:h.b.CAMERA_MOVED,coord:this.coord,range:this.range,heading:this.heading,tilt:this.tilt})}setProxy(t,e){!this.proxy&&t&&e&&(this.proxy={position:new i.Vector3},Object.keys(e.position).forEach((r=>function(t,e,r,i){r.proxy.position[i]=e.position[i],Object.defineProperty(e.position,i,{get:()=>r.proxy.position[i],set:n=>{r.removeProxy(t,e),e.position[i]=n}})}(t,e,this,r))),this._onChangeCallback=e.quaternion._onChangeCallback,e.quaternion._onChange((()=>this.removeProxy(t,e))))}removeProxy(t,e){this.stop(t),this.proxy&&t&&e&&(Object.keys(e.position).forEach((t=>Object.defineProperty(e.position,t,{value:this.proxy.position[t],writable:!0}))),e.quaternion._onChange(this._onChangeCallback),this.proxy=null)}setTargetFromCoordinate(t,e){e.as(y(t).extent.crs,this.coord);const r=Math.max(0,s.Z.getElevationValueAt(y(t),this.coord,s.Z.PRECISE_READ_Z)||this.coord.z);this.coord.z=r,this.coord.as(t.referenceCrs).toVector3(u),"EPSG:4978"==t.referenceCrs?(this.lookAt(u),this.seaLevel.position.set(0,0,u.length()-r)):(this.position.set(u.x,u.y,0),this.seaLevel.position.set(0,0,0)),this.target.position.set(0,0,r)}setFromPositions(t,e){this.setTargetFromCoordinate(t,new a.Z(t.referenceCrs,u)),this.target.rotation.set(0,0,0),this.updateMatrixWorld(!0),this.camera.position.copy(e),this.target.worldToLocal(this.camera.position);const r=this.camera.position.length();this.target.rotation.x=Math.asin(this.camera.position.z/r);const n=i.MathUtils.clamp(this.camera.position.y/(Math.cos(this.target.rotation.x)*r),-1,1);this.target.rotation.z=Math.sign(-this.camera.position.x||1)*Math.acos(n),this.camera.position.set(0,r,0)}applyParams(t,e){e.coord&&this.setTargetFromCoordinate(t,e.coord),null!=e.tilt&&(this.target.rotation.x=i.MathUtils.degToRad(e.tilt)),null!=e.heading&&(this.target.rotation.z=i.MathUtils.degToRad(-A(e.heading+180))),e.range&&this.camera.position.set(0,e.range,0),this.camera.rotation.set(.5*-Math.PI,0,Math.PI),this.updateMatrixWorld(!0),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld)}getParams(){return{coord:this.coord.clone(),tilt:this.tilt,heading:this.heading,range:this.range,targetWorldPosition:this.targetWorldPosition}}setfromCamera(t,e,r){e.updateMatrixWorld(!0),null==r&&(r=t.getPickingPositionFromDepth()||function(t,e){const r=new i.Vector3(0,0,.5);if(r.unproject(e),r.sub(e.position).normalize(),"EPSG:4978"==t.referenceCrs)return p.intersection({direction:r,origin:e.position});{const t=e.position.z/r.z;return r.multiplyScalar(t).add(e.position)}}(t,e));const n=r&&!isNaN(r.x)?e.position.distanceTo(r):100;e.localToWorld(u.set(0,0,-n)),this.setFromPositions(t,e.position)}copyObject3D(t){return this.copy(t,!1),this.seaLevel.copy(t.seaLevel,!1),this.target.copy(t.target,!1),this.camera.copy(t.camera),this}animateCameraToLookAtTarget(t,e,r){r.easing=r.easing||n.ZP.Easing.Quartic.InOut,this.setfromCamera(t,e);const s=new n.ZP.Group;this.start=(this.start||new v).copyObject3D(this),this.end=(this.end||new v).copyObject3D(this);const a=r.time||2500,l={t:0},c=[],h=(()=>{let t,e;return{promise:new Promise(((r,i)=>{t=r,e=i})),resolve:t,reject:e}})();this.addPlaceTargetOnGround(t,e,r.coord,l),this.end.applyParams(t,r);const u=this.end.target.rotation.z-this.start.target.rotation.z;return Math.abs(u)>Math.PI&&(this.end.target.rotation.z=this.start.target.rotation.z+u-2*Math.sign(u)*Math.PI),c.push(new n.ZP.Tween(l,s).to({t:1},a).easing(r.easing).onUpdate((e=>{"EPSG:4978"==t.referenceCrs&&this.quaternion.slerpQuaternions(this.start.quaternion,this.end.quaternion,e.t),this.camera.quaternion.slerpQuaternions(this.start.camera.quaternion,this.end.camera.quaternion,e.t),this.target.rotation.set(0,0,0),this.target.rotateZ(i.MathUtils.lerp(this.start.target.rotation.z,this.end.target.rotation.z,e.t)),this.target.rotateX(i.MathUtils.lerp(this.start.target.rotation.x,this.end.target.rotation.x,e.t))}))),"EPSG:4978"!=t.referenceCrs&&c.push(new n.ZP.Tween(this.position,s).to(this.end.position,a).easing(r.easing)),c.push(new n.ZP.Tween(this.seaLevel.position,s).to(this.end.seaLevel.position,a).easing(r.easing)),c.push(new n.ZP.Tween(this.camera.position,s).to(this.end.camera.position,a).easing(r.easing)),this.animationFrameRequester=()=>{s.update(),this.updateMatrixWorld(!0),this.applyTransformToCamera(t,e),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld),r.callback&&r.callback(this),d.crs=t.referenceCrs,d.setFromVector3(this.targetWorldPosition).as(y(t).extent.crs,this.coord),t.notifyChange(e)},this.removeAll=function(e){this.removeAll=()=>{},s.removeAll(),this.animationFrameRequester&&t.removeFrameRequester(o.Ao.BEFORE_RENDER,this.animationFrameRequester),h.resolve(void 0!==e),this.animationFrameRequester=null},c[c.length-1].onComplete(this.removeAll),c.forEach((t=>t.start())),t.addFrameRequester(o.Ao.BEFORE_RENDER,this.animationFrameRequester),t.notifyChange(e),h}stop(t){this.removePlaceTargetOnGround(t),this.removeAll()}addPlaceTargetOnGround(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{t:1};if(this.removePlaceTargetOnGround(t),t&&e){const n=this.target.position.z;this.placeTargetOnGround=()=>{const o=Math.max(0,s.Z.getElevationValueAt(y(t),r||this.coord,s.Z.PRECISE_READ_Z)||0);this.target.position.z=n*(1-i.t)+o*i.t,this.target.updateMatrixWorld(!0),this.applyTransformToCamera(t,e)},this.placeTargetOnGround(),t.addFrameRequester(o.Ao.BEFORE_RENDER,this.placeTargetOnGround)}}removePlaceTargetOnGround(t){t&&this.placeTargetOnGround&&(t.removeFrameRequester(o.Ao.BEFORE_RENDER,this.placeTargetOnGround),this.placeTargetOnGround=null)}get tilt(){return i.MathUtils.radToDeg(this.target.rotation.x)}get heading(){return-A(i.MathUtils.radToDeg(this.target.rotation.z)+180)}get range(){return this.camera.position.y}}function x(t){return f[t.uuid]=f[t.uuid]||new v,f[t.uuid]}const b={defaultStopPlaceOnGroundAtEnd:!1,Easing:n.ZP.Easing,stop(t,e){x(e).stop(t)},getTransformCameraLookingAtTarget(t,e,r){const i=x(e);return i.setfromCamera(t,e,r),i.getParams()},transformCameraToLookAtTarget(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.isExtent&&(r=this.getCameraTransformOptionsFromExtent(t,e,r)),r.proxy=void 0===r.proxy||r.proxy;const i=x(e);return i.stop(t),i.setfromCamera(t,e),r.proxy&&i.setProxy(t,e),i.applyParams(t,r),i.addPlaceTargetOnGround(t,e,r.coord),i.applyTransformToCamera(t,e),t.notifyChange(e),Promise.resolve(i.getParams())},getCameraTransformOptionsFromExtent(t,e,r){const n={coord:new a.Z(r.crs,0,0,0),heading:0,tilt:t.isPlanarView?90:89.9};let s;if(t.isGlobeView?(r=r.as("EPSG:4326"),m.setFromExtent(r),m.box3D.getSize(g),s={x:g.y,y:g.x}):s=(r=r.as(t.referenceCrs)).planarDimensions(),r.center(n.coord),e.isOrthographicCamera)s.x/s.y>e.aspect?e.zoom=(e.right-e.left)/s.x:e.zoom=(e.top-e.bottom)/s.y,e.updateProjectionMatrix(),n.range=1e3;else if(e.isPerspectiveCamera){const r=i.MathUtils.degToRad(e.fov);if(s.x/s.y>e.aspect){const e=.5*t.domElement.clientHeight/Math.tan(.5*r),i=2*Math.atan(.5*t.domElement.clientWidth/e);n.range=s.x/(2*Math.tan(.5*i))}else n.range=s.y/(2*Math.tan(.5*r))}return n},animateCameraToLookAtTarget(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.proxy=void 0===r.proxy||r.proxy;const i=x(e);return i.stop(t),r.proxy&&i.setProxy(t,e),i.animateCameraToLookAtTarget(t,e,r).promise.then((e=>{const n=void 0===r.stopPlaceOnGroundAtEnd?this.defaultStopPlaceOnGroundAtEnd:r.stopPlaceOnGroundAtEnd,s=i.getParams();return n&&i.stop(t),s.finished=e,s}))},sequenceAnimationsToLookAtTarget(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{}]).map((r=>()=>this.animateCameraToLookAtTarget(t,e,r))).reduce(((t,e)=>t.then((t=>!t.length||t[t.length-1].finished?e().then(Array.prototype.concat.bind(t)):Promise.resolve([{finished:!1}])))),Promise.resolve([]))},getDiffParams(t,e){if(!t||!e)return;let r;return Math.abs(t.range-e.range)/t.range>.001&&(r=r||{},r.range={previous:t.range,new:e.range}),Math.abs(t.tilt-e.tilt)>.1&&(r=r||{},r.tilt={previous:t.tilt,new:e.tilt}),Math.abs(t.heading-e.heading)>.1&&(r=r||{},r.heading={previous:t.heading,new:e.heading}),(Math.abs(t.coord.x-e.coord.x)>1e-6||Math.abs(t.coord.y-e.coord.y)>1e-6)&&(r=r||{},r.coord={previous:t.coord,new:e.coord}),r}}},86541:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a,P:()=>p});var i=r(99477),n=r(62310);const s={v:new i.Vector3,coord1:new n.Z("EPSG:4978"),coord2:new n.Z("EPSG:4978"),offset:new i.Vector2};function o(t,e,r,i,o,l){let c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},h=arguments.length>8?arguments[8]:void 0;const u=(arguments.length>7?arguments[7]:void 0)||new n.Z(i);c.worldFromLocal?u.setFromVector3(s.v.copy(o).applyMatrix4(c.worldFromLocal)):u.setFromVector3(o);const d=a.getTerrainObjectAt(t,u,e,r,h);if(d)return d.coord.z+=l,d.coord.as(i,s.coord2).toVector3(o),c.localFromWorld&&o.applyMatrix4(c.localFromWorld),{id:d.texture.id,version:d.texture.version,tile:d.tile}}const a={getElevationValueAt(t,e){const r=A(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e,(arguments.length>3?arguments[3]:void 0)||t.level0Nodes);if(r)return r.coord.z},getTerrainObjectAt(t,e){let r=arguments.length>4?arguments[4]:void 0;return A(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e,(arguments.length>3?arguments[3]:void 0)||t.level0Nodes,r)},FAST_READ_Z:0,PRECISE_READ_Z:1,placeObjectOnGround:function(t,e,r){let s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0;if(console.warn("placeObjectOnGround has been deprecated because it needs review and test"),s=c?c.concat(t.level0Nodes):t.level0Nodes,l.modifyGeometry){const c={worldFromLocal:r.matrixWorld,localFromWorld:(new i.Matrix4).copy(r.matrixWorld).invert()},h=r.geometry;if(h.vertices){l.cache&&(l.cache.length=h.vertices.length);let r=!0;const i=new n.Z(e);for(let n=0;n=0?e:void 0}}let c;function h(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s2&&void 0!==arguments[2]?arguments[2]:new i.Vector2;if(t.crs!=e.crs)throw new Error(`Unsupported mix: ${t.crs} and ${e.crs}`);e.planarDimensions(g);const n=(t.x-e.west)/g.x,s=(e.north-t.y)/g.y;r.set(n,s)}(a,c.extent,m.offset),a.z=1==e?function(t,e,r,n,s){const o=n.x/s.x/16;let a=Math.floor(r.x/o)*o,l=Math.floor(r.y/o)*o;1==a&&(a-=o),1==l&&(l-=o);const c=a,h=a+o,u=l,d=l+o,m=(r.x-a)/o,g=(r.y-l)/o,A=new i.Triangle(new i.Vector3(c,d),new i.Vector3(h,u),1==g||m/(1-g)>=1?new i.Vector3(h,d):new i.Vector3(c,u));A.getBarycoord(new i.Vector3(r.x,r.y),f);const y=t.attachedLayers.filter((t=>t.isElevationLayer))[0],v=p(y,e,A.a.x,A.a.y),x=p(y,e,A.b.x,A.b.y),b=p(y,e,A.c.x,A.c.y);return v*f.x+x*f.y+b*f.z}(t,y,m.offset,d.extent.planarDimensions(),c.extent.planarDimensions()):function(t,e,r){return function(t,e,r,i){const n=u(e,r,i);return h(t,e,n.wu<=0?n.u1:n.u2,n.wv<=0?n.v1:n.v2)}(t.attachedLayers.filter((t=>t.isElevationLayer))[0],e,r.x,r.y)}(t,y,m.offset),null!=a.z?{coord:a,texture:y,tile:d}:void 0}},29372:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(5167);function n(t,e,r,i,n,s){const o=t.x,a=t.y;for(let t=i+s,l=i;t=-r&&p<=d+r&&Math.abs(u*o-h*a+s*n-c*i)/d<=r)return!0}return!1}function s(t,e,r,s,o,a,l){if(e==i.tg.LINE&&n(t,r,s,o,a,l))return!0;if(e==i.tg.POLYGON&&function(t,e,r,i,s,o){const a=t.x,l=t.y;let c=!1;for(let h=i,u=i+s-o;hl!=d>l&&a<(o-i)*(l-s)/(d-s)+i&&(c=!c)}return c}(t,r,s,o,a,l))return!0;if(e==i.tg.POINT){const e=function(t,e,r,i,n,s){const o=t.x,a=t.y;let l,c=r*r;for(let t=i;t2&&void 0!==arguments[2]?arguments[2]:.1;const i=[];if(t.as(e.crs,a),a.applyMatrix4(e.matrixWorldInverse),e.extent.isPointInside(a,r))if(e.isFeatureCollection){r*=Math.sqrt(e.scale.x**2+e.scale.y**2);for(const t of e.features)t.extent&&!t.extent.isPointInside(a,r)||o(a,t,r,i)}else e.geometries&&o(a,e,r,i);return i}}},59099:(t,e,r)=>{"use strict";function i(t){const e=function(t){const e=[];return t.alphaMap&&e.push(t.map),t.aoMap&&e.push(t.map),t.bumpMap&&e.push(t.bumpMap),t.displacementMap&&e.push(t.bumpMap),t.emissiveMap&&e.push(t.emissiveMap),t.envMap&&e.push(t.envMap),t.lightMap&&e.push(t.envMap),t.map&&e.push(t.map),t.metalnessMap&&e.push(t.map),t.normalMap&&e.push(t.map),t.roughnessMap&&e.push(t.map),t.specularMap&&e.push(t.specularMap),e}(t);if(Array.isArray(t))for(const e of t)e.dispose();else t.dispose();for(let t=0;t-1*(t.start-e.start)));const e=t.geometry.groups.length-1;let r=t.geometry.groups[e].materialIndex;const i=[r];for(let n=e-1;n>=0;n--){const e=t.geometry.groups[n];e.materialIndex===r?(t.geometry.groups[n+1].count+=e.count,t.geometry.groups.splice(n,1)):(r=e.materialIndex,i.push(r))}for(let e=t.material.length-1;e>=0;e--)i.includes(e)||(t.geometry.groups.forEach((t=>{t.materialIndex>e&&(t.materialIndex-=1)})),t.material.splice(e,1))}r.d(e,{O:()=>n,Z:()=>i})},99477:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ACESFilmicToneMapping:()=>st,AddEquation:()=>E,AddOperation:()=>tt,AdditiveAnimationBlendMode:()=>Ne,AdditiveBlending:()=>x,AlphaFormat:()=>Ft,AlwaysCompare:()=>Sr,AlwaysDepth:()=>H,AlwaysStencilFunc:()=>yr,AmbientLight:()=>op,AnimationAction:()=>Yp,AnimationClip:()=>Rd,AnimationLoader:()=>Fd,AnimationMixer:()=>Jp,AnimationObjectGroup:()=>Zp,AnimationUtils:()=>Ad,ArcCurve:()=>kh,ArrayCamera:()=>jl,ArrowHelper:()=>jf,AttachedBindMode:()=>at,Audio:()=>Pp,AudioAnalyser:()=>Fp,AudioContext:()=>xp,AudioListener:()=>Lp,AudioLoader:()=>bp,AxesHelper:()=>Vf,BackSide:()=>m,BasicDepthPacking:()=>Ve,BasicShadowMap:()=>h,BatchedMesh:()=>ch,Bone:()=>Pc,BooleanKeyframeTrack:()=>wd,Box2:()=>hf,Box3:()=>Ui,Box3Helper:()=>Nf,BoxGeometry:()=>Ys,BoxHelper:()=>Uf,BufferAttribute:()=>us,BufferGeometry:()=>Is,BufferGeometryLoader:()=>pp,ByteType:()=>It,Cache:()=>Ld,Camera:()=>eo,CameraHelper:()=>Df,CanvasTexture:()=>Ph,CapsuleGeometry:()=>iu,CatmullRomCurve3:()=>Qh,CineonToneMapping:()=>nt,CircleGeometry:()=>nu,ClampToEdgeWrapping:()=>gt,Clock:()=>Sp,Color:()=>$n,ColorKeyframeTrack:()=>Ed,ColorManagement:()=>mi,CompressedArrayTexture:()=>Bh,CompressedCubeTexture:()=>Lh,CompressedTexture:()=>Rh,CompressedTextureLoader:()=>zd,ConeGeometry:()=>ou,ConstantAlphaFactor:()=>Q,ConstantColorFactor:()=>z,CubeCamera:()=>no,CubeReflectionMapping:()=>ht,CubeRefractionMapping:()=>ut,CubeTexture:()=>so,CubeTextureLoader:()=>Qd,CubeUVReflectionMapping:()=>ft,CubicBezierCurve:()=>Wh,CubicBezierCurve3:()=>qh,CubicInterpolant:()=>vd,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>o,Curve:()=>Dh,CurvePath:()=>tu,CustomBlending:()=>w,CustomToneMapping:()=>ot,CylinderGeometry:()=>su,Cylindrical:()=>lf,Data3DTexture:()=>Ri,DataArrayTexture:()=>Ti,DataTexture:()=>Dc,DataTextureLoader:()=>jd,DataUtils:()=>ls,DecrementStencilOp:()=>ar,DecrementWrapStencilOp:()=>cr,DefaultLoadingManager:()=>Dd,DepthFormat:()=>jt,DepthStencilFormat:()=>Vt,DepthTexture:()=>Ko,DetachedBindMode:()=>lt,DirectionalLight:()=>sp,DirectionalLightHelper:()=>Bf,DiscreteInterpolant:()=>bd,DisplayP3ColorSpace:()=>Je,DodecahedronGeometry:()=>lu,DoubleSide:()=>g,DstAlphaFactor:()=>O,DstColorFactor:()=>U,DynamicCopyUsage:()=>Dr,DynamicDrawUsage:()=>Tr,DynamicReadUsage:()=>Br,EdgesGeometry:()=>pu,EllipseCurve:()=>Oh,EqualCompare:()=>br,EqualDepth:()=>Z,EqualStencilFunc:()=>pr,EquirectangularReflectionMapping:()=>dt,EquirectangularRefractionMapping:()=>pt,Euler:()=>bn,EventDispatcher:()=>Gr,ExtrudeGeometry:()=>Qu,FileLoader:()=>Nd,Float16BufferAttribute:()=>vs,Float32BufferAttribute:()=>xs,Float64BufferAttribute:()=>bs,FloatType:()=>Dt,Fog:()=>$l,FogExp2:()=>Kl,FramebufferTexture:()=>Ih,FrontSide:()=>f,Frustum:()=>fo,GLBufferAttribute:()=>rf,GLSL1:()=>kr,GLSL3:()=>Ur,GreaterCompare:()=>wr,GreaterDepth:()=>X,GreaterEqualCompare:()=>Mr,GreaterEqualDepth:()=>Y,GreaterEqualStencilFunc:()=>Ar,GreaterStencilFunc:()=>mr,GridHelper:()=>Sf,Group:()=>Vl,HalfFloatType:()=>Ot,HemisphereLight:()=>Wd,HemisphereLightHelper:()=>Mf,IcosahedronGeometry:()=>Vu,ImageBitmapLoader:()=>yp,ImageLoader:()=>Gd,ImageUtils:()=>vi,IncrementStencilOp:()=>or,IncrementWrapStencilOp:()=>lr,InstancedBufferAttribute:()=>Nc,InstancedBufferGeometry:()=>dp,InstancedInterleavedBuffer:()=>ef,InstancedMesh:()=>Wc,Int16BufferAttribute:()=>ms,Int32BufferAttribute:()=>As,Int8BufferAttribute:()=>ds,IntType:()=>Lt,InterleavedBuffer:()=>ec,InterleavedBufferAttribute:()=>ic,Interpolant:()=>yd,InterpolateDiscrete:()=>Be,InterpolateLinear:()=>Le,InterpolateSmooth:()=>Pe,InvertStencilOp:()=>hr,KeepStencilOp:()=>nr,KeyframeTrack:()=>_d,LOD:()=>_c,LatheGeometry:()=>ru,Layers:()=>_n,LessCompare:()=>xr,LessDepth:()=>W,LessEqualCompare:()=>_r,LessEqualDepth:()=>q,LessEqualStencilFunc:()=>fr,LessStencilFunc:()=>dr,Light:()=>Hd,LightProbe:()=>cp,Line:()=>gh,Line3:()=>pf,LineBasicMaterial:()=>hh,LineCurve:()=>Zh,LineCurve3:()=>Yh,LineDashedMaterial:()=>ud,LineLoop:()=>xh,LineSegments:()=>vh,LinearDisplayP3ColorSpace:()=>Ke,LinearEncoding:()=>Qe,LinearFilter:()=>wt,LinearInterpolant:()=>xd,LinearMipMapLinearFilter:()=>Ct,LinearMipMapNearestFilter:()=>Mt,LinearMipmapLinearFilter:()=>St,LinearMipmapNearestFilter:()=>Et,LinearSRGBColorSpace:()=>Xe,LinearToneMapping:()=>rt,LinearTransfer:()=>$e,Loader:()=>Od,LoaderUtils:()=>up,LoadingManager:()=>Pd,LoopOnce:()=>Te,LoopPingPong:()=>Re,LoopRepeat:()=>Ie,LuminanceAlphaFormat:()=>Qt,LuminanceFormat:()=>Gt,MOUSE:()=>n,Material:()=>rs,MaterialLoader:()=>hp,MathUtils:()=>ti,Matrix3:()=>ri,Matrix4:()=>un,MaxEquation:()=>T,Mesh:()=>qs,MeshBasicMaterial:()=>is,MeshDepthMaterial:()=>Ul,MeshDistanceMaterial:()=>Nl,MeshLambertMaterial:()=>cd,MeshMatcapMaterial:()=>hd,MeshNormalMaterial:()=>ld,MeshPhongMaterial:()=>od,MeshPhysicalMaterial:()=>sd,MeshStandardMaterial:()=>nd,MeshToonMaterial:()=>ad,MinEquation:()=>C,MirroredRepeatWrapping:()=>At,MixOperation:()=>$,MultiplyBlending:()=>_,MultiplyOperation:()=>K,NearestFilter:()=>yt,NearestMipMapLinearFilter:()=>_t,NearestMipMapNearestFilter:()=>xt,NearestMipmapLinearFilter:()=>bt,NearestMipmapNearestFilter:()=>vt,NeverCompare:()=>vr,NeverDepth:()=>V,NeverStencilFunc:()=>ur,NoBlending:()=>y,NoColorSpace:()=>Ze,NoToneMapping:()=>et,NormalAnimationBlendMode:()=>Ue,NormalBlending:()=>v,NotEqualCompare:()=>Er,NotEqualDepth:()=>J,NotEqualStencilFunc:()=>gr,NumberKeyframeTrack:()=>Md,Object3D:()=>kn,ObjectLoader:()=>fp,ObjectSpaceNormalMap:()=>qe,OctahedronGeometry:()=>Hu,OneFactor:()=>R,OneMinusConstantAlphaFactor:()=>j,OneMinusConstantColorFactor:()=>G,OneMinusDstAlphaFactor:()=>k,OneMinusDstColorFactor:()=>N,OneMinusSrcAlphaFactor:()=>D,OneMinusSrcColorFactor:()=>L,OrthographicCamera:()=>To,P3Primaries:()=>rr,PCFShadowMap:()=>u,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>No,Path:()=>eu,PerspectiveCamera:()=>ro,Plane:()=>ho,PlaneGeometry:()=>Ao,PlaneHelper:()=>Ff,PointLight:()=>ip,PointLightHelper:()=>bf,Points:()=>Sh,PointsMaterial:()=>bh,PolarGridHelper:()=>Cf,PolyhedronGeometry:()=>au,PositionalAudio:()=>Np,PropertyBinding:()=>qp,PropertyMixer:()=>zp,QuadraticBezierCurve:()=>Xh,QuadraticBezierCurve3:()=>Jh,Quaternion:()=>Pi,QuaternionKeyframeTrack:()=>Cd,QuaternionLinearInterpolant:()=>Sd,RED_GREEN_RGTC2_Format:()=>Se,RED_RGTC1_Format:()=>Ee,REVISION:()=>i,RGBADepthPacking:()=>He,RGBAFormat:()=>zt,RGBAIntegerFormat:()=>Yt,RGBA_ASTC_10x10_Format:()=>ye,RGBA_ASTC_10x5_Format:()=>me,RGBA_ASTC_10x6_Format:()=>ge,RGBA_ASTC_10x8_Format:()=>Ae,RGBA_ASTC_12x10_Format:()=>ve,RGBA_ASTC_12x12_Format:()=>xe,RGBA_ASTC_4x4_Format:()=>ae,RGBA_ASTC_5x4_Format:()=>le,RGBA_ASTC_5x5_Format:()=>ce,RGBA_ASTC_6x5_Format:()=>he,RGBA_ASTC_6x6_Format:()=>ue,RGBA_ASTC_8x5_Format:()=>de,RGBA_ASTC_8x6_Format:()=>pe,RGBA_ASTC_8x8_Format:()=>fe,RGBA_BPTC_Format:()=>be,RGBA_ETC2_EAC_Format:()=>oe,RGBA_PVRTC_2BPPV1_Format:()=>ie,RGBA_PVRTC_4BPPV1_Format:()=>re,RGBA_S3TC_DXT1_Format:()=>Jt,RGBA_S3TC_DXT3_Format:()=>Kt,RGBA_S3TC_DXT5_Format:()=>$t,RGB_BPTC_SIGNED_Format:()=>_e,RGB_BPTC_UNSIGNED_Format:()=>we,RGB_ETC1_Format:()=>ne,RGB_ETC2_Format:()=>se,RGB_PVRTC_2BPPV1_Format:()=>ee,RGB_PVRTC_4BPPV1_Format:()=>te,RGB_S3TC_DXT1_Format:()=>Xt,RGFormat:()=>qt,RGIntegerFormat:()=>Zt,RawShaderMaterial:()=>id,Ray:()=>hn,Raycaster:()=>nf,Rec709Primaries:()=>er,RectAreaLight:()=>ap,RedFormat:()=>Ht,RedIntegerFormat:()=>Wt,ReinhardToneMapping:()=>it,RenderTarget:()=>Si,RepeatWrapping:()=>mt,ReplaceStencilOp:()=>sr,ReverseSubtractEquation:()=>S,RingGeometry:()=>Wu,SIGNED_RED_GREEN_RGTC2_Format:()=>Ce,SIGNED_RED_RGTC1_Format:()=>Me,SRGBColorSpace:()=>Ye,SRGBTransfer:()=>tr,Scene:()=>tc,ShaderChunk:()=>yo,ShaderLib:()=>xo,ShaderMaterial:()=>to,ShadowMaterial:()=>rd,Shape:()=>fu,ShapeGeometry:()=>qu,ShapePath:()=>Hf,ShapeUtils:()=>Fu,ShortType:()=>Rt,Skeleton:()=>Uc,SkeletonHelper:()=>vf,SkinnedMesh:()=>Lc,Source:()=>bi,Sphere:()=>en,SphereGeometry:()=>Zu,Spherical:()=>af,SphericalHarmonics3:()=>lp,SplineCurve:()=>Kh,SpotLight:()=>Kd,SpotLightHelper:()=>mf,Sprite:()=>yc,SpriteMaterial:()=>nc,SrcAlphaFactor:()=>P,SrcAlphaSaturateFactor:()=>F,SrcColorFactor:()=>B,StaticCopyUsage:()=>Pr,StaticDrawUsage:()=>Cr,StaticReadUsage:()=>Rr,StereoCamera:()=>Mp,StreamCopyUsage:()=>Or,StreamDrawUsage:()=>Ir,StreamReadUsage:()=>Lr,StringKeyframeTrack:()=>Td,SubtractEquation:()=>M,SubtractiveBlending:()=>b,TOUCH:()=>s,TangentSpaceNormalMap:()=>We,TetrahedronGeometry:()=>Yu,Texture:()=>Ei,TextureLoader:()=>Vd,TorusGeometry:()=>Xu,TorusKnotGeometry:()=>Ju,Triangle:()=>Zn,TriangleFanDrawMode:()=>Ge,TriangleStripDrawMode:()=>ze,TrianglesDrawMode:()=>Fe,TubeGeometry:()=>Ku,TwoPassDoubleSide:()=>A,UVMapping:()=>ct,Uint16BufferAttribute:()=>gs,Uint32BufferAttribute:()=>ys,Uint8BufferAttribute:()=>ps,Uint8ClampedBufferAttribute:()=>fs,Uniform:()=>Kp,UniformsGroup:()=>tf,UniformsLib:()=>vo,UniformsUtils:()=>$s,UnsignedByteType:()=>Tt,UnsignedInt248Type:()=>Nt,UnsignedIntType:()=>Pt,UnsignedShort4444Type:()=>kt,UnsignedShort5551Type:()=>Ut,UnsignedShortType:()=>Bt,VSMShadowMap:()=>p,Vector2:()=>ei,Vector3:()=>Di,Vector4:()=>Mi,VectorKeyframeTrack:()=>Id,VideoTexture:()=>Th,WebGL1Renderer:()=>Jl,WebGL3DRenderTarget:()=>Bi,WebGLArrayRenderTarget:()=>Ii,WebGLCoordinateSystem:()=>Fr,WebGLCubeRenderTarget:()=>oo,WebGLMultipleRenderTargets:()=>Li,WebGLRenderTarget:()=>Ci,WebGLRenderer:()=>Xl,WebGLUtils:()=>Ql,WebGPUCoordinateSystem:()=>zr,WireframeGeometry:()=>$u,WrapAroundEnding:()=>ke,ZeroCurvatureEnding:()=>De,ZeroFactor:()=>I,ZeroSlopeEnding:()=>Oe,ZeroStencilOp:()=>ir,_SRGBAFormat:()=>Nr,createCanvasElement:()=>li,sRGBEncoding:()=>je});const i="159",n={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,l=2,c=3,h=0,u=1,d=2,p=3,f=0,m=1,g=2,A=2,y=0,v=1,x=2,b=3,_=4,w=5,E=100,M=101,S=102,C=103,T=104,I=200,R=201,B=202,L=203,P=204,D=205,O=206,k=207,U=208,N=209,F=210,z=211,G=212,Q=213,j=214,V=0,H=1,W=2,q=3,Z=4,Y=5,X=6,J=7,K=0,$=1,tt=2,et=0,rt=1,it=2,nt=3,st=4,ot=5,at="attached",lt="detached",ct=300,ht=301,ut=302,dt=303,pt=304,ft=306,mt=1e3,gt=1001,At=1002,yt=1003,vt=1004,xt=1004,bt=1005,_t=1005,wt=1006,Et=1007,Mt=1007,St=1008,Ct=1008,Tt=1009,It=1010,Rt=1011,Bt=1012,Lt=1013,Pt=1014,Dt=1015,Ot=1016,kt=1017,Ut=1018,Nt=1020,Ft=1021,zt=1023,Gt=1024,Qt=1025,jt=1026,Vt=1027,Ht=1028,Wt=1029,qt=1030,Zt=1031,Yt=1033,Xt=33776,Jt=33777,Kt=33778,$t=33779,te=35840,ee=35841,re=35842,ie=35843,ne=36196,se=37492,oe=37496,ae=37808,le=37809,ce=37810,he=37811,ue=37812,de=37813,pe=37814,fe=37815,me=37816,ge=37817,Ae=37818,ye=37819,ve=37820,xe=37821,be=36492,_e=36494,we=36495,Ee=36283,Me=36284,Se=36285,Ce=36286,Te=2200,Ie=2201,Re=2202,Be=2300,Le=2301,Pe=2302,De=2400,Oe=2401,ke=2402,Ue=2500,Ne=2501,Fe=0,ze=1,Ge=2,Qe=3e3,je=3001,Ve=3200,He=3201,We=0,qe=1,Ze="",Ye="srgb",Xe="srgb-linear",Je="display-p3",Ke="display-p3-linear",$e="linear",tr="srgb",er="rec709",rr="p3",ir=0,nr=7680,sr=7681,or=7682,ar=7683,lr=34055,cr=34056,hr=5386,ur=512,dr=513,pr=514,fr=515,mr=516,gr=517,Ar=518,yr=519,vr=512,xr=513,br=514,_r=515,wr=516,Er=517,Mr=518,Sr=519,Cr=35044,Tr=35048,Ir=35040,Rr=35045,Br=35049,Lr=35041,Pr=35046,Dr=35050,Or=35042,kr="100",Ur="300 es",Nr=1035,Fr=2e3,zr=2001;class Gr{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>8&255]+Qr[t>>16&255]+Qr[t>>24&255]+"-"+Qr[255&e]+Qr[e>>8&255]+"-"+Qr[e>>16&15|64]+Qr[e>>24&255]+"-"+Qr[63&r|128]+Qr[r>>8&255]+"-"+Qr[r>>16&255]+Qr[r>>24&255]+Qr[255&i]+Qr[i>>8&255]+Qr[i>>16&255]+Qr[i>>24&255]).toLowerCase()}function qr(t,e,r){return Math.max(e,Math.min(r,t))}function Zr(t,e){return(t%e+e)%e}function Yr(t,e,r){return(1-r)*t+r*e}function Xr(t){return 0==(t&t-1)&&0!==t}function Jr(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Kr(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function $r(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const ti={DEG2RAD:Vr,RAD2DEG:Hr,generateUUID:Wr,clamp:qr,euclideanModulo:Zr,mapLinear:function(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)},inverseLerp:function(t,e,r){return t!==e?(r-t)/(e-t):0},lerp:Yr,damp:function(t,e,r,i){return Yr(t,e,1-Math.exp(-r*i))},pingpong:function(t,e=1){return e-Math.abs(Zr(t,2*e)-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(jr=t);let e=jr+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*Vr},radToDeg:function(t){return t*Hr},isPowerOfTwo:Xr,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Jr,setQuaternionFromProperEuler:function(t,e,r,i,n){const s=Math.cos,o=Math.sin,a=s(r/2),l=o(r/2),c=s((e+i)/2),h=o((e+i)/2),u=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,l*u,l*d,a*c);break;case"YZY":t.set(l*d,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*d,a*h,a*c);break;case"XZX":t.set(a*h,l*f,l*p,a*c);break;case"YXY":t.set(l*p,a*h,l*f,a*c);break;case"ZYZ":t.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}},normalize:$r,denormalize:Kr};class ei{constructor(t=0,e=0){ei.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}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(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(qr(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}}class ri{constructor(t,e,r,i,n,s,o,a,l){ri.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,l)}set(t,e,r,i,n,s,o,a,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=o,c[3]=e,c[4]=n,c[5]=a,c[6]=r,c[7]=s,c[8]=l,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],l=r[1],c=r[4],h=r[7],u=r[2],d=r[5],p=r[8],f=i[0],m=i[3],g=i[6],A=i[1],y=i[4],v=i[7],x=i[2],b=i[5],_=i[8];return n[0]=s*f+o*A+a*x,n[3]=s*m+o*y+a*b,n[6]=s*g+o*v+a*_,n[1]=l*f+c*A+h*x,n[4]=l*m+c*y+h*b,n[7]=l*g+c*v+h*_,n[2]=u*f+d*A+p*x,n[5]=u*m+d*y+p*b,n[8]=u*g+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],l=t[7],c=t[8];return e*s*c-e*o*l-r*n*c+r*o*a+i*n*l-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],l=t[7],c=t[8],h=c*s-o*l,u=o*a-c*n,d=l*n-s*a,p=e*h+r*u+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*l-c*r)*f,t[2]=(o*r-i*s)*f,t[3]=u*f,t[4]=(c*e-i*a)*f,t[5]=(i*n-o*e)*f,t[6]=d*f,t[7]=(r*a-l*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),l=Math.sin(n);return this.set(r*a,r*l,-r*(a*s+l*o)+s+t,-i*l,i*a,-i*(-l*s+a*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(ii.makeScale(t,e)),this}rotate(t){return this.premultiply(ii.makeRotation(-t)),this}translate(t,e){return this.premultiply(ii.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):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 ii=new ri;function ni(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const si={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oi(t,e){return new si[t](e)}function ai(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function li(){const t=ai("canvas");return t.style.display="block",t}const ci={};function hi(t){t in ci||(ci[t]=!0,console.warn(t))}const ui=(new ri).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),di=(new ri).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),pi={[Xe]:{transfer:$e,primaries:er,toReference:t=>t,fromReference:t=>t},[Ye]:{transfer:tr,primaries:er,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Ke]:{transfer:$e,primaries:rr,toReference:t=>t.applyMatrix3(di),fromReference:t=>t.applyMatrix3(ui)},[Je]:{transfer:tr,primaries:rr,toReference:t=>t.convertSRGBToLinear().applyMatrix3(di),fromReference:t=>t.applyMatrix3(ui).convertLinearToSRGB()}},fi=new Set([Xe,Ke]),mi={enabled:!0,_workingColorSpace:Xe,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 this._workingColorSpace},set workingColorSpace(t){if(!fi.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,r){if(!1===this.enabled||e===r||!e||!r)return t;const i=pi[e].toReference;return(0,pi[r].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return pi[t].primaries},getTransfer:function(t){return t===Ze?$e:pi[t].transfer}};function gi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ai(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let yi;class vi{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===yi&&(yi=ai("canvas")),yi.width=t.width,yi.height=t.height;const r=yi.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),e=yi}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=ai("canvas");e.width=t.width,e.height=t.height;const r=e.getContext("2d");r.drawImage(t,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height),n=i.data;for(let t=0;t0&&(r.userData=this.userData),e||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==ct)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case mt:t.x=t.x-Math.floor(t.x);break;case gt:t.x=t.x<0?0:1;break;case At: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 mt:t.y=t.y-Math.floor(t.y);break;case gt:t.y=t.y<0?0:1;break;case At: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 hi("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Ye?je:Qe}set encoding(t){hi("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===je?Ye:Ze}}Ei.DEFAULT_IMAGE=null,Ei.DEFAULT_MAPPING=ct,Ei.DEFAULT_ANISOTROPY=1;class Mi{constructor(t=0,e=0,r=0,i=1){Mi.prototype.isVector4=!0,this.x=t,this.y=e,this.z=r,this.w=i}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,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)a&&t>A?tA?a=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+u*n,l=l*t+d*n,c=c*t+p*n,h=h*t+f*n,t===1-o){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,r,i,n,s){const o=r[i],a=r[i+1],l=r[i+2],c=r[i+3],h=n[s],u=n[s+1],d=n[s+2],p=n[s+3];return t[e]=o*p+c*h+a*d-l*u,t[e+1]=a*p+c*u+l*h-o*d,t[e+2]=l*p+c*d+o*u-a*h,t[e+3]=c*p-o*h-a*u-l*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,l=o(r/2),c=o(i/2),h=o(n/2),u=a(r/2),d=a(i/2),p=a(n/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*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],l=e[2],c=e[6],h=e[10],u=r+o+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=(s-i)*t}else if(r>o&&r>h){const t=2*Math.sqrt(1+r-o-h);this._w=(c-a)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(n+l)/t}else if(o>h){const t=2*Math.sqrt(1+o-r-h);this._w=(n-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-r-o);this._w=(s-i)/t,this._x=(n+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let r=t.dot(e)+1;return rMath.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(qr(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()}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 r=t._x,i=t._y,n=t._z,s=t._w,o=e._x,a=e._y,l=e._z,c=e._w;return this._x=r*c+s*o+i*l-n*a,this._y=i*c+s*a+n*o-r*l,this._z=n*c+s*l+r*a-i*o,this._w=s*c-r*o-i*a-n*l,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 l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=r*h+this._x*u,this._y=i*h+this._y*u,this._z=n*h+this._z*u,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}}class Di{constructor(t=0,e=0,r=0){Di.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(ki.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ki.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,l=2*(s*i-o*r),c=2*(o*e-n*i),h=2*(n*r-s*e);return this.x=e+a*l+s*h-o*c,this.y=r+a*c+o*l-n*h,this.z=i+a*h+n*c-s*l,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(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 Oi.copy(this).projectOnVector(t),this.sub(Oi)}reflect(t){return this.sub(Oi.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(qr(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 Oi=new Di,ki=new Pi;class Ui{constructor(t=new Di(1/0,1/0,1/0),e=new Di(-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;ethis.max.x||t.ythis.max.y||t.zthis.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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Fi),Fi.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(qi),Zi.subVectors(this.max,qi),Gi.subVectors(t.a,qi),Qi.subVectors(t.b,qi),ji.subVectors(t.c,qi),Vi.subVectors(Qi,Gi),Hi.subVectors(ji,Qi),Wi.subVectors(Gi,ji);let e=[0,-Vi.z,Vi.y,0,-Hi.z,Hi.y,0,-Wi.z,Wi.y,Vi.z,0,-Vi.x,Hi.z,0,-Hi.x,Wi.z,0,-Wi.x,-Vi.y,Vi.x,0,-Hi.y,Hi.x,0,-Wi.y,Wi.x,0];return!!Ji(e,Gi,Qi,ji,Zi)&&(e=[1,0,0,0,1,0,0,0,1],!!Ji(e,Gi,Qi,ji,Zi)&&(Yi.crossVectors(Vi,Hi),e=[Yi.x,Yi.y,Yi.z],Ji(e,Gi,Qi,ji,Zi)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Fi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Fi).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()||(Ni[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ni[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ni[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ni[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ni[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ni[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ni[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ni[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ni)),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 Ni=[new Di,new Di,new Di,new Di,new Di,new Di,new Di,new Di],Fi=new Di,zi=new Ui,Gi=new Di,Qi=new Di,ji=new Di,Vi=new Di,Hi=new Di,Wi=new Di,qi=new Di,Zi=new Di,Yi=new Di,Xi=new Di;function Ji(t,e,r,i,n){for(let s=0,o=t.length-3;s<=o;s+=3){Xi.fromArray(t,s);const o=n.x*Math.abs(Xi.x)+n.y*Math.abs(Xi.y)+n.z*Math.abs(Xi.z),a=e.dot(Xi),l=r.dot(Xi),c=i.dot(Xi);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const Ki=new Ui,$i=new Di,tn=new Di;class en{constructor(t=new Di,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):Ki.setFromPoints(t).getCenter(r);let i=0;for(let e=0,n=t.length;ethis.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;$i.subVectors(t,this.center);const e=$i.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),r=.5*(t-this.radius);this.center.addScaledVector($i,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):(tn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint($i.copy(t.center).add(tn)),this.expandByPoint($i.copy(t.center).sub(tn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const rn=new Di,nn=new Di,sn=new Di,on=new Di,an=new Di,ln=new Di,cn=new Di;class hn{constructor(t=new Di,e=new Di(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,rn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const r=e.dot(this.direction);return r<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=rn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(rn.copy(this.origin).addScaledVector(this.direction,e),rn.distanceToSquared(t))}distanceSqToSegment(t,e,r,i){nn.copy(t).add(e).multiplyScalar(.5),sn.copy(e).sub(t).normalize(),on.copy(this.origin).sub(nn);const n=.5*t.distanceTo(e),s=-this.direction.dot(sn),o=on.dot(this.direction),a=-on.dot(sn),l=on.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*a-o,u=s*o-a,p=n*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-s*n+o)),u=h>0?-n:Math.min(Math.max(-n,-a),n),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-n,-a),n),d=u*(u+2*a)+l):(h=Math.max(0,-(s*n+o)),u=h>0?n:Math.min(Math.max(-n,-a),n),d=-h*h+u*(u+2*a)+l);else u=s>0?-n:n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(nn).addScaledVector(sn,u),d}intersectSphere(t,e){rn.subVectors(t.center,this.origin);const r=rn.dot(this.direction),i=rn.dot(rn)-r*r,n=t.radius*t.radius;if(i>n)return null;const s=Math.sqrt(n-i),o=r-s,a=r+s;return a<0?null:o<0?this.at(a,e):this.at(o,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 r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null}intersectPlane(t,e){const r=this.distanceToPlane(t);return null===r?null:this.at(r,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let r,i,n,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(r=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(r=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(n=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(n=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),r>s||n>i?null:((n>r||isNaN(r))&&(r=n),(s=0?(o=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(o=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),r>a||o>i?null:((o>r||r!=r)&&(r=o),(a=0?r:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,rn)}intersectTriangle(t,e,r,i,n){an.subVectors(e,t),ln.subVectors(r,t),cn.crossVectors(an,ln);let s,o=this.direction.dot(cn);if(o>0){if(i)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}on.subVectors(this.origin,t);const a=s*this.direction.dot(ln.crossVectors(on,ln));if(a<0)return null;const l=s*this.direction.dot(an.cross(on));if(l<0)return null;if(a+l>o)return null;const c=-s*on.dot(cn);return c<0?null:this.at(c/o,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)}}class un{constructor(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m){un.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m)}set(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=r,g[12]=i,g[1]=n,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new un).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/dn.setFromMatrixColumn(t,0).length(),n=1/dn.setFromMatrixColumn(t,1).length(),s=1/dn.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]*s,e[9]=r[9]*s,e[10]=r[10]*s,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),l=Math.sin(i),c=Math.cos(n),h=Math.sin(n);if("XYZ"===t.order){const t=s*c,r=s*h,i=o*c,n=o*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=r+i*l,e[5]=t-n*l,e[9]=-o*a,e[2]=n-t*l,e[6]=i+r*l,e[10]=s*a}else if("YXZ"===t.order){const t=a*c,r=a*h,i=l*c,n=l*h;e[0]=t+n*o,e[4]=i*o-r,e[8]=s*l,e[1]=s*h,e[5]=s*c,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*c,r=a*h,i=l*c,n=l*h;e[0]=t-n*o,e[4]=-s*h,e[8]=i+r*o,e[1]=r+i*o,e[5]=s*c,e[9]=n-t*o,e[2]=-s*l,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*c,r=s*h,i=o*c,n=o*h;e[0]=a*c,e[4]=i*l-r,e[8]=t*l+n,e[1]=a*h,e[5]=n*l+t,e[9]=r*l-i,e[2]=-l,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,r=s*l,i=o*a,n=o*l;e[0]=a*c,e[4]=n-t*h,e[8]=i*h+r,e[1]=h,e[5]=s*c,e[9]=-o*c,e[2]=-l*c,e[6]=r*h+i,e[10]=t-n*h}else if("XZY"===t.order){const t=s*a,r=s*l,i=o*a,n=o*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+n,e[5]=s*c,e[9]=r*h-i,e[2]=i*h-r,e[6]=o*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(fn,t,mn)}lookAt(t,e,r){const i=this.elements;return yn.subVectors(t,e),0===yn.lengthSq()&&(yn.z=1),yn.normalize(),gn.crossVectors(r,yn),0===gn.lengthSq()&&(1===Math.abs(r.z)?yn.x+=1e-4:yn.z+=1e-4,yn.normalize(),gn.crossVectors(r,yn)),gn.normalize(),An.crossVectors(yn,gn),i[0]=gn.x,i[4]=An.x,i[8]=yn.x,i[1]=gn.y,i[5]=An.y,i[9]=yn.y,i[2]=gn.z,i[6]=An.z,i[10]=yn.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],l=r[12],c=r[1],h=r[5],u=r[9],d=r[13],p=r[2],f=r[6],m=r[10],g=r[14],A=r[3],y=r[7],v=r[11],x=r[15],b=i[0],_=i[4],w=i[8],E=i[12],M=i[1],S=i[5],C=i[9],T=i[13],I=i[2],R=i[6],B=i[10],L=i[14],P=i[3],D=i[7],O=i[11],k=i[15];return n[0]=s*b+o*M+a*I+l*P,n[4]=s*_+o*S+a*R+l*D,n[8]=s*w+o*C+a*B+l*O,n[12]=s*E+o*T+a*L+l*k,n[1]=c*b+h*M+u*I+d*P,n[5]=c*_+h*S+u*R+d*D,n[9]=c*w+h*C+u*B+d*O,n[13]=c*E+h*T+u*L+d*k,n[2]=p*b+f*M+m*I+g*P,n[6]=p*_+f*S+m*R+g*D,n[10]=p*w+f*C+m*B+g*O,n[14]=p*E+f*T+m*L+g*k,n[3]=A*b+y*M+v*I+x*P,n[7]=A*_+y*S+v*R+x*D,n[11]=A*w+y*C+v*B+x*O,n[15]=A*E+y*T+v*L+x*k,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],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+n*a*h-i*l*h-n*o*u+r*l*u+i*o*d-r*a*d)+t[7]*(+e*a*d-e*l*u+n*s*u-i*s*d+i*l*c-n*a*c)+t[11]*(+e*l*h-e*o*d-n*s*h+r*s*d+n*o*c-r*l*c)+t[15]*(-i*o*c-e*a*h+e*o*u+i*s*h-r*s*u+r*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,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],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],A=h*m*l-f*u*l+f*a*d-o*m*d-h*a*g+o*u*g,y=p*u*l-c*m*l-p*a*d+s*m*d+c*a*g-s*u*g,v=c*f*l-p*h*l+p*o*d-s*f*d-c*o*g+s*h*g,x=p*h*a-c*f*a-p*o*u+s*f*u+c*o*m-s*h*m,b=e*A+r*y+i*v+n*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/b;return t[0]=A*_,t[1]=(f*u*n-h*m*n-f*i*d+r*m*d+h*i*g-r*u*g)*_,t[2]=(o*m*n-f*a*n+f*i*l-r*m*l-o*i*g+r*a*g)*_,t[3]=(h*a*n-o*u*n-h*i*l+r*u*l+o*i*d-r*a*d)*_,t[4]=y*_,t[5]=(c*m*n-p*u*n+p*i*d-e*m*d-c*i*g+e*u*g)*_,t[6]=(p*a*n-s*m*n-p*i*l+e*m*l+s*i*g-e*a*g)*_,t[7]=(s*u*n-c*a*n+c*i*l-e*u*l-s*i*d+e*a*d)*_,t[8]=v*_,t[9]=(p*h*n-c*f*n-p*r*d+e*f*d+c*r*g-e*h*g)*_,t[10]=(s*f*n-p*o*n+p*r*l-e*f*l-s*r*g+e*o*g)*_,t[11]=(c*o*n-s*h*n-c*r*l+e*h*l+s*r*d-e*o*d)*_,t[12]=x*_,t[13]=(c*f*i-p*h*i+p*r*u-e*f*u-c*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-c*o*i+c*r*a-e*h*a-s*r*u+e*o*u)*_,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 t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):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,l=n*s,c=n*o;return this.set(l*s+r,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+r,c*a-i*s,0,l*a-i*o,c*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,l=n+n,c=s+s,h=o+o,u=n*l,d=n*c,p=n*h,f=s*c,m=s*h,g=o*h,A=a*l,y=a*c,v=a*h,x=r.x,b=r.y,_=r.z;return i[0]=(1-(f+g))*x,i[1]=(d+v)*x,i[2]=(p-y)*x,i[3]=0,i[4]=(d-v)*b,i[5]=(1-(u+g))*b,i[6]=(m+A)*b,i[7]=0,i[8]=(p+y)*_,i[9]=(m-A)*_,i[10]=(1-(u+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=dn.set(i[0],i[1],i[2]).length();const s=dn.set(i[4],i[5],i[6]).length(),o=dn.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],pn.copy(this);const a=1/n,l=1/s,c=1/o;return pn.elements[0]*=a,pn.elements[1]*=a,pn.elements[2]*=a,pn.elements[4]*=l,pn.elements[5]*=l,pn.elements[6]*=l,pn.elements[8]*=c,pn.elements[9]*=c,pn.elements[10]*=c,e.setFromRotationMatrix(pn),r.x=n,r.y=s,r.z=o,this}makePerspective(t,e,r,i,n,s,o=Fr){const a=this.elements,l=2*n/(e-t),c=2*n/(r-i),h=(e+t)/(e-t),u=(r+i)/(r-i);let d,p;if(o===Fr)d=-(s+n)/(s-n),p=-2*s*n/(s-n);else{if(o!==zr)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);d=-s/(s-n),p=-s*n/(s-n)}return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,r,i,n,s,o=Fr){const a=this.elements,l=1/(e-t),c=1/(r-i),h=1/(s-n),u=(e+t)*l,d=(r+i)*c;let p,f;if(o===Fr)p=(s+n)*h,f=-2*h;else{if(o!==zr)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);p=n*h,f=-1*h}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=f,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[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 dn=new Di,pn=new un,fn=new Di(0,0,0),mn=new Di(1,1,1),gn=new Di,An=new Di,yn=new Di,vn=new un,xn=new Pi;class bn{constructor(t=0,e=0,r=0,i=bn.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],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(qr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,n)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-qr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-h,n),this._z=0);break;case"ZXY":this._x=Math.asin(qr(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-qr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(qr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,n)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-qr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-c,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 vn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(vn,e,r)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return xn.setFromEuler(this),this.setFromQuaternion(xn,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}}bn.DEFAULT_ORDER="XYZ";class _n{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(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.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),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;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(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),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),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.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,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.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(t,e,r,i,n){Un.subVectors(i,e),Nn.subVectors(r,e),Fn.subVectors(t,e);const s=Un.dot(Un),o=Un.dot(Nn),a=Un.dot(Fn),l=Nn.dot(Nn),c=Nn.dot(Fn),h=s*l-o*o;if(0===h)return n.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,p=(s*c-o*a)*u;return n.set(1-d-p,p,d)}static containsPoint(t,e,r,i){return this.getBarycoord(t,e,r,i,zn),zn.x>=0&&zn.y>=0&&zn.x+zn.y<=1}static getUV(t,e,r,i,n,s,o,a){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),this.getInterpolation(t,e,r,i,n,s,o,a)}static getInterpolation(t,e,r,i,n,s,o,a){return this.getBarycoord(t,e,r,i,zn),a.setScalar(0),a.addScaledVector(n,zn.x),a.addScaledVector(s,zn.y),a.addScaledVector(o,zn.z),a}static isFrontFacing(t,e,r,i){return Un.subVectors(r,e),Nn.subVectors(t,e),Un.cross(Nn).dot(i)<0}set(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this}setFromPointsAndIndices(t,e,r,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,r,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,i),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 Un.subVectors(this.c,this.b),Nn.subVectors(this.a,this.b),.5*Un.cross(Nn).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Zn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Zn.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,r,i,n){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),Zn.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}getInterpolation(t,e,r,i,n){return Zn.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}containsPoint(t){return Zn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Zn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const r=this.a,i=this.b,n=this.c;let s,o;Gn.subVectors(i,r),Qn.subVectors(n,r),Vn.subVectors(t,r);const a=Gn.dot(Vn),l=Qn.dot(Vn);if(a<=0&&l<=0)return e.copy(r);Hn.subVectors(t,i);const c=Gn.dot(Hn),h=Qn.dot(Hn);if(c>=0&&h<=c)return e.copy(i);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),e.copy(r).addScaledVector(Gn,s);Wn.subVectors(t,n);const d=Gn.dot(Wn),p=Qn.dot(Wn);if(p>=0&&d<=p)return e.copy(n);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(r).addScaledVector(Qn,o);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return jn.subVectors(n,i),o=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(jn,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(r).addScaledVector(Gn,s).addScaledVector(Qn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Yn={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},Xn={h:0,s:0,l:0},Jn={h:0,s:0,l:0};function Kn(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 $n{constructor(t,e,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,r)}set(t,e,r){if(void 0===e&&void 0===r){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,r);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ye){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,mi.toWorkingColorSpace(this,e),this}setRGB(t,e,r,i=mi.workingColorSpace){return this.r=t,this.g=e,this.b=r,mi.toWorkingColorSpace(this,i),this}setHSL(t,e,r,i=mi.workingColorSpace){if(t=Zr(t,1),e=qr(e,0,1),r=qr(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=Kn(n,i,t+1/3),this.g=Kn(n,i,t),this.b=Kn(n,i,t-1/3)}return mi.toWorkingColorSpace(this,i),this}setStyle(t,e=Ye){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=Ye){const r=Yn[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=gi(t.r),this.g=gi(t.g),this.b=gi(t.b),this}copyLinearToSRGB(t){return this.r=Ai(t.r),this.g=Ai(t.g),this.b=Ai(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ye){return mi.fromWorkingColorSpace(ts.copy(this),t),65536*Math.round(qr(255*ts.r,0,255))+256*Math.round(qr(255*ts.g,0,255))+Math.round(qr(255*ts.b,0,255))}getHexString(t=Ye){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=mi.workingColorSpace){mi.fromWorkingColorSpace(ts.copy(this),e);const r=ts.r,i=ts.g,n=ts.b,s=Math.max(r,i,n),o=Math.min(r,i,n);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const t=s-o;switch(l=c<=.5?t/(s+o):t/(2-s-o),s){case r:a=(i-n)/t+(i0!=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 r=t[e];if(void 0===r){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[e]=r: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 r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const r in t){const i=t[r];delete i.metadata,e.push(i)}return e}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==v&&(r.blending=this.blending),this.side!==f&&(r.side=this.side),!0===this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=!0),this.blendSrc!==P&&(r.blendSrc=this.blendSrc),this.blendDst!==D&&(r.blendDst=this.blendDst),this.blendEquation!==E&&(r.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(r.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(r.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==q&&(r.depthFunc=this.depthFunc),!1===this.depthTest&&(r.depthTest=this.depthTest),!1===this.depthWrite&&(r.depthWrite=this.depthWrite),!1===this.colorWrite&&(r.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yr&&(r.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(r.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==nr&&(r.stencilFail=this.stencilFail),this.stencilZFail!==nr&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==nr&&(r.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(r.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaHash&&(r.alphaHash=!0),!0===this.alphaToCoverage&&(r.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=!0),!0===this.forceSinglePass&&(r.forceSinglePass=!0),!0===this.wireframe&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),e){const e=i(t.textures),n=i(t.images);e.length>0&&(r.textures=e),n.length>0&&(r.images=n)}return r}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.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,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 r=null;if(null!==e){const t=e.length;r=new Array(t);for(let i=0;i!==t;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,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.alphaHash=t.alphaHash,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++}}class is extends rs{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new $n(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=K,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}}const ns=ss();function ss(){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(;0==(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;++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:r,baseTable:i,shiftTable:n,mantissaTable:s,exponentTable:o,offsetTable:a}}function os(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=qr(t,-65504,65504),ns.floatView[0]=t;const e=ns.uint32View[0],r=e>>23&511;return ns.baseTable[r]+((8388607&e)>>ns.shiftTable[r])}function as(t){const e=t>>10;return ns.uint32View[0]=ns.mantissaTable[ns.offsetTable[e]+(1023&t)]+ns.exponentTable[e],ns.floatView[0]}const ls={toHalfFloat:os,fromHalfFloat:as},cs=new Di,hs=new ei;class us{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=Cr,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Dt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=t.gpuType,this}copyAt(t,e,r){t*=this.itemSize,r*=e.itemSize;for(let i=0,n=this.itemSize;i0&&(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;e0&&(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;t0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t(t.far-t.near)**2)return}Rs.copy(n).invert(),Bs.copy(t.ray).applyMatrix4(Rs),null!==r.boundingBox&&!1===Bs.intersectsBox(r.boundingBox)||this._computeIntersections(t,e,Bs)}}_computeIntersections(t,e,r){let i;const n=this.geometry,s=this.material,o=n.index,a=n.attributes.position,l=n.attributes.uv,c=n.attributes.uv1,h=n.attributes.normal,u=n.groups,d=n.drawRange;if(null!==o)if(Array.isArray(s))for(let n=0,a=u.length;nr.far?null:{distance:c,point:Ws.clone(),object:t}}(t,e,r,i,Ds,Os,ks,Hs);if(h){n&&(Fs.fromBufferAttribute(n,a),zs.fromBufferAttribute(n,l),Gs.fromBufferAttribute(n,c),h.uv=Zn.getInterpolation(Hs,Ds,Os,ks,Fs,zs,Gs,new ei)),s&&(Fs.fromBufferAttribute(s,a),zs.fromBufferAttribute(s,l),Gs.fromBufferAttribute(s,c),h.uv1=Zn.getInterpolation(Hs,Ds,Os,ks,Fs,zs,Gs,new ei),h.uv2=h.uv1),o&&(Qs.fromBufferAttribute(o,a),js.fromBufferAttribute(o,l),Vs.fromBufferAttribute(o,c),h.normal=Zn.getInterpolation(Hs,Ds,Os,ks,Qs,js,Vs,new Di),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const t={a,b:l,c,normal:new Di,materialIndex:0};Zn.getNormal(Ds,Os,ks,t.normal),h.face=t}return h}class Ys extends Is{constructor(t=1,e=1,r=1,i=1,n=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:s};const o=this;i=Math.floor(i),n=Math.floor(n),s=Math.floor(s);const a=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,r,i,n,s,p,f,m,g,A){const y=s/m,v=p/g,x=s/2,b=p/2,_=f/2,w=m+1,E=g+1;let M=0,S=0;const C=new Di;for(let s=0;s0?1:-1,c.push(C.x,C.y,C.z),h.push(a/m),h.push(1-s/g),M+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const r={};for(const t in this.extensions)!0===this.extensions[t]&&(r[t]=!0);return Object.keys(r).length>0&&(e.extensions=r),e}}class eo extends kn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new un,this.projectionMatrix=new un,this.projectionMatrixInverse=new un,this.coordinateSystem=Fr}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}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)}}class ro extends eo{constructor(t=50,e=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=i,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*Hr*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Vr*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Hr*Math.atan(Math.tan(.5*Vr*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,r,i,n,s){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=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Vr*this.fov)/this.zoom,r=2*e,i=this.aspect*r,n=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;n+=s.offsetX*i/t,e-=s.offsetY*r/o,i*=s.width/t,r*=s.height/o}const o=this.filmOffset;0!==o&&(n+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,e,e-r,t,this.far,this.coordinateSystem),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}}const io=-90;class no extends kn{constructor(t,e,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ro(io,1,t,e);i.layers=this.layers,this.add(i);const n=new ro(io,1,t,e);n.layers=this.layers,this.add(n);const s=new ro(io,1,t,e);s.layers=this.layers,this.add(s);const o=new ro(io,1,t,e);o.layers=this.layers,this.add(o);const a=new ro(io,1,t,e);a.layers=this.layers,this.add(a);const l=new ro(io,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[r,i,n,s,o,a]=e;for(const t of e)this.remove(t);if(t===Fr)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(t!==zr)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[n,s,o,a,l,c]=this.children,h=t.getRenderTarget(),u=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;const f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0,i),t.render(e,n),t.setRenderTarget(r,1,i),t.render(e,s),t.setRenderTarget(r,2,i),t.render(e,o),t.setRenderTarget(r,3,i),t.render(e,a),t.setRenderTarget(r,4,i),t.render(e,l),r.texture.generateMipmaps=f,t.setRenderTarget(r,5,i),t.render(e,c),t.setRenderTarget(h,u,d),t.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class so extends Ei{constructor(t,e,r,i,n,s,o,a,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:ht,r,i,n,s,o,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class oo extends Ci{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const r={width:t,height:t,depth:1},i=[r,r,r,r,r,r];void 0!==e.encoding&&(hi("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===je?Ye:Ze),this.texture=new so(i,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:wt}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 r={tEquirect:{value:null}},i="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",n="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new Ys(5,5,5),o=new to({name:"CubemapFromEquirect",uniforms:Xs(r),vertexShader:i,fragmentShader:n,side:m,blending:y});o.uniforms.tEquirect.value=e;const a=new qs(s,o),l=e.minFilter;return e.minFilter===St&&(e.minFilter=wt),new no(1,10,this).update(t,a),e.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,r,i){const n=t.getRenderTarget();for(let n=0;n<6;n++)t.setRenderTarget(this,n),t.clear(e,r,i);t.setRenderTarget(n)}}const ao=new Di,lo=new Di,co=new ri;class ho{constructor(t=new Di(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,r,i){return this.normal.set(t,e,r),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,r){const i=ao.subVectors(r,e).cross(lo.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 r=t.delta(ao),i=this.normal.dot(r);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const n=-(t.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:e.copy(t.start).addScaledVector(r,n)}intersectsLine(t){const e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<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 r=e||co.getNormalMatrix(t),i=this.coplanarPoint(ao).applyMatrix4(t),n=this.normal.applyMatrix3(r).normalize();return this.constant=-i.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)}}const uo=new en,po=new Di;class fo{constructor(t=new ho,e=new ho,r=new ho,i=new ho,n=new ho,s=new ho){this.planes=[t,e,r,i,n,s]}set(t,e,r,i,n,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(r),o[3].copy(i),o[4].copy(n),o[5].copy(s),this}copy(t){const e=this.planes;for(let r=0;r<6;r++)e[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t,e=Fr){const r=this.planes,i=t.elements,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],A=i[13],y=i[14],v=i[15];if(r[0].setComponents(a-n,u-l,m-d,v-g).normalize(),r[1].setComponents(a+n,u+l,m+d,v+g).normalize(),r[2].setComponents(a+s,u+c,m+p,v+A).normalize(),r[3].setComponents(a-s,u-c,m-p,v-A).normalize(),r[4].setComponents(a-o,u-h,m-f,v-y).normalize(),e===Fr)r[5].setComponents(a+o,u+h,m+f,v+y).normalize();else{if(e!==zr)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);r[5].setComponents(o,h,f,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),uo.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),uo.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(uo)}intersectsSprite(t){return uo.center.set(0,0,0),uo.radius=.7071067811865476,uo.applyMatrix4(t.matrixWorld),this.intersectsSphere(uo)}intersectsSphere(t){const e=this.planes,r=t.center,i=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(r)0?t.max.x:t.min.x,po.y=i.normal.y>0?t.max.y:t.min.y,po.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(po)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function mo(){let t=null,e=!1,r=null,i=null;function n(e,s){r(e,s),i=t.requestAnimationFrame(n)}return{start:function(){!0!==e&&null!==r&&(i=t.requestAnimationFrame(n),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){r=t},setContext:function(e){t=e}}}function go(t,e){const r=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const r=i.get(e);r&&(t.deleteBuffer(r.buffer),i.delete(e))},update:function(e,n){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\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 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\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\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\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\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_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\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\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\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\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 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\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\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\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\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\t\t#undef SPOT_LIGHT_MAP_INDEX\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\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\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\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\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\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\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\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\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = 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\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\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\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\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\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\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\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\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\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},vo={common:{diffuse:{value:new $n(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ri},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ri}},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 ri}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ri}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ri},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ri},normalScale:{value:new ei(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ri},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ri}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ri}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ri}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new $n(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 $n(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0},uvTransform:{value:new ri}},sprite:{diffuse:{value:new $n(16777215)},opacity:{value:1},center:{value:new ei(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ri},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0}}},xo={basic:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.fog]),vertexShader:yo.meshbasic_vert,fragmentShader:yo.meshbasic_frag},lambert:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new $n(0)}}]),vertexShader:yo.meshlambert_vert,fragmentShader:yo.meshlambert_frag},phong:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new $n(0)},specular:{value:new $n(1118481)},shininess:{value:30}}]),vertexShader:yo.meshphong_vert,fragmentShader:yo.meshphong_frag},standard:{uniforms:Js([vo.common,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.roughnessmap,vo.metalnessmap,vo.fog,vo.lights,{emissive:{value:new $n(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yo.meshphysical_vert,fragmentShader:yo.meshphysical_frag},toon:{uniforms:Js([vo.common,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.gradientmap,vo.fog,vo.lights,{emissive:{value:new $n(0)}}]),vertexShader:yo.meshtoon_vert,fragmentShader:yo.meshtoon_frag},matcap:{uniforms:Js([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,{matcap:{value:null}}]),vertexShader:yo.meshmatcap_vert,fragmentShader:yo.meshmatcap_frag},points:{uniforms:Js([vo.points,vo.fog]),vertexShader:yo.points_vert,fragmentShader:yo.points_frag},dashed:{uniforms:Js([vo.common,vo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yo.linedashed_vert,fragmentShader:yo.linedashed_frag},depth:{uniforms:Js([vo.common,vo.displacementmap]),vertexShader:yo.depth_vert,fragmentShader:yo.depth_frag},normal:{uniforms:Js([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,{opacity:{value:1}}]),vertexShader:yo.meshnormal_vert,fragmentShader:yo.meshnormal_frag},sprite:{uniforms:Js([vo.sprite,vo.fog]),vertexShader:yo.sprite_vert,fragmentShader:yo.sprite_frag},background:{uniforms:{uvTransform:{value:new ri},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yo.background_vert,fragmentShader:yo.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:yo.backgroundCube_vert,fragmentShader:yo.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yo.cube_vert,fragmentShader:yo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yo.equirect_vert,fragmentShader:yo.equirect_frag},distanceRGBA:{uniforms:Js([vo.common,vo.displacementmap,{referencePosition:{value:new Di},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yo.distanceRGBA_vert,fragmentShader:yo.distanceRGBA_frag},shadow:{uniforms:Js([vo.lights,vo.fog,{color:{value:new $n(0)},opacity:{value:1}}]),vertexShader:yo.shadow_vert,fragmentShader:yo.shadow_frag}};xo.physical={uniforms:Js([xo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ri},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ri},clearcoatNormalScale:{value:new ei(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ri},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ri},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ri},sheen:{value:0},sheenColor:{value:new $n(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ri},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ri},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ri},transmissionSamplerSize:{value:new ei},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ri},attenuationDistance:{value:0},attenuationColor:{value:new $n(0)},specularColor:{value:new $n(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ri},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ri},anisotropyVector:{value:new ei},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ri}}]),vertexShader:yo.meshphysical_vert,fragmentShader:yo.meshphysical_frag};const bo={r:0,b:0,g:0};function _o(t,e,r,i,n,s,o){const a=new $n(0);let l,c,h=!0===s?0:1,u=null,d=0,p=null;function g(e,r){e.getRGB(bo,Ks(t)),i.buffers.color.setClear(bo.r,bo.g,bo.b,r,o)}return{getClearColor:function(){return a},setClearColor:function(t,e=1){a.set(t),h=e,g(a,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,g(a,h)},render:function(s,A){let y=!1,v=!0===A.isScene?A.background:null;v&&v.isTexture&&(v=(A.backgroundBlurriness>0?r:e).get(v)),null===v?g(a,h):v&&v.isColor&&(g(v,1),y=!0);const x=t.xr.getEnvironmentBlendMode();"additive"===x?i.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===x&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||y)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.mapping===ft)?(void 0===c&&(c=new qs(new Ys(1,1,1),new to({name:"BackgroundCubeMaterial",uniforms:Xs(xo.backgroundCube.uniforms),vertexShader:xo.backgroundCube.vertexShader,fragmentShader:xo.backgroundCube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,c.material.toneMapped=mi.getTransfer(v.colorSpace)!==tr,u===v&&d===v.version&&p===t.toneMapping||(c.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(void 0===l&&(l=new qs(new Ao(2,2),new to({name:"BackgroundMaterial",uniforms:Xs(xo.background.uniforms),vertexShader:xo.background.vertexShader,fragmentShader:xo.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=v,l.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,l.material.toneMapped=mi.getTransfer(v.colorSpace)!==tr,!0===v.matrixAutoUpdate&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),u===v&&d===v.version&&p===t.toneMapping||(l.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),l.layers.enableAll(),s.unshift(l,l.geometry,l.material,0,0,null))}}}function wo(t,e,r,i){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||null!==s,a={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],r=[],i=[];for(let t=0;t=0){const r=n[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===r)return!0;if(r.attribute!==i)return!0;if(i&&r.data!==i.data)return!0;o++}return c.attributesNum!==o||c.index!==i}(n,v,d,x),b&&function(t,e,r,i){const n={},s=e.attributes;let o=0;const a=r.getAttributes();for(const e in a)if(a[e].location>=0){let r=s[e];void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor));const i={};i.attribute=r,r&&r.data&&(i.data=r.data),n[e]=i,o++}c.attributes=n,c.attributesNum=o,c.index=i}(n,v,d,x)}else{const t=!0===l.wireframe;c.geometry===v.id&&c.program===d.id&&c.wireframe===t||(c.geometry=v.id,c.program=d.id,c.wireframe=t,b=!0)}null!==x&&r.update(x,t.ELEMENT_ARRAY_BUFFER),(b||h)&&(h=!1,function(n,s,o,a){if(!1===i.isWebGL2&&(n.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const l=a.attributes,c=o.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.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,l=o.itemSize,c=r.get(o);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||o.gpuType===Lt);if(o.isInterleavedBufferAttribute){const r=o.data,i=r.stride,c=o.offset;if(r.isInstancedInterleavedBuffer){for(let t=0;t0&&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 s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let o=void 0!==r.precision?r.precision:"highp";const a=n(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||e.has("WEBGL_draw_buffers"),c=!0===r.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),m=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),A=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),y=u>0,v=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const r=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:n,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:A,vertexTextures:y,floatFragmentTextures:v,floatVertexTextures:y&&v,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function So(t){const e=this;let r=null,i=0,n=!1,s=!1;const o=new ho,a=new ri,l={value:null,needsUpdate:!1};function c(t,r,i,n){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==n||null===c){const e=i+4*s,n=r.matrixWorldInverse;a.getNormalMatrix(n),(null===c||c.length0),e.numPlanes=i,e.numIntersection=0);else{const t=s?0:i,e=4*t;let n=f.clippingState||null;l.value=n,n=c(u,a,e,h);for(let t=0;t!==e;++t)n[t]=r[t];f.clippingState=n,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function Co(t){let e=new WeakMap;function r(t,e){return e===dt?t.mapping=ht:e===pt&&(t.mapping=ut),t}function i(t){const r=t.target;r.removeEventListener("dispose",i);const n=e.get(r);void 0!==n&&(e.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping;if(s===dt||s===pt){if(e.has(n))return r(e.get(n).texture,n.mapping);{const s=n.image;if(s&&s.height>0){const o=new oo(s.height/2);return o.fromEquirectangularTexture(t,n),e.set(n,o),n.addEventListener("dispose",i),r(o.texture,n.mapping)}return null}}}return n},dispose:function(){e=new WeakMap}}}class To extends eo{constructor(t=-1,e=1,r=1,i=-1,n=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=n,this.far=s,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,r,i,n,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,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),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let n=r-t,s=r+t,o=i+e,a=i-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,s=n+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(n,s,o,a,this.near,this.far,this.coordinateSystem),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}}const Io=[.125,.215,.35,.446,.526,.582],Ro=new To,Bo=new $n;let Lo=null,Po=0,Do=0;const Oo=(1+Math.sqrt(5))/2,ko=1/Oo,Uo=[new Di(1,1,1),new Di(-1,1,1),new Di(1,1,-1),new Di(-1,1,-1),new Di(0,Oo,ko),new Di(0,Oo,-ko),new Di(ko,0,Oo),new Di(-ko,0,Oo),new Di(Oo,ko,0),new Di(-Oo,ko,0)];class No{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,r=.1,i=100){Lo=this._renderer.getRenderTarget(),Po=this._renderer.getActiveCubeFace(),Do=this._renderer.getActiveMipmapLevel(),this._setSize(256);const n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(t,r,i,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=Qo(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Go(),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;tt-4?a=Io[o-t+4-1]:0===o&&(a=0),i.push(a);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,A=new Float32Array(f*p*d),y=new Float32Array(m*p*d),v=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,r,0,e+2/3,r,0,e+2/3,r+1,0,e,r,0,e+2/3,r+1,0,e,r+1,0];A.set(i,f*p*t),y.set(u,m*p*t);const n=[t,t,t,t,t,t];v.set(n,g*p*t)}const x=new Is;x.setAttribute("position",new us(A,f)),x.setAttribute("uv",new us(y,m)),x.setAttribute("faceIndex",new us(v,g)),e.push(x),n>4&&n--}return{lodPlanes:e,sizeLods:r,sigmas:i}}(i)),this._blurMaterial=function(t,e,r){const i=new Float32Array(20),n=new Di(0,1,0);return new to({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},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 \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:y,depthTest:!1,depthWrite:!1})}(i,t,e)}return i}_compileMaterial(t){const e=new qs(this._lodPlanes[0],t);this._renderer.compile(e,Ro)}_sceneToCubeUV(t,e,r,i){const n=new ro(90,1,e,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(Bo),a.toneMapping=et,a.autoClear=!1;const h=new is({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),u=new qs(new Ys,h);let d=!1;const p=t.background;p?p.isColor&&(h.color.copy(p),t.background=null,d=!0):(h.color.copy(Bo),d=!0);for(let e=0;e<6;e++){const r=e%3;0===r?(n.up.set(0,s[e],0),n.lookAt(o[e],0,0)):1===r?(n.up.set(0,0,s[e]),n.lookAt(0,o[e],0)):(n.up.set(0,s[e],0),n.lookAt(0,0,o[e]));const l=this._cubeSize;zo(i,r*l,e>2?l:0,l,l),a.setRenderTarget(i),d&&a.render(u,n),a.render(t,n)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=c,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const r=this._renderer,i=t.mapping===ht||t.mapping===ut;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Qo()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Go());const n=i?this._cubemapMaterial:this._equirectMaterial,s=new qs(this._lodPlanes[0],n);n.uniforms.envMap.value=t;const o=this._cubeSize;zo(e,0,0,3*o,2*o),r.setRenderTarget(e),r.render(s,Ro)}_applyPMREM(t){const e=this._renderer,r=e.autoClear;e.autoClear=!1;for(let e=1;e20&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,r=Math.exp(-e*e/2);m.push(r),0===t?g+=r:tA-4?i-A+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(e),a.render(c,Ro)}}function Fo(t,e,r){const i=new Ci(t,e,r);return i.texture.mapping=ft,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function zo(t,e,r,i,n){t.viewport.set(e,r,i,n),t.scissor.set(e,r,i,n)}function Go(){return new to({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 \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:y,depthTest:!1,depthWrite:!1})}function Qo(){return new to({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:y,depthTest:!1,depthWrite:!1})}function jo(t){let e=new WeakMap,r=null;function i(t){const r=t.target;r.removeEventListener("dispose",i);const n=e.get(r);void 0!==n&&(e.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping,o=s===dt||s===pt,a=s===ht||s===ut;if(o||a){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let i=e.get(n);return null===r&&(r=new No(t)),i=o?r.fromEquirectangular(n,i):r.fromCubemap(n,i),e.set(n,i),i.texture}if(e.has(n))return e.get(n).texture;{const s=n.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;for(let r=0;r<6;r++)void 0!==t[r]&&e++;return 6===e}(s)){null===r&&(r=new No(t));const s=o?r.fromEquirectangular(n):r.fromCubemap(n);return e.set(n,s),n.addEventListener("dispose",i),s.texture}return null}}}return n},dispose:function(){e=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function Vo(t){const e={};function r(r){if(void 0!==e[r])return e[r];let i;switch(r){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(r)}return e[r]=i,i}return{has:function(t){return null!==r(t)},init:function(t){t.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture")},get:function(t){const e=r(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Ho(t,e,r,i){const n={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);for(const t in a.morphAttributes){const r=a.morphAttributes[t];for(let t=0,i=r.length;te.maxTextureSize&&(M=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const S=new Float32Array(E*M*4*p),C=new Ti(S,E,M,p);C.type=Dt,C.needsUpdate=!0;const T=4*w;for(let R=0;R0)return t;const n=e*r;let s=na[n];if(void 0===s&&(s=new Float32Array(n),na[n]=s),0!==e){i.toArray(s,0);for(let i=1,n=0;i!==e;++i)n+=r,t[i].toArray(s,n)}return s}function ha(t,e){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r":" "} ${n}: ${r[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return n}function ll(t,e){const r=function(t){const e=mi.getPrimaries(mi.workingColorSpace),r=mi.getPrimaries(t);let i;switch(e===r?i="":e===rr&&r===er?i="LinearDisplayP3ToLinearSRGB":e===er&&r===rr&&(i="LinearSRGBToLinearDisplayP3"),t){case Xe:case Ke:return[i,"LinearTransferOETF"];case Ye:case Je:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${r[0]}( ${r[1]}( value ) ); }`}function cl(t,e){let r;switch(e){case rt:r="Linear";break;case it:r="Reinhard";break;case nt:r="OptimizedCineon";break;case st:r="ACESFilmic";break;case ot:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),r="Linear"}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function hl(t){return""!==t}function ul(t,e){const r=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,r).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 dl(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const pl=/^[ \t]*#include +<([\w\d./]+)>/gm;function fl(t){return t.replace(pl,gl)}const ml=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function gl(t,e){let r=yo[e];if(void 0===r){const t=ml.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");r=yo[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return fl(r)}const Al=/#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 yl(t){return t.replace(Al,vl)}function vl(t,e,r,i){let n="";for(let t=parseInt(e);t0&&(v+="\n"),x=[g,"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A].filter(hl).join("\n"),x.length>0&&(x+="\n")):(v=[xl(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.batching?"#define USE_BATCHING":"",r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.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(hl).join("\n"),x=[g,xl(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+h:"",r.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==et?"#define TONE_MAPPING":"",r.toneMapping!==et?yo.tonemapping_pars_fragment:"",r.toneMapping!==et?cl("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",yo.colorspace_pars_fragment,ll("linearToOutputTexel",r.outputColorSpace),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(hl).join("\n")),o=fl(o),o=ul(o,r),o=dl(o,r),a=fl(a),a=ul(a,r),a=dl(a,r),o=yl(o),a=yl(a),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(b="#version 300 es\n",v=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,x=["precision mediump sampler2DArray;","#define varying in",r.glslVersion===Ur?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===Ur?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const _=b+v+o,w=b+x+a,E=nl(n,n.VERTEX_SHADER,_),M=nl(n,n.FRAGMENT_SHADER,w);function S(e){if(t.debug.checkShaderErrors){const r=n.getProgramInfoLog(y).trim(),i=n.getShaderInfoLog(E).trim(),s=n.getShaderInfoLog(M).trim();let o=!0,a=!0;if(!1===n.getProgramParameter(y,n.LINK_STATUS))if(o=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(n,y,E,M);else{const t=al(n,E,"vertex"),e=al(n,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(y,n.VALIDATE_STATUS)+"\n\nProgram Info Log: "+r+"\n"+t+"\n"+e)}else""!==r?console.warn("THREE.WebGLProgram: Program Info Log:",r):""!==i&&""!==s||(a=!1);a&&(e.diagnostics={runnable:o,programLog:r,vertexShader:{log:i,prefix:v},fragmentShader:{log:s,prefix:x}})}n.deleteShader(E),n.deleteShader(M),C=new il(n,y),T=function(t,e){const r={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let n=0;n0,Y=s.clearcoat>0,X=s.iridescence>0,J=s.sheen>0,K=s.transmission>0,$=Z&&!!s.anisotropyMap,tt=Y&&!!s.clearcoatMap,rt=Y&&!!s.clearcoatNormalMap,it=Y&&!!s.clearcoatRoughnessMap,nt=X&&!!s.iridescenceMap,st=X&&!!s.iridescenceThicknessMap,ot=J&&!!s.sheenColorMap,at=J&&!!s.sheenRoughnessMap,lt=!!s.specularMap,ct=!!s.specularColorMap,ht=!!s.specularIntensityMap,ut=K&&!!s.transmissionMap,dt=K&&!!s.thicknessMap,pt=!!s.gradientMap,mt=!!s.alphaMap,gt=s.alphaTest>0,At=!!s.alphaHash,yt=!!s.extensions,vt=!!_.attributes.uv1,xt=!!_.attributes.uv2,bt=!!_.attributes.uv3;let _t=et;return s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(_t=t.toneMapping)),{isWebGL2:h,shaderID:S,shaderType:s.type,shaderName:s.name,vertexShader:I,fragmentShader:R,defines:s.defines,customVertexShaderID:B,customFragmentShaderID:L,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,batching:k,instancing:O,instancingColor:O&&null!==x.instanceColor,supportsVertexTextures:d,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Xe,map:U,matcap:N,envMap:F,envMapMode:F&&E.mapping,envMapCubeUVHeight:M,aoMap:z,lightMap:G,bumpMap:Q,normalMap:j,displacementMap:d&&V,emissiveMap:H,normalMapObjectSpace:j&&s.normalMapType===qe,normalMapTangentSpace:j&&s.normalMapType===We,metalnessMap:W,roughnessMap:q,anisotropy:Z,anisotropyMap:$,clearcoat:Y,clearcoatMap:tt,clearcoatNormalMap:rt,clearcoatRoughnessMap:it,iridescence:X,iridescenceMap:nt,iridescenceThicknessMap:st,sheen:J,sheenColorMap:ot,sheenRoughnessMap:at,specularMap:lt,specularColorMap:ct,specularIntensityMap:ht,transmission:K,transmissionMap:ut,thicknessMap:dt,gradientMap:pt,opaque:!1===s.transparent&&s.blending===v,alphaMap:mt,alphaTest:gt,alphaHash:At,combine:s.combine,mapUv:U&&A(s.map.channel),aoMapUv:z&&A(s.aoMap.channel),lightMapUv:G&&A(s.lightMap.channel),bumpMapUv:Q&&A(s.bumpMap.channel),normalMapUv:j&&A(s.normalMap.channel),displacementMapUv:V&&A(s.displacementMap.channel),emissiveMapUv:H&&A(s.emissiveMap.channel),metalnessMapUv:W&&A(s.metalnessMap.channel),roughnessMapUv:q&&A(s.roughnessMap.channel),anisotropyMapUv:$&&A(s.anisotropyMap.channel),clearcoatMapUv:tt&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:rt&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:it&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:st&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:ot&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:at&&A(s.sheenRoughnessMap.channel),specularMapUv:lt&&A(s.specularMap.channel),specularColorMapUv:ct&&A(s.specularColorMap.channel),specularIntensityMapUv:ht&&A(s.specularIntensityMap.channel),transmissionMapUv:ut&&A(s.transmissionMap.channel),thicknessMapUv:dt&&A(s.thicknessMap.channel),alphaMapUv:mt&&A(s.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(j||Z),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,vertexUv1s:vt,vertexUv2s:xt,vertexUv3s:bt,pointsUvs:!0===x.isPoints&&!!_.attributes.uv&&(U||mt),fog:!!b,useFog:!0===s.fog,fogExp2:b&&b.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:T,morphTextureStride:P,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:_t,useLegacyLights:t._useLegacyLights,decodeVideoTexture:U&&!0===s.map.isVideoTexture&&mi.getTransfer(s.map.colorSpace)===tr,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===m,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:yt&&!0===s.extensions.derivatives,extensionFragDepth:yt&&!0===s.extensions.fragDepth,extensionDrawBuffers:yt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:yt&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const r=[];if(e.shaderID?r.push(e.shaderID):(r.push(e.customVertexShaderID),r.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)r.push(t),r.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(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.anisotropyMapUv),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.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(r,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0),e.supportsVertexTextures&&a.enable(1),e.instancing&&a.enable(2),e.instancingColor&&a.enable(3),e.matcap&&a.enable(4),e.envMap&&a.enable(5),e.normalMapObjectSpace&&a.enable(6),e.normalMapTangentSpace&&a.enable(7),e.clearcoat&&a.enable(8),e.iridescence&&a.enable(9),e.alphaTest&&a.enable(10),e.vertexColors&&a.enable(11),e.vertexAlphas&&a.enable(12),e.vertexUv1s&&a.enable(13),e.vertexUv2s&&a.enable(14),e.vertexUv3s&&a.enable(15),e.vertexTangents&&a.enable(16),e.anisotropy&&a.enable(17),e.alphaHash&&a.enable(18),e.batching&&a.enable(19),t.push(a.mask),a.disableAll(),e.fog&&a.enable(0),e.useFog&&a.enable(1),e.flatShading&&a.enable(2),e.logarithmicDepthBuffer&&a.enable(3),e.skinning&&a.enable(4),e.morphTargets&&a.enable(5),e.morphNormals&&a.enable(6),e.morphColors&&a.enable(7),e.premultipliedAlpha&&a.enable(8),e.shadowMapEnabled&&a.enable(9),e.useLegacyLights&&a.enable(10),e.doubleSided&&a.enable(11),e.flipSided&&a.enable(12),e.useDepthPacking&&a.enable(13),e.dithering&&a.enable(14),e.transmission&&a.enable(15),e.sheen&&a.enable(16),e.opaque&&a.enable(17),e.pointsUvs&&a.enable(18),e.decodeVideoTexture&&a.enable(19),t.push(a.mask)}(r,e),r.push(t.outputColorSpace)),r.push(e.customProgramCacheKey),r.join()},getUniforms:function(t){const e=f[t.type];let r;if(e){const t=xo[e];r=$s.clone(t.uniforms)}else r=t.uniforms;return r},acquireProgram:function(e,r){let i;for(let t=0,e=c.length;t0?i.push(h):!0===o.transparent?n.push(h):r.push(h)},unshift:function(t,e,o,a,l,c){const h=s(t,e,o,a,l,c);o.transmission>0?i.unshift(h):!0===o.transparent?n.unshift(h):r.unshift(h)},finish:function(){for(let r=e,i=t.length;r1&&r.sort(t||Cl),i.length>1&&i.sort(e||Tl),n.length>1&&n.sort(e||Tl)}}}function Rl(){let t=new WeakMap;return{get:function(e,r){const i=t.get(e);let n;return void 0===i?(n=new Il,t.set(e,[n])):r>=i.length?(n=new Il,i.push(n)):n=i[r],n},dispose:function(){t=new WeakMap}}}function Bl(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let r;switch(e.type){case"DirectionalLight":r={direction:new Di,color:new $n};break;case"SpotLight":r={position:new Di,direction:new Di,color:new $n,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new Di,color:new $n,distance:0,decay:0};break;case"HemisphereLight":r={direction:new Di,skyColor:new $n,groundColor:new $n};break;case"RectAreaLight":r={color:new $n,position:new Di,halfWidth:new Di,halfHeight:new Di}}return t[e.id]=r,r}}}let Ll=0;function Pl(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Dl(t,e){const r=new Bl,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let r;switch(e.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ei};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ei,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=r,r}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-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,numLightProbes:0};for(let t=0;t<9;t++)n.probe.push(new Di);const s=new Di,o=new un,a=new un;return{setup:function(s,o){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,d=0,p=0,f=0,m=0,g=0,A=0,y=0,v=0,x=0;s.sort(Pl);const b=!0===o?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(n.rectAreaLTC1=vo.LTC_FLOAT_1,n.rectAreaLTC2=vo.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(n.rectAreaLTC1=vo.LTC_HALF_1,n.rectAreaLTC2=vo.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 _=n.hash;_.directionalLength===h&&_.pointLength===u&&_.spotLength===d&&_.rectAreaLength===p&&_.hemiLength===f&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===A&&_.numSpotMaps===y&&_.numLightProbes===x||(n.directional.length=h,n.spot.length=d,n.rectArea.length=p,n.point.length=u,n.hemi.length=f,n.directionalShadow.length=m,n.directionalShadowMap.length=m,n.pointShadow.length=g,n.pointShadowMap.length=g,n.spotShadow.length=A,n.spotShadowMap.length=A,n.directionalShadowMatrix.length=m,n.pointShadowMatrix.length=g,n.spotLightMatrix.length=A+y-v,n.spotLightMap.length=y,n.numSpotLightShadowsWithMaps=v,n.numLightProbes=x,_.directionalLength=h,_.pointLength=u,_.spotLength=d,_.rectAreaLength=p,_.hemiLength=f,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=A,_.numSpotMaps=y,_.numLightProbes=x,n.version=Ll++)},setupView:function(t,e){let r=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(o=new Ol(t,e),s.push(o)):o=s[n],o},dispose:function(){r=new WeakMap}}}class Ul extends rs{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ve,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}}class Nl extends rs{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 Fl(t,e,r){let i=new fo;const n=new ei,s=new ei,o=new Mi,a=new Ul({depthPacking:He}),l=new Nl,c={},h=r.maxTextureSize,d={[f]:m,[m]:f,[g]:g},A=new to({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ei},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=A.clone();v.defines.HORIZONTAL_PASS=1;const x=new Is;x.setAttribute("position",new us(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new qs(x,A),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=u;let w=this.type;function E(r,i){const s=e.update(b);A.defines.VSM_SAMPLES!==r.blurSamples&&(A.defines.VSM_SAMPLES=r.blurSamples,v.defines.VSM_SAMPLES=r.blurSamples,A.needsUpdate=!0,v.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new Ci(n.x,n.y)),A.uniforms.shadow_pass.value=r.map.texture,A.uniforms.resolution.value=r.mapSize,A.uniforms.radius.value=r.radius,t.setRenderTarget(r.mapPass),t.clear(),t.renderBufferDirect(i,null,s,A,b,null),v.uniforms.shadow_pass.value=r.mapPass.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,t.setRenderTarget(r.map),t.clear(),t.renderBufferDirect(i,null,s,v,b,null)}function M(e,r,i,n){let s=null;const o=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)s=o;else if(s=!0===i.isPointLight?l:a,t.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0){const t=s.uuid,e=r.uuid;let i=c[t];void 0===i&&(i={},c[t]=i);let n=i[e];void 0===n&&(n=s.clone(),i[e]=n),s=n}return s.visible=r.visible,s.wireframe=r.wireframe,s.side=n===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:d[r.side],s.alphaMap=r.alphaMap,s.alphaTest=r.alphaTest,s.map=r.map,s.clipShadows=r.clipShadows,s.clippingPlanes=r.clippingPlanes,s.clipIntersection=r.clipIntersection,s.displacementMap=r.displacementMap,s.displacementScale=r.displacementScale,s.displacementBias=r.displacementBias,s.wireframeLinewidth=r.wireframeLinewidth,s.linewidth=r.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial&&(t.properties.get(s).light=i),s}function S(r,n,s,o,a){if(!1===r.visible)return;if(r.layers.test(n.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&a===p)&&(!r.frustumCulled||i.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);const i=e.update(r),l=r.material;if(Array.isArray(l)){const e=i.groups;for(let c=0,h=e.length;ch||n.y>h)&&(n.x>h&&(s.x=Math.floor(h/g.x),n.x=s.x*g.x,u.mapSize.x=s.x),n.y>h&&(s.y=Math.floor(h/g.y),n.y=s.y*g.y,u.mapSize.y=s.y)),null===u.map||!0===f||!0===m){const t=this.type!==p?{minFilter:yt,magFilter:yt}:{};null!==u.map&&u.map.dispose(),u.map=new Ci(n.x,n.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const A=u.getViewportCount();for(let t=0;t=1):-1!==yt.indexOf("OpenGL ES")&&(At=parseFloat(/^OpenGL ES (\d)/.exec(yt)[1]),gt=At>=2);let vt=null,xt={};const bt=t.getParameter(t.SCISSOR_BOX),_t=t.getParameter(t.VIEWPORT),wt=(new Mi).fromArray(bt),Et=(new Mi).fromArray(_t);function Mt(e,r,n,s){const o=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;ai||t.height>i)&&(n=i/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 i=e?Jr:Math.floor,s=i(n*t.width),o=i(n*t.height);void 0===m&&(m=y(s,o));const a=r?y(s,o):m;return a.width=s,a.height=o,a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),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 Xr(t.width)&&Xr(t.height)}function b(t,e){return t.generateMipmaps&&e&&t.minFilter!==yt&&t.minFilter!==wt}function _(e){t.generateMipmap(e)}function w(r,i,n,s,o=!1){if(!1===a)return i;if(null!==r){if(void 0!==t[r])return t[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let l=i;if(i===t.RED&&(n===t.FLOAT&&(l=t.R32F),n===t.HALF_FLOAT&&(l=t.R16F),n===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RED_INTEGER&&(n===t.UNSIGNED_BYTE&&(l=t.R8UI),n===t.UNSIGNED_SHORT&&(l=t.R16UI),n===t.UNSIGNED_INT&&(l=t.R32UI),n===t.BYTE&&(l=t.R8I),n===t.SHORT&&(l=t.R16I),n===t.INT&&(l=t.R32I)),i===t.RG&&(n===t.FLOAT&&(l=t.RG32F),n===t.HALF_FLOAT&&(l=t.RG16F),n===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA){const e=o?$e:mi.getTransfer(s);n===t.FLOAT&&(l=t.RGBA32F),n===t.HALF_FLOAT&&(l=t.RGBA16F),n===t.UNSIGNED_BYTE&&(l=e===tr?t.SRGB8_ALPHA8:t.RGBA8),n===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),n===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)}return l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function E(t,e,r){return!0===b(t,r)||t.isFramebufferTexture&&t.minFilter!==yt&&t.minFilter!==wt?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===yt||e===vt||e===bt?t.NEAREST:t.LINEAR}function S(t){const e=t.target;e.removeEventListener("dispose",S),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const r=t.source,n=g.get(r);if(n){const i=n[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&T(t),0===Object.keys(n).length&&g.delete(r)}i.remove(t)}(e),e.isVideoTexture&&f.delete(e)}function C(e){const r=e.target;r.removeEventListener("dispose",C),function(e){const r=e.texture,n=i.get(e),s=i.get(r);if(void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let r=0;r0&&s.__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 k(s,e,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+n)}const B={[mt]:t.REPEAT,[gt]:t.CLAMP_TO_EDGE,[At]:t.MIRRORED_REPEAT},L={[yt]:t.NEAREST,[vt]:t.NEAREST_MIPMAP_NEAREST,[bt]:t.NEAREST_MIPMAP_LINEAR,[wt]:t.LINEAR,[Et]:t.LINEAR_MIPMAP_NEAREST,[St]:t.LINEAR_MIPMAP_LINEAR},P={[vr]:t.NEVER,[Sr]:t.ALWAYS,[xr]:t.LESS,[_r]:t.LEQUAL,[br]:t.EQUAL,[Mr]:t.GEQUAL,[wr]:t.GREATER,[Er]:t.NOTEQUAL};function D(r,s,o){if(o?(t.texParameteri(r,t.TEXTURE_WRAP_S,B[s.wrapS]),t.texParameteri(r,t.TEXTURE_WRAP_T,B[s.wrapT]),r!==t.TEXTURE_3D&&r!==t.TEXTURE_2D_ARRAY||t.texParameteri(r,t.TEXTURE_WRAP_R,B[s.wrapR]),t.texParameteri(r,t.TEXTURE_MAG_FILTER,L[s.magFilter]),t.texParameteri(r,t.TEXTURE_MIN_FILTER,L[s.minFilter])):(t.texParameteri(r,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(r,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r!==t.TEXTURE_3D&&r!==t.TEXTURE_2D_ARRAY||t.texParameteri(r,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===gt&&s.wrapT===gt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(r,t.TEXTURE_MAG_FILTER,M(s.magFilter)),t.texParameteri(r,t.TEXTURE_MIN_FILTER,M(s.minFilter)),s.minFilter!==yt&&s.minFilter!==wt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(r,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(r,t.TEXTURE_COMPARE_FUNC,P[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const o=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===yt)return;if(s.minFilter!==bt&&s.minFilter!==St)return;if(s.type===Dt&&!1===e.has("OES_texture_float_linear"))return;if(!1===a&&s.type===Ot&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(r,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,n.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function O(e,r){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",S));const n=r.source;let s=g.get(n);void 0===s&&(s={},g.set(n,s));const a=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()}(r);if(a!==e.__cacheKey){void 0===s[a]&&(s[a]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,i=!0),s[a].usedTimes++;const n=s[e.__cacheKey];void 0!==n&&(s[e.__cacheKey].usedTimes--,0===n.usedTimes&&T(r)),e.__cacheKey=a,e.__webglTexture=s[a].texture}return i}function k(e,n,o){let l=t.TEXTURE_2D;(n.isDataArrayTexture||n.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),n.isData3DTexture&&(l=t.TEXTURE_3D);const c=O(e,n),u=n.source;r.bindTexture(l,e.__webglTexture,t.TEXTURE0+o);const d=i.get(u);if(u.version!==d.__version||!0===c){r.activeTexture(t.TEXTURE0+o);const e=mi.getPrimaries(mi.workingColorSpace),i=n.colorSpace===Ze?null:mi.getPrimaries(n.colorSpace),p=n.colorSpace===Ze||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const f=function(t){return!a&&(t.wrapS!==gt||t.wrapT!==gt||t.minFilter!==yt&&t.minFilter!==wt)}(n)&&!1===x(n.image);let m=v(n.image,f,!1,h);m=Q(n,m);const g=x(m)||a,A=s.convert(n.format,n.colorSpace);let y,M=s.convert(n.type),S=w(n.internalFormat,A,M,n.colorSpace,n.isVideoTexture);D(l,n,g);const C=n.mipmaps,T=a&&!0!==n.isVideoTexture&&S!==ne,I=void 0===d.__version||!0===c,R=E(n,m,g);if(n.isDepthTexture)S=t.DEPTH_COMPONENT,a?S=n.type===Dt?t.DEPTH_COMPONENT32F:n.type===Pt?t.DEPTH_COMPONENT24:n.type===Nt?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:n.type===Dt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===jt&&S===t.DEPTH_COMPONENT&&n.type!==Bt&&n.type!==Pt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Pt,M=s.convert(n.type)),n.format===Vt&&S===t.DEPTH_COMPONENT&&(S=t.DEPTH_STENCIL,n.type!==Nt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Nt,M=s.convert(n.type))),I&&(T?r.texStorage2D(t.TEXTURE_2D,1,S,m.width,m.height):r.texImage2D(t.TEXTURE_2D,0,S,m.width,m.height,0,A,M,null));else if(n.isDataTexture)if(C.length>0&&g){T&&I&&r.texStorage2D(t.TEXTURE_2D,R,S,C[0].width,C[0].height);for(let e=0,i=C.length;e>=1,i>>=1}}else if(C.length>0&&g){T&&I&&r.texStorage2D(t.TEXTURE_2D,R,S,C[0].width,C[0].height);for(let e=0,i=C.length;e>c),i=Math.max(1,n.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?r.texImage3D(l,c,p,e,i,n.depth,0,h,u,null):r.texImage2D(l,c,p,e,i,0,h,u,null)}r.bindFramebuffer(t.FRAMEBUFFER,e),G(n)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,a,l,i.get(o).__webglTexture,0,z(n)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,a,l,i.get(o).__webglTexture,c),r.bindFramebuffer(t.FRAMEBUFFER,null)}function N(e,r,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),r.depthBuffer&&!r.stencilBuffer){let n=!0===a?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(i||G(r)){const e=r.depthTexture;e&&e.isDepthTexture&&(e.type===Dt?n=t.DEPTH_COMPONENT32F:e.type===Pt&&(n=t.DEPTH_COMPONENT24));const i=z(r);G(r)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,n,r.width,r.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,n,r.width,r.height)}else t.renderbufferStorage(t.RENDERBUFFER,n,r.width,r.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(r.depthBuffer&&r.stencilBuffer){const n=z(r);i&&!1===G(r)?t.renderbufferStorageMultisample(t.RENDERBUFFER,n,t.DEPTH24_STENCIL8,r.width,r.height):G(r)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,n,t.DEPTH24_STENCIL8,r.width,r.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,r.width,r.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===r.isWebGLMultipleRenderTargets?r.texture:[r.texture];for(let n=0;n0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function Q(t,r){const i=t.colorSpace,n=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Nr||i!==Xe&&i!==Ze&&(mi.getTransfer(i)===tr?!1===a?!0===e.has("EXT_sRGB")&&n===zt?(t.format=Nr,t.minFilter=wt,t.generateMipmaps=!1):r=vi.sRGBToLinear(r):n===zt&&s===Tt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),r}this.allocateTextureUnit=function(){const t=I;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),I+=1,t},this.resetTextureUnits=function(){I=0},this.setTexture2D=R,this.setTexture2DArray=function(e,n){const s=i.get(e);e.version>0&&s.__version!==e.version?k(s,e,n):r.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+n)},this.setTexture3D=function(e,n){const s=i.get(e);e.version>0&&s.__version!==e.version?k(s,e,n):r.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+n)},this.setTextureCube=function(e,n){const o=i.get(e);e.version>0&&o.__version!==e.version?function(e,n,o){if(6!==n.image.length)return;const l=O(e,n),h=n.source;r.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+o);const u=i.get(h);if(h.version!==u.__version||!0===l){r.activeTexture(t.TEXTURE0+o);const e=mi.getPrimaries(mi.workingColorSpace),i=n.colorSpace===Ze?null:mi.getPrimaries(n.colorSpace),d=n.colorSpace===Ze||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const p=n.isCompressedTexture||n.image[0].isCompressedTexture,f=n.image[0]&&n.image[0].isDataTexture,m=[];for(let t=0;t<6;t++)m[t]=p||f?f?n.image[t].image:n.image[t]:v(n.image[t],!1,!0,c),m[t]=Q(n,m[t]);const g=m[0],A=x(g)||a,y=s.convert(n.format,n.colorSpace),M=s.convert(n.type),S=w(n.internalFormat,y,M,n.colorSpace),C=a&&!0!==n.isVideoTexture,T=void 0===u.__version||!0===l;let I,R=E(n,g,A);if(D(t.TEXTURE_CUBE_MAP,n,A),p){C&&T&&r.texStorage2D(t.TEXTURE_CUBE_MAP,R,S,g.width,g.height);for(let e=0;e<6;e++){I=m[e].mipmaps;for(let i=0;i0&&R++,r.texStorage2D(t.TEXTURE_CUBE_MAP,R,S,m[0].width,m[0].height));for(let e=0;e<6;e++)if(f){C?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,m[e].width,m[e].height,y,M,m[e].data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,m[e].width,m[e].height,0,y,M,m[e].data);for(let i=0;i0){c.__webglFramebuffer[e]=[];for(let r=0;r0){c.__webglFramebuffer=[];for(let e=0;e0&&!1===G(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],r.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let r=0;r0)for(let i=0;i0)for(let r=0;r0&&!1===G(e)){const n=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,o=e.height;let a=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;ea+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&o<=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,r),null!==n&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,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!==o&&(i=e.getPose(t.targetRaySpace,r),null===i&&null!==n&&(i=n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Hl)))}return null!==o&&(o.visible=null!==i),null!==a&&(a.visible=null!==n),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const r=new Vl;r.matrixAutoUpdate=!1,r.visible=!1,t.joints[e.jointName]=r,t.add(r)}return t.joints[e.jointName]}}class ql extends Gr{constructor(t,e){super();const r=this;let i=null,n=1,s=null,o="local-floor",a=1,l=null,c=null,h=null,u=null,d=null,p=null;const f=e.getContextAttributes();let m=null,g=null;const A=[],y=[],v=new ei;let x=null;const b=new ro;b.layers.enable(1),b.viewport=new Mi;const _=new ro;_.layers.enable(2),_.viewport=new Mi;const w=[b,_],E=new jl;E.layers.enable(1),E.layers.enable(2);let M=null,S=null;function C(t){const e=y.indexOf(t.inputSource);if(-1===e)return;const r=A[e];void 0!==r&&(r.update(t.inputSource,t.frame,l||s),r.dispatchEvent({type:t.type,data:t.inputSource}))}function T(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",T),i.removeEventListener("inputsourceschange",I);for(let t=0;t=0&&(y[i]=null,A[i].disconnect(r))}for(let e=0;e=y.length){y.push(r),i=t;break}if(null===y[t]){y[t]=r,i=t;break}}if(-1===i)break}const n=A[i];n&&n.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getGripSpace()},this.getHand=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){n=t,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(m=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",T),i.addEventListener("inputsourceschange",I),!0!==f.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(v),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const r={antialias:void 0!==i.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:n};d=new XRWebGLLayer(i,e,r),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),g=new Ci(d.framebufferWidth,d.framebufferHeight,{format:zt,type:Tt,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil})}else{let r=null,s=null,o=null;f.depth&&(o=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,r=f.stencil?Vt:jt,s=f.stencil?Nt:Pt);const a={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:n};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(a),i.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),g=new Ci(u.textureWidth,u.textureHeight,{format:zt,type:Tt,depthTexture:new Ko(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0}),t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(a),l=null,s=await i.requestReferenceSpace(o),D.setContext(i),D.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const R=new Di,B=new Di;function L(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===i)return;E.near=_.near=b.near=t.near,E.far=_.far=b.far=t.far,M===E.near&&S===E.far||(i.updateRenderState({depthNear:E.near,depthFar:E.far}),M=E.near,S=E.far);const e=t.parent,r=E.cameras;L(E,e);for(let t=0;t0&&(i.alphaTest.value=n.alphaTest);const s=e.get(n).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*e,r(n.lightMap,i.lightMapTransform)}n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity,r(n.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,r){r.color.getRGB(e.fogColor.value,Ks(t)),r.isFog?(e.fogNear.value=r.near,e.fogFar.value=r.far):r.isFogExp2&&(e.fogDensity.value=r.density)},refreshMaterialUniforms:function(t,n,s,o,a){n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(t,n):n.isMeshToonMaterial?(i(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,n)):n.isMeshPhongMaterial?(i(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,n)):n.isMeshStandardMaterial?(i(t,n),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,r(i.metalnessMap,t.metalnessMapTransform)),t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,r(i.roughnessMap,t.roughnessMapTransform));e.get(i).envMap&&(t.envMapIntensity.value=i.envMapIntensity)}(t,n),n.isMeshPhysicalMaterial&&function(t,e,i){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,r(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,r(e.sheenRoughnessMap,t.sheenRoughnessMapTransform))),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,r(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,r(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,r(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===m&&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,r(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,r(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform))),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,r(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,r(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,r(e.anisotropyMap,t.anisotropyMapTransform))),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,r(e.specularColorMap,t.specularColorMapTransform)),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,r(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,n,a)):n.isMeshMatcapMaterial?(i(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,n)):n.isMeshDepthMaterial?i(t,n):n.isMeshDistanceMaterial?(i(t,n),function(t,r){const i=e.get(r).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,n)):n.isMeshNormalMaterial?i(t,n):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,r(e.map,t.mapTransform))}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map,r(e.map,t.uvTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap,r(e.alphaMap,t.alphaMapTransform)),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,n,s,o):n.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,r(e.map,t.mapTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap,r(e.alphaMap,t.alphaMapTransform)),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Yl(t,e,r,i){let n={},s={},o=[];const a=r.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,r){const i=t.value;if(void 0===r[e]){if("number"==typeof i)r[e]=i;else{const t=Array.isArray(i)?i:[i],n=[];for(let e=0;e0&&(i=r%16,0!==i&&16-i-s.boundary<0&&(r+=16-i,n.__offset=r)),r+=s.storage}i=r%16,i>0&&(r+=16-i),t.__size=r,t.__cache={}}(r),d=function(e){const r=function(){for(let t=0;t0),u=!!r.morphAttributes.position,d=!!r.morphAttributes.normal,p=!!r.morphAttributes.color;let f=et;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=_.toneMapping));const m=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,g=void 0!==m?m.length:0,A=rt.get(i),y=v.state.lights;if(!0===j&&(!0===V||t!==T)){const e=t===T&&i.id===C;pt.setState(i,t,e)}let x=!1;i.version===A.__version?A.needsLights&&A.lightsStateVersion!==y.state.version||A.outputColorSpace!==a||n.isBatchedMesh&&!1===A.batching?x=!0:n.isBatchedMesh||!0!==A.batching?n.isInstancedMesh&&!1===A.instancing?x=!0:n.isInstancedMesh||!0!==A.instancing?n.isSkinnedMesh&&!1===A.skinning?x=!0:n.isSkinnedMesh||!0!==A.skinning?n.isInstancedMesh&&!0===A.instancingColor&&null===n.instanceColor||n.isInstancedMesh&&!1===A.instancingColor&&null!==n.instanceColor||A.envMap!==l||!0===i.fog&&A.fog!==s?x=!0:void 0===A.numClippingPlanes||A.numClippingPlanes===pt.numPlanes&&A.numIntersection===pt.numIntersection?(A.vertexAlphas!==c||A.vertexTangents!==h||A.morphTargets!==u||A.morphNormals!==d||A.morphColors!==p||A.toneMapping!==f||!0===K.isWebGL2&&A.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,A.__version=i.version);let b=A.currentProgram;!0===x&&(b=Kt(i,e,n));let w=!1,E=!1,M=!1;const I=b.getUniforms(),R=A.uniforms;if($.useProgram(b.program)&&(w=!0,E=!0,M=!0),i.id!==C&&(C=i.id,E=!0),w||T!==t){I.setValue(_t,"projectionMatrix",t.projectionMatrix),I.setValue(_t,"viewMatrix",t.matrixWorldInverse);const e=I.map.cameraPosition;void 0!==e&&e.setValue(_t,Z.setFromMatrixPosition(t.matrixWorld)),K.logarithmicDepthBuffer&&I.setValue(_t,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&I.setValue(_t,"isOrthographic",!0===t.isOrthographicCamera),T!==t&&(T=t,E=!0,M=!0)}if(n.isSkinnedMesh){I.setOptional(_t,n,"bindMatrix"),I.setOptional(_t,n,"bindMatrixInverse");const t=n.skeleton;t&&(K.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),I.setValue(_t,"boneTexture",t.boneTexture,it)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}n.isBatchedMesh&&(I.setOptional(_t,n,"batchingTexture"),I.setValue(_t,"batchingTexture",n._matricesTexture,it));const B=r.morphAttributes;var L,P;if((void 0!==B.position||void 0!==B.normal||void 0!==B.color&&!0===K.isWebGL2)&>.update(n,r,b),(E||A.receiveShadow!==n.receiveShadow)&&(A.receiveShadow=n.receiveShadow,I.setValue(_t,"receiveShadow",n.receiveShadow)),i.isMeshGouraudMaterial&&null!==i.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),E&&(I.setValue(_t,"toneMappingExposure",_.toneMappingExposure),A.needsLights&&(P=M,(L=R).ambientLightColor.needsUpdate=P,L.lightProbe.needsUpdate=P,L.directionalLights.needsUpdate=P,L.directionalLightShadows.needsUpdate=P,L.pointLights.needsUpdate=P,L.pointLightShadows.needsUpdate=P,L.spotLights.needsUpdate=P,L.spotLightShadows.needsUpdate=P,L.rectAreaLights.needsUpdate=P,L.hemisphereLights.needsUpdate=P),s&&!0===i.fog&&ht.refreshFogUniforms(R,s),ht.refreshMaterialUniforms(R,i,k,O,H),il.upload(_t,$t(A),R,it)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(il.upload(_t,$t(A),R,it),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&I.setValue(_t,"center",n.center),I.setValue(_t,"modelViewMatrix",n.modelViewMatrix),I.setValue(_t,"normalMatrix",n.normalMatrix),I.setValue(_t,"modelMatrix",n.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,r=t.length;e{function r(){i.forEach((function(t){rt.get(t).currentProgram.isReady()&&i.delete(t)})),0!==i.size?setTimeout(r,10):e(t)}null!==J.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)}))};let Gt=null;function Qt(){Vt.stop()}function jt(){Vt.start()}const Vt=new mo;function Ht(t,e,r,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)r=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Q.intersectsSprite(t)){i&&Z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(W);const e=lt.update(t),n=t.material;n.visible&&y.push(t,e,n,r,Z.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Q.intersectsObject(t))){const e=lt.update(t),n=t.material;if(i&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),Z.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),Z.copy(e.boundingSphere.center)),Z.applyMatrix4(t.matrixWorld).applyMatrix4(W)),Array.isArray(n)){const i=e.groups;for(let s=0,o=i.length;s0&&function(t,e,r,i){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;const n=K.isWebGL2;null===H&&(H=new Ci(1,1,{generateMipmaps:!0,type:J.has("EXT_color_buffer_half_float")?Ot:Tt,minFilter:St,samples:n?4:0})),_.getDrawingBufferSize(q),n?H.setSize(q.x,q.y):H.setSize(Jr(q.x),Jr(q.y));const s=_.getRenderTarget();_.setRenderTarget(H),_.getClearColor(L),P=_.getClearAlpha(),P<1&&_.setClearColor(16777215,.5),_.clear();const o=_.toneMapping;_.toneMapping=et,Xt(t,r,i),it.updateMultisampleRenderTarget(H),it.updateRenderTargetMipmap(H);let a=!1;for(let t=0,n=e.length;t0&&Xt(n,e,r),s.length>0&&Xt(s,e,r),o.length>0&&Xt(o,e,r),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function Xt(t,e,r){const i=!0===e.isScene?e.overrideMaterial:null;for(let n=0,s=t.length;n0?b[b.length-1]:null,x.pop(),y=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,r){rt.get(t.texture).__webglTexture=e,rt.get(t.depthTexture).__webglTexture=r;const i=rt.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===r,i.__autoAllocateDepthBuffer||!0===J.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const r=rt.get(t);r.__webglFramebuffer=e,r.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,r=0){S=t,E=e,M=r;let i=!0,n=null,s=!1,o=!1;if(t){const a=rt.get(t);void 0!==a.__useDefaultFramebuffer?($.bindFramebuffer(_t.FRAMEBUFFER,null),i=!1):void 0===a.__webglFramebuffer?it.setupRenderTarget(t):a.__hasExternalTextures&&it.rebindTextures(t,rt.get(t.texture).__webglTexture,rt.get(t.depthTexture).__webglTexture);const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=rt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=Array.isArray(c[e])?c[e][r]:c[e],s=!0):n=K.isWebGL2&&t.samples>0&&!1===it.useMultisampledRTT(t)?rt.get(t).__webglMultisampledFramebuffer:Array.isArray(c)?c[r]:c,I.copy(t.viewport),R.copy(t.scissor),B=t.scissorTest}else I.copy(F).multiplyScalar(k).floor(),R.copy(z).multiplyScalar(k).floor(),B=G;if($.bindFramebuffer(_t.FRAMEBUFFER,n)&&K.drawBuffers&&i&&$.drawBuffers(t,n),$.viewport(I),$.scissor(R),$.setScissorTest(B),s){const i=rt.get(t.texture);_t.framebufferTexture2D(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,_t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,r)}else if(o){const i=rt.get(t.texture),n=e||0;_t.framebufferTextureLayer(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,i.__webglTexture,r||0,n)}C=-1},this.readRenderTargetPixels=function(t,e,r,i,n,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=rt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){$.bindFramebuffer(_t.FRAMEBUFFER,a);try{const o=t.texture,a=o.format,l=o.type;if(a!==zt&&vt.convert(a)!==_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Ot&&(J.has("EXT_color_buffer_half_float")||K.isWebGL2&&J.has("EXT_color_buffer_float"));if(!(l===Tt||vt.convert(l)===_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_TYPE)||l===Dt&&(K.isWebGL2||J.has("OES_texture_float")||J.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&r>=0&&r<=t.height-n&&_t.readPixels(e,r,i,n,vt.convert(a),vt.convert(l),s)}finally{const t=null!==S?rt.get(S).__webglFramebuffer:null;$.bindFramebuffer(_t.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,r=0){const i=Math.pow(2,-r),n=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);it.setTexture2D(e,0),_t.copyTexSubImage2D(_t.TEXTURE_2D,r,0,0,t.x,t.y,n,s),$.unbindTexture()},this.copyTextureToTexture=function(t,e,r,i=0){const n=e.image.width,s=e.image.height,o=vt.convert(r.format),a=vt.convert(r.type);it.setTexture2D(r,0),_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,r.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,r.unpackAlignment),e.isDataTexture?_t.texSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,n,s,o,a,e.image.data):e.isCompressedTexture?_t.compressedTexSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):_t.texSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,o,a,e.image),0===i&&r.generateMipmaps&&_t.generateMipmap(_t.TEXTURE_2D),$.unbindTexture()},this.copyTextureToTexture3D=function(t,e,r,i,n=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=vt.convert(i.format),c=vt.convert(i.type);let h;if(i.isData3DTexture)it.setTexture3D(i,0),h=_t.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");it.setTexture2DArray(i,0),h=_t.TEXTURE_2D_ARRAY}_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,i.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,i.unpackAlignment);const u=_t.getParameter(_t.UNPACK_ROW_LENGTH),d=_t.getParameter(_t.UNPACK_IMAGE_HEIGHT),p=_t.getParameter(_t.UNPACK_SKIP_PIXELS),f=_t.getParameter(_t.UNPACK_SKIP_ROWS),m=_t.getParameter(_t.UNPACK_SKIP_IMAGES),g=r.isCompressedTexture?r.mipmaps[0]:r.image;_t.pixelStorei(_t.UNPACK_ROW_LENGTH,g.width),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,g.height),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,t.min.x),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,t.min.y),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,t.min.z),r.isDataTexture||r.isData3DTexture?_t.texSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,c,g.data):r.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),_t.compressedTexSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,g.data)):_t.texSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,c,g),_t.pixelStorei(_t.UNPACK_ROW_LENGTH,u),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,d),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,p),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,f),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,m),0===n&&i.generateMipmaps&&_t.generateMipmap(h),$.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?it.setTextureCube(t,0):t.isData3DTexture?it.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?it.setTexture2DArray(t,0):it.setTexture2D(t,0),$.unbindTexture()},this.resetState=function(){E=0,M=0,S=null,$.reset(),xt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Fr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===Je?"display-p3":"srgb",e.unpackColorSpace=mi.workingColorSpace===Ke?"display-p3":"srgb"}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===Ye?je:Qe}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===je?Ye:Xe}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class Jl extends Xl{}Jl.prototype.isWebGL1Renderer=!0;class Kl{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new $n(t),this.density=e}clone(){return new Kl(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class $l{constructor(t,e=1,r=1e3){this.isFog=!0,this.name="",this.color=new $n(t),this.near=e,this.far=r}clone(){return new $l(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class tc extends kn{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}}class ec{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Cr,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Wr()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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;it.far||e.push({distance:a,point:oc.clone(),uv:Zn.getInterpolation(oc,dc,pc,fc,mc,gc,Ac,new ei),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function vc(t,e,r,i,n,s){cc.subVectors(t,r).addScalar(.5).multiply(i),void 0!==n?(hc.x=s*cc.x-n*cc.y,hc.y=n*cc.x+s*cc.y):hc.copy(cc),t.copy(e),t.x+=hc.x,t.y+=hc.y,t.applyMatrix4(uc)}const xc=new Di,bc=new Di;class _c extends kn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,r=e.length;t0){let r,i;for(r=1,i=e.length;r0){xc.setFromMatrixPosition(this.matrixWorld);const r=t.ray.origin.distanceTo(xc);this.getObjectForDistance(r).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){xc.setFromMatrixPosition(t.matrixWorld),bc.setFromMatrixPosition(this.matrixWorld);const r=xc.distanceTo(bc)/t.zoom;let i,n;for(e[0].object.visible=!0,i=1,n=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;i=r.length&&r.push({start:-1,count:-1,z:-1});const n=r[this.index];i.push(n),this.index++,n.start=t.start,n.count=t.count,n.z=e}reset(){this.list.length=0,this.index=0}}const Xc="batchId",Jc=new un,Kc=new un,$c=new un,th=new un,eh=new fo,rh=new Ui,ih=new en,nh=new Di,sh=new Yc,oh=new qs,ah=[];function lh(t,e,r=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const n=t.count;for(let s=0;s65536?new Uint32Array(n):new Uint16Array(n);e.setIndex(new us(t,1))}const s=i>65536?new Uint32Array(r):new Uint16Array(r);e.setAttribute(Xc,new us(s,1)),this._geometryInitialized=!0}}_validateGeometry(t){if(t.getAttribute(Xc))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Xc}"`);const e=this.geometry;if(Boolean(t.getIndex())!==Boolean(e.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in e.attributes){if(r===Xc)continue;if(!t.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=t.getAttribute(r),n=e.getAttribute(r);if(i.itemSize!==n.itemSize||i.normalized!==n.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ui);const t=this._geometryCount,e=this.boundingBox,r=this._active;e.makeEmpty();for(let i=0;i=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let n=null;const s=this._reservedRanges,o=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(n=s[s.length-1]),i.vertexCount=-1===e?t.getAttribute("position").count:e,i.vertexStart=null===n?0:n.vertexStart+n.vertexCount;const l=t.getIndex(),c=null!==l;if(c&&(i.indexCount=-1===r?l.count:r,i.indexStart=null===n?0:n.indexStart+n.indexCount),-1!==i.indexStart&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,u=this._active,d=this._matricesTexture,p=this._matricesTexture.image.data;h.push(!0),u.push(!0);const f=this._geometryCount;this._geometryCount++,$c.toArray(p,16*f),d.needsUpdate=!0,s.push(i),o.push({start:c?i.indexStart:i.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Ui,sphereInitialized:!1,sphere:new en});const m=this.geometry.getAttribute(Xc);for(let t=0;t=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const r=this.geometry,i=null!==r.getIndex(),n=r.getIndex(),s=e.getIndex(),o=this._reservedRanges[t];if(i&&s.count>o.indexCount||e.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=o.vertexStart,l=o.vertexCount;for(const t in r.attributes){if(t===Xc)continue;const i=e.getAttribute(t),n=r.getAttribute(t);lh(i,n,a);const s=i.itemSize;for(let t=i.count,e=l;t=e.length||!1===e[t]||(e[t]=!1,this._visibilityChanged=!0),this}getBoundingBoxAt(t,e){if(!1===this._active[t])return this;const r=this._bounds[t],i=r.box,n=this.geometry;if(!1===r.boxInitialized){i.makeEmpty();const e=n.index,s=n.attributes.position,o=this._drawRanges[t];for(let t=o.start,r=o.start+o.count;t=this._geometryCount||!1===r[t]||(e.toArray(n,16*t),i.needsUpdate=!0),this}getMatrixAt(t,e){const r=this._active,i=this._matricesTexture.image.data;return t>=this._geometryCount||!1===r[t]?null:e.fromArray(i,16*t)}setVisibleAt(t,e){const r=this._visibility,i=this._active;return t>=this._geometryCount||!1===i[t]||r[t]===e||(r[t]=e,this._visibilityChanged=!0),this}getVisibleAt(t){const e=this._visibility,r=this._active;return!(t>=this._geometryCount||!1===r[t])&&e[t]}raycast(t,e){const r=this._visibility,i=this._active,n=this._drawRanges,s=this._geometryCount,o=this.matrixWorld,a=this.geometry;oh.material=this.material,oh.geometry.index=a.index,oh.geometry.attributes=a.attributes,null===oh.geometry.boundingBox&&(oh.geometry.boundingBox=new Ui),null===oh.geometry.boundingSphere&&(oh.geometry.boundingSphere=new en);for(let a=0;a({...t}))),this._reservedRanges=t._reservedRanges.map((t=>({...t}))),this._visibility=t._visibility.slice(),this._active=t._active.slice(),this._bounds=t._bounds.map((t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()}))),this._maxGeometryCount=t._maxGeometryCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(t,e,r,i,n){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),o=null===s?1:s.array.BYTES_PER_ELEMENT,a=this._visibility,l=this._multiDrawStarts,c=this._multiDrawCounts,h=this._drawRanges,u=this.perObjectFrustumCulled;u&&(th.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),eh.setFromProjectionMatrix(th,t.isWebGPURenderer?zr:Fr));let d=0;if(this.sortObjects){Kc.copy(this.matrixWorld).invert(),nh.setFromMatrixPosition(r.matrixWorld).applyMatrix4(Kc);for(let t=0,e=a.length;ta)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}else for(let r=Math.max(0,s.start),i=Math.min(f.count,s.start+s.count)-1;ra)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;tn.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:r,index:e,face:null,object:o})}}class Th extends Ei{constructor(t,e,r,i,n,s,o,a,l){super(t,e,r,i,n,s,o,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:wt,this.magFilter=void 0!==n?n:wt,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Ih extends Ei{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=yt,this.minFilter=yt,this.generateMipmaps=!1,this.needsUpdate=!0}}class Rh extends Ei{constructor(t,e,r,i,n,s,o,a,l,c,h,u){super(null,s,o,a,l,c,i,n,h,u),this.isCompressedTexture=!0,this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Bh extends Rh{constructor(t,e,r,i,n,s){super(t,e,r,n,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=gt}}class Lh extends Rh{constructor(t,e,r){super(void 0,t[0].width,t[0].height,e,r,ht),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class Ph extends Ei{constructor(t,e,r,i,n,s,o,a,l){super(t,e,r,i,n,s,o,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Dh{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const r=this.getUtoTmapping(t);return this.getPoint(r,e)}getPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return e}getSpacedPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPointAt(r/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 r,i=this.getPoint(0),n=0;e.push(0);for(let s=1;s<=t;s++)r=this.getPoint(s/t),n+=r.distanceTo(i),e.push(n),i=r;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const r=this.getLengths();let i=0;const n=r.length;let s;s=e||t*r[n-1];let o,a=0,l=n-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),o=r[i]-s,o<0)a=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(i=l,r[i]===s)return i/(n-1);const c=r[i];return(i+(s-c)/(r[i+1]-c))/(n-1)}getTangent(t,e){const r=1e-4;let i=t-r,n=t+r;i<0&&(i=0),n>1&&(n=1);const s=this.getPoint(i),o=this.getPoint(n),a=e||(s.isVector2?new ei:new Di);return a.copy(o).sub(s).normalize(),a}getTangentAt(t,e){const r=this.getUtoTmapping(t);return this.getTangent(r,e)}computeFrenetFrames(t,e){const r=new Di,i=[],n=[],s=[],o=new Di,a=new un;for(let e=0;e<=t;e++){const r=e/t;i[e]=this.getTangentAt(r,new Di)}n[0]=new Di,s[0]=new Di;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,r.set(1,0,0)),h<=l&&(l=h,r.set(0,1,0)),u<=l&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),n[0].crossVectors(i[0],o),s[0].crossVectors(i[0],n[0]);for(let e=1;e<=t;e++){if(n[e]=n[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(i[e-1],i[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(qr(i[e-1].dot(i[e]),-1,1));n[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(i[e],n[e])}if(!0===e){let e=Math.acos(qr(n[0].dot(n[t]),-1,1));e/=t,i[0].dot(o.crossVectors(n[0],n[t]))>0&&(e=-e);for(let r=1;r<=t;r++)n[r].applyMatrix4(a.makeRotationAxis(i[r],e*r)),s[r].crossVectors(i[r],n[r])}return{tangents:i,normals:n,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Oh extends Dh{constructor(t=0,e=0,r=1,i=1,n=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const r=e||new ei,i=2*Math.PI;let n=this.aEndAngle-this.aStartAngle;const s=Math.abs(n)i;)n-=i;n0?0:(Math.floor(Math.abs(l)/n)+1)*n:0===c&&l===n-1&&(l=n-2,c=1),this.closed||l>0?o=i[(l-1)%n]:(Nh.subVectors(i[0],i[1]).add(i[0]),o=Nh);const h=i[l%n],u=i[(l+1)%n];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return r.set(jh(o,a.x,l.x,c.x,h.x),jh(o,a.y,l.y,c.y,h.y)),r}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e=r){const t=i[n]-r,s=this.curves[n],o=s.getLength(),a=0===o?0:1-t/o;return s.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 r=0,i=this.curves.length;r1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,r=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),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}}class ru extends Is{constructor(t=[new ei(0,-.5),new ei(.5,0),new ei(0,.5)],e=12,r=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=Math.floor(e),i=qr(i,0,2*Math.PI);const n=[],s=[],o=[],a=[],l=[],c=1/e,h=new Di,u=new ei,d=new Di,p=new Di,f=new Di;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case t.length-1:a.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let n=0;n<=e;n++){const d=r+n*c*i,p=Math.sin(d),f=Math.cos(d);for(let r=0;r<=t.length-1;r++){h.x=t[r].x*p,h.y=t[r].y,h.z=t[r].x*f,s.push(h.x,h.y,h.z),u.x=n/e,u.y=r/(t.length-1),o.push(u.x,u.y);const i=a[3*r+0]*p,c=a[3*r+1],d=a[3*r+0]*f;l.push(i,c,d)}}for(let r=0;r0&&A(!0),e>0&&A(!1)),this.setIndex(c),this.setAttribute("position",new xs(h,3)),this.setAttribute("normal",new xs(u,3)),this.setAttribute("uv",new xs(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new su(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ou extends su{constructor(t=1,e=1,r=32,i=1,n=!1,s=0,o=2*Math.PI){super(0,t,e,r,i,n,s,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:i,openEnded:n,thetaStart:s,thetaLength:o}}static fromJSON(t){return new ou(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class au extends Is{constructor(t=[],e=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i};const n=[],s=[];function o(t,e,r,i){const n=i+1,s=[];for(let i=0;i<=n;i++){s[i]=[];const o=t.clone().lerp(r,i/n),a=e.clone().lerp(r,i/n),l=n-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===n?o:o.clone().lerp(a,t/l)}for(let t=0;t.9&&o<.1&&(e<.2&&(s[t+0]+=1),r<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new xs(n,3)),this.setAttribute("normal",new xs(n.slice(),3)),this.setAttribute("uv",new xs(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new au(t.vertices,t.indices,t.radius,t.details)}}class lu extends au{constructor(t=1,e=0){const r=(1+Math.sqrt(5))/2,i=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new lu(t.radius,t.detail)}}const cu=new Di,hu=new Di,uu=new Di,du=new Zn;class pu extends Is{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const r=4,i=Math.pow(10,r),n=Math.cos(Vr*e),s=t.getIndex(),o=t.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t0)for(s=e;s=e;s-=i)o=ku(s,t[s],t[s+1],o);return o&&Ru(o,o.next)&&(Uu(o),o=o.next),o}function gu(t,e){if(!t)return t;e||(e=t);let r,i=t;do{if(r=!1,i.steiner||!Ru(i,i.next)&&0!==Iu(i.prev,i,i.next))i=i.next;else{if(Uu(i),i=e=i.prev,i===i.next)break;r=!0}}while(r||i!==e);return e}function Au(t,e,r,i,n,s,o){if(!t)return;!o&&s&&function(t,e,r,i){let n=t;do{0===n.z&&(n.z=Mu(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,l,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(o>1)}(n)}(t,i,n,s);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,s?vu(t,i,n,s):yu(t))e.push(a.i/r|0),e.push(t.i/r|0),e.push(l.i/r|0),Uu(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?Au(t=xu(gu(t),e,r),e,r,i,n,s,2):2===o&&bu(t,e,r,i,n,s):Au(gu(t),e,r,i,n,s,1);break}}function yu(t){const e=t.prev,r=t,i=t.next;if(Iu(e,r,i)>=0)return!1;const n=e.x,s=r.x,o=i.x,a=e.y,l=r.y,c=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=i.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Cu(n,a,s,l,o,c,f.x,f.y)&&Iu(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function vu(t,e,r,i){const n=t.prev,s=t,o=t.next;if(Iu(n,s,o)>=0)return!1;const a=n.x,l=s.x,c=o.x,h=n.y,u=s.y,d=o.y,p=al?a>c?a:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,A=Mu(p,f,e,r,i),y=Mu(m,g,e,r,i);let v=t.prevZ,x=t.nextZ;for(;v&&v.z>=A&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==o&&Cu(a,h,l,u,c,d,v.x,v.y)&&Iu(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==o&&Cu(a,h,l,u,c,d,x.x,x.y)&&Iu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==o&&Cu(a,h,l,u,c,d,v.x,v.y)&&Iu(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==o&&Cu(a,h,l,u,c,d,x.x,x.y)&&Iu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xu(t,e,r){let i=t;do{const n=i.prev,s=i.next.next;!Ru(n,s)&&Bu(n,i,i.next,s)&&Du(n,s)&&Du(s,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),Uu(i),Uu(i.next),i=t=s),i=i.next}while(i!==t);return gu(i)}function bu(t,e,r,i,n,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&Tu(o,t)){let a=Ou(o,t);return o=gu(o,o.next),a=gu(a,a.next),Au(o,e,r,i,n,s,0),void Au(a,e,r,i,n,s,0)}t=t.next}o=o.next}while(o!==t)}function _u(t,e){return t.x-e.x}function wu(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.x&&i.x>=l&&s!==i.x&&Cu(or.x||i.x===r.x&&Eu(r,i)))&&(r=i,u=h)),i=i.next}while(i!==a);return r}(t,e);if(!r)return e;const i=Ou(r,t);return gu(i,i.next),gu(r,r.next)}function Eu(t,e){return Iu(t.prev,t,e.prev)<0&&Iu(e.next,t,t.next)<0}function Mu(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 Su(t){let e=t,r=t;do{(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function Tu(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&&Bu(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Du(t,e)&&Du(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)&&(Iu(t.prev,t,e.prev)||Iu(t,e.prev,e))||Ru(t,e)&&Iu(t.prev,t,t.next)>0&&Iu(e.prev,e,e.next)>0)}function Iu(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ru(t,e){return t.x===e.x&&t.y===e.y}function Bu(t,e,r,i){const n=Pu(Iu(t,e,r)),s=Pu(Iu(t,e,i)),o=Pu(Iu(r,i,t)),a=Pu(Iu(r,i,e));return n!==s&&o!==a||!(0!==n||!Lu(t,r,e))||!(0!==s||!Lu(t,i,e))||!(0!==o||!Lu(r,t,i))||!(0!==a||!Lu(r,e,i))}function Lu(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 Pu(t){return t>0?1:t<0?-1:0}function Du(t,e){return Iu(t.prev,t,t.next)<0?Iu(t,e,t.next)>=0&&Iu(t,t.prev,e)>=0:Iu(t,e,t.prev)<0||Iu(t,t.next,e)<0}function Ou(t,e){const r=new Nu(t.i,t.x,t.y),i=new Nu(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 ku(t,e,r,i){const n=new Nu(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 Uu(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 Nu(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}class Fu{static area(t){const e=t.length;let r=0;for(let i=e-1,n=0;n80*r){a=c=t[0],l=h=t[1];for(let e=r;ec&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return Au(s,o,r,a,l,p,0),o}(r,i);for(let t=0;t2&&t[e-1].equals(t[0])&&t.pop()}function Gu(t,e){for(let r=0;rNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/u,f=e.y+o/u,m=((r.x-c/d-p)*c-(r.y+l/d-f)*l)/(o*c-a*l);i=p+o*m-t.x,n=f+a*m-t.y;const g=i*i+n*n;if(g<=2)return new ei(i,n);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?l>Number.EPSILON&&(t=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(i=-a,n=o,s=Math.sqrt(h)):(i=o,n=a,s=Math.sqrt(h/2))}return new ei(i/s,n/s)}const B=[];for(let t=0,e=S.length,r=e-1,i=t+1;t=0;t--){const e=t/p,r=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=S.length;t=0;){const i=r;let n=r-1;n<0&&(n=t.length-1);for(let t=0,r=a+2*p;t0)&&d.push(e,n,l),(t!==r-1||a0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class od extends rs{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new $n(16777215),this.specular=new $n(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K,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}}class ad extends rs{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new $n(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,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.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class ld extends rs{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),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.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class cd extends rs{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new $n(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K,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.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}}class hd extends rs{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new $n(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,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.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class ud extends hh{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}}function dd(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function pd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function fd(t){const e=t.length,r=new Array(e);for(let t=0;t!==e;++t)r[t]=t;return r.sort((function(e,r){return t[e]-t[r]})),r}function md(t,e,r){const i=t.length,n=new t.constructor(i);for(let s=0,o=0;o!==i;++s){const i=r[s]*e;for(let r=0;r!==e;++r)n[o++]=t[i+r]}return n}function gd(t,e,r,i){let n=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[n++];if(void 0===s)return;let o=s[i];if(void 0!==o)if(Array.isArray(o))do{o=s[i],void 0!==o&&(e.push(s.time),r.push.apply(r,o)),s=t[n++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[i],void 0!==o&&(e.push(s.time),o.toArray(r,r.length)),s=t[n++]}while(void 0!==s);else do{o=s[i],void 0!==o&&(e.push(s.time),r.push(o)),s=t[n++]}while(void 0!==s)}const Ad={convertArray:dd,isTypedArray:pd,getKeyframeOrder:fd,sortedArray:md,flattenJSON:gd,subclip:function(t,e,r,i,n=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t=i)){l.push(e.times[t]);for(let r=0;rs.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+a,e=t+l-a;d=i.values.slice(t,e)}else{const t=i.createInterpolant(),e=a,r=l-a;t.evaluate(s),d=t.resultBuffer.slice(e,r)}"quaternion"===n&&(new Pi).fromArray(d).normalize().conjugate().toArray(d);const p=o.times.length;for(let t=0;t=n)break t;{const o=e[1];t=n)break e}s=r,r=0}}for(;r>>1;te;)--s;if(++s,0!==n||s!==i){n>=s&&(s=Math.max(s,1),n=s-1);const t=this.getValueSize();this.times=r.slice(n,s),this.values=this.values.slice(n*t,s*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 r=this.times,i=this.values,n=r.length;0===n&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==n;e++){const i=r[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&pd(i))for(let e=0,r=i.length;e!==r;++e){const r=i[e];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,r),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Pe,n=t.length-1;let s=1;for(let o=1;o0){t[s]=t[n];for(let t=n*r,i=s*r,o=0;o!==r;++o)e[i+o]=e[t+o];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=e.slice(0,s*r)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),r=new(0,this.constructor)(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}_d.prototype.TimeBufferType=Float32Array,_d.prototype.ValueBufferType=Float32Array,_d.prototype.DefaultInterpolation=Le;class wd extends _d{}wd.prototype.ValueTypeName="bool",wd.prototype.ValueBufferType=Array,wd.prototype.DefaultInterpolation=Be,wd.prototype.InterpolantFactoryMethodLinear=void 0,wd.prototype.InterpolantFactoryMethodSmooth=void 0;class Ed extends _d{}Ed.prototype.ValueTypeName="color";class Md extends _d{}Md.prototype.ValueTypeName="number";class Sd extends yd{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){const n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(r-e)/(i-e);let l=t*o;for(let t=l+o;l!==t;l+=4)Pi.slerpFlat(n,0,s,l-o,s,l,a);return n}}class Cd extends _d{InterpolantFactoryMethodLinear(t){return new Sd(this.times,this.values,this.getValueSize(),t)}}Cd.prototype.ValueTypeName="quaternion",Cd.prototype.DefaultInterpolation=Le,Cd.prototype.InterpolantFactoryMethodSmooth=void 0;class Td extends _d{}Td.prototype.ValueTypeName="string",Td.prototype.ValueBufferType=Array,Td.prototype.DefaultInterpolation=Be,Td.prototype.InterpolantFactoryMethodLinear=void 0,Td.prototype.InterpolantFactoryMethodSmooth=void 0;class Id extends _d{}Id.prototype.ValueTypeName="vector";class Rd{constructor(t,e=-1,r,i=Ue){this.name=t,this.tracks=r,this.duration=e,this.blendMode=i,this.uuid=Wr(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],r=t.tracks,i=1/(t.fps||1);for(let t=0,n=r.length;t!==n;++t)e.push(Bd(r[t]).scale(i));const n=new this(t.name,t.duration,e,t.blendMode);return n.uuid=t.uuid,n}static toJSON(t){const e=[],r=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=r.length;t!==i;++t)e.push(_d.toJSON(r[t]));return i}static CreateFromMorphTargetSequence(t,e,r,i){const n=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(r)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,r));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(t,e,r,i,n){if(0!==r.length){const s=[],o=[];gd(r,s,o,i),0!==s.length&&n.push(new t(e,s,o))}},i=[],n=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(n),this.manager.itemEnd(t)}),0),n;if(void 0!==kd[t])return void kd[t].push({onLoad:e,onProgress:r,onError:i});kd[t]=[],kd[t].push({onLoad:e,onProgress:r,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const r=kd[t],i=e.body.getReader(),n=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=n?parseInt(n):0,o=0!==s;let a=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:n})=>{if(i)t.close();else{a+=n.byteLength;const i=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=r.length;t{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,o)));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),r=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(r);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{Ld.add(t,e);const r=kd[t];delete kd[t];for(let t=0,i=r.length;t{const r=kd[t];if(void 0===r)throw this.manager.itemError(t),e;delete kd[t];for(let t=0,i=r.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Fd extends Od{constructor(t){super(t)}load(t,e,r,i){const n=this,s=new Nd(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(r){try{e(n.parse(JSON.parse(r)))}catch(e){i?i(e):console.error(e),n.manager.itemError(t)}}),r,i)}parse(t){const e=[];for(let r=0;r0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const n=t.uniforms[e];switch(i.uniforms[e]={},n.type){case"t":i.uniforms[e].value=r(n.value);break;case"c":i.uniforms[e].value=(new $n).setHex(n.value);break;case"v2":i.uniforms[e].value=(new ei).fromArray(n.value);break;case"v3":i.uniforms[e].value=(new Di).fromArray(n.value);break;case"v4":i.uniforms[e].value=(new Mi).fromArray(n.value);break;case"m3":i.uniforms[e].value=(new ri).fromArray(n.value);break;case"m4":i.uniforms[e].value=(new un).fromArray(n.value);break;default:i.uniforms[e].value=n.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=r(t.map)),void 0!==t.matcap&&(i.matcap=r(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=r(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=r(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=r(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new ei).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=r(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=r(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=r(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=r(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=r(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=r(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=r(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=r(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=r(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=r(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=r(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=r(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=r(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=r(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new ei).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=r(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=r(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=r(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=r(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=r(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=r(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=r(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:rd,SpriteMaterial:nc,RawShaderMaterial:id,ShaderMaterial:to,PointsMaterial:bh,MeshPhysicalMaterial:sd,MeshStandardMaterial:nd,MeshPhongMaterial:od,MeshToonMaterial:ad,MeshNormalMaterial:ld,MeshLambertMaterial:cd,MeshDepthMaterial:Ul,MeshDistanceMaterial:Nl,MeshBasicMaterial:is,MeshMatcapMaterial:hd,LineDashedMaterial:ud,LineBasicMaterial:hh,Material:rs}[t]}}class up{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let r=0,i=t.length;r0){const r=new Pd(e);n=new Gd(r),n.setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e0){i=new Gd(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e{const e=new Ui;e.min.fromArray(t.boxMin),e.max.fromArray(t.boxMax);const r=new en;return r.radius=t.sphereRadius,r.center.fromArray(t.sphereCenter),{boxInitialized:t.boxInitialized,box:e,sphereInitialized:t.sphereInitialized,sphere:r}})),s._maxGeometryCount=t.maxGeometryCount,s._maxVertexCount=t.maxVertexCount,s._maxIndexCount=t.maxIndexCount,s._geometryInitialized=t.geometryInitialized,s._geometryCount=t.geometryCount,s._matricesTexture=h(t.matricesTexture.uuid);break;case"LOD":s=new _c;break;case"Line":s=new gh(l(t.geometry),c(t.material));break;case"LineLoop":s=new xh(l(t.geometry),c(t.material));break;case"LineSegments":s=new vh(l(t.geometry),c(t.material));break;case"PointCloud":case"Points":s=new Sh(l(t.geometry),c(t.material));break;case"Sprite":s=new yc(c(t.material));break;case"Group":s=new Vl;break;case"Bone":s=new Pc;break;default:s=new kn}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(s.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.quaternion&&s.quaternion.fromArray(t.quaternion),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.up&&s.up.fromArray(t.up),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(s.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(s.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(s.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&s.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(s.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.frustumCulled&&(s.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(s.renderOrder=t.renderOrder),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.layers&&(s.layers.mask=t.layers),void 0!==t.children){const o=t.children;for(let t=0;t0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(r,i,this._addIndex*e,1,e);for(let t=e,n=e+e;t!==n;++t)if(r[t]!==r[t+e]){o.setValue(r,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,r=this.valueSize,i=r*this._origIndex;t.getValue(e,i);for(let t=r,n=i;t!==n;++t)e[t]=e[i+t%r];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 r=t;r=.5)for(let i=0;i!==n;++i)t[e+i]=t[r+i]}_slerp(t,e,r,i){Pi.slerpFlat(t,e,t,e,t,r,i)}_slerpAdditive(t,e,r,i,n){const s=this._workIndex*n;Pi.multiplyQuaternionsFlat(t,s,t,e,t,r),Pi.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,r,i,n){const s=1-i;for(let o=0;o!==n;++o){const n=e+o;t[n]=t[n]*s+t[r+o]*i}}_lerpAdditive(t,e,r,i,n){for(let s=0;s!==n;++s){const n=e+s;t[n]=t[n]+t[r+s]*i}}}const Gp="\\[\\]\\.:\\/",Qp=new RegExp("["+Gp+"]","g"),jp="[^"+Gp+"]",Vp="[^"+Gp.replace("\\.","")+"]",Hp=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",jp)+/(WCOD+)?/.source.replace("WCOD",Vp)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",jp)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",jp)+"$"),Wp=["material","materials","bones","map"];class qp{constructor(t,e,r){this.path=e,this.parsedPath=r||qp.parseTrackName(e),this.node=qp.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,r){return t&&t.isAnimationObjectGroup?new qp.Composite(t,e,r):new qp(t,e,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Qp,"")}static parseTrackName(t){const e=Hp.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const r={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=r.nodeName.substring(i+1);-1!==Wp.indexOf(t)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=t)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const r=t.skeleton.getBoneByName(e);if(void 0!==r)return r}if(t.children){const r=function(t){for(let i=0;i=n){const s=n++,c=t[s];e[c.uuid]=l,t[l]=c,e[a]=s,t[s]=o;for(let t=0,e=i;t!==e;++t){const e=r[t],i=e[s],n=e[l];e[l]=i,e[s]=n}}}this.nCachedObjects_=n}uncache(){const t=this._objects,e=this._indicesByUUID,r=this._bindings,i=r.length;let n=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=e[a];if(void 0!==l)if(delete e[a],l0&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0,e=i;t!==e;++t){const e=r[t];e[l]=e[n],e.pop()}}}this.nCachedObjects_=n}subscribe_(t,e){const r=this._bindingsIndicesByPath;let i=r[t];const n=this._bindings;if(void 0!==i)return n[i];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);i=n.length,r[t]=i,s.push(t),o.push(e),n.push(h);for(let r=c,i=a.length;r!==i;++r){const i=a[r];h[r]=new qp(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){const i=this._paths,n=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=r,s[r]=a,s.pop(),n[r]=n[o],n.pop(),i[r]=i[o],i.pop()}}}class Yp{constructor(t,e,r=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=r,this.blendMode=i;const n=e.tracks,s=n.length,o=new Array(s),a={endingStart:De,endingEnd:De};for(let t=0;t!==s;++t){const e=n[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ie,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,r){if(t.fadeOut(e),this.fadeIn(e),r){const r=this._clip.duration,i=t._clip.duration,n=i/r,s=r/i;t.warp(1,n,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,r){return t.crossFadeFrom(this,e,r)}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,r){const i=this._mixer,n=i.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=n,a[1]=n+r,l[0]=t/s,l[1]=e/s,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,r,i){if(!this.enabled)return void this._updateWeight(t);const n=this._startTime;if(null!==n){const i=(t-n)*r;i<0||0===r?e=0:(this._startTime=null,e=r*i)}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===Ne)for(let r=0,i=t.length;r!==i;++r)t[r].evaluate(s),e[r].accumulateAdditive(o);else for(let r=0,n=t.length;r!==n;++r)t[r].evaluate(s),e[r].accumulate(i,o)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const r=this._weightInterpolant;if(null!==r){const i=r.evaluate(t)[0];e*=i,t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,r=this.loop;let i=this.time+t,n=this._loopCount;const s=r===Re;if(0===t)return-1===n?i:s&&1==(1&n)?e-i:i;if(r===Te){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===n&&(t>=0?(n=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const r=Math.floor(i/e);i-=e*r,n+=Math.abs(r);const o=this.repetitions-n;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=n,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=i;if(s&&1==(1&n))return e-i}return i}_setEndings(t,e,r){const i=this._interpolantSettings;r?(i.endingStart=Oe,i.endingEnd=Oe):(i.endingStart=t?this.zeroSlopeAtStart?Oe:De:ke,i.endingEnd=e?this.zeroSlopeAtEnd?Oe:De:ke)}_scheduleFading(t,e,r){const i=this._mixer,n=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=n,a[0]=e,o[1]=n+t,a[1]=r,this}}const Xp=new Float32Array(1);class Jp extends Gr{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,s=t._propertyBindings,o=t._interpolants,a=r.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==n;++t){const n=i[t],l=n.name;let h=c[l];if(void 0!==h)++h.referenceCount,s[t]=h;else{if(h=s[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;h=new zp(qp.create(r,l,i),n.ValueTypeName,n.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[t]=h}o[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,r=t._clip.uuid,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}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=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==r;++o)e[o]._update(i,t,n,s);const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.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.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,cf).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)}}const uf=new Di,df=new Di;class pf{constructor(t=new Di,e=new Di){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){uf.subVectors(t,this.start),df.subVectors(this.end,this.start);const r=df.dot(df);let i=df.dot(uf)/r;return e&&(i=qr(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)}}const ff=new Di;class mf extends kn{constructor(t,e){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const r=new Is,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,r=32;t1)for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{zf.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(zf,e)}}setLength(t,e=.2*t,r=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Vf extends vh{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],r=new Is;r.setAttribute("position",new xs(e,3)),r.setAttribute("color",new xs([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(r,new hh({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,r){const i=new $n,n=this.geometry.attributes.color.array;return i.set(t),i.toArray(n,0),i.toArray(n,3),i.set(e),i.toArray(n,6),i.toArray(n,9),i.set(r),i.toArray(n,12),i.toArray(n,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Hf{constructor(){this.type="ShapePath",this.color=new $n,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new eu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const r=e.length;let i=!1;for(let n=r-1,s=0;sNumber.EPSILON){if(l<0&&(r=e[s],a=-a,o=e[n],l=-l),t.yo.y)continue;if(t.y===r.y){if(t.x===r.x)return!0}else{const e=l*(t.x-r.x)-a*(t.y-r.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==r.y)continue;if(o.x<=t.x&&t.x<=r.x||r.x<=t.x&&t.x<=o.x)return!0}}return i}const r=Fu.isClockWise,i=this.subPaths;if(0===i.length)return[];let n,s,o;const a=[];if(1===i.length)return s=i[0],o=new fu,o.curves=s.curves,a.push(o),a;let l=!r(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let e=0,o=i.length;e1){let t=!1,r=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t{if(!r){var o=1/0;for(h=0;h=s)&&Object.keys(i.O).every((t=>i.O[t](r[l])))?r.splice(l--,1):(a=!1,s0&&t[h-1][2]>s;h--)t[h]=t[h-1];t[h]=[r,n,s]},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={764:0};i.O.j=e=>0===t[e];var e=(e,r)=>{var n,s,[o,a,l]=r,c=0;if(o.some((e=>0!==t[e]))){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(l)var h=l(i)}for(e&&e(r);c(()=>{var t,e={75550:t=>{"use strict";function e(t,e){this.x=t,this.y=e}t.exports=e,e.prototype={clone:function(){return new e(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),s=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t}},38929:(t,e,r)=>{t.exports.VectorTile=r(22779),r(66024),r(59701)},22779:(t,e,r)=>{"use strict";var i=r(59701);function n(t,e,r){if(3===t){var n=new i(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}t.exports=function(t,e){this.layers=t.readFields(n,{},e)}},66024:(t,e,r)=>{"use strict";var i=r(75550);function n(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(s,this,e)}function s(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos>3}if(s--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,s=0,o=1/0,a=-1/0,l=1/0,c=-1/0;t.pos>3}if(i--,1===r||2===r)(n+=t.readSVarint())a&&(a=n),(s+=t.readSVarint())c&&(c=s);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,a,c]},n.prototype.toGeoJSON=function(t,e,r){var i,s,a=this.extent*Math.pow(2,r),l=this.extent*t,c=this.extent*e,h=this.loadGeometry(),u=n.types[this.type];function d(t){for(var e=0;e{"use strict";var i=r(66024);function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(s,this,e),this.length=this._features.length}function s(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}t.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new i(this._pbf,e,this.extent,this._keys,this._values)}},36194:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>y});var i,n={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-n.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*n.Bounce.In(2*t):.5*n.Bounce.Out(2*t-1)+.5}}},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},o=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=s()),void 0===e&&(e=!1);var r=Object.keys(this._tweens);if(0===r.length)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i1?s(t[r],t[r-1],r-i):s(t[n],t[n+1>r?r:n+1],i-n)},Bezier:function(t,e){for(var r=0,i=t.length-1,n=Math.pow,s=a.Utils.Bernstein,o=0;o<=i;o++)r+=n(1-e,i-o)*n(e,o)*t[o]*s(i,o);return r},CatmullRom:function(t,e){var r=t.length-1,i=r*e,n=Math.floor(i),s=a.Utils.CatmullRom;return t[0]===t[r]?(e<0&&(n=Math.floor(i=r*(1+e))),s(t[(n-1+r)%r],t[n],t[(n+1)%r],t[(n+2)%r],i-n)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[r]-(s(t[r],t[r],t[r-1],t[r-1],i-r)-t[r]):s(t[n?n-1:0],t[n],t[r1;r--)e*=r;return i[t]=e,e}),CatmullRom:function(t,e,r,i,n){var s=.5*(r-t),o=.5*(i-e),a=n*n;return(2*e-2*r+s+o)*(n*a)+(-3*e+3*r-2*s-o)*a+s*n+e}}},l=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),c=new o,h=function(){function t(t,e){void 0===e&&(e=c),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=n.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=l.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?s()+parseFloat(t):t:s(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,r,i){for(var n in r){var s=t[n],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(r[n]);if("undefined"!==a&&"function"!==a){if(l){var c=r[n];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,s)),r[n]=[s].concat(c)}if("object"!==a&&!o||!s||l)void 0===e[n]&&(e[n]=s),o||(e[n]*=1),i[n]=l?r[n].slice().reverse():e[n]||0;else{for(var h in e[n]=o?[]:{},s)e[n][h]=s[h];i[n]=o?[]:{},this._setupProperties(s,e[n],r[n],i[n])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=s()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=s()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;tn)return!1;e&&this.start(t)}if(this._goToEnd=!1,t1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(r in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,s=a(t),o=s[0],l=s[1],c=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),h=0,u=l>0?o-4:o;for(r=0;r>16&255,c[h++]=e>>8&255,c[h++]=255&e;return 2===l&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,c[h++]=255&e),1===l&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,c[h++]=e>>8&255,c[h++]=255&e),c},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],o=16383,a=0,c=i-n;ac?c:a+o));return 1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,i){for(var n,s,o=[],a=e;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},48764:(t,e,r)=>{"use strict";var i=r(79742),n=r(80645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=l,e.h2=50;var o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|m(t,e),i=a(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return l.from(i,e,r);var n=function(t){if(l.isBuffer(t)){var e=0|f(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Q(t.length)?a(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return h(t),a(t<0?0:0|f(t))}function d(t){for(var e=t.length<0?0:0|f(t.length),r=a(e),i=0;i=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return i?-1:N(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function A(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var h=-1;for(s=r;sa&&(r=a-l),s=r;s>=0;s--){for(var u=!0,d=0;dn&&(i=n):i=n;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function M(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:c>223?3:c>191?2:1;if(n+u<=r)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[n+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=u}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii.length?l.from(s).copy(i,n):Uint8Array.prototype.set.call(i,s,n);else{if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n)}n+=s.length}return i},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(t,e,r,i,n){if(G(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(i,n),h=t.slice(e,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,i,n,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function D(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function k(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,8),n.write(t,e,r,i,52,8),r+8}l.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t],n=1,s=0;++s>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,i||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return k(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return k(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,i){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function F(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Q(t){return t!=t}var j=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()},94629:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hierarchyItemLength=e.infoLength=void 0,e.infoLength=160,e.hierarchyItemLength=32},73156: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Copc=void 0;const o=s(r(81693)),a=r(26115),l=r(52277),c=r(53216);async function h(t,{pointDataRecordFormat:e,pointDataRecordLength:r},i,n){const s=await async function(t,{pointDataOffset:e,pointDataLength:r}){return a.Getter.create(t)(e,e+r)}(t,i),{pointCount:l}=i;return o.PointData.decompressChunk(s,{pointCount:l,pointDataRecordFormat:e,pointDataRecordLength:r},n)}e.Copc={create:async function(t){const e=a.Getter.create(t),r=e(0,65536);async function i(t,i){return i>=65536?e(t,i):(await r).slice(t,i)}const n=o.Header.parse(await i(0,o.Constants.minHeaderLength)),s=await o.Vlr.walk(i,n),l=o.Vlr.find(s,"copc",1);if(!l)throw new Error("COPC info VLR is required");const h=c.Info.parse(await o.Vlr.fetch(i,l));let u;const d=o.Vlr.find(s,"LASF_Projection",2112);d&&d.contentLength&&(u=a.Binary.toCString(await o.Vlr.fetch(i,d)),""===u&&(u=void 0));let p=[];const f=o.Vlr.find(s,"LASF_Spec",4);return f&&(p=o.ExtraBytes.parse(await o.Vlr.fetch(i,f))),{header:n,vlrs:s,info:h,wkt:u,eb:p}},loadHierarchyPage:async function(t,e){const r=a.Getter.create(t);return l.Hierarchy.load(r,e)},loadPointDataBuffer:h,loadPointDataView:async function(t,e,r,{lazPerf:i,include:n}={}){const s=await h(t,e.header,r,i);return o.View.create(s,e.header,e.eb,n)}}},52277:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hierarchy=void 0;const i=r(26115),n=r(94629);function s(t){const e=i.Binary.toDataView(t);if(e.byteLength%n.hierarchyItemLength!=0)throw new Error(`Invalid hierarchy page length: ${e.byteLength}`);const r={},s={};for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Info=void 0;const i=r(26115),n=r(94629);e.Info={parse:function(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${n.infoLength}): ${e.byteLength}`);const r=[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)],s=e.getFloat64(24,!0);return{cube:[r[0]-s,r[1]-s,r[2]-s,r[0]+s,r[1]+s,r[2]+s],spacing:e.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,i.parseBigInt)((0,i.getBigUint64)(e,40,!0)),pageLength:(0,i.parseBigInt)((0,i.getBigUint64)(e,48,!0))},gpsTimeRange:[e.getFloat64(56,!0),e.getFloat64(64,!0)]}}}},44975:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},98212:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hierarchy=void 0,e.Hierarchy={parse:function(t){return Object.entries(t).reduce(((t,[e,r])=>(-1===r?t.pages[e]={}:r&&(t.nodes[e]={pointCount:r}),t)),{nodes:{},pages:{}})}}},66329: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(44975),e),n(r(98212),e)},37830: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e},o=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.Las=e.Ept=void 0,e.Ept=s(r(66329)),o(r(68750),e),e.Las=s(r(81693)),o(r(26115),e)},50755:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.evlrHeaderLength=e.vlrHeaderLength=e.minHeaderLength=void 0,e.minHeaderLength=375,e.vlrHeaderLength=54,e.evlrHeaderLength=60},14953:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dimensions=void 0;const i=r(26115),n=r(6125);e.Dimensions={create:function(t,e=[]){return Object.keys(t).reduce(((t,r)=>{const i=o[r];if(i)return{...t,[r]:i};const s=e.find((t=>t.name===r)),a=s&&n.ExtraBytes.getDimension(s);if(a)return{...t,[r]:a};throw new Error(`Failed to look up LAS type: ${r}`)}),{})}};const{Type:s}=i.Dimension,o={X:s.float64,Y:s.float64,Z:s.float64,Intensity:s.uint16,ReturnNumber:s.uint8,NumberOfReturns:s.uint8,ScanDirectionFlag:s.boolean,EdgeOfFlightLine:s.boolean,Classification:s.uint8,Synthetic:s.boolean,KeyPoint:s.boolean,Withheld:s.boolean,Overlap:s.boolean,ScanAngle:s.float32,UserData:s.uint8,PointSourceId:s.uint16,GpsTime:s.float64,Red:s.uint16,Green:s.uint16,Blue:s.uint16,ScannerChannel:s.uint8,Infrared:s.uint16}},6125:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtraBytes=void 0;const i=r(26115);e.ExtraBytes={getDimension:function({type:t,length:e}){switch(t){case"signed":case"unsigned":switch(e){case 1:case 2:case 4:case 8:return{type:t,size:e}}case"float":switch(e){case 4:case 8:return{type:t,size:e}}}},parse:function(t){if(t.byteLength%n!=0)throw new Error(`Invalid extra bytes VLR length: ${t.byteLength}`);const e=[];for(let r=0;r=11)throw new Error(`Invalid extra bytes "type" value: ${o}`);if(0===o)return{name:r,description:s,length:a};const l=(c=a,{hasNodata:Boolean(1&c),hasMin:Boolean(c>>1&1),hasMax:Boolean(c>>2&1),hasScale:Boolean(c>>3&1),hasOffset:Boolean(c>>4&1)});var c;const h=function(t){switch(t){case 1:return i.Dimension.Type.uint8;case 2:return i.Dimension.Type.int8;case 3:return i.Dimension.Type.uint16;case 4:return i.Dimension.Type.int16;case 5:return i.Dimension.Type.uint32;case 6:return i.Dimension.Type.int32;case 7:return i.Dimension.Type.uint64;case 8:return i.Dimension.Type.int64;case 9:return i.Dimension.Type.float32;case 10:return i.Dimension.Type.float64}}(o);if(!h)throw new Error(`Failed to extract dimension type: ${o}`);const{type:u,size:d}=h;function p(t){switch(u){case"signed":return(0,i.parseBigInt)(e.getBigInt64(t,!0));case"unsigned":return(0,i.parseBigInt)((0,i.getBigUint64)(e,t,!0));case"float":return e.getFloat64(t,!0)}}const f={name:r,description:s,type:u,length:d};return l.hasNodata&&(f.nodata=p(40)),l.hasMin&&(f.min=p(64)),l.hasMax&&(f.max=p(88)),l.hasScale&&(f.scale=e.getFloat64(112)),l.hasOffset&&(f.offset=e.getFloat64(136)),f}},29032:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Extractor=void 0;const i=r(26115);function n(t){const{scale:e,offset:r}=t,n=a(t);function s(t,e){return t.getUint8(n(e)+14)}function o(t,e){return t.getUint8(n(e)+15)}function l(t,e){return 31&o(t,e)}return{X:(t,s)=>i.Scale.unapply(t.getInt32(n(s),!0),e[0],r[0]),Y:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+4,!0),e[1],r[1]),Z:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+8,!0),e[2],r[2]),Intensity:(t,e)=>t.getUint16(n(e)+12,!0),ReturnNumber:(t,e)=>7&s(t,e),NumberOfReturns:(t,e)=>(56&s(t,e))>>3,ScanDirectionFlag:(t,e)=>(64&s(t,e))>>6,EdgeOfFlightLine:(t,e)=>(128&s(t,e))>>7,Classification:(t,e)=>{const r=l(t,e);return 12===r?0:r},Synthetic:(t,e)=>(32&o(t,e))>>5,KeyPoint:(t,e)=>(64&o(t,e))>>6,Withheld:(t,e)=>(128&o(t,e))>>7,Overlap:(t,e)=>12===l(t,e)?1:0,ScanAngle:(t,e)=>t.getInt8(n(e)+16),UserData:(t,e)=>t.getUint8(n(e)+17),PointSourceId:(t,e)=>t.getUint16(n(e)+18,!0)}}function s(t){const{scale:e,offset:r}=t,n=a(t);function s(t,e){return t.getUint8(n(e)+15)}return{X:(t,s)=>i.Scale.unapply(t.getInt32(n(s),!0),e[0],r[0]),Y:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+4,!0),e[1],r[1]),Z:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+8,!0),e[2],r[2]),Intensity:(t,e)=>t.getUint16(n(e)+12,!0),ReturnNumber:(t,e)=>15&t.getUint16(n(e)+14,!0),NumberOfReturns:(t,e)=>(240&t.getUint16(n(e)+14,!0))>>4,Synthetic:(t,e)=>1&s(t,e),KeyPoint:(t,e)=>(2&s(t,e))>>1,Withheld:(t,e)=>(4&s(t,e))>>2,Overlap:(t,e)=>(8&s(t,e))>>3,ScannerChannel:(t,e)=>(48&s(t,e))>>4,ScanDirectionFlag:(t,e)=>(64&s(t,e))>>6,EdgeOfFlightLine:(t,e)=>(128&s(t,e))>>7,Classification:(t,e)=>t.getUint8(n(e)+16),UserData:(t,e)=>t.getUint8(n(e)+17),ScanAngle:(t,e)=>.006*t.getInt16(n(e)+18,!0),PointSourceId:(t,e)=>t.getUint16(n(e)+20,!0),GpsTime:(t,e)=>t.getFloat64(n(e)+22,!0)}}function o(t){const e=a(t);return{...s(t),Red:(t,r)=>t.getUint16(e(r)+30,!0),Green:(t,r)=>t.getUint16(e(r)+32,!0),Blue:(t,r)=>t.getUint16(e(r)+34,!0)}}function a(t){const{pointDataRecordLength:e}=t;return function(t){return t*e}}e.Extractor={create:function(t,e=[]){const r=function(t,e){let r=function(t){switch(t){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${t}`)}}(t.pointDataRecordFormat);return e.reduce(((e,n)=>{const s=r;r+=n.length;const o=function(t,e,{type:r,length:n}){const s=a(t);switch(r){case"signed":switch(n){case 1:return(t,r)=>t.getInt8(s(r)+e);case 2:return(t,r)=>t.getInt16(s(r)+e,!0);case 4:return(t,r)=>t.getInt32(s(r)+e,!0);case 8:return(t,r)=>(0,i.parseBigInt)(t.getBigInt64(s(r)+e,!0))}case"unsigned":switch(n){case 1:return(t,r)=>t.getUint8(s(r)+e);case 2:return(t,r)=>t.getUint16(s(r)+e,!0);case 4:return(t,r)=>t.getUint32(s(r)+e,!0);case 8:return(t,r)=>(0,i.parseBigInt)((0,i.getBigUint64)(t,s(r)+e,!0))}case"float":switch(n){case 4:return(t,r)=>t.getFloat32(s(r)+e,!0);case 8:return(t,r)=>t.getFloat64(s(r)+e,!0)}}}(t,s,n);if(!o)return e;return{...e,[n.name]:(t,e)=>i.Scale.unapply(o(t,e),n.scale,n.offset)}}),{})}(t,e);return{...(()=>{const{pointDataRecordFormat:e}=t;switch(e){case 0:return n(t);case 1:return function(t){const e=a(t);return{...n(t),GpsTime:(t,r)=>t.getFloat64(e(r)+20,!0)}}(t);case 2:return function(t){const e=a(t);return{...n(t),Red:(t,r)=>t.getUint16(e(r)+20,!0),Green:(t,r)=>t.getUint16(e(r)+22,!0),Blue:(t,r)=>t.getUint16(e(r)+24,!0)}}(t);case 3:return function(t){const e=a(t);return{...n(t),GpsTime:(t,r)=>t.getFloat64(e(r)+20,!0),Red:(t,r)=>t.getUint16(e(r)+28,!0),Green:(t,r)=>t.getUint16(e(r)+30,!0),Blue:(t,r)=>t.getUint16(e(r)+32,!0)}}(t);case 6:return s(t);case 7:return o(t);case 8:return function(t){const e=a(t);return{...o(t),Infrared:(t,r)=>t.getUint16(e(r)+36,!0)}}(t);default:throw new Error(`Unsupported point data record format: ${e}`)}})(),...r}}}},73651:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Header=void 0;const i=r(26115),n=r(50755),s=r(64267);function o(t){const e=i.Binary.toDataView(t),r=[];for(let t=0;t<120;t+=8)r.push((0,i.getBigUint64)(e,t,!0));return r.map((t=>(0,i.parseBigInt)(t)))}function a(t){const e=i.Binary.toDataView(t),r=[];for(let t=0;t<20;t+=4)r.push(e.getUint32(t,!0));return r}e.Header={parse:function(t){if(t.byteLength{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decompressFile=e.decompressChunk=e.PointData=void 0;const i=r(42622),n=r(73651);let s;async function o(t){return t||(s||(s=(0,i.createLazPerf)()),s)}async function a(t,{pointCount:e,pointDataRecordFormat:r,pointDataRecordLength:i},n){const s=await o(n),a=new Uint8Array(e*i),l=s._malloc(t.byteLength),c=s._malloc(i),h=new s.ChunkDecoder;try{s.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),l),h.open(r,i,l);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatGuid=e.parsePoint=void 0;const i=r(26115);e.parsePoint=function(t){const e=i.Binary.toDataView(t);if(24!==e.byteLength)throw new Error(`Invalid tuple buffer length: ${e.byteLength}`);return[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)]},e.formatGuid=function(t){const e=i.Binary.toDataView(t);if(16!==e.byteLength)throw new Error(`Invalid GUID buffer length: ${e.byteLength}`);let r="";for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.View=void 0;const i=r(26115),n=r(14953),s=r(29032);e.View={create:function(t,e,r=[],o){let a=s.Extractor.create(e,r);if(o){const t=new Set([...o]);a=Object.entries(a).reduce(((e,[r,i])=>(t.has(r)&&(e[r]=i),e)),{})}const l=n.Dimensions.create(a,r),c=i.Binary.toDataView(t),h=e.pointDataRecordLength;if(c.byteLength%h!=0)throw new Error(`Invalid buffer length (${c.byteLength}) for point length ${h}`);const u=c.byteLength/e.pointDataRecordLength;return{pointCount:u,dimensions:l,getter:function(t){const e=a[t];if(!e)throw new Error(`No extractor for dimension: ${t}`);return function(t){if(t>=u)throw new RangeError(`View index (${t}) out of range: ${u}`);return e(c,t)}}}}}},79687:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Vlr=void 0;const i=r(26115),n=r(50755);function s(t,e,r){return t.find((t=>t.userId===e&&t.recordId===r))}function o(t,e){return(e?l:a)(t)}function a(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${n.vlrHeaderLength}): ${e.byteLength}`);return{userId:i.Binary.toCString(t.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:e.getUint16(20,!0),description:i.Binary.toCString(t.slice(22,54)),isExtended:!1}}function l(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${n.evlrHeaderLength}): ${e.byteLength}`);return{userId:i.Binary.toCString(t.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:(0,i.parseBigInt)((0,i.getBigUint64)(e,20,!0)),description:i.Binary.toCString(t.slice(28,60)),isExtended:!0}}async function c({get:t,startOffset:e,count:r,isExtended:i}){const s=[];let a=e;const l=i?n.evlrHeaderLength:n.vlrHeaderLength;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBigUint64=e.parseBigInt=void 0,e.parseBigInt=function(t){if(t>BigInt(Number.MAX_SAFE_INTEGER)||t{"use strict";function r(t){return new DataView(t.buffer,t.byteOffset,t.length)}function i(t){const e=r(t);let i="";for(let t=0;t{"use strict";function r([t,e,r,i,n,s]){return[t+(i-t)/2,e+(n-e)/2,r+(s-r)/2]}function i(t){return t[3]-t[0]}function n(t){return t[4]-t[1]}function s(t){return t[5]-t[2]}function o(t,[e,i,n]){const[s,o,a,l,c,h]=t,[u,d,p]=r(t);return[e?u:s,i?d:o,n?p:a,e?l:u,i?c:d,n?h:p]}Object.defineProperty(e,"__esModule",{value:!0}),e.Bounds=void 0,e.Bounds={min:function(t){return[t[0],t[1],t[2]]},max:function(t){return[t[3],t[4],t[5]]},mid:r,width:i,depth:n,height:s,cube:function(t){const e=r(t),o=Math.max(i(t),n(t),s(t))/2;return[e[0]-o,e[1]-o,e[2]-o,e[0]+o,e[1]+o,e[2]+o]},step:o,stepTo:function(t,[e,r,i,n]){for(let s=e-1;s>=0;--s)t=o(t,[r>>s&1,i>>s&1,n>>s&1]);return t},intersection:function(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1]),Math.max(t[2],e[2]),Math.min(t[3],e[3]),Math.min(t[4],e[4]),Math.min(t[5],e[5])]}}},15882:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dimension=void 0,e.Dimension={Type:{int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}},ctype:function({type:t,size:e}){switch(t){case"signed":switch(e){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(e){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(e){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${t}/${e}`)}}},28732: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Getter=void 0;const a=o(r(86747));function l(t){return async function(e,r){if(e<0||r<0||e>r)throw new Error("Invalid range");const i=await(0,a.default)(t,{headers:{Range:`bytes=${e}-${r-1}`}}),n=await i.arrayBuffer();return new Uint8Array(n)}}function c(t){return async function(e,i){const n=await Promise.resolve().then((()=>s(r(78963))));return async function(e=0,r=1/0){if(e<0||r<0||e>r)throw new Error("Invalid range");return await n.promises.access(t),async function(t){return await new Promise(((e,r)=>{const i=[];t.on("data",(t=>i.push(t))),t.on("error",r),t.on("end",(()=>e(Buffer.concat(i))))}))}(n.createReadStream(t,{start:e,end:r-1,autoClose:!0}))}(e,i)}}e.Getter={create:function(t){return"function"==typeof t?t:t.startsWith("http://")||t.startsWith("https://")?l(t):c(t)},http:l,file:c}},26115: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.Step=e.Scale=e.Key=e.Getter=e.Dimension=e.Bounds=e.Binary=void 0,n(r(51877),e);var s=r(16467);Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return s.Binary}});var o=r(45314);Object.defineProperty(e,"Bounds",{enumerable:!0,get:function(){return o.Bounds}});var a=r(15882);Object.defineProperty(e,"Dimension",{enumerable:!0,get:function(){return a.Dimension}});var l=r(28732);Object.defineProperty(e,"Getter",{enumerable:!0,get:function(){return l.Getter}});var c=r(49479);Object.defineProperty(e,"Key",{enumerable:!0,get:function(){return c.Key}});var h=r(50350);Object.defineProperty(e,"Scale",{enumerable:!0,get:function(){return h.Scale}});var u=r(96784);Object.defineProperty(e,"Step",{enumerable:!0,get:function(){return u.Step}})},49479:(t,e)=>{"use strict";function r(t){if("string"!=typeof t)return t;const[e,r,i,n,...s]=t.split("-").map((t=>parseInt(t,10))),o=[e,r,i,n];if(0!==s.length||o.some((t=>"number"!=typeof t||Number.isNaN(t))))throw new Error(`Invalid key: ${t}`);return o}Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={create:function(t,e=0,i=0,n=0){return"number"!=typeof t?r(t):[t,e,i,n]},parse:r,toString:function(t){return"string"==typeof t?t:t.join("-")},step:function(t,[r,i,n]){const[s,o,a,l]=e.Key.create(t);return[s+1,2*o+r,2*a+i,2*l+n]},up:function(t,r=1){const[i,n,s,o]=e.Key.create(t);return[i-r,n>>r,s>>r,o>>r]},compare:function(t,e){for(let r=0;re[r])return 1}return 0},depth:function(t){return t[0]}}},50350:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scale=void 0,e.Scale={apply:(t,e=1,r=0)=>(t-r)/e,unapply:(t,e=1,r=0)=>t*e+r}},96784:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Step=void 0,e.Step={fromIndex:function(t){if(t<0||t>=8)throw new Error(`Invalid step index: ${t}`);return[t>>0&1?1:0,t>>1&1?1:0,t>>2&1?1:0]},list:function(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}}},86747:function(t,e){var r="undefined"!=typeof self?self:this,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in t,o="ArrayBuffer"in t;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function m(t){var e=new FileReader,r=f(e);return e.readAsArrayBuffer(t),r}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&n&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var t,e,r,i=p(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,r=f(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i-1?i:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function x(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},A.call(v.prototype),A.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];b.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function w(t,r){return new Promise((function(i,s){var o=new v(t,r);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new b(n,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",l)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}w.polyfill=!0,t.fetch||(t.fetch=w,t.Headers=d,t.Request=v,t.Response=b),e.Headers=d,e.Request=v,e.Response=b,e.fetch=w,Object.defineProperty(e,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e},9187:t=>{"use strict";function e(t,e,i){i=i||2;var s,o,a,l,u,d,f,m=e&&e.length,g=m?e[0]*i:t.length,A=r(t,0,g,i,!0),y=[];if(!A||A.next===A.prev)return y;if(m&&(A=function(t,e,i,n){var s,o,a,l=[];for(s=0,o=e.length;s80*i){s=a=t[0],o=l=t[1];for(var v=i;va&&(a=u),d>l&&(l=d);f=0!==(f=Math.max(a-s,l-o))?32767/f:0}return n(A,y,i,s,o,f,0),y}function r(t,e,r,i,n){var s,o;if(n===S(t,e,r,i)>0)for(s=e;s=e;s-=i)o=w(s,t[s],t[s+1],o);return o&&A(o,o.next)&&(E(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!A(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(E(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function n(t,e,r,c,h,u,p){if(t){!p&&u&&function(t,e,r,i){var n=t;do{0===n.z&&(n.z=d(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){var e,r,i,n,s,o,a,l,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(o>1)}(n)}(t,c,h,u);for(var f,m,g=t;t.prev!==t.next;)if(f=t.prev,m=t.next,u?o(t,c,h,u):s(t))e.push(f.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),E(t),t=m.next,g=m.next;else if((t=m)===g){p?1===p?n(t=a(i(t),e,r),e,r,c,h,u,2):2===p&&l(t,e,r,c,h,u):n(i(t),e,r,c,h,u,1);break}}}function s(t){var e=t.prev,r=t,i=t.next;if(g(e,r,i)>=0)return!1;for(var n=e.x,s=r.x,o=i.x,a=e.y,l=r.y,c=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c,m=i.next;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&f(n,a,s,l,o,c,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,r,i){var n=t.prev,s=t,o=t.next;if(g(n,s,o)>=0)return!1;for(var a=n.x,l=s.x,c=o.x,h=n.y,u=s.y,p=o.y,m=al?a>c?a:c:l>c?l:c,v=h>u?h>p?h:p:u>p?u:p,x=d(m,A,e,r,i),b=d(y,v,e,r,i),_=t.prevZ,w=t.nextZ;_&&_.z>=x&&w&&w.z<=b;){if(_.x>=m&&_.x<=y&&_.y>=A&&_.y<=v&&_!==n&&_!==o&&f(a,h,l,u,c,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,w.x>=m&&w.x<=y&&w.y>=A&&w.y<=v&&w!==n&&w!==o&&f(a,h,l,u,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;_&&_.z>=x;){if(_.x>=m&&_.x<=y&&_.y>=A&&_.y<=v&&_!==n&&_!==o&&f(a,h,l,u,c,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;w&&w.z<=b;){if(w.x>=m&&w.x<=y&&w.y>=A&&w.y<=v&&w!==n&&w!==o&&f(a,h,l,u,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function a(t,e,r){var n=t;do{var s=n.prev,o=n.next.next;!A(s,o)&&y(s,n,n.next,o)&&b(s,o)&&b(o,s)&&(e.push(s.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),E(n),E(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function l(t,e,r,s,o,a){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var h=_(l,c);return l=i(l,l.next),h=i(h,h.next),n(l,e,r,s,o,a,0),void n(h,e,r,s,o,a,0)}c=c.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,i=e,n=t.x,s=t.y,o=-1/0;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){var a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>o&&(o=a,r=i.x=i.x&&i.x>=h&&n!==i.x&&f(sr.x||i.x===r.x&&u(r,i)))&&(r=i,p=l)),i=i.next}while(i!==c);return r}(t,e);if(!r)return e;var n=_(r,t);return i(n,n.next),i(r,r.next)}function u(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(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 p(t){var e=t,r=t;do{(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&y(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var r=t,i=!1,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)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||A(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function A(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,r,i){var n=x(g(t,e,r)),s=x(g(t,e,i)),o=x(g(r,i,t)),a=x(g(r,i,e));return n!==s&&o!==a||!(0!==n||!v(t,r,e))||!(0!==s||!v(t,i,e))||!(0!==o||!v(r,t,i))||!(0!==a||!v(r,e,i))}function v(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 x(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function _(t,e){var r=new M(t.i,t.x,t.y),i=new M(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 w(t,e,r,i){var n=new M(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 E(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 M(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}function S(t,e,r,i){for(var n=0,s=e,o=r-i;s0&&(i+=t[n-1].length,r.holes.push(i))}return r}},80645:(t,e)=>{e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,l=(1<>1,h=-7,u=r?n-1:0,d=r?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,l,c=8*s-n-1,h=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,n),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;t[r+p]=255&a,p+=f,a/=256,n-=8);for(o=o<0;t[r+p]=255&o,p+=f,o/=256,c-=8);t[r+p-f]|=128*m}},25705:(t,e,r)=>{"use strict";var i,n,s=r.g.MutationObserver||r.g.WebKitMutationObserver;if(s){var o=0,a=new s(u),l=r.g.document.createTextNode("");a.observe(l,{characterData:!0}),i=function(){l.data=o=++o%2}}else if(r.g.setImmediate||void 0===r.g.MessageChannel)i="document"in r.g&&"onreadystatechange"in r.g.document.createElement("script")?function(){var t=r.g.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},r.g.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new r.g.MessageChannel;c.port1.onmessage=u,i=function(){c.port2.postMessage(0)}}var h=[];function u(){var t,e;n=!0;for(var r=h.length;r;){for(e=h,h=[],t=-1;++t{t.exports=function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return n(e[o][1][t]||t)}),c,c.exports,t,e,r,i)}return r[o].exports}for(var s=void 0,o=0;o>>1],e)>=0?n=s+1:i=s;return n},e.exports=function(){function t(t){var e;this.options=t,this.comparator=this.options.comparator,this.data=(null!=(e=this.options.initialValues)?e.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return t.prototype.queue=function(t){var e;e=i(this.data,t,this.comparator),this.data.splice(e,0,t)},t.prototype.dequeue=function(){return this.data.pop()},t.prototype.peek=function(){return this.data[this.data.length-1]},t.prototype.clear=function(){this.data.length=0},t}()},{}],4:[function(t,e,r){e.exports=function(){function t(t){var e,r,i,n,s,o,a,l;for(this.comparator=(null!=t?t.comparator:void 0)||function(t,e){return t-e},this.pageSize=(null!=t?t.pageSize:void 0)||512,this.length=0,a=0;1<s;0<=s?++r:--r)e.push(null);if(this._memory=[],this._mask=this.pageSize-1,t.initialValues)for(i=0,n=(o=t.initialValues).length;i0&&(this._write(1,e),this._bubbleDown(1,e)),t},t.prototype.peek=function(){return this._read(1)},t.prototype.clear=function(){this.length=0,this._memory.length=0},t.prototype._write=function(t,e){var r;for(r=t>>this._shift;r>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[r][t&this._mask]=e},t.prototype._read=function(t){return this._memory[t>>this._shift][t&this._mask]},t.prototype._bubbleUp=function(t,e){var r,i,n,s;for(r=this.comparator;t>1&&(i=t&this._mask,t3?n=t&~this._mask|i>>1:i<2?(n=t-this.pageSize>>this._shift,n+=n&~(this._mask>>1),n|=this.pageSize>>1):n=t-2,!(r(s=this._read(n),e)<0));)this._write(n,e),this._write(t,s),t=n},t.prototype._bubbleDown=function(t,e){var r,i,n,s,o;for(o=this.comparator;tthis._mask&&!(t&this._mask-1)?r=i=t+2:t&this.pageSize>>1?(r=(t&~this._mask)>>1,i=1+(r=1+(r|=t&this._mask>>1)<0)for(t=e=1,r=this.data.length;1<=r?er;t=1<=r?++e:--e)this._bubbleUp(t)},t.prototype.queue=function(t){this.data.push(t),this._bubbleUp(this.data.length-1)},t.prototype.dequeue=function(){var t,e;return e=this.data[0],t=this.data.pop(),this.data.length>0&&(this.data[0]=t,this._bubbleDown(0)),e},t.prototype.peek=function(){return this.data[0]},t.prototype.clear=function(){this.length=0,this.data.length=0},t.prototype._bubbleUp=function(t){for(var e,r;t>0&&(e=t-1>>>1,this.comparator(this.data[t],this.data[e])<0);)r=this.data[e],this.data[e]=this.data[t],this.data[t]=r,t=e},t.prototype._bubbleDown=function(t){var e,r,i,n,s;for(e=this.data.length-1;n=1+(r=1+(t<<1)),i=t,r<=e&&this.comparator(this.data[r],this.data[i])<0&&(i=r),n<=e&&this.comparator(this.data[n],this.data[i])<0&&(i=n),i!==t;)s=this.data[i],this.data[i]=this.data[t],this.data[t]=s,t=i},t}()},{}]},{},[1])(1)},55733:(t,e,r)=>{t.exports=function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return n(e[o][1][t]||t)}),c,c.exports,t,e,r,i)}return r[o].exports}for(var s=void 0,o=0;o>2,a=(3&e)<<4|r>>4,l=1>6:64,c=2>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(c++)))>>2,i=(3&a)<<6|(l=s.indexOf(t.charAt(c++))),d[h++]=e,64!==a&&(d[h++]=r),64!==l&&(d[h++]=i);return d}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var i=t("./external"),n=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}a.prototype={getContentWorker:function(){var t=new n(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var i=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var i=t("./utils"),n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,r,i){var s=n,o=0+r;t^=-1;for(var a=0;a>>8^s[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,r,i){var s=n,o=0+r;t^=-1;for(var a=0;a>>8^s[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var i;i="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,r){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=i?"uint8array":"array";function l(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new l("Deflate",t)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function i(t,e){var r,i="";for(r=0;r>>=8;return i}function n(t,e,r,n,o,h){var u,d,p=t.file,f=t.compression,m=h!==a.utf8encode,g=s.transformTo("string",h(p.name)),A=s.transformTo("string",a.utf8encode(p.name)),y=p.comment,v=s.transformTo("string",h(y)),x=s.transformTo("string",a.utf8encode(y)),b=A.length!==p.name.length,_=x.length!==y.length,w="",E="",M="",S=p.dir,C=p.date,T={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(T.crc32=t.crc32,T.compressedSize=t.compressedSize,T.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),m||!b&&!_||(I|=2048);var R=0,B=0;S&&(R|=16),"UNIX"===o?(B=798,R|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(p.unixPermissions,S)):(B=20,R|=function(t){return 63&(t||0)}(p.dosPermissions)),u=C.getUTCHours(),u<<=6,u|=C.getUTCMinutes(),u<<=5,u|=C.getUTCSeconds()/2,d=C.getUTCFullYear()-1980,d<<=4,d|=C.getUTCMonth()+1,d<<=5,d|=C.getUTCDate(),b&&(E=i(1,1)+i(l(g),4)+A,w+="up"+i(E.length,2)+E),_&&(M=i(1,1)+i(l(v),4)+x,w+="uc"+i(M.length,2)+M);var L="";return L+="\n\0",L+=i(I,2),L+=f.magic,L+=i(u,2),L+=i(d,2),L+=i(T.crc32,4),L+=i(T.compressedSize,4),L+=i(T.uncompressedSize,4),L+=i(g.length,2),L+=i(w.length,2),{fileRecord:c.LOCAL_FILE_HEADER+L+g+w,dirRecord:c.CENTRAL_FILE_HEADER+i(B,2)+L+i(v.length,2)+"\0\0\0\0"+i(R,4)+i(n,4)+g+w+v}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),c=t("../signature");function h(t,e,r,i){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,o),h.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:function(t){return c.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,r){"use strict";var i=t("./Uint8ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var i=t("./DataReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var i=t("./ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var i=t("../utils"),n=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new a(t):n.uint8array?new l(i.transformTo("uint8array",t)):new s(i.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../utils");function s(t){i.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../crc32");function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function i(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=i},{}],29:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),l=t("../external"),c=null;if(a.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e,r){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=r,i.checkSupport(o),this._worker=t.pipe(new n(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return function(t,e){return new l.Promise((function(r,n){var s=[],a=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",(function(t,r){s.push(t),e&&e(r)})).on("error",(function(t){s=[],n(t)})).on("end",(function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return i.transformTo(t,e)}}(l,function(t,e){var r,i=0,n=null,s=0;for(r=0;r>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return n.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,n,s,o=t.length,l=new Array(2*o);for(e=r=0;e>10&1023,l[r++]=56320|1023&n)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),i.applyFromCharCode(l)}(t=i.transformTo(n.uint8array?"uint8array":"array",t))},i.inherits(c,o),c.prototype.processChunk=function(t){var e=i.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),l=e;o!==e.length&&(n.uint8array?(l=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(l=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(l),meta:t.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,i.inherits(h,o),h.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var i=t("./support"),n=t("./base64"),s=t("./nodejsUtils"),o=t("./external");function a(t){return t}function l(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r>10&1023,c[i++]=56320|1023&n)}return l(c,i)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,n){var s=i,o=n+r;t^=-1;for(var a=n;a>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){"use strict";var i,n=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),l=t("./messages"),c=0,h=0,u=-2,d=2,p=8,f=286,m=30,g=19,A=2*f+1,y=15,v=3,x=258,b=x+v+1,_=42,w=113;function E(t,e){return t.msg=l[e],e}function M(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(n.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function T(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,C(t.strm)}function I(t,e){t.pending_buf[t.pending++]=e}function R(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function B(t,e){var r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-b?t.strstart-(t.w_size-b):0,c=t.window,h=t.w_mask,u=t.prev,d=t.strstart+x,p=c[s+o-1],f=c[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(c[(r=e)+o]===f&&c[r+o-1]===p&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&sl&&0!=--n);return o<=t.lookahead?o:t.lookahead}function L(t){var e,r,i,s,l,c,h,u,d,p,f=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-b)){for(n.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--r;);for(e=r=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--r;);s+=f}if(0===t.strm.avail_in)break;if(c=t.strm,h=t.window,u=t.strstart+t.lookahead,p=void 0,(d=s)<(p=c.avail_in)&&(p=d),r=0===p?0:(c.avail_in-=p,n.arraySet(h,c.input,c.next_in,p,u),1===c.state.wrap?c.adler=o(c.adler,h,p,u):2===c.state.wrap&&(c.adler=a(c.adler,h,p,u)),c.next_in+=p,c.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=v)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=v&&(t.ins_h=(t.ins_h<=v)if(i=s._tr_tally(t,t.strstart-t.match_start,t.match_length-v),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=v){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=v&&(t.ins_h=(t.ins_h<=v&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-v,i=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-v),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(L(t),0===t.lookahead&&e===c)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,T(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-b&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(T(t,!1),t.strm.avail_out),1)})),new O(4,4,8,4,P),new O(4,5,16,8,P),new O(4,6,32,32,P),new O(4,4,16,16,D),new O(8,16,32,32,D),new O(8,16,128,128,D),new O(8,32,128,256,D),new O(32,128,258,1024,D),new O(32,258,258,4096,D)],r.deflateInit=function(t,e){return F(t,e,p,15,8,0)},r.deflateInit2=F,r.deflateReset=N,r.deflateResetKeep=U,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,h):u},r.deflate=function(t,e){var r,n,o,l;if(!t||!t.state||5>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,3),n.status=w);else{var d=p+(n.w_bits-8<<4)<<8;d|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(d|=32),d+=31-d%31,n.status=w,R(n,d),0!==n.strstart&&(R(n,t.adler>>>16),R(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending!==n.pending_buf_size));)I(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(t),n.pending+2<=n.pending_buf_size&&(I(n,255&t.adler),I(n,t.adler>>8&255),t.adler=0,n.status=w)):n.status=w),0!==n.pending){if(C(t),0===t.avail_out)return n.last_flush=-1,h}else if(0===t.avail_in&&M(e)<=M(r)&&4!==e)return E(t,-5);if(666===n.status&&0!==t.avail_in)return E(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==c&&666!==n.status){var f=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(L(t),0===t.lookahead)){if(e===c)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,i,n,o,a=t.window;;){if(t.lookahead<=x){if(L(t),t.lookahead<=x&&e===c)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=v&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=v?(r=s._tr_tally(t,1,t.match_length-v),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?1:2}(n,e):i[n.level].func(n,e);if(3!==f&&4!==f||(n.status=666),1===f||3===f)return 0===t.avail_out&&(n.last_flush=-1),h;if(2===f&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(S(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(t),0===t.avail_out))return n.last_flush=-1,h}return 4!==e?h:n.wrap<=0?1:(2===n.wrap?(I(n,255&t.adler),I(n,t.adler>>8&255),I(n,t.adler>>16&255),I(n,t.adler>>24&255),I(n,255&t.total_in),I(n,t.total_in>>8&255),I(n,t.total_in>>16&255),I(n,t.total_in>>24&255)):(R(n,t.adler>>>16),R(n,65535&t.adler)),C(t),0=r.w_size&&(0===a&&(S(r.head),r.strstart=0,r.block_start=0,r.insert=0),p=new n.Buf8(r.w_size),n.arraySet(p,e,f-r.w_size,r.w_size,0),e=p,f=r.w_size),l=t.avail_in,c=t.next_in,d=t.input,t.avail_in=f,t.next_in=0,t.input=e,L(r);r.lookahead>=v;){for(i=r.strstart,s=r.lookahead-(v-1);r.ins_h=(r.ins_h<>>=x=v>>>24,f-=x,0==(x=v>>>16&255))S[s++]=65535&v;else{if(!(16&x)){if(0==(64&x)){v=m[(65535&v)+(p&(1<>>=x,f-=x),f<15&&(p+=M[i++]<>>=x=v>>>24,f-=x,!(16&(x=v>>>16&255))){if(0==(64&x)){v=g[(65535&v)+(p&(1<>>=x,f-=x,(x=s-o)<_){if(h<(x=_-x)&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=d,(w=0)===u){if(w+=c-x,x>3,p&=(1<<(f-=b<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=h,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(u),e.distcode=e.distdyn=new i.Buf32(d),e.sane=1,e.back=-1,l):c}function g(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,m(t)):c}function A(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(i.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n<(s=o.wsize-o.wnext)&&(s=n),i.arraySet(o.window,e,r-n,s,o.wnext),(n-=s)?(i.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,N,2,0),v=y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&y)){t.msg="unknown compression method",r.mode=30;break}if(v-=4,P=8+(15&(y>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(N[0]=255&y,N[1]=y>>>8&255,r.check=s(r.check,N,2,0)),v=y=0,r.mode=3;case 3:for(;v<32;){if(0===g)break t;g--,y+=u[f++]<>>8&255,N[2]=y>>>16&255,N[3]=y>>>24&255,r.check=s(r.check,N,4,0)),v=y=0,r.mode=4;case 4:for(;v<16;){if(0===g)break t;g--,y+=u[f++]<>8),512&r.flags&&(N[0]=255&y,N[1]=y>>>8&255,r.check=s(r.check,N,2,0)),v=y=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===g)break t;g--,y+=u[f++]<>>8&255,r.check=s(r.check,N,2,0)),v=y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(g<(E=r.length)&&(E=g),E&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,u,f,E,P)),512&r.flags&&(r.check=s(r.check,u,E,f)),g-=E,f+=E,r.length-=E),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break t;for(E=0;P=u[f+E++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P)),P&&E>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===g)break t;g--,y+=u[f++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===g)break t;g--,y+=u[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(_(r),r.mode=20,6!==e)break;y>>>=2,v-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}y>>>=2,v-=2;break;case 14:for(y>>>=7&v,v-=7&v;v<32;){if(0===g)break t;g--,y+=u[f++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&y,v=y=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(E=r.length){if(g>>=5,v-=5,r.ndist=1+(31&y),y>>>=5,v-=5,r.ncode=4+(15&y),y>>>=4,v-=4,286>>=3,v-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},D=a(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,D){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=C,v-=C,r.lens[r.have++]=I;else{if(16===I){for(k=C+2;v>>=C,v-=C,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}P=r.lens[r.have-1],E=3+(3&y),y>>>=2,v-=2}else if(17===I){for(k=C+3;v>>=C)),y>>>=3,v-=3}else{for(k=C+7;v>>=C)),y>>>=7,v-=7}if(r.have+E>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;E--;)r.lens[r.have++]=P}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,O={bits:r.lenbits},D=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,D){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},D=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,D){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=g&&258<=A){t.next_out=m,t.avail_out=A,t.next_in=f,t.avail_in=g,r.hold=y,r.bits=v,o(t,b),m=t.next_out,d=t.output,A=t.avail_out,f=t.next_in,u=t.input,g=t.avail_in,y=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;T=(U=r.lencode[y&(1<>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>R)])>>>16&255,I=65535&U,!(R+(C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=R,v-=R,r.back+=R}if(y>>>=C,v-=C,r.back+=C,r.length=I,0===T){r.mode=26;break}if(32&T){r.back=-1,r.mode=12;break}if(64&T){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&T,r.mode=22;case 22:if(r.extra){for(k=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;T=(U=r.distcode[y&(1<>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>R)])>>>16&255,I=65535&U,!(R+(C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=R,v-=R,r.back+=R}if(y>>>=C,v-=C,r.back+=C,64&T){t.msg="invalid distance code",r.mode=30;break}r.offset=I,r.extra=15&T,r.mode=24;case 24:if(r.extra){for(k=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===A)break t;if(E=b-A,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}M=E>r.wnext?(E-=r.wnext,r.wsize-E):r.wnext-E,E>r.length&&(E=r.length),S=r.window}else S=d,M=m-r.offset,E=r.length;for(Ay?(x=U[N+u[E]],P[D+u[E]]):(x=96,0),p=1<>I)+(f-=p)]=v<<24|x<<16|b|0,0!==f;);for(p=1<>=1;if(0!==p?(L&=p-1,L+=p):L=0,E++,0==--O[w]){if(w===S)break;w=e[r+u[E]]}if(C>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function C(t,e,r){t.bi_valid>c-r?(t.bi_buf|=e<>c-t.bi_valid,t.bi_valid+=r-c):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function R(t,e,r){var i,n,s=new Array(l+1),o=0;for(i=1;i<=l;i++)s[i]=o=o+r[i-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=I(s[a]++,a))}}function B(t){var e;for(e=0;e>1;1<=r;r--)D(t,s,r);for(n=c;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],D(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,D(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,o,a,c=e.dyn_tree,h=e.max_code,u=e.stat_desc.static_tree,d=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(s=0;s<=l;s++)t.bl_count[s]=0;for(c[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(s=c[2*c[2*(i=t.heap[r])+1]+1]+1)&&(s=m,g++),c[2*i+1]=s,h>=7;i>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e>>3,(o=t.static_len+3+7>>>3)<=n&&(n=o)):n=o=r+5,r+4<=n&&-1!==e?z(t,e,r,i):4===t.strategy||o===n?(C(t,2+(i?1:0),3),O(t,f,m)):(C(t,4+(i?1:0),3),function(t,e,r,i){var n;for(C(t,e-257,5),C(t,r-1,5),C(t,i-4,4),n=0;n>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(A[r]+s+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){C(t,2,3),T(t,256,f),function(t){16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var r,i,n,s,o=1,a={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,r="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(s+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){n.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(t){var e=c.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):function(t){setTimeout(d,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i{var e,r=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var r,i,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){r=t,i=e})),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>W("You are getting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>W("You are setting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var s=Object.assign({},n),o=[],a="./this.program";if(n.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var l,c="";if("undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),e&&(c=e),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var h,u,d,p=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);function m(t,e){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){W("Module."+t+" has been replaced with plain "+e+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function g(t){return"FS_createPath"===t||"FS_createDataFile"===t||"FS_createPreloadedFile"===t||"FS_unlink"===t||"addRunDependency"===t||"FS_createLazyFile"===t||"FS_createDevice"===t||"removeRunDependency"===t}Object.assign(n,s),s=null,h="fetchSettings",Object.getOwnPropertyDescriptor(n,h)&&W("`Module."+h+"` was supplied but `"+h+"` not included in INCOMING_MODULE_JS_API"),n.arguments&&(o=n.arguments),m("arguments","arguments_"),n.thisProgram&&(a=n.thisProgram),m("thisProgram","thisProgram"),n.quit&&n.quit,m("quit","quit_"),y(void 0===n.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.read,"Module.read option was removed (modify read_ in JS)"),y(void 0===n.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),y(void 0===n.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),y(void 0===n.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),y(void 0===n.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),m("read","read_"),m("readAsync","readAsync"),m("readBinary","readBinary"),m("setWindowTitle","setWindowTitle"),y(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),y(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),y(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(u=n.wasmBinary),m("wasmBinary","wasmBinary"),n.noExitRuntime,m("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&W("no native wasm support detected");var A=!1;function y(t,e){t||W("Assertion failed"+(e?": "+e:""))}var v,x,b,_,w,E,M,S,C,T="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(t,e,r){for(var i=e+r,n=e;t[n]&&!(n>=i);)++n;if(n-e>16&&t.buffer&&T)return T.decode(t.subarray(e,n));for(var s="";e>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|a)}else s+=String.fromCharCode(o)}return s}function R(t,e){return t?I(b,t,e):""}function B(t,e,r,i){if(!(i>0))return 0;for(var n=r,s=r+i-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),a<=127){if(r>=s)break;e[r++]=a}else if(a<=2047){if(r+1>=s)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=s)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+3>=s)break;a>1114111&&tt("Invalid Unicode code point 0x"+a.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-n}function L(t){for(var e=0,r=0;r=55296&&i<=57343?(e+=4,++r):e+=3}return e}function P(t){v=t,n.HEAP8=x=new Int8Array(t),n.HEAP16=_=new Int16Array(t),n.HEAP32=E=new Int32Array(t),n.HEAPU8=b=new Uint8Array(t),n.HEAPU16=w=new Uint16Array(t),n.HEAPU32=M=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}var D=65536;n.TOTAL_STACK&&y(D===n.TOTAL_STACK,"the stack size can no longer be determined at runtime");var O,k=n.INITIAL_MEMORY||262144;function U(){if(!A){var t=Ee(),e=M[t>>2],r=M[t+4>>2];34821223==e&&2310721022==r||W("Stack overflow! Stack cookie has been overwritten at 0x"+t.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+e.toString(16)),1668509029!==M[0]&&W("Runtime error: The application has corrupted its heap memory area (address zero)!")}}m("INITIAL_MEMORY","INITIAL_MEMORY"),y(k>=D,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+k+"! (TOTAL_STACK="+D+")"),y("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),y(!n.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),y(262144==k,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var N=[],F=[],z=[],G=!1;y(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Q=0,j=null,V=null,H={};function W(t){n.onAbort&&n.onAbort(t),f(t="Aborted("+t+")"),A=!0;var e=new WebAssembly.RuntimeError(t);throw i(e),e}var q={error:function(){W("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){q.error()},createDataFile:function(){q.error()},createPreloadedFile:function(){q.error()},createLazyFile:function(){q.error()},open:function(){q.error()},mkdev:function(){q.error()},registerDevice:function(){q.error()},analyzePath:function(){q.error()},loadFilesFromDB:function(){q.error()},ErrnoError:function(){q.error()}};n.FS_createDataFile=q.createDataFile,n.FS_createPreloadedFile=q.createPreloadedFile;var Z,Y;function X(t){return t.startsWith("data:application/octet-stream;base64,")}function J(t,e){return function(){var r=t,i=e;return e||(i=n.asm),y(G,"native function `"+r+"` called before runtime initialization"),i[t]||y(i[t],"exported native function `"+r+"` not found"),i[t].apply(null,arguments)}}function K(t){try{if(t==Z&&u)return new Uint8Array(u);if(l)return l(t);throw"both async and sync fetching of the wasm failed"}catch(t){W(t)}}function $(t){for(;t.length>0;)t.shift()(n)}function tt(t){tt.shown||(tt.shown={}),tt.shown[t]||(tt.shown[t]=1,f(t))}function et(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){M[this.ptr+4>>2]=t},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(t){M[this.ptr+8>>2]=t},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_refcount=function(t){E[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,x[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=x[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,x[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=x[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=E[this.ptr>>2];E[this.ptr>>2]=t+1},this.release_ref=function(){var t=E[this.ptr>>2];return E[this.ptr>>2]=t-1,y(t>0),1===t},this.set_adjusted_ptr=function(t){M[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Me(this.get_type()))return M[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}function rt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}X(Z="laz-perf.wasm")||(Y=Z,Z=n.locateFile?n.locateFile(Y,c):c+Y);var it=void 0;function nt(t){for(var e="",r=t;b[r];)e+=it[b[r++]];return e}var st={},ot={},at={},lt=48,ct=57;function ht(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=lt&&e<=ct?"_"+t:t}function ut(t,e){return t=ht(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function dt(t,e){var r=ut(e,(function(t){this.name=e,this.message=t;var r=new Error(t).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var pt=void 0;function ft(t){throw new pt(t)}var mt=void 0;function gt(t){throw new mt(t)}function At(t,e,r){function i(e){var i=r(e);i.length!==t.length&>("Mismatched type converter count");for(var n=0;n{ot.hasOwnProperty(t)?n[e]=ot[t]:(s.push(t),st.hasOwnProperty(t)||(st[t]=[]),st[t].push((()=>{n[e]=ot[t],++o===s.length&&i(n)})))})),0===s.length&&i(n)}function yt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var i=e.name;if(t||ft('type "'+i+'" must have a positive integer typeid pointer'),ot.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;ft("Cannot register type '"+i+"' twice")}if(ot[t]=e,delete at[t],st.hasOwnProperty(t)){var n=st[t];delete st[t],n.forEach((t=>t()))}}function vt(t){ft(t.$$.ptrType.registeredClass.name+" instance already deleted")}var xt=!1;function bt(t){}function _t(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function wt(t,e,r){if(e===r)return t;if(void 0===r.baseClass)return null;var i=wt(t,e,r.baseClass);return null===i?null:r.downcast(i)}var Et={};var Mt=[];function St(){for(;Mt.length;){var t=Mt.pop();t.$$.deleteScheduled=!1,t.delete()}}var Ct=void 0;var Tt={};function It(t,e){return e.ptrType&&e.ptr||gt("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&>("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Bt(Object.create(t,{$$:{value:e}}))}function Rt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=function(t,e){return e=function(t,e){for(void 0===e&&ft("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),Tt[e]}(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var i=r.clone();return this.destructor(t),i}function n(){return this.isSmartPointer?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var s,o=this.registeredClass.getActualType(e),a=Et[o];if(!a)return n.call(this);s=this.isConst?a.constPointerType:a.pointerType;var l=wt(e,this.registeredClass,s.registeredClass);return null===l?n.call(this):this.isSmartPointer?It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}function Bt(t){return"undefined"==typeof FinalizationRegistry?(Bt=t=>t,t):(xt=new FinalizationRegistry((t=>{console.warn(t.leakWarning.stack.replace(/^Error: /,"")),_t(t.$$)})),Bt=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e},i=e.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+i.name+" <0x"+e.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Rt),xt.register(t,r,t)}return t},bt=t=>xt.unregister(t),Bt(t))}function Lt(){}function Pt(t,e,r){if(void 0===t[e].overloadTable){var i=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ft("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[i.argCount]=i}}function Dt(t,e,r,i,n,s,o,a){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=i,this.baseClass=n,this.getActualType=s,this.upcast=o,this.downcast=a,this.pureVirtualFunctions=[]}function Ot(t,e,r){for(;e!==r;)e.upcast||ft("Expected null or instance of "+r.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function kt(t,e){if(null===e)return this.isReference&&ft("null is not a valid "+this.name),0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name);var r=e.$$.ptrType.registeredClass;return Ot(e.$$.ptr,r,this.registeredClass)}function Ut(t,e){var r;if(null===e)return this.isReference&&ft("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&ft("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var i=e.$$.ptrType.registeredClass;if(r=Ot(e.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&ft("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:ft("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var n=e.clone();r=this.rawShare(r,Kt.toHandle((function(){n.delete()}))),null!==t&&t.push(this.rawDestructor,r)}break;default:ft("Unsupporting sharing policy")}return r}function Nt(t,e){if(null===e)return this.isReference&&ft("null is not a valid "+this.name),0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&ft("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;return Ot(e.$$.ptr,r,this.registeredClass)}function Ft(t){return this.fromWireType(E[t>>2])}function zt(t,e,r,i,n,s,o,a,l,c,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=i,this.isSmartPointer=n,this.pointeeType=s,this.sharingPolicy=o,this.rawGetPointee=a,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=h,n||void 0!==e.baseClass?this.toWireType=Ut:i?(this.toWireType=kt,this.destructorFunction=null):(this.toWireType=Nt,this.destructorFunction=null)}var Gt=[];function Qt(t){var e=Gt[t];return e||(t>=Gt.length&&(Gt.length=t+1),Gt[t]=e=O.get(t)),y(O.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e}function jt(t,e){var r=(t=nt(t)).includes("j")?function(t,e){y(t.includes("j")||t.includes("p"),"getDynCaller should only be called with i64 sigs");var r=[];return function(){return r.length=0,Object.assign(r,arguments),function(t,e,r){return t.includes("j")?function(t,e,r){y("dynCall_"+t in n,"bad function pointer type - no table for sig '"+t+"'"),r&&r.length?y(r.length===t.substring(1).replace(/j/g,"--").length):y(1==t.length);var i=n["dynCall_"+t];return r&&r.length?i.apply(null,[e].concat(r)):i.call(null,e)}(t,e,r):(y(Qt(e),"missing table entry in dynCall: "+e),Qt(e).apply(null,r))}(t,e,r)}}(t,e):Qt(e);return"function"!=typeof r&&ft("unknown function pointer with signature "+t+": "+e),r}var Vt=void 0;function Ht(t){var e=_e(t),r=nt(e);return be(e),r}function Wt(t,e){var r=[],i={};throw e.forEach((function t(e){i[e]||ot[e]||(at[e]?at[e].forEach(t):(r.push(e),i[e]=!0))})),new Vt(t+": "+r.map(Ht).join([", "]))}function qt(t,e){for(var r=[],i=0;i>2]);return r}function Zt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function Yt(t,e,r,i,n){var s=e.length;s<2&&ft("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==e[1]&&null!==r,a=!1,l=1;l0?", ":"")+u),d+=(c?"var rv = ":"")+"invoker(fn"+(u.length>0?", ":"")+u+");\n",a)d+="runDestructors(destructors);\n";else for(l=o?1:2;l(t||ft("Cannot use deleted val. handle = "+t),Jt[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Xt.length?Xt.pop():Jt.length;return Jt[e]={refcount:1,value:t},e}}};function $t(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function te(t,e){switch(e){case 2:return function(t){return this.fromWireType(S[t>>2])};case 3:return function(t){return this.fromWireType(C[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function ee(t,e,r){switch(e){case 0:return r?function(t){return x[t]}:function(t){return b[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return w[t>>1]};case 2:return r?function(t){return E[t>>2]}:function(t){return M[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ie(t,e){y(t%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=t,i=r>>1,n=i+e/2;!(i>=n)&&w[i];)++i;if((r=i<<1)-t>32&&re)return re.decode(b.subarray(t,r));for(var s="",o=0;!(o>=e/2);++o){var a=_[t+2*o>>1];if(0==a)break;s+=String.fromCharCode(a)}return s}function ne(t,e,r){if(y(e%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),y("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var i=e,n=(r-=2)<2*t.length?r/2:t.length,s=0;s>1]=o,e+=2}return _[e>>1]=0,e-i}function se(t){return 2*t.length}function oe(t,e){y(t%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,i="";!(r>=e/4);){var n=E[t+4*r>>2];if(0==n)break;if(++r,n>=65536){var s=n-65536;i+=String.fromCharCode(55296|s>>10,56320|1023&s)}else i+=String.fromCharCode(n)}return i}function ae(t,e,r){if(y(e%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),y("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var i=e,n=i+r-4,s=0;s=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++s)),E[e>>2]=o,(e+=4)+4>n)break}return E[e>>2]=0,e-i}function le(t){for(var e=0,r=0;r=55296&&i<=57343&&++r,e+=4}return e}function ce(t){try{return d.grow(t-v.byteLength+65535>>>16),P(d.buffer),1}catch(e){f("emscripten_realloc_buffer: Attempted to grow heap from "+v.byteLength+" bytes to "+t+" bytes, but got error: "+e)}}var he={};function ue(){if(!ue.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(var e in he)void 0===he[e]?delete t[e]:t[e]=he[e];var r=[];for(var e in t)r.push(e+"="+t[e]);ue.strings=r}return ue.strings}var de=[null,[],[]];function pe(t,e){var r=de[t];y(r),0===e||10===e?((1===t?p:f)(I(r,0)),r.length=0):r.push(e)}function fe(t){return t%4==0&&(t%100!=0||t%400==0)}var me=[31,29,31,30,31,30,31,31,30,31,30,31],ge=[31,28,31,30,31,30,31,31,30,31,30,31];function Ae(t,e,r,i){var n=E[i+40>>2],s={tm_sec:E[i>>2],tm_min:E[i+4>>2],tm_hour:E[i+8>>2],tm_mday:E[i+12>>2],tm_mon:E[i+16>>2],tm_year:E[i+20>>2],tm_wday:E[i+24>>2],tm_yday:E[i+28>>2],tm_isdst:E[i+32>>2],tm_gmtoff:E[i+36>>2],tm_zone:n?R(n):""},o=R(r),a={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in a)o=o.replace(new RegExp(l,"g"),a[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function u(t,e,r){for(var i="number"==typeof t?t.toString():t||"";i.length0?1:0}var i;return 0===(i=r(t.getFullYear()-e.getFullYear()))&&0===(i=r(t.getMonth()-e.getMonth()))&&(i=r(t.getDate()-e.getDate())),i}function f(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function m(t){var e=function(t,e){for(var r=new Date(t.getTime());e>0;){var i=fe(r.getFullYear()),n=r.getMonth(),s=(i?me:ge)[n];if(!(e>s-r.getDate()))return r.setDate(r.getDate()+e),r;e-=s-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(t.tm_year+1900,0,1),t.tm_yday),r=new Date(e.getFullYear(),0,4),i=new Date(e.getFullYear()+1,0,4),n=f(r),s=f(i);return p(n,e)<=0?p(s,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var g={"%a":function(t){return c[t.tm_wday].substring(0,3)},"%A":function(t){return c[t.tm_wday]},"%b":function(t){return h[t.tm_mon].substring(0,3)},"%B":function(t){return h[t.tm_mon]},"%C":function(t){return d((t.tm_year+1900)/100|0,2)},"%d":function(t){return d(t.tm_mday,2)},"%e":function(t){return u(t.tm_mday,2," ")},"%g":function(t){return m(t).toString().substring(2)},"%G":function(t){return m(t)},"%H":function(t){return d(t.tm_hour,2)},"%I":function(t){var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),d(e,2)},"%j":function(t){return d(t.tm_mday+function(t,e){for(var r=0,i=0;i<=e;r+=t[i++]);return r}(fe(t.tm_year+1900)?me:ge,t.tm_mon-1),3)},"%m":function(t){return d(t.tm_mon+1,2)},"%M":function(t){return d(t.tm_min,2)},"%n":function(){return"\n"},"%p":function(t){return t.tm_hour>=0&&t.tm_hour<12?"AM":"PM"},"%S":function(t){return d(t.tm_sec,2)},"%t":function(){return"\t"},"%u":function(t){return t.tm_wday||7},"%U":function(t){var e=t.tm_yday+7-t.tm_wday;return d(Math.floor(e/7),2)},"%V":function(t){var e=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&e++,e){if(53==e){var r=(t.tm_wday+371-t.tm_yday)%7;4==r||3==r&&fe(t.tm_year)||(e=1)}}else{e=52;var i=(t.tm_wday+7-t.tm_yday-1)%7;(4==i||5==i&&fe(t.tm_year%400-1))&&e++}return d(e,2)},"%w":function(t){return t.tm_wday},"%W":function(t){var e=t.tm_yday+7-(t.tm_wday+6)%7;return d(Math.floor(e/7),2)},"%y":function(t){return(t.tm_year+1900).toString().substring(2)},"%Y":function(t){return t.tm_year+1900},"%z":function(t){var e=t.tm_gmtoff,r=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(r?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(t){return t.tm_zone},"%%":function(){return"%"}};for(var l in o=o.replace(/%%/g,"\0\0"),g)o.includes(l)&&(o=o.replace(new RegExp(l,"g"),g[l](s)));var A,v,b,_=(!1,v=L(A=o=o.replace(/\0\0/g,"%"))+1,B(A,b=new Array(v),0,b.length),b);return _.length>e?0:(function(t,e){y(t.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),x.set(t,e)}(_,t),_.length-1)}!function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);it=t}(),pt=n.BindingError=dt(Error,"BindingError"),mt=n.InternalError=dt(Error,"InternalError"),Lt.prototype.isAliasOf=function(t){if(!(this instanceof Lt))return!1;if(!(t instanceof Lt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,i=t.$$.ptrType.registeredClass,n=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;i.baseClass;)n=i.upcast(n),i=i.baseClass;return e===i&&r===n},Lt.prototype.clone=function(){if(this.$$.ptr||vt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Bt(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},Lt.prototype.delete=function(){this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ft("Object already scheduled for deletion"),bt(this),_t(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Lt.prototype.isDeleted=function(){return!this.$$.ptr},Lt.prototype.deleteLater=function(){return this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ft("Object already scheduled for deletion"),Mt.push(this),1===Mt.length&&Ct&&Ct(St),this.$$.deleteScheduled=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Tt).length},n.getLiveInheritedInstances=function(){var t=[];for(var e in Tt)Tt.hasOwnProperty(e)&&t.push(Tt[e]);return t},n.flushPendingDeletes=St,n.setDelayFunction=function(t){Ct=t,Mt.length&&Ct&&Ct(St)},zt.prototype.getPointee=function(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},zt.prototype.destructor=function(t){this.rawDestructor&&this.rawDestructor(t)},zt.prototype.argPackAdvance=8,zt.prototype.readValueFromPointer=Ft,zt.prototype.deleteObject=function(t){null!==t&&t.delete()},zt.prototype.fromWireType=Rt,Vt=n.UnboundTypeError=dt(Error,"UnboundTypeError"),n.count_emval_handles=function(){for(var t=0,e=5;e>s])},destructorFunction:null})},_embind_register_class:function(t,e,r,i,s,o,a,l,c,h,u,d,p){u=nt(u),o=jt(s,o),l&&(l=jt(a,l)),h&&(h=jt(c,h)),p=jt(d,p);var f=ht(u);!function(t,e,r){n.hasOwnProperty(t)?(ft("Cannot register public name '"+t+"' twice"),Pt(n,t,t),n.hasOwnProperty(r)&&ft("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),n[t].overloadTable[void 0]=e):n[t]=e}(f,(function(){Wt("Cannot construct "+u+" due to unbound types",[i])})),At([t,e,r],i?[i]:[],(function(e){var r,s;e=e[0],s=i?(r=e.registeredClass).instancePrototype:Lt.prototype;var a=ut(f,(function(){if(Object.getPrototypeOf(this)!==c)throw new pt("Use 'new' to construct "+u);if(void 0===d.constructor_body)throw new pt(u+" has no accessible constructor");var t=d.constructor_body[arguments.length];if(void 0===t)throw new pt("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),c=Object.create(s,{constructor:{value:a}});a.prototype=c;var d=new Dt(u,a,c,p,r,o,l,h),m=new zt(u,d,!0,!1,!1),g=new zt(u+"*",d,!1,!1,!1),A=new zt(u+" const*",d,!1,!0,!1);return Et[t]={pointerType:g,constPointerType:A},function(t,e,r){n.hasOwnProperty(t)||gt("Replacing nonexistant public symbol"),n[t].overloadTable,n[t]=e,n[t].argCount=r}(f,a),[m,g,A]}))},_embind_register_class_constructor:function(t,e,r,i,n,s){y(e>0);var o=qt(e,r);n=jt(i,n),At([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new pt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{Wt("Cannot construct "+t.name+" due to unbound types",o)},At([],o,(function(i){return i.splice(1,0,null),t.registeredClass.constructor_body[e-1]=Yt(r,i,null,n,s),[]})),[]}))},_embind_register_class_function:function(t,e,r,i,n,s,o,a){var l=qt(r,i);e=nt(e),s=jt(n,s),At([],[t],(function(t){var i=(t=t[0]).name+"."+e;function n(){Wt("Cannot call "+i+" due to unbound types",l)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),a&&t.registeredClass.pureVirtualFunctions.push(e);var c=t.registeredClass.instancePrototype,h=c[e];return void 0===h||void 0===h.overloadTable&&h.className!==t.name&&h.argCount===r-2?(n.argCount=r-2,n.className=t.name,c[e]=n):(Pt(c,e,i),c[e].overloadTable[r-2]=n),At([],l,(function(n){var a=Yt(i,n,t,s,o);return void 0===c[e].overloadTable?(a.argCount=r-2,c[e]=a):c[e].overloadTable[r-2]=a,[]})),[]}))},_embind_register_emval:function(t,e){yt(t,{name:e=nt(e),fromWireType:function(t){var e=Kt.toValue(t);return function(t){t>4&&0==--Jt[t].refcount&&(Jt[t]=void 0,Xt.push(t))}(t),e},toWireType:function(t,e){return Kt.toHandle(e)},argPackAdvance:8,readValueFromPointer:Ft,destructorFunction:null})},_embind_register_float:function(t,e,r){var i=rt(r);yt(t,{name:e=nt(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+$t(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:te(e,i),destructorFunction:null})},_embind_register_integer:function(t,e,r,i,n){e=nt(e),-1===n&&(n=4294967295);var s=rt(r),o=t=>t;if(0===i){var a=32-8*r;o=t=>t<>>a}var l=e.includes("unsigned"),c=(t,r)=>{if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+$t(t)+'" to '+r);if(tn)throw new TypeError('Passing a number "'+$t(t)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+i+", "+n+"]!")};yt(t,{name:e,fromWireType:o,toWireType:l?function(t,e){return c(e,this.name),e>>>0}:function(t,e){return c(e,this.name),e},argPackAdvance:8,readValueFromPointer:ee(e,s,0!==i),destructorFunction:null})},_embind_register_memory_view:function(t,e,r){var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function n(t){var e=M,r=e[t>>=2],n=e[t+1];return new i(v,n,r)}yt(t,{name:r=nt(r),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:function(t,e){var r="std::string"===(e=nt(e));yt(t,{name:e,fromWireType:function(t){var e,i=M[t>>2],n=t+4;if(r)for(var s=n,o=0;o<=i;++o){var a=n+o;if(o==i||0==b[a]){var l=R(s,a-s);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),s=a+1}}else{var c=new Array(i);for(o=0;o>2]=i,r&&n)s=e,o=c,y("number"==typeof(a=i+1),"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),B(s,b,o,a);else if(n)for(var h=0;h255&&(be(c),ft("String has UTF-16 code units that do not fit in 8 bits")),b[c+h]=u}else for(h=0;hw,a=1):4===e&&(i=oe,n=ae,o=le,s=()=>M,a=2),yt(t,{name:r,fromWireType:function(t){for(var r,n=M[t>>2],o=s(),l=t+4,c=0;c<=n;++c){var h=t+4+c*e;if(c==n||0==o[h>>a]){var u=i(l,h-l);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),l=h+e}}return be(t),r},toWireType:function(t,i){"string"!=typeof i&&ft("Cannot pass non-string to C++ string type "+r);var s=o(i),l=xe(4+s+e);return M[l>>2]=s>>a,n(i,l+4,s+e),null!==t&&t.push(be,l),l},argPackAdvance:8,readValueFromPointer:Ft,destructorFunction:function(t){be(t)}})},_embind_register_void:function(t,e){yt(t,{isVoid:!0,name:e=nt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},abort:function(){W("native code called abort()")},emscripten_memcpy_big:function(t,e,r){b.copyWithin(t,e,e+r)},emscripten_resize_heap:function(t){var e=b.length;y((t>>>=0)>e);var r,i=2147483648;if(t>i)return f("Cannot enlarge memory, asked to go up to "+t+" bytes, but the limit is "+i+" bytes!"),!1;for(var n=1;n<=4;n*=2){var s=e*(1+.2/n);s=Math.min(s,t+100663296);var o=Math.min(i,(r=Math.max(t,s))+(65536-r%65536)%65536);if(ce(o))return!0}return f("Failed to grow the heap from "+e+" bytes to "+o+" bytes, not enough memory!"),!1},environ_get:function(t,e){var r=0;return ue().forEach((function(i,n){var s=e+r;M[t+4*n>>2]=s,function(t,e,r){for(var i=0;i>0]=t.charCodeAt(i);x[e>>0]=0}(i,s),r+=i.length+1})),0},environ_sizes_get:function(t,e){var r=ue();M[t>>2]=r.length;var i=0;return r.forEach((function(t){i+=t.length+1})),M[e>>2]=i,0},fd_close:function(t){W("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(t,e,r,i,n){return 70},fd_write:function(t,e,r,i){for(var n=0,s=0;s>2],a=M[e+4>>2];e+=8;for(var l=0;l>2]=n,0},strftime_l:function(t,e,r,i){return Ae(t,e,r,i)}},xe=(function(){var t,e={env:ve,wasi_snapshot_preview1:ve};function r(t,e){var r,i=t.exports;n.asm=i,y(d=n.asm.memory,"memory not found in wasm exports"),P(d.buffer),y(O=n.asm.__indirect_function_table,"table not found in wasm exports"),r=n.asm.__wasm_call_ctors,F.unshift(r),function(t){if(Q--,n.monitorRunDependencies&&n.monitorRunDependencies(Q),t?(y(H[t]),delete H[t]):f("warning: run dependency removed without ID"),0==Q&&(null!==j&&(clearInterval(j),j=null),V)){var e=V;V=null,e()}}("wasm-instantiate")}t="wasm-instantiate",Q++,n.monitorRunDependencies&&n.monitorRunDependencies(Q),t?(y(!H[t]),H[t]=1,null===j&&"undefined"!=typeof setInterval&&(j=setInterval((function(){if(A)return clearInterval(j),void(j=null);var t=!1;for(var e in H)t||(t=!0,f("still waiting on run dependencies:")),f("dependency: "+e);t&&f("(end of list)")}),1e4))):f("warning: run dependency added without ID");var s=n;function o(t){y(n===s,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),s=null,r(t.instance)}function a(t){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return K(Z)})):fetch(Z,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return K(Z)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),Z.startsWith("file://")&&f("warning: Loading from a file URI ("+Z+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),W(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(e,r)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(u||"function"!=typeof WebAssembly.instantiateStreaming||X(Z)||"function"!=typeof fetch?a(o):fetch(Z,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(i)}(),n.___wasm_call_ctors=J("__wasm_call_ctors"),n._malloc=J("malloc")),be=n._free=J("free"),_e=n.___getTypeName=J("__getTypeName"),we=(n.__embind_initialize_bindings=J("_embind_initialize_bindings"),n.___errno_location=J("__errno_location"),n._fflush=J("fflush"),n._emscripten_stack_init=function(){return(we=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),Ee=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(Ee=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)}),Me=(n.stackSave=J("stackSave"),n.stackRestore=J("stackRestore"),n.stackAlloc=J("stackAlloc"),n.___cxa_is_pointer_type=J("__cxa_is_pointer_type"));function Se(t){function e(){ye||(ye=!0,n.calledRun=!0,A||(y(!G),G=!0,U(),$(F),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),y(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),z.unshift(t);var t;$(z)}()))}var i;t=t||o,Q>0||(we(),y(0==(3&(i=Ee()))),M[i>>2]=34821223,M[i+4>>2]=2310721022,M[0]=1668509029,function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),N.unshift(t);var t;$(N)}(),Q>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e(),U()))}if(n.dynCall_viijii=J("dynCall_viijii"),n.dynCall_ji=J("dynCall_ji"),n.dynCall_jiji=J("dynCall_jiji"),n.dynCall_iiiiij=J("dynCall_iiiiij"),n.dynCall_iiiiijj=J("dynCall_iiiiijj"),n.dynCall_iiiiiijj=J("dynCall_iiiiiijj"),["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","print","printErr","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readAsmConstArgsArray","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","flush_NO_FILESYSTEM","dlopenMissingError","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var e="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";g(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),W(e)}})})),["ptrToString","zeroMemory","stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getRandomDevice","traverseStack","convertPCtoSourceLocation","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","reallyNegative","unSign","strLen","reSign","formatString","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","checkWasiClock","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","registerInheritedInstance","unregisterInheritedInstance","requireRegisteredType","enumReadValueFromPointer","validateThis","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(t){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var e="`"+t+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";g(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),tt(e)}})})),V=function t(){ye||Se(),ye||(V=t)},n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return Se(),t.ready});t.exports=r},43389:(t,e,r)=>{"use strict";var i=r(25705);function n(){}var s={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==n&&p(this,t)}function h(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function u(t,e,r){i((function(){var i;try{i=e(r)}catch(e){return s.reject(t,e)}i===t?s.reject(t,new TypeError("Cannot resolve promise with itself")):s.resolve(t,i)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var r=!1;function i(e){r||(r=!0,s.reject(t,e))}function n(e){r||(r=!0,s.resolve(t,e))}var o=f((function(){e(n,i)}));"error"===o.status&&i(o.value)}function f(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}t.exports=c,c.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){throw r}))}))},c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===o)return this;var r=new this.constructor(n);return this.state!==l?u(r,this.state===a?t:e,this.outcome):this.queue.push(new h(r,t,e)),r},h.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){s.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},s.resolve=function(t,e){var r=f(d,e);if("error"===r.status)return s.reject(t,r.value);var i=r.value;if(i)p(t,i);else{t.state=a,t.outcome=e;for(var n=-1,o=t.queue.length;++n{r(29718);var i=r(6941).s;function n(t){var e=new i;return(e.write(t)+e.end()).replace(/\0/g,"").trim()}t.exports=function t(e,r){if(!e)return n;try{new TextDecoder(e.trim())}catch(o){var i=s.exec(e);return i&&!r?t("windows-"+i[1],!0):n}return function(t){var r=new TextDecoder(e);return(r.decode(t,{stream:!0})+r.decode()).replace(/\0/g,"").trim()}};var s=/^(?:ANSI\s)?(\d+)$/m},9462:(t,e,r)=>{var i=r(11392);function n(t,e,r,i,n){var s=n(t.slice(e,e+r));switch(i){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return"y"===s.toLowerCase()||"t"===s.toLowerCase();default:return s}}function s(t,e,r,i){for(var s,o,a={},l=0,c=r.length;l{"use strict";t.exports=n;var i=r(80645);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var s=4294967296,o=1/s,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function h(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function u(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,s=this.pos;this.type=7&i,t(n,e,this),this.pos===s&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=x(this.buf,this.pos)+x(this.buf,this.pos+4)*s;return this.pos+=8,t},readSFixed64:function(){var t=x(this.buf,this.pos)+_(this.buf,this.pos+4)*s;return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,s=r.buf;if(i=(112&(n=s[r.pos++]))>>4,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<3,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<10,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<17,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<24,n<128)return c(t,i,e);if(i|=(1&(n=s[r.pos++]))<<31,n<128)return c(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,r){return a.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n239?4:l>223?3:l>191?2:1;if(n+h>r)break;1===h?l<128&&(c=l):2===h?128==(192&(s=t[n+1]))&&(c=(31&l)<<6|63&s)<=127&&(c=null):3===h?(s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&((c=(15&l)<<12|(63&s)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((c=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),n+=h}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==n.Bytes)return t.push(this.readVarint(e));var r=l(this);for(t=t||[];this.pos127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,s=0;s55295&&i<57344){if(!n){i>56319||s+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&h(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&h(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},24472:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>rr});var i=1,n=2,s=3,o=5,a=6378137,l=6356752.314,c=.0066943799901413165,h=484813681109536e-20,u=Math.PI/2,d=1e-10,p=.017453292519943295,f=57.29577951308232,m=Math.PI/4,g=2*Math.PI,A=3.14159265359,y={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const v={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var x=/[\s_\-\/\(\)]/g;function b(t,e){if(t[e])return t[e];for(var r,i=Object.keys(t),n=e.toLowerCase().replace(x,""),s=-1;++s=this.text.length)return;t=this.text[this.place++]}switch(this.state){case E:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},R.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(T.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},R.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=E)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=E,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},R.prototype.number=function(t){if(!I.test(t)){if(T.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},R.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},R.prototype.keyword=function(t){if(C.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=E)}if(!T.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},R.prototype.neutral=function(t){if(S.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(I.test(t))return this.word=t,void(this.state=3);if(!T.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},R.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=D(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(n),n}function k(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?k[t]=_(arguments[1]):k[t]=O(arguments[1]):k[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?k.apply(e,t):k(t)}));if("string"==typeof t){if(t in k)return k[t]}else"EPSG"in t?k["EPSG:"+t.EPSG]=t:"ESRI"in t?k["ESRI:"+t.ESRI]=t:"IAU2000"in t?k["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(k);const U=k;var N=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],F=["3857","900913","3785","102113"];function z(t,e){var r,i;if(t=t||{},!e)return t;for(i in e)void 0!==(r=e[i])&&(t[i]=r);return t}function G(t,e,r){var i=t*e;return r/Math.sqrt(1-i*i)}function Q(t){return t<0?-1:1}function j(t){return Math.abs(t)<=A?t:t-Q(t)*g}function V(t,e,r){var i=t*r,n=.5*t;return i=Math.pow((1-i)/(1+i),n),Math.tan(.5*(u-e))/i}function H(t,e){for(var r,i,n=.5*t,s=u-2*Math.atan(e),o=0;o<=15;o++)if(r=t*Math.sin(s),s+=i=u-2*Math.atan(e*Math.pow((1-r)/(1+r),n))-s,Math.abs(i)<=1e-10)return s;return-9999}function W(t){return t}var q=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,i=t.x,n=t.y;if(n*f>90&&n*f<-90&&i*f>180&&i*f<-180)return null;if(Math.abs(Math.abs(n)-u)<=d)return null;if(this.sphere)e=this.x0+this.a*this.k0*j(i-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(m+.5*n));else{var s=Math.sin(n),o=V(this.e,n,s);e=this.x0+this.a*this.k0*j(i-this.long0),r=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,i=t.x-this.x0,n=t.y-this.y0;if(this.sphere)r=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var s=Math.exp(-n/(this.a*this.k0));if(-9999===(r=H(this.e,s)))return null}return e=j(this.long0+i/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:W,inverse:W,names:["longlat","identity"]}],Z={},Y=[];function X(t,e){var r=Y.length;return t.names?(Y[r]=t,t.names.forEach((function(t){Z[t.toLowerCase()]=r})),this):(console.log(e),!0)}const J={start:function(){q.forEach(X)},add:X,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Z[e]&&Y[Z[e]]?Y[Z[e]]:void 0}};var K={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},$=K.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};K.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var tt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var et={};function rt(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:et[t]||null,isNull:!1}}function it(t){return t/3600*Math.PI/180}function nt(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function st(t){return t.map((function(t){return[it(t.longitudeShift),it(t.latitudeShift)]}))}function ot(t,e,r){return{name:nt(t,e+8,e+16).trim(),parent:nt(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function at(t,e,r,i){for(var n=e+176,s=[],o=0;o-1}))}(t)){var e=O(t);if(function(t){var e=b(t,"authority");if(e){var r=b(e,"epsg");return r&&F.indexOf(r)>-1}}(e))return U["EPSG:3857"];var r=function(t){var e=b(t,"extension");if(e)return b(e,"proj4")}(e);return r?_(r):e}return function(t){return"+"===t[0]}(t)?_(t):void 0}(t);if("object"==typeof r){var a=lt.projections.get(r.projName);if(a){if(r.datumCode&&"none"!==r.datumCode){var l=b(tt,r.datumCode);l&&(r.datum_params=r.datum_params||(l.towgs84?l.towgs84.split(","):null),r.ellps=l.ellipse,r.datumName=l.datumName?l.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var c,u,p,f,m,g,A=function(t,e,r,i,n){if(!t){var s=b(K,i);s||(s=$),t=s.a,e=s.b,r=s.rf}return r&&!e&&(e=(1-1/r)*t),(0===r||Math.abs(t-e)3&&(0===d.datum_params[3]&&0===d.datum_params[4]&&0===d.datum_params[5]&&0===d.datum_params[6]||(d.datum_type=n,d.datum_params[3]*=h,d.datum_params[4]*=h,d.datum_params[5]*=h,d.datum_params[6]=d.datum_params[6]/1e6+1))),u&&(d.datum_type=s,d.grids=u),d.a=r,d.b=a,d.es=l,d.ep2=c,d}(r.datumCode,r.datum_params,A.a,A.b,y.es,y.ep2,v);z(this,r),z(this,a),this.a=A.a,this.b=A.b,this.rf=A.rf,this.sphere=A.sphere,this.es=y.es,this.e=y.e,this.ep2=y.ep2,this.datum=x,this.init(),e(null,this)}else e(t)}else e(t)}lt.projections=J,lt.projections.start();const ct=lt;function ht(t,e,r){var i,n,s,o,a=t.x,l=t.y,c=t.z?t.z:0;if(l<-u&&l>-1.001*u)l=-u;else if(l>u&&l<1.001*u)l=u;else{if(l<-u)return{x:-1/0,y:-1/0,z:t.z};if(l>u)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(l),o=Math.cos(l),s=n*n,{x:((i=r/Math.sqrt(1-e*s))+c)*o*Math.cos(a),y:(i+c)*o*Math.sin(a),z:(i*(1-e)+c)*n}}function ut(t,e,r,i){var n,s,o,a,l,c,h,u,d,p,f,m,g,A,y,v=t.x,x=t.y,b=t.z?t.z:0;if(n=Math.sqrt(v*v+x*x),s=Math.sqrt(v*v+x*x+b*b),n/r<1e-12){if(A=0,s/r<1e-12)return y=-i,{x:t.x,y:t.y,z:t.z}}else A=Math.atan2(x,v);o=b/s,u=(a=n/s)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),d=o*l,g=0;do{g++,c=e*(h=r/Math.sqrt(1-e*d*d))/(h+(y=n*u+b*d-h*(1-e*d*d))),m=(f=o*(l=1/Math.sqrt(1-c*(2-c)*a*a)))*u-(p=a*(1-c)*l)*d,u=p,d=f}while(m*m>1e-24&&g<30);return{x:A,y:Math.atan(f/Math.abs(p)),z:y}}function dt(t){return t===i||t===n}function pt(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var i={x:-r.x,y:r.y},n={x:Number.NaN,y:Number.NaN},s=[];t:for(var o=0;oi.y||p>i.x||A1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=j(s.x+r.ll[0]),i.y=s.y+r.ll[1]}else isNaN(s.x)||(i.x=t.x+s.x,i.y=t.y+s.y);return i}function mt(t,e){var r,i={x:t.x/e.del[0],y:t.y/e.del[1]},n=Math.floor(i.x),s=Math.floor(i.y),o=i.x-1*n,a=i.y-1*s,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=e.lim[0])return l;if(s<0||s>=e.lim[1])return l;r=s*e.lim[0]+n;var c=e.cvs[r][0],h=e.cvs[r][1];r++;var u=e.cvs[r][0],d=e.cvs[r][1];r+=e.lim[0];var p=e.cvs[r][0],f=e.cvs[r][1];r--;var m=e.cvs[r][0],g=e.cvs[r][1],A=o*a,y=o*(1-a),v=(1-o)*(1-a),x=(1-o)*a;return l.x=v*c+y*u+x*m+A*p,l.y=v*h+y*d+x*g+A*f,l}function gt(t,e,r){var i,n,s,o=r.x,a=r.y,l=r.z||0,c={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==r.z)switch(0===s?(i=o,n=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(i=a,n=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(i=l,n="z"),t.axis[s]){case"e":case"n":c[n]=i;break;case"w":case"s":c[n]=-i;break;case"u":void 0!==r[n]&&(c.z=i);break;case"d":void 0!==r[n]&&(c.z=-i);break;default:return null}return c}function At(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function yt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function vt(t,e,r,h){var u,d=void 0!==(r=Array.isArray(r)?At(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){yt(t.x),yt(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===i||t.datum.datum_type===n||t.datum.datum_type===s)&&"WGS84"!==e.datumCode||(e.datum.datum_type===i||e.datum.datum_type===n||e.datum.datum_type===s)&&"WGS84"!==t.datumCode}(t,e)&&(r=vt(t,u=new ct("WGS84"),r,h),t=u),h&&"enu"!==t.axis&&(r=gt(t,!1,r)),"longlat"===t.projName)r={x:r.x*p,y:r.y*p,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===i?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==n||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===o||e.datum_type===o)return r;var h=t.a,u=t.es;if(t.datum_type===s){if(0!==pt(t,!1,r))return;h=a,u=c}var d=e.a,p=e.b,f=e.es;return e.datum_type===s&&(d=a,p=l,f=c),u!==f||h!==d||dt(t.datum_type)||dt(e.datum_type)?(r=ht(r,u,h),dt(t.datum_type)&&(r=function(t,e,r){if(e===i)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===n){var s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6];return{x:u*(t.x-h*t.y+c*t.z)+s,y:u*(h*t.x+t.y-l*t.z)+o,z:u*(-c*t.x+l*t.y+t.z)+a}}}(r,t.datum_type,t.datum_params)),dt(e.datum_type)&&(r=function(t,e,r){if(e===i)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===n){var s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],d=(t.x-s)/u,p=(t.y-o)/u,f=(t.z-a)/u;return{x:d+h*p-c*f,y:-h*d+p+l*f,z:c*d-l*p+f}}}(r,e.datum_type,e.datum_params)),r=ut(r,f,d,p),e.datum_type!==s||0===pt(e,!0,r)?r:void 0):r}(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*f,y:r.y*f,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),h&&"enu"!==e.axis?gt(e,!0,r):(r&&!d&&delete r.z,r)}var xt=ct("WGS84");function bt(t,e,r,i){var n,s,o;return Array.isArray(r)?(n=vt(t,e,r,i)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(r.splice(3)):[n.x,n.y,r[2]].concat(r.splice(3)):[n.x,n.y].concat(r.splice(2)):[n.x,n.y]):(s=vt(t,e,r,i),2===(o=Object.keys(r)).length||o.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;s[i]=r[i]})),s)}function _t(t){return t instanceof ct?t:t.oProj?t.oProj:ct(t)}const wt=function(t,e,r){t=_t(t);var i,n=!1;return void 0===e?(e=t,t=xt,n=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=xt,n=!0),e=_t(e),r?bt(t,e,r):(i={forward:function(r,i){return bt(t,e,r,i)},inverse:function(r,i){return bt(e,t,r,i)}},n&&(i.oProj=e),i)};var Et=6,Mt="AJSAJS",St="AFAFAF",Ct=65,Tt=73,It=79,Rt=86,Bt=90;const Lt={forward:Pt,inverse:function(t){var e=Ut(Ft(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:Dt};function Pt(t,e){return e=e||5,function(t,e){var r,i,n,s,o,a,l,c,h,u,d,p="00000"+t.easting,f="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(h=t.easting,u=t.northing,d=Nt(t.zoneNumber),r=Math.floor(h/1e5),i=Math.floor(u/1e5)%20,n=d-1,s=Mt.charCodeAt(n),o=St.charCodeAt(n),c=!1,(a=s+r-1)>Bt&&(a=a-Bt+Ct-1,c=!0),(a===Tt||sTt||(a>Tt||sIt||(a>It||sBt&&(a=a-Bt+Ct-1),(l=o+i)>Rt?(l=l-Rt+Ct-1,c=!0):c=!1,(l===Tt||oTt||(l>Tt||oIt||(l>It||oRt&&(l=l-Rt+Ct-1),String.fromCharCode(a)+String.fromCharCode(l))+p.substr(p.length-5,e)+f.substr(f.length-5,e)}(function(t){var e,r,i,n,s,o,a,l=t.lat,c=t.lon,h=6378137,u=.00669438,d=.9996,p=Ot(l),f=Ot(c);a=Math.floor((c+180)/6)+1,180===c&&(a=60),l>=56&&l<64&&c>=3&&c<12&&(a=32),l>=72&&l<84&&(c>=0&&c<9?a=31:c>=9&&c<21?a=33:c>=21&&c<33?a=35:c>=33&&c<42&&(a=37)),o=Ot(6*(a-1)-180+3),e=.006739496752268451,r=h/Math.sqrt(1-u*Math.sin(p)*Math.sin(p)),i=Math.tan(p)*Math.tan(p),n=e*Math.cos(p)*Math.cos(p);var m,g,A=d*r*((s=Math.cos(p)*(f-o))+(1-i+n)*s*s*s/6+(5-18*i+i*i+72*n-58*e)*s*s*s*s*s/120)+5e5,y=d*(h*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p))+r*Math.tan(p)*(s*s/2+(5-i+9*n+4*n*n)*s*s*s*s/24+(61-58*i+i*i+600*n-2.2240339282485886)*s*s*s*s*s*s/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(A),zoneNumber:a,zoneLetter:(m=l,g="Z",84>=m&&m>=72?g="X":72>m&&m>=64?g="W":64>m&&m>=56?g="V":56>m&&m>=48?g="U":48>m&&m>=40?g="T":40>m&&m>=32?g="S":32>m&&m>=24?g="R":24>m&&m>=16?g="Q":16>m&&m>=8?g="P":8>m&&m>=0?g="N":0>m&&m>=-8?g="M":-8>m&&m>=-16?g="L":-16>m&&m>=-24?g="K":-24>m&&m>=-32?g="J":-32>m&&m>=-40?g="H":-40>m&&m>=-48?g="G":-48>m&&m>=-56?g="F":-56>m&&m>=-64?g="E":-64>m&&m>=-72?g="D":-72>m&&m>=-80&&(g="C"),g)}}({lat:t[1],lon:t[0]}),e)}function Dt(t){var e=Ut(Ft(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Ot(t){return t*(Math.PI/180)}function kt(t){return t/Math.PI*180}function Ut(t){var e=t.northing,r=t.easting,i=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var s,o,a,l,c,h,u,d,p,f=.9996,m=6378137,g=.00669438,A=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,v=e;i<"N"&&(v-=1e7),u=6*(n-1)-180+3,s=.006739496752268451,p=(d=v/f/6367449.145945056)+(3*A/2-27*A*A*A/32)*Math.sin(2*d)+(21*A*A/16-55*A*A*A*A/32)*Math.sin(4*d)+151*A*A*A/96*Math.sin(6*d),o=m/Math.sqrt(1-g*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),l=s*Math.cos(p)*Math.cos(p),c=.99330562*m/Math.pow(1-g*Math.sin(p)*Math.sin(p),1.5),h=y/(o*f);var x=p-o*Math.tan(p)/c*(h*h/2-(5+3*a+10*l-4*l*l-9*s)*h*h*h*h/24+(61+90*a+298*l+45*a*a-1.6983531815716497-3*l*l)*h*h*h*h*h*h/720);x=kt(x);var b,_=(h-(1+2*a+l)*h*h*h/6+(5-2*l+28*a-3*l*l+8*s+24*a*a)*h*h*h*h*h/120)/Math.cos(p);if(_=u+kt(_),t.accuracy){var w=Ut({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:w.lat,right:w.lon,bottom:x,left:_}}else b={lat:x,lon:_};return b}function Nt(t){var e=t%Et;return 0===e&&(e=Et),e}function Ft(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,i=null,n="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;n+=e,s++}var o=parseInt(n,10);if(0===s||s+3>r)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;i=t.substring(s,s+=2);for(var l=Nt(o),c=function(t,e){for(var r=Mt.charCodeAt(e-1),i=1e5,n=!1;r!==t.charCodeAt(0);){if(++r===Tt&&r++,r===It&&r++,r>Bt){if(n)throw"Bad character: "+t;r=Ct,n=!0}i+=1e5}return i}(i.charAt(0),l),h=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=St.charCodeAt(e-1),i=0,n=!1;r!==t.charCodeAt(0);){if(++r===Tt&&r++,r===It&&r++,r>Rt){if(n)throw"Bad character: "+t;r=Ct,n=!0}i+=1e5}return i}(i.charAt(1),l);h0&&(d=1e5/Math.pow(10,m),p=t.substring(s,s+m),g=parseFloat(p)*d,f=t.substring(s+m),A=parseFloat(f)*d),{easting:g+c,northing:A+h,zoneLetter:a,zoneNumber:o,accuracy:d}}function zt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Gt(t,e,r){if(!(this instanceof Gt))return new Gt(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Gt.fromMGRS=function(t){return new Gt(Dt(t))},Gt.prototype.toMGRS=function(t){return Pt([this.x,this.y],t)};const Qt=Gt;var jt=.046875,Vt=.01953125,Ht=.01068115234375;function Wt(t){var e=[];e[0]=1-t*(.25+t*(jt+t*(Vt+t*Ht))),e[1]=t*(.75-t*(jt+t*(Vt+t*Ht)));var r=t*t;return e[2]=r*(.46875-t*(.013020833333333334+.007120768229166667*t)),r*=t,e[3]=r*(.3645833333333333-.005696614583333333*t),e[4]=r*t*.3076171875,e}function qt(t,e,r,i){return r*=e,e*=e,i[0]*t-r*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))}function Zt(t,e,r){for(var i=1/(1-e),n=t,s=20;s;--s){var o=Math.sin(n),a=1-e*o*o;if(n-=a=(qt(n,o,Math.cos(n),r)-t)*(a*Math.sqrt(a))*i,Math.abs(a)d?Math.tan(s):0,m=Math.pow(f,2),g=Math.pow(m,2);e=1-this.es*Math.pow(a,2),c/=Math.sqrt(e);var A=qt(s,a,l,this.en);r=this.a*(this.k0*c*(1+h/6*(1-m+u+h/20*(5-18*m+g+14*u-58*m*u+h/42*(61+179*g-g*m-479*m)))))+this.x0,i=this.a*(this.k0*(A-this.ml0+a*o*c/2*(1+h/12*(5-m+9*u+4*p+h/30*(61+g-58*m+270*u-330*m*u+h/56*(1385+543*g-g*m-3111*m))))))+this.y0}else{var y=l*Math.sin(o);if(Math.abs(Math.abs(y)-1)=1){if(y-1>d)return 93;i=0}else i=Math.acos(i);s<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=r,t.y=i,t},inverse:function(t){var e,r,i,n,s=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(r=Zt(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(r)d?Math.tan(r):0,h=this.ep2*Math.pow(l,2),p=Math.pow(h,2),f=Math.pow(c,2),m=Math.pow(f,2);e=1-this.es*Math.pow(a,2);var g=s*Math.sqrt(e)/this.k0,A=Math.pow(g,2);i=r-(e*=c)*A/(1-this.es)*.5*(1-A/12*(5+3*f-9*h*f+h-4*p-A/30*(61+90*f-252*h*f+45*m+46*h-A/56*(1385+3633*f+4095*m+1574*m*f)))),n=j(this.long0+g*(1-A/6*(1+2*f+h-A/20*(5+28*f+24*m+8*h*f+6*h-A/42*(61+662*f+1320*m+720*m*f))))/l)}else i=u*Q(o),n=0;else{var y=Math.exp(s/this.k0),v=.5*(y-1/y),x=this.lat0+o/this.k0,b=Math.cos(x);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(v,2))),i=Math.asin(e),o<0&&(i=-i),n=0===v&&0===b?0:j(Math.atan2(v,b)+this.long0)}return t.x=n,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Xt(t){var e=Math.exp(t);return(e-1/e)/2}function Jt(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),i=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function Kt(t,e){for(var r,i=2*Math.cos(2*e),n=t.length-1,s=t[n],o=0;--n>=0;)r=i*s-o+t[n],o=s,s=r;return e+r*Math.sin(2*e)}function $t(t,e,r){for(var i,n,s=Math.sin(e),o=Math.cos(e),a=Xt(r),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(r),c=2*o*l,h=-2*s*a,u=t.length-1,d=t[u],p=0,f=0,m=0;--u>=0;)i=f,n=p,d=c*(f=d)-i-h*(p=m)+t[u],m=h*f-n+c*p;return[(c=s*l)*d-(h=o*a)*m,c*m+h*d]}const te={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Yt.init.apply(this),this.forward=Yt.forward,this.inverse=Yt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var i=Kt(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var r,i=2*Math.cos(e),n=t.length-1,s=t[n],o=0;--n>=0;)r=i*s-o+t[n],o=s,s=r;return Math.sin(e)*r}(this.gtu,2*i))},forward:function(t){var e=j(t.x-this.long0),r=t.y;r=Kt(this.cbg,r);var i=Math.sin(r),n=Math.cos(r),s=Math.sin(e),o=Math.cos(e);r=Math.atan2(i,o*n),e=Math.atan2(s*n,Jt(i,n*o)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(Jt(1,e)+1))),t<0?-e:e}(Math.tan(e));var a,l,c=$t(this.gtu,2*r,2*e);return r+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,r,i=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var s=$t(this.utg,2*n,2*i);n+=s[0],i+=s[1],i=Math.atan(Xt(i));var o=Math.sin(n),a=Math.cos(n),l=Math.sin(i),c=Math.cos(i);n=Math.atan2(o*c,Jt(l,c*a)),e=j((i=Math.atan2(l,c*a))+this.long0),r=Kt(this.cgb,n)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ee={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(j(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*p,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,te.init.apply(this),this.forward=te.forward,this.inverse=te.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function re(t,e){return Math.pow((1-t)/(1+t),e)}const ie={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+m)/(Math.pow(Math.tan(.5*this.lat0+m),this.C)*re(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+m),this.C)*re(this.e*Math.sin(r),this.ratexp))-u,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,i=Math.pow(Math.tan(.5*r+m)/this.K,1/this.C),n=20;n>0&&(r=2*Math.atan(i*re(this.e*Math.sin(t.y),-.5*this.e))-u,!(Math.abs(r-t.y)<1e-14));--n)t.y=r;return n?(t.x=e,t.y=r,t):null},names:["gauss"]},ne={init:function(){ie.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,i,n;return t.x=j(t.x-this.long0),ie.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),i=Math.cos(t.x),n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*i),t.x=n*r*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*r*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,i,n,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var o=2*Math.atan2(s,this.R2);e=Math.sin(o),r=Math.cos(o),n=Math.asin(r*this.sinc0+t.y*e*this.cosc0/s),i=Math.atan2(t.x*e,s*this.cosc0*r-t.y*this.sinc0*e)}else n=this.phic0,i=0;return t.x=i,t.y=n,ie.inverse.apply(this,[t]),t.x=j(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},se={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=d&&(this.k0=.5*(1+Q(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=d&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=d&&Math.abs(Math.cos(this.lat_ts))>d&&(this.k0=.5*this.cons*G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/V(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=G(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,i,n,s,o,a=t.x,l=t.y,c=Math.sin(l),h=Math.cos(l),p=j(a-this.long0);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=d&&Math.abs(l+this.lat0)<=d?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*h*Math.cos(p)),t.x=this.a*e*h*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*h*Math.cos(p))+this.y0,t):(r=2*Math.atan(this.ssfn_(l,c,this.e))-u,n=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=d?(s=V(this.e,l*this.con,this.con*c),o=2*this.a*this.k0*s/this.cons,t.x=this.x0+o*Math.sin(a-this.long0),t.y=this.y0-this.con*o*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)0?j(this.long0+Math.atan2(t.x,-1*t.y)):j(this.long0+Math.atan2(t.x,t.y)):j(this.long0+Math.atan2(t.x*Math.sin(a),o*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=d){if(o<=d)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,i=o*this.cons/(2*this.a*this.k0),r=this.con*H(this.e,i),e=this.con*j(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=d?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/o),e=j(this.long0+Math.atan2(t.x*Math.sin(n),o*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))),r=-1*H(this.e,Math.tan(.5*(u+s)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(u+t))*Math.pow((1-e)/(1+e),.5*r)}},oe={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,i=1/this.rf,n=2*i-Math.pow(i,2),s=this.e=Math.sqrt(n);this.R=this.k0*r*Math.sqrt(1-n)/(1-n*Math.pow(e,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=-this.alpha*(e+r)+this.K,n=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,i=e/this.R,n=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(i)),o=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(n))),a=this.lambda0+o/this.alpha,l=0,c=s,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=c,t},names:["somerc"]};var ae=1e-7;const le={init:function(){var t,e,r,i,n,s,o,a,l,c,h,f,A,y=0,v=0,x=0,b=0,_=0,w=0,E=0;this.no_off=(A="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(A)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),M&&(E=this.alpha),S&&(y=this.rectified_grid_angle*p),M||S)v=this.longc;else if(x=this.long1,_=this.lat1,b=this.long2,w=this.lat2,Math.abs(_-w)<=ae||(t=Math.abs(_))<=ae||Math.abs(t-u)<=ae||Math.abs(Math.abs(this.lat0)-u)<=ae||Math.abs(Math.abs(w)-u)<=ae)throw new Error;var C=1-this.es;e=Math.sqrt(C),Math.abs(this.lat0)>d?(a=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*a*a,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*e/t,(n=(i=this.B*e/(r*Math.sqrt(t)))*i-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(V(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=n=1),M||S?(M?(h=Math.asin(Math.sin(E)/i),S||(y=E)):(h=y,E=Math.asin(i*Math.sin(h))),this.lam0=v-Math.asin(.5*(n-1/n)*Math.tan(h))/this.B):(s=Math.pow(V(this.e,_,Math.sin(_)),this.B),o=Math.pow(V(this.e,w,Math.sin(w)),this.B),n=this.E/s,l=(o-s)/(o+s),c=((c=this.E*this.E)-o*s)/(c+o*s),(t=x-b)<-Math.pi?b-=g:t>Math.pi&&(b+=g),this.lam0=j(.5*(x+b)-Math.atan(c*Math.tan(.5*this.B*(x-b))/l)/this.B),h=Math.atan(2*Math.sin(this.B*j(x-this.lam0))/(n-1/n)),y=E=Math.asin(i*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(E))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(m-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(m+n))},forward:function(t){var e,r,i,n,s,o,a,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-u)>d){if(e=.5*((s=this.E/Math.pow(V(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/s)),r=.5*(s+o),n=Math.sin(this.B*t.x),i=(e*this.singam-n*this.cosgam)/r,Math.abs(Math.abs(i)-1)0?this.v_pole_n:this.v_pole_s,a=this.ArB*t.y;return this.no_rot?(c.x=a,c.y=l):(a-=this.u_0,c.x=l*this.cosrot+a*this.sinrot,c.y=a*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,r,i,n,s,o,a,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((i=Math.exp(-this.BrA*r))-1/i),s=.5*(i+1/i),a=((o=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/s,Math.abs(Math.abs(a)-1)d?this.ns=Math.log(i/a)/Math.log(n/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=d&&(r=Q(r)*(u-2e-10));var i,n,s=Math.abs(Math.abs(r)-u);if(s>d)i=V(this.e,r,Math.sin(r)),n=this.a*this.f0*Math.pow(i,this.ns);else{if((s=r*this.ns)<=0)return null;n=0}var o=this.ns*j(e-this.long0);return t.x=this.k0*(n*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,t},inverse:function(t){var e,r,i,n,s,o=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+a*a),r=1):(e=-Math.sqrt(o*o+a*a),r=-1);var l=0;if(0!==e&&(l=Math.atan2(r*o,r*a)),0!==e||this.ns>0){if(r=1/this.ns,i=Math.pow(e/(this.a*this.f0),r),-9999===(n=H(this.e,i)))return null}else n=-u;return s=j(l/this.ns+this.long0),t.x=s,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},he={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,i,n,s,o,a,l=t.x,c=t.y,h=j(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),i=-h*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),s=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(n)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,i,n,s,o,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(e)),t.x=this.long0-r/this.alfa,o=e,a=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(a=1),o=t.y,c+=1}while(0===a&&c<15);return c>=15?null:t},names:["Krovak","krovak"]};function ue(t,e,r,i,n){return t*n-e*Math.sin(2*n)+r*Math.sin(4*n)-i*Math.sin(6*n)}function de(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function pe(t){return.375*t*(1+.25*t*(1+.46875*t))}function fe(t){return.05859375*t*t*(1+.75*t)}function me(t){return t*t*t*(35/3072)}function ge(t,e,r){var i=e*r;return t/Math.sqrt(1-i*i)}function Ae(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}const be={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-u)0)switch(this.qp=xe(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,e=t*t,r[0]+=.17222222222222222*e,r[1]=.06388888888888888*e,e*=t,r[0]+=.10257936507936508*e,r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=xe(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,i,n,s,o,a,l,c,h,p=t.x,f=t.y;if(p=j(p-this.long0),this.sphere){if(s=Math.sin(f),h=Math.cos(f),i=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+h*i:1+this.sinph0*s+this.cosph0*h*i)<=d)return null;e=(r=Math.sqrt(2/r))*h*Math.sin(p),r*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(f+this.lat0)=0?(e=(c=Math.sqrt(o))*n,r=i*(this.mode===this.S_POLE?c:-c)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,i,n,s,o,a,l,c,h,p=t.x/this.a,f=t.y/this.a;if(this.sphere){var m,g=0,A=0;if((r=.5*(m=Math.sqrt(p*p+f*f)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(A=Math.sin(r),g=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(m)<=d?0:Math.asin(f*A/m),p*=A,f=g*m;break;case this.OBLIQ:r=Math.abs(m)<=d?this.lat0:Math.asin(g*this.sinph0+f*A*this.cosph0/m),p*=A*this.cosph0,f=(g-Math.sin(r)*this.sinph0)*m;break;case this.N_POLE:f=-f,r=u-r;break;case this.S_POLE:r-=u}e=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(o=Math.sqrt(p*p+f*f))1&&(t=t>1?1:-1),Math.asin(t)}const we={init:function(){Math.abs(this.lat1+this.lat2)d?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=xe(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*j(e-this.long0),o=n*Math.sin(s)+this.x0,a=this.rh-n*Math.cos(s)+this.y0;return t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),n=0,0!==e&&(n=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-i*i)/(2*this.ns0)):(r=(this.c-i*i)/this.ns0,o=this.phi1z(this.e3,r)),s=j(n/this.ns0+this.long0),t.x=s,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,i,n,s,o=_e(.5*e);if(t0||Math.abs(s)<=d?(o=this.x0+1*this.a*r*Math.sin(i)/s,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)/s):(o=this.x0+this.infinity_dist*r*Math.sin(i),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*n)),t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),r=Math.sin(n),o=_e((i=Math.cos(n))*this.sin_p14+t.y*r*this.cos_p14/e),s=Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r),s=j(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t},names:["gnom"]},Me={init:function(){this.sphere||(this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,i=t.x,n=t.y,s=j(i-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=xe(this.e,Math.sin(n));e=this.x0+this.a*this.k0*s,r=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=j(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*u:u;for(var i,n,s,o,a=Math.asin(.5*e),l=0;l<30;l++)if(n=Math.sin(a),s=Math.cos(a),o=t*n,a+=i=Math.pow(1-o*o,2)/(2*s)*(e/(1-t*t)-n/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(i)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),e=j(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]},Se={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,i=j(e-this.long0),n=Ae(r-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*n,t},inverse:function(t){var e=t.x,r=t.y;return t.x=j(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Ae(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ce={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=de(this.es),this.e1=pe(this.es),this.e2=fe(this.es),this.e3=me(this.es),this.ml0=this.a*ue(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,i,n=t.x,s=t.y,o=j(n-this.long0);if(i=o*Math.sin(s),this.sphere)Math.abs(s)<=d?(e=this.a*o,r=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(s),r=this.a*(Ae(s-this.lat0)+(1-Math.cos(i))/Math.tan(s)));else if(Math.abs(s)<=d)e=this.a*o,r=-1*this.ml0;else{var a=ge(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(i),r=this.a*ue(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(i))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,i,n,s,o,a,l,c;if(i=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=d)e=j(i/this.a+this.long0),r=0;else{var h;for(o=this.lat0+n/this.a,a=i*i/this.a/this.a+o*o,l=o,s=20;s;--s)if(l+=c=-1*(o*(l*(h=Math.tan(l))+1)-l-.5*(l*l+a)*h)/((l-o)/h-1),Math.abs(c)<=d){r=l;break}e=j(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(n+this.ml0)<=d)r=0,e=j(this.long0+i/this.a);else{var u,p,f,m,g;for(o=(this.ml0+n)/this.a,a=i*i/this.a/this.a+o*o,l=o,s=20;s;--s)if(g=this.e*Math.sin(l),u=Math.sqrt(1-g*g)*Math.tan(l),p=this.a*ue(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(o*(u*(m=p/this.a)+1)-m-.5*u*(m*m+a))/(this.es*Math.sin(2*l)*(m*m+a-2*o*m)/(4*u)+(o-m)*(u*f-2/Math.sin(2*l))-f),Math.abs(c)<=d){r=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=j(this.long0+Math.asin(i*u/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]},Te={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,i=t.y-this.lat0,n=r-this.long0,s=i/h*1e-5,o=n,a=1,l=0;for(e=1;e<=10;e++)a*=s,l+=this.A[e]*a;var c,u=l,d=o,p=1,f=0,m=0,g=0;for(e=1;e<=6;e++)c=f*u+p*d,p=p*u-f*d,f=c,m=m+this.B_re[e]*p-this.B_im[e]*f,g=g+this.B_im[e]*p+this.B_re[e]*f;return t.x=g*this.a+this.x0,t.y=m*this.a+this.y0,t},inverse:function(t){var e,r,i=t.x,n=t.y,s=i-this.x0,o=(n-this.y0)/this.a,a=s/this.a,l=1,c=0,u=0,d=0;for(e=1;e<=6;e++)r=c*o+l*a,l=l*o-c*a,c=r,u=u+this.C_re[e]*l-this.C_im[e]*c,d=d+this.C_im[e]*l+this.C_re[e]*c;for(var p=0;p.999999999999&&(r=.999999999999),e=Math.asin(r);var i=j(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var n=Math.asin(r);return t.x=i,t.y=n,t},names:["Mollweide","moll"]},Le={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;return 0!==r&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere?(n=j(this.long0+s/this.ns),i=Ae(this.g-r/this.a),t.x=n,t.y=i,t):(i=ye(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),n=j(this.long0+s/this.ns),t.x=n,t.y=i,t)},names:["Equidistant_Conic","eqdc"]},Pe={init:function(){this.R=this.a},forward:function(t){var e,r,i=t.x,n=t.y,s=j(i-this.long0);Math.abs(n)<=d&&(e=this.x0+this.R*s,r=this.y0);var o=_e(2*Math.abs(n/Math.PI));(Math.abs(s)<=d||Math.abs(Math.abs(n)-u)<=d)&&(e=this.x0,r=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/s-s/Math.PI),l=a*a,c=Math.sin(o),h=Math.cos(o),p=h/(c+h-1),f=p*p,m=p*(2/c-1),g=m*m,A=Math.PI*this.R*(a*(p-g)+Math.sqrt(l*(p-g)*(p-g)-(g+l)*(f-g)))/(g+l);s<0&&(A=-A),e=this.x0+A;var y=l+p;return A=Math.PI*this.R*(m*y-a*Math.sqrt((g+l)*(l+1)-y*y))/(g+l),r=n>=0?this.y0+A:this.y0-A,t.x=e,t.y=r,t},inverse:function(t){var e,r,i,n,s,o,a,l,c,h,u,p;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=(i=t.x/u)*i+(n=t.y/u)*n,u=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+s))+1+2*n*n+s*s)+(2*(a=o-2*n*n+i*i)*a*a/l/l/l-9*o*a/l/l)/27)/(c=(o-a*a/3/l)/l)/(h=2*Math.sqrt(-c/3)),Math.abs(u)>1&&(u=u>=0?1:-1),p=Math.acos(u)/3,r=t.y>=0?(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(i)2*u*this.a)return;return r=e/this.a,i=Math.sin(r),n=Math.cos(r),s=this.long0,Math.abs(e)<=d?o=this.lat0:(o=_e(n*this.sin_p12+t.y*i*this.cos_p12/e),a=Math.abs(this.lat0)-u,s=Math.abs(a)<=d?this.lat0>=0?j(this.long0+Math.atan2(t.x,-t.y)):j(this.long0-Math.atan2(-t.x,t.y)):j(this.long0+Math.atan2(t.x*i,e*this.cos_p12*n-t.y*this.sin_p12*i))),t.x=s,t.y=o,t}return l=de(this.es),c=pe(this.es),h=fe(this.es),p=me(this.es),Math.abs(this.sin_p12-1)<=d?(o=ye(((f=this.a*ue(l,c,h,p,u))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,c,h,p),s=j(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=o,t):Math.abs(this.sin_p12+1)<=d?(f=this.a*ue(l,c,h,p,u),o=ye(((e=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,l,c,h,p),s=j(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),A=Math.atan2(t.x,t.y),m=ge(this.a,this.e,this.sin_p12),y=Math.cos(A),x=-(v=this.e*this.cos_p12*y)*v/(1-this.es),b=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),E=1-x*(w=(_=e/m)-x*(1+x)*Math.pow(_,3)/6-b*(1+3*x)*Math.pow(_,4)/24)*w/2-_*w*w*w/6,g=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*y),s=j(this.long0+Math.asin(Math.sin(A)*Math.sin(w)/Math.cos(g))),M=Math.sin(g),o=Math.atan2((M-this.es*E*this.sin_p12)*Math.tan(g),M*(1-this.es)),t.x=s,t.y=o,t)},names:["Azimuthal_Equidistant","aeqd"]},Oe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,i,n,s,o,a,l=t.x,c=t.y;return i=j(l-this.long0),e=Math.sin(c),r=Math.cos(c),n=Math.cos(i),((s=this.sin_p14*e+this.cos_p14*r*n)>0||Math.abs(s)<=d)&&(o=1*this.a*r*Math.sin(i),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)),t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o,a;return t.x-=this.x0,t.y-=this.y0,r=_e((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),i=Math.sin(r),n=Math.cos(r),o=this.long0,Math.abs(e)<=d?(a=this.lat0,t.x=o,t.y=a,t):(a=_e(n*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.abs(this.lat0)-u,Math.abs(s)<=d?(o=this.lat0>=0?j(this.long0+Math.atan2(t.x,-t.y)):j(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=a,t):(o=j(this.long0+Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i)),t.x=o,t.y=a,t))},names:["ortho"]};var ke=1,Ue=2,Ne=3,Fe=4;function ze(t,e,r,i){var n;return tm&&n<=u+m?(i.value=Ue,n-=u):n>u+m||n<=-(u+m)?(i.value=Ne,n=n>=0?n-A:n+A):(i.value=Fe,n+=u)),n}function Ge(t,e){var r=t+e;return r<-A?r+=g:r>+A&&(r-=g),r}const Qe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=u-m/2?this.face=5:this.lat0<=-(u-m/2)?this.face=6:Math.abs(this.long0)<=m?this.face=1:Math.abs(this.long0)<=u+m?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,i,n,s,o,a={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,5===this.face)n=u-e,r>=m&&r<=u+m?(l.value=ke,i=r-u):r>u+m||r<=-(u+m)?(l.value=Ue,i=r>0?r-A:r+A):r>-(u+m)&&r<=-m?(l.value=Ne,i=r+u):(l.value=Fe,i=r);else if(6===this.face)n=u+e,r>=m&&r<=u+m?(l.value=ke,i=-r+u):r=-m?(l.value=Ue,i=-r):r<-m&&r>=-(u+m)?(l.value=Ne,i=-r-u):(l.value=Fe,i=r>0?-r+A:-r-A);else{var c,h,d,p,f,g;2===this.face?r=Ge(r,+u):3===this.face?r=Ge(r,+A):4===this.face&&(r=Ge(r,-u)),p=Math.sin(e),f=Math.cos(e),g=Math.sin(r),c=f*Math.cos(r),h=f*g,d=p,1===this.face?i=ze(n=Math.acos(c),d,h,l):2===this.face?i=ze(n=Math.acos(h),d,-c,l):3===this.face?i=ze(n=Math.acos(-c),d,-h,l):4===this.face?i=ze(n=Math.acos(-h),d,c,l):(n=i=0,l.value=ke)}return o=Math.atan(12/A*(i+Math.acos(Math.sin(i)*Math.cos(m))-u)),s=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Ue?o+=u:l.value===Ne?o+=A:l.value===Fe&&(o+=1.5*A),a.x=s*Math.cos(o),a.y=s*Math.sin(o),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var e,r,i,n,s,o,a,l,c,h,d,p,f={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=ke:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=Ue,e-=u):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=Ne,e=e<0?e+A:e-A):(m.value=Fe,e+=u),c=A/12*Math.tan(e),s=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(s),(a=1-(i=Math.cos(e))*i*(n=Math.tan(r))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?a=-1:a>1&&(a=1),5===this.face)l=Math.acos(a),f.phi=u-l,m.value===ke?f.lam=o+u:m.value===Ue?f.lam=o<0?o+A:o-A:m.value===Ne?f.lam=o-u:f.lam=o;else if(6===this.face)l=Math.acos(a),f.phi=l-u,m.value===ke?f.lam=-o+u:m.value===Ue?f.lam=-o:m.value===Ne?f.lam=-o-u:f.lam=o<0?-o-A:-o+A;else{var g,y,v;c=(g=a)*g,y=(c+=(v=c>=1?0:Math.sqrt(1-c)*Math.sin(o))*v)>=1?0:Math.sqrt(1-c),m.value===Ue?(c=y,y=-v,v=c):m.value===Ne?(y=-y,v=-v):m.value===Fe&&(c=y,y=v,v=-c),2===this.face?(c=g,g=-y,y=c):3===this.face?(g=-g,y=-y):4===this.face&&(c=g,g=y,y=-c),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(y,g),2===this.face?f.lam=Ge(f.lam,-u):3===this.face?f.lam=Ge(f.lam,-A):4===this.face&&(f.lam=Ge(f.lam,+u))}return 0!==this.es&&(h=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),h&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var je=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ve=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],He=.8487,We=1.3523,qe=f/5,Ze=1/qe,Ye=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const Xe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=j(t.x-this.long0),r=Math.abs(t.y),i=Math.floor(r*qe);i<0?i=0:i>=18&&(i=17);var n={x:Ye(je[i],r=f*(r-Ze*i))*e,y:Ye(Ve[i],r)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*He+this.x0,n.y=n.y*this.a*We+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*He),y:Math.abs(t.y-this.y0)/(this.a*We)};if(e.y>=1)e.x/=je[18][0],e.y=t.y<0?-u:u;else{var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(Ve[r][0]>e.y)--r;else{if(!(Ve[r+1][0]<=e.y))break;++r}var i=Ve[r],n=5*(e.y-i[0])/(Ve[r+1][0]-i[0]);n=function(t,e,r,i){for(var n=e;i;--i){var s=t(n);if(n-=s,Math.abs(s)<1e-10)break}return n}((function(t){return(Ye(i,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(i,t)}),n,0,100),e.x/=Ye(je[r],n),e.y=(5*r+n)*p,t.y<0&&(e.y=-e.y)}return e.x=j(e.x+this.long0),e},names:["Robinson","robin"]},Je={init:function(){this.name="geocent"},forward:function(t){return ht(t,this.es,this.a)},inverse:function(t){return ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Ke={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const $e={init:function(){if(Object.keys(Ke).forEach(function(t){if(void 0===this[t])this[t]=Ke[t].def;else{if(Ke[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Ke[t].num&&(this[t]=parseFloat(this[t]))}Ke[t].degrees&&(this[t]=this[t]*p)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,r,i,n,s=Math.sin(t.y),o=Math.cos(t.y),a=Math.cos(t.x);switch(this.mode){case 3:r=this.sinph0*s+this.cosph0*o*a;break;case 2:r=o*a;break;case 1:r=-s;break;case 0:r=s}switch(e=(r=this.pn1/(this.p-r))*o*Math.sin(t.x),this.mode){case 3:r*=this.cosph0*s-this.sinph0*o*a;break;case 2:r*=s;break;case 0:r*=-o*a;break;case 1:r*=o*a}return n=1/((i=r*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-r*this.sg)*this.cw*n,r=i*n,t.x=e*this.a,t.y=r*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,r,i,n={x:t.x,y:t.y};i=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*i,r=this.pn1*t.y*this.cw*i,t.x=e*this.cg+r*this.sg,t.y=r*this.cg-e*this.sg;var s=Jt(t.x,t.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,i,n,s=t.x,o=t.y;if(s-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var a=this.radius_p/Jt(this.radius_p*Math.cos(o),Math.sin(o));if(r=a*Math.cos(s)*Math.cos(o),i=a*Math.sin(s)*Math.cos(o),n=a*Math.sin(o),(this.radius_g-r)*r-i*i-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/Jt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/Jt(i,e)))}else"sphere"===this.shape&&(e=Math.cos(o),r=Math.cos(s)*e,i=Math.sin(s)*e,n=Math.sin(o),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/Jt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/Jt(i,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,i,n,s=-1,o=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Jt(1,a)):(o=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Jt(1,o));var l=a/this.radius_p;if(e=o*o+l*l+s*s,(i=(r=2*this.radius_g*s)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),s=this.radius_g+n*s,o*=n,a*=n,t.x=Math.atan2(o,s),t.y=Math.atan(a*Math.cos(t.x)/s),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(o=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),e=o*o+a*a+s*s,(i=(r=2*this.radius_g*s)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),s=this.radius_g+n*s,o*=n,a*=n,t.x=Math.atan2(o,s),t.y=Math.atan(a*Math.cos(t.x)/s)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var er;wt.defaultDatum="WGS84",wt.Proj=ct,wt.WGS84=new wt.Proj("WGS84"),wt.Point=Qt,wt.toPoint=At,wt.defs=U,wt.nadgrid=function(t,e){var r=new DataView(e),i=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),n=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:nt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,i),s=function(t,e,r){for(var i=176,n=[],s=0;s{"use strict";const i=r(43389),n=r(69208),s=r(48764).lW;t.exports=function(t,e){return new i((function(r,i){const o=n(t,e),a=new XMLHttpRequest;a.open("GET",o,!0),"prj"!==e&&"cpg"!==e&&(a.responseType="arraybuffer"),a.addEventListener("load",(function(){return a.status>399?"prj"===e||"cpg"===e?r(!1):i(new Error(a.status)):r("prj"!==e&&"cpg"!==e?s.from(a.response):a.response)}),!1),a.send()}))}},9078:(t,e,r)=>{"use strict";const i=r(94830),n=r(69208),s=r(48764).lW;t.exports=async function(t,e){if(!r.g.fetch)return i(t,e);const o=n(t,e),a="prj"===e||"cpg"===e;try{const t=await fetch(o);if(t.status>399)throw new Error(t.statusText);if(a)return t.text();const e=await t.arrayBuffer();return s.from(e)}catch(t){if(console.log("ERROR",t,e),a||"dbf"===e)return!1;throw t}}},69208:(t,e,r)=>{const i=r.g.URL;t.exports=(t,e)=>{if(!e)return t;const r=new i(t);return r.pathname=`${r.pathname}.${e}`,r.href}},79003:(t,e,r)=>{"use strict";let i=r(24472);i.default&&(i=i.default);const n=r(32555),s=r(9078),o=r(76415),a=r(9462),l=r(43389),c=r(95079),h=r(48764).lW,u=r.g.URL,d=new c({max:20});function p(t){if(!t)throw new Error("forgot to pass buffer");return h.isBuffer(t)?t:f(t)?h.from(t):f(t.buffer)?1===t.BYTES_PER_ELEMENT?h.from(t):h.from(t.buffer):void 0}function f(t){return t instanceof r.g.ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(t)}function m(t,e){return"string"==typeof t&&d.has(t)?l.resolve(d.get(t)):m.getShapefile(t,e).then((function(e){return"string"==typeof t&&d.set(t,e),e}))}m.combine=function([t,e]){const r={type:"FeatureCollection",features:[]};let i=0;const n=t.length;for(e||(e=[]);i-1?l.push(r.slice(0,-3)+r.slice(-3).toLowerCase()):"dbf"!==r.slice(-3).toLowerCase()&&"cpg"!==r.slice(-3).toLowerCase()||(s[r.slice(0,-3)+r.slice(-3).toLowerCase()]=s[r]));if(!l.length)throw new Error("no layers founds");const c=l.map((function(t){let r,i;const n=t.lastIndexOf(".");return n>-1&&t.slice(n).indexOf("json")>-1?(r=JSON.parse(s[t]),r.fileName=t.slice(0,n)):e.indexOf(t.slice(n+1))>-1?(r=s[t],r.fileName=t):(s[t+".dbf"]&&(i=a(s[t+".dbf"],s[t+".cpg"])),r=m.combine([o(s[t+".shp"],s[t+".prj"]),i]),r.fileName=t),r}));return 1===c.length?c[0]:c};const g=async t=>{const e=await l.all([s(t,"shp"),s(t,"prj")]);let r=!1;try{e[1]&&(r=i(e[1]))}catch(t){r=!1}return o(e[0],r)},A=async t=>{const[e,r]=await l.all([s(t,"dbf"),s(t,"cpg")]);if(e)return a(e,r)};m.getShapefile=async function(t,e){if("string"!=typeof t)return m.parseZip(t);if(((t,e)=>".zip"===new u(t).pathname.slice(-4).toLowerCase())(t))return async function(t,e){const r=await s(t);return m.parseZip(r,e)}(t,e);const r=await l.all([g(t),A(t)]);return m.combine(r)},m.parseShp=function(t,e){if(t=p(t),h.isBuffer(e)&&(e=e.toString()),"string"==typeof e)try{e=i(e)}catch(t){e=!1}return o(t,e)},m.parseDbf=function(t,e){return t=p(t),a(t,e)},t.exports=m},76415:t=>{"use strict";function e(t,e){return!function(t){let e=0,r=1;const i=t.length;let n,s;for(;r0}(e)&&t.length?t[t.length-1].push(e):t.push([e]),t}i.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}},i.prototype.parseZPoint=function(t){const e=this.parsePoint(t);return e.coordinates.push(t.readDoubleLE(16)),e},i.prototype.parsePointArray=function(t,e,r){const i=[];let n=0;for(;n20&&(e-=20),!(e in r))throw new Error("I don't know that shp type");var i;this.parseFunc=this[r[e]],this.parseCoord=(i=t)?function(t,e){const r=[t.readDoubleLE(e),t.readDoubleLE(e+8)];return i.inverse(r)}:function(t,e){return[t.readDoubleLE(e),t.readDoubleLE(e+8)]}},i.prototype.getShpCode=function(){return this.parseHeader().shpCode},i.prototype.parseHeader=function(){const t=this.buffer.slice(0,100);return{length:t.readInt32BE(24)<<1,version:t.readInt32LE(28),shpCode:t.readInt32LE(32),bbox:[t.readDoubleLE(36),t.readDoubleLE(44),t.readDoubleLE(52),t.readDoubleLE(52)]}},i.prototype.getRows=function(){let t=100;const e=this.buffer.byteLength,r=[];let i;for(;t{"use strict";const i=r(55733);t.exports=async t=>{const e=new i;await e.loadAsync(t);const r=e.file(/.+/),n={};return await Promise.all(r.map((async t=>{let e;e="shp"===t.name.slice(-3).toLowerCase()||"dbf"===t.name.slice(-3).toLowerCase()?await t.async("nodebuffer"):await t.async("text"),n[t.name]=e}))),n}},95079:t=>{!function(){function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function r(){return 1}t.exports?t.exports=s:this.LRUCache=s;var i=!1;function n(t){i||"string"==typeof t||"number"==typeof t||(i=!0,console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! "+typeof t).stack))}function s(t){if(!(this instanceof s))return new s(t);"number"==typeof t&&(t={max:t}),t||(t={}),this._max=t.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=t.length||r,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=r),this._allowStale=t.stale||!1,this._maxAge=t.maxAge||null,this._dispose=t.dispose,this.reset()}function o(t,e,r){n(e);var i=t._cache[e];return i&&(a(t,i)?(h(t,i),t._allowStale||(i=void 0)):r&&function(t,e){c(t,e),e.lu=t._mru++,t._lruList[e.lu]=e}(t,i),i&&(i=i.value)),i}function a(t,e){if(!e||!e.maxAge&&!t._maxAge)return!1;var r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t._maxAge&&r>t._maxAge}function l(t){for(;t._lrut._max;)h(t,t._lruList[t._lru])}function c(t,e){for(delete t._lruList[e.lu];t._lruthis._max&&l(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(s.prototype,"lengthCalculator",{set:function(t){if("function"!=typeof t)for(var e in this._lengthCalculator=r,this._length=this._itemCount,this._cache)this._cache[e].length=1;else for(var e in this._lengthCalculator=t,this._length=0,this._cache)this._cache[e].length=this._lengthCalculator(this._cache[e].value),this._length+=this._cache[e].length;this._length>this._max&&l(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(s.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),s.prototype.forEach=function(t,e){e=e||this;for(var r=0,i=this._itemCount,n=this._mru-1;n>=0&&r=0&&e=0&&e=0&&ethis._max?(h(this,this._cache[t]),!1):(this._dispose&&this._dispose(t,this._cache[t].value),this._cache[t].now=s,this._cache[t].maxAge=i,this._cache[t].value=r,this._length+=o-this._cache[t].length,this._cache[t].length=o,this.get(t),this._length>this._max&&l(this),!0);var a=new u(t,r,this._mru++,o,s,i);return a.length>this._max?(this._dispose&&this._dispose(t,r),!1):(this._length+=a.length,this._lruList[a.lu]=this._cache[t]=a,this._itemCount++,this._length>this._max&&l(this),!0)},s.prototype.has=function(t){return n(t),!!e(this._cache,t)&&!a(this,this._cache[t])},s.prototype.get=function(t){return n(t),o(this,t,!0)},s.prototype.peek=function(t){return n(t),o(this,t,!1)},s.prototype.pop=function(){var t=this._lruList[this._lru];return h(this,t),t||null},s.prototype.del=function(t){n(t),h(this,this._cache[t])},s.prototype.load=function(t){this.reset();for(var e=Date.now(),r=t.length-1;r>=0;r--){var i=t[r];n(i.k);var s=i.e||0;if(0===s)this.set(i.k,i.v);else{var o=s-e;o>0&&this.set(i.k,i.v,o)}}}}()},6941:(t,e,r)=>{var i=r(48764).lW,n=i.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},s=e.s=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!n(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=l;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(t){return t.toString(this.encoding)}function a(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function l(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}s.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i,n=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,(i=e.charCodeAt(n))>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),t.copy(this.charBuffer,0,0,s),e.substring(0,n)}return e},s.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},s.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;e+=i.slice(0,r).toString(n)}return e}},29718:(t,e,r)=>{t.exports=r(59141)},59141:function(t,e,r){!function(e){"use strict";function i(t,e,r){return e<=t&&t<=r}t.exports&&!e["encoding-indexes"]&&r(37597);var n=Math.floor;function s(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o(t){return 0<=t&&t<=127}var a=o,l=-1;function c(t){this.tokens=[].slice.call(t),this.tokens.reverse()}c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():l},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.pop());else this.tokens.push(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(t)}};var h=-1;function u(t,e){if(t)throw TypeError("Decoder error");return e||65533}function d(t){throw TypeError("The code point "+t+" could not be encoded.")}function p(t){return t=String(t).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(m,t)?m[t]:null}var f=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],m={};f.forEach((function(t){t.encodings.forEach((function(t){t.labels.forEach((function(e){m[e]=t}))}))}));var g,A,y={},v={};function x(t,e){return e&&e[t]||null}function b(t,e){var r=e.indexOf(t);return-1===r?null:r}function _(t){if(!("encoding-indexes"in e))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return e["encoding-indexes"][t]}var w="utf-8";function E(t,e){if(!(this instanceof E))throw TypeError("Called as a function. Did you forget 'new'?");t=void 0!==t?String(t):w,e=s(e),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=p(t);if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+t);if(!v[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=r,Boolean(e.fatal)&&(i._error_mode="fatal"),Boolean(e.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal="fatal"===i._error_mode,this.ignoreBOM=i._ignoreBOM),i}function M(t,r){if(!(this instanceof M))throw TypeError("Called as a function. Did you forget 'new'?");r=s(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var i=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){var n=p(t=void 0!==t?String(t):w);if(null===n||"replacement"===n.name)throw RangeError("Unknown encoding: "+t);if(!y[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");i._encoding=n}else i._encoding=p("utf-8"),void 0!==t&&"console"in e&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase()),i}function S(t){var e=t.fatal,r=0,n=0,s=0,o=128,a=191;this.handler=function(t,c){if(c===l&&0!==s)return s=0,u(e);if(c===l)return h;if(0===s){if(i(c,0,127))return c;if(i(c,194,223))s=1,r=31&c;else if(i(c,224,239))224===c&&(o=160),237===c&&(a=159),s=2,r=15&c;else{if(!i(c,240,244))return u(e);240===c&&(o=144),244===c&&(a=143),s=3,r=7&c}return null}if(!i(c,o,a))return r=s=n=0,o=128,a=191,t.prepend(c),u(e);if(o=128,a=191,r=r<<6|63&c,(n+=1)!==s)return null;var d=r;return r=s=n=0,d}}function C(t){t.fatal,this.handler=function(t,e){if(e===l)return h;if(a(e))return e;var r,n;i(e,128,2047)?(r=1,n=192):i(e,2048,65535)?(r=2,n=224):i(e,65536,1114111)&&(r=3,n=240);for(var s=[(e>>6*r)+n];r>0;){var o=e>>6*(r-1);s.push(128|63&o),r-=1}return s}}function T(t,e){var r=e.fatal;this.handler=function(e,i){if(i===l)return h;if(o(i))return i;var n=t[i-128];return null===n?u(r):n}}function I(t,e){e.fatal,this.handler=function(e,r){if(r===l)return h;if(a(r))return r;var i=b(r,t);return null===i&&d(r),i+128}}function R(t){var e=t.fatal,r=0,n=0,s=0;this.handler=function(t,a){if(a===l&&0===r&&0===n&&0===s)return h;var c;if(a!==l||0===r&&0===n&&0===s||(r=0,n=0,s=0,u(e)),0!==s){c=null,i(a,48,57)&&(c=function(t){if(t>39419&&t<189e3||t>1237575)return null;if(7457===t)return 59335;var e,r=0,i=0,n=_("gb18030-ranges");for(e=0;e>8,i=255&t;return e?[r,i]:[i,r]}function j(t,e){var r=e.fatal,n=null,s=null;this.handler=function(e,o){if(o===l&&(null!==n||null!==s))return u(r);if(o===l&&null===n&&null===s)return h;if(null===n)return n=o,null;var a;if(a=t?(n<<8)+o:(o<<8)+n,n=null,null!==s){var c=s;return s=null,i(a,56320,57343)?65536+1024*(c-55296)+(a-56320):(e.prepend(Q(a,t)),u(r))}return i(a,55296,56319)?(s=a,null):i(a,56320,57343)?u(r):a}}function V(t,e){e.fatal,this.handler=function(e,r){if(r===l)return h;if(i(r,0,65535))return Q(r,t);var n=Q(55296+(r-65536>>10),t),s=Q(56320+(r-65536&1023),t);return n.concat(s)}}function H(t){t.fatal,this.handler=function(t,e){return e===l?h:o(e)?e:63360+e-128}}function W(t){t.fatal,this.handler=function(t,e){return e===l?h:a(e)?e:i(e,63360,63487)?e-63360+128:d(e)}}Object.defineProperty&&(Object.defineProperty(E.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(E.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(E.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),E.prototype.decode=function(t,e){var r;r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=s(e),this._do_not_flush||(this._decoder=v[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(e.stream);for(var i,n=new c(r),o=[];;){var a=n.read();if(a===l)break;if((i=this._decoder.handler(n,a))===h)break;null!==i&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}if(!this._do_not_flush){do{if((i=this._decoder.handler(n,n.read()))===h)break;null!==i&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}while(!n.endOfStream());this._decoder=null}return function(t){var e,r;return e=["UTF-8","UTF-16LE","UTF-16BE"],r=this._encoding.name,-1===e.indexOf(r)||this._ignoreBOM||this._BOMseen||(t.length>0&&65279===t[0]?(this._BOMseen=!0,t.shift()):t.length>0&&(this._BOMseen=!0)),function(t){for(var e="",r=0;r>10),56320+(1023&i)))}return e}(t)}.call(this,o)},Object.defineProperty&&Object.defineProperty(M.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),M.prototype.encode=function(t,e){t=void 0===t?"":String(t),e=s(e),this._do_not_flush||(this._encoder=y[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(e.stream);for(var r,i=new c(function(t){for(var e=String(t),r=e.length,i=0,n=[];i57343)n.push(s);else if(56320<=s&&s<=57343)n.push(65533);else if(55296<=s&&s<=56319)if(i===r-1)n.push(65533);else{var o=e.charCodeAt(i+1);if(56320<=o&&o<=57343){var a=1023&s,l=1023&o;n.push(65536+(a<<10)+l),i+=1}else n.push(65533)}i+=1}return n}(t)),n=[];;){var o=i.read();if(o===l)break;if((r=this._encoder.handler(i,o))===h)break;Array.isArray(r)?n.push.apply(n,r):n.push(r)}if(!this._do_not_flush){for(;(r=this._encoder.handler(i,i.read()))!==h;)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)},y["UTF-8"]=function(t){return new C(t)},v["UTF-8"]=function(t){return new S(t)},"encoding-indexes"in e&&f.forEach((function(t){"Legacy single-byte encodings"===t.heading&&t.encodings.forEach((function(t){var e=t.name,r=_(e.toLowerCase());v[e]=function(t){return new T(r,t)},y[e]=function(t){return new I(r,t)}}))})),v.GBK=function(t){return new R(t)},y.GBK=function(t){return new B(t,!0)},y.gb18030=function(t){return new B(t)},v.gb18030=function(t){return new R(t)},y.Big5=function(t){return new P(t)},v.Big5=function(t){return new L(t)},y["EUC-JP"]=function(t){return new O(t)},v["EUC-JP"]=function(t){return new D(t)},y["ISO-2022-JP"]=function(t){return new U(t)},v["ISO-2022-JP"]=function(t){return new k(t)},y.Shift_JIS=function(t){return new F(t)},v.Shift_JIS=function(t){return new N(t)},y["EUC-KR"]=function(t){return new G(t)},v["EUC-KR"]=function(t){return new z(t)},y["UTF-16BE"]=function(t){return new V(!0,t)},v["UTF-16BE"]=function(t){return new j(!0,t)},y["UTF-16LE"]=function(t){return new V(!1,t)},v["UTF-16LE"]=function(t){return new j(!1,t)},y["x-user-defined"]=function(t){return new W(t)},v["x-user-defined"]=function(t){return new H(t)},e.TextEncoder||(e.TextEncoder=M),e.TextDecoder||(e.TextDecoder=E),t.exports&&(t.exports={TextEncoder:e.TextEncoder,TextDecoder:e.TextDecoder,EncodingIndexes:e["encoding-indexes"]})}(this||{})},78963:()=>{},37597:()=>{},42917:(t,e,r)=>{"use strict";r(59749),r(86544),r(58373),r(96157),r(82529),r(84254),r(64155),r(93531),r(95906),r(50549),r(96285),r(18200),r(69373),r(66793),r(44578),r(21057),r(68932),r(95879),r(54927),r(92176),r(34338),r(2966),r(55791),r(97895),r(38077),r(25728),r(39772),r(59867),r(93383),r(62795),r(54564),r(49693),r(77049),r(76801),r(97195),r(63975),r(752),r(6203),r(72410),r(50886),r(37593),r(70560),r(278),r(81386),r(93374),r(89730),r(98742),r(65137),r(21932),r(62506),r(29830),r(12894),r(93530),r(13383),r(90385),r(91719),r(21319),r(69365),r(33870),r(99211),r(18201),r(55635),r(42227),r(99679),r(24343),r(65007),r(78150),r(59903),r(30024),r(60428),r(41517),r(56269),r(34284),r(45398),r(48324),r(7629),r(56646),r(89348),r(6557),r(62428),r(45263),r(74712),r(54986),r(47221),r(94992),r(25499),r(59944),r(78527),r(75239),r(92076),r(68813),r(96976),r(62700),r(91554),r(77509),r(21416),r(79288),r(53584),r(82243),r(95765),r(45993),r(92547),r(7936),r(32704),r(52362),r(21552),r(10704),r(97389),r(25284),r(60429),r(51013),r(33994),r(35082),r(40739),r(47409),r(36585),r(41830),r(85415),r(81919),r(99474),r(79997),r(88052),r(44079),r(14566),r(76101),r(36446),r(35140),r(4179),r(69358),r(75450),r(54993),r(48115),r(19330),r(30658),r(5399),r(60228),r(86466),r(80939),r(32320),r(73964),r(41195),r(87609),r(36409),r(13505),r(54333),r(30050),r(99871),r(1049),r(32349),r(50149),r(43792),r(69707),r(63545),r(62087),r(51505),r(45247),r(22373),r(76034),r(52003),r(68518),r(64043),r(25847),r(13440),r(7409),r(12826),r(19649),r(7961),r(86239),r(2918),r(20283),r(43843),r(12281),r(21694),r(22462),r(79866),r(72940),r(8472),r(92404),r(59588),r(57267),r(56532),r(61514),r(9873),r(268),r(20372),r(35237),r(28436),r(16386),r(3255),r(90343),r(21444),r(25906),r(95682),r(98041),r(6364),r(82954),r(19162),r(37960),r(470),r(67446),r(47729),r(2e3),r(29068),r(70292),r(55304),r(89988),r(854),r(28607),r(30938),r(75679),r(18557),r(95194),r(36664),r(55980),r(79943),r(96089),r(18539),r(48690),r(20522),r(82),r(45385),r(59495),r(85552),r(31803),r(91565),r(67987),r(49365),r(80677),r(19038),r(18118),r(41165),r(71522),r(79976),r(4797),r(7300),r(93356),r(62533),r(99724),r(24224),r(61121),r(99901),r(37133),r(622),r(51090),r(50414),r(89503),r(26810),r(18073),r(4154),r(7802),r(54883),r(38197),r(20097),r(36208),r(22525),r(96882),r(32539),r(5082),r(98),r(32221),r(67890),r(47041),r(86322),r(92253),r(97554),r(86247),r(21412),r(43097),r(11070),r(64578),r(77299),r(15694),r(17815),r(19029),r(6237),r(81954),r(87152),r(89667),r(49118),r(32411),r(3256),r(85625),r(10914),r(14494),r(9468),r(24587),r(60779),r(65503),r(50236),r(89246),r(31186),r(9279),r(26725),r(26125),r(2820),r(62517),r(54947),r(74993),r(78832),r(67602),r(50647),r(82639),r(63986),r(16054),r(53476),r(70928),r(49411),r(30005),r(73494),r(94564),r(41792),r(5985),r(31107),r(28244),r(3645),r(58429),r(39569),r(74320),r(20691),r(82964),r(67444),r(97968),r(747),r(41099),r(26320),r(20876),r(6052),r(39879),r(76791),r(75341),r(40019),r(92343),r(51096),r(4314),r(63111),r(23346),r(64984),r(64078),r(24453),r(66190),r(25684),r(31789),r(8677),r(346),r(59151),r(91069),r(18886),r(88065),r(68172),r(60445),r(99457),r(613),r(835),r(926),r(82899),r(29977),r(53669),r(31927),r(77131),r(55174),r(3210),r(76314),r(218),r(40393),r(6616),r(90810),r(19959),r(73347),r(71913),r(70003),r(79955),r(7859),r(31138),r(28809),r(2946),r(32460),r(57282),r(5058),r(15716),r(36814),r(30349),r(96986),r(95681),r(13781),r(33442),r(98873),r(61964),r(50308),r(69878),r(18955),r(52915),r(65115),r(19490),r(95752),r(32789),r(27913),r(6831),r(98686),r(90243),r(22275),r(98030),r(86220),r(21917),r(95853),r(66084),r(2741),r(59012),r(38320),r(78988),r(80546),r(62586),r(46019),r(5010),r(45749),r(4835),r(58799),r(18134),r(27041),r(44767),r(92981),r(85044),r(76677),r(96256),r(18241),r(59359),r(54302),r(1274),r(30548),r(25298),r(11882),r(915),r(91238),r(17911),r(23579),r(91117),r(85723),r(68680),r(77225),r(99369),r(22983),r(90201),r(13466),r(23321),r(84930),r(92465),r(45738),r(52586),r(84645),r(47522),r(76265),r(97337),r(13429),r(37462),r(40088),r(10455),r(3650),r(25564),r(96869),r(78730),r(69822),r(19979),r(79307),r(98858),r(61318),r(33228),r(50496)},46108:(t,e,r)=>{"use strict";r(42917)},10509:(t,e,r)=>{"use strict";var i=r(69985),n=r(23691),s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not a function")}},52655:(t,e,r)=>{"use strict";var i=r(19429),n=r(23691),s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not a constructor")}},9945:(t,e,r)=>{"use strict";var i=r(83914).has;t.exports=function(t){return i(t),t}},23550:(t,e,r)=>{"use strict";var i=r(69985),n=String,s=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw new s("Can't set "+n(t)+" as a prototype")}},10029:(t,e,r)=>{"use strict";var i=r(61034).has;t.exports=function(t){return i(t),t}},51082:t=>{"use strict";var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},457:(t,e,r)=>{"use strict";var i=r(16803).has;t.exports=function(t){return i(t),t}},53499:(t,e,r)=>{"use strict";var i=r(78616).has;t.exports=function(t){return i(t),t}},29199:(t,e,r)=>{"use strict";var i=r(22615),n=r(68844),s=r(54071),o=r(85027),a=r(10509),l=r(981),c=r(54849),h=r(44201),u=h("asyncDispose"),d=h("dispose"),p=n([].push),f=function(t,e,r){return arguments.length<3&&!l(t)&&(r=a(function(t,e){if("async-dispose"===e){var r=c(t,u);return void 0!==r?r:(r=c(t,d),function(){i(r,this)})}return c(t,d)}(o(t),e))),void 0===r?function(){}:s(r,t)};t.exports=function(t,e,r,i){var n;if(arguments.length<4){if(l(e)&&"sync-dispose"===r)return;n=f(e,r)}else n=f(void 0,r,i);p(t.stack,n)}},87370:(t,e,r)=>{"use strict";var i=r(44201),n=r(25391),s=r(72560).f,o=i("unscopables"),a=Array.prototype;void 0===a[o]&&s(a,o,{configurable:!0,value:n(null)}),t.exports=function(t){a[o][t]=!0}},71514:(t,e,r)=>{"use strict";var i=r(10730).charAt;t.exports=function(t,e,r){return e+(r?i(t,e).length:1)}},767:(t,e,r)=>{"use strict";var i=r(23622),n=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw new n("Incorrect invocation")}},33425:(t,e,r)=>{"use strict";var i=r(48999),n=String,s=TypeError;t.exports=function(t){if(void 0===t||i(t))return t;throw new s(n(t)+" is not an object or undefined")}},85027:(t,e,r)=>{"use strict";var i=r(48999),n=String,s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not an object")}},95668:(t,e,r)=>{"use strict";var i=r(50926),n=TypeError;t.exports=function(t){if("Uint8Array"===i(t))return t;throw new n("Argument is not an Uint8Array")}},37075:t=>{"use strict";t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},33050:(t,e,r)=>{"use strict";var i=r(52743),n=r(6648),s=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==n(t))throw new s("ArrayBuffer expected");return t.byteLength}},22961:(t,e,r)=>{"use strict";var i=r(68844),n=r(33050),s=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==n(t))return!1;try{return s(t,0,0),!1}catch(t){return!0}}},11655:(t,e,r)=>{"use strict";var i=r(3689);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},29195:(t,e,r)=>{"use strict";var i=r(19037),n=r(68844),s=r(52743),o=r(19842),a=r(22961),l=r(33050),c=r(21420),h=r(63514),u=i.structuredClone,d=i.ArrayBuffer,p=i.DataView,f=i.TypeError,m=Math.min,g=d.prototype,A=p.prototype,y=n(g.slice),v=s(g,"resizable","get"),x=s(g,"maxByteLength","get"),b=n(A.getInt8),_=n(A.setInt8);t.exports=(h||c)&&function(t,e,r){var i,n=l(t),s=void 0===e?n:o(e),g=!v||!v(t);if(a(t))throw new f("ArrayBuffer is detached");if(h&&(t=u(t,{transfer:[t]}),n===s&&(r||g)))return t;if(n>=s&&(!r||g))i=y(t,0,s);else{var A=r&&!g&&x?{maxByteLength:x(t)}:void 0;i=new d(s,A);for(var w=new p(t),E=new p(i),M=m(s,n),S=0;S{"use strict";var i,n,s,o=r(37075),a=r(67697),l=r(19037),c=r(69985),h=r(48999),u=r(36812),d=r(50926),p=r(23691),f=r(75773),m=r(11880),g=r(62148),A=r(23622),y=r(61868),v=r(49385),x=r(44201),b=r(14630),_=r(618),w=_.enforce,E=_.get,M=l.Int8Array,S=M&&M.prototype,C=l.Uint8ClampedArray,T=C&&C.prototype,I=M&&y(M),R=S&&y(S),B=Object.prototype,L=l.TypeError,P=x("toStringTag"),D=b("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",k=o&&!!v&&"Opera"!==d(l.opera),U=!1,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},z=function(t){var e=y(t);if(h(e)){var r=E(e);return r&&u(r,O)?r[O]:z(e)}},G=function(t){if(!h(t))return!1;var e=d(t);return u(N,e)||u(F,e)};for(i in N)(s=(n=l[i])&&n.prototype)?w(s)[O]=n:k=!1;for(i in F)(s=(n=l[i])&&n.prototype)&&(w(s)[O]=n);if((!k||!c(I)||I===Function.prototype)&&(I=function(){throw new L("Incorrect invocation")},k))for(i in N)l[i]&&v(l[i],I);if((!k||!R||R===B)&&(R=I.prototype,k))for(i in N)l[i]&&v(l[i].prototype,R);if(k&&y(T)!==R&&v(T,R),a&&!u(R,P))for(i in U=!0,g(R,P,{configurable:!0,get:function(){return h(this)?this[D]:void 0}}),N)l[i]&&f(l[i],D,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:k,TYPED_ARRAY_TAG:U&&D,aTypedArray:function(t){if(G(t))return t;throw new L("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!v||A(I,t)))return t;throw new L(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,i){if(a){if(r)for(var n in N){var s=l[n];if(s&&u(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}R[t]&&!r||m(R,t,r?e:k&&S[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,r){var i,n;if(a){if(v){if(r)for(i in N)if((n=l[i])&&u(n,t))try{delete n[t]}catch(t){}if(I[t]&&!r)return;try{return m(I,t,r?e:k&&I[t]||e)}catch(t){}}for(i in N)!(n=l[i])||n[t]&&!r||m(n,t,e)}},getTypedArrayConstructor:z,isView:function(t){if(!h(t))return!1;var e=d(t);return"DataView"===e||u(N,e)||u(F,e)},isTypedArray:G,TypedArray:I,TypedArrayPrototype:R}},83999:(t,e,r)=>{"use strict";var i=r(19037),n=r(68844),s=r(67697),o=r(37075),a=r(41236),l=r(75773),c=r(62148),h=r(6045),u=r(3689),d=r(767),p=r(68700),f=r(43126),m=r(19842),g=r(37788),A=r(15477),y=r(61868),v=r(49385),x=r(72741).f,b=r(62872),_=r(9015),w=r(55997),E=r(618),M=a.PROPER,S=a.CONFIGURABLE,C="ArrayBuffer",T="DataView",I="prototype",R="Wrong index",B=E.getterFor(C),L=E.getterFor(T),P=E.set,D=i[C],O=D,k=O&&O[I],U=i[T],N=U&&U[I],F=Object.prototype,z=i.Array,G=i.RangeError,Q=n(b),j=n([].reverse),V=A.pack,H=A.unpack,W=function(t){return[255&t]},q=function(t){return[255&t,t>>8&255]},Z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},X=function(t){return V(g(t),23,4)},J=function(t){return V(t,52,8)},K=function(t,e,r){c(t[I],e,{configurable:!0,get:function(){return r(this)[e]}})},$=function(t,e,r,i){var n=L(t),s=m(r),o=!!i;if(s+e>n.byteLength)throw new G(R);var a=n.bytes,l=s+n.byteOffset,c=_(a,l,l+e);return o?c:j(c)},tt=function(t,e,r,i,n,s){var o=L(t),a=m(r),l=i(+n),c=!!s;if(a+e>o.byteLength)throw new G(R);for(var h=o.bytes,u=a+o.byteOffset,d=0;dnt;)(rt=it[nt++])in O||l(O,rt,D[rt]);k.constructor=O}v&&y(N)!==F&&v(N,F);var st=new U(new O(2)),ot=n(N.setInt8);st.setInt8(0,2147483648),st.setInt8(1,2147483649),!st.getInt8(0)&&st.getInt8(1)||h(N,{setInt8:function(t,e){ot(this,t,e<<24>>24)},setUint8:function(t,e){ot(this,t,e<<24>>24)}},{unsafe:!0})}else k=(O=function(t){d(this,k);var e=m(t);P(this,{type:C,bytes:Q(z(e),0),byteLength:e}),s||(this.byteLength=e,this.detached=!1)})[I],N=(U=function(t,e,r){d(this,N),d(t,k);var i=B(t),n=i.byteLength,o=p(e);if(o<0||o>n)throw new G("Wrong offset");if(o+(r=void 0===r?n-o:f(r))>n)throw new G("Wrong length");P(this,{type:T,buffer:t,byteLength:r,byteOffset:o,bytes:i.bytes}),s||(this.buffer=t,this.byteLength=r,this.byteOffset=o)})[I],s&&(K(O,"byteLength",B),K(U,"buffer",L),K(U,"byteLength",L),K(U,"byteOffset",L)),h(N,{getInt8:function(t){return $(this,1,t)[0]<<24>>24},getUint8:function(t){return $(this,1,t)[0]},getInt16:function(t){var e=$(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=$(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Y($(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Y($(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return H($(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return H($(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){tt(this,1,t,W,e)},setUint8:function(t,e){tt(this,1,t,W,e)},setInt16:function(t,e){tt(this,2,t,q,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){tt(this,2,t,q,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){tt(this,4,t,Z,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){tt(this,4,t,Z,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){tt(this,4,t,X,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){tt(this,8,t,J,e,arguments.length>2&&arguments[2])}});w(O,C),w(U,T),t.exports={ArrayBuffer:O,DataView:U}},70357:(t,e,r)=>{"use strict";var i=r(90690),n=r(27578),s=r(6310),o=r(98494),a=Math.min;t.exports=[].copyWithin||function(t,e){var r=i(this),l=s(r),c=n(t,l),h=n(e,l),u=arguments.length>2?arguments[2]:void 0,d=a((void 0===u?l:n(u,l))-h,l-c),p=1;for(h0;)h in r?r[c]=r[h]:o(r,c),c+=p,h+=p;return r}},62872:(t,e,r)=>{"use strict";var i=r(90690),n=r(27578),s=r(6310);t.exports=function(t){for(var e=i(this),r=s(e),o=arguments.length,a=n(o>1?arguments[1]:void 0,r),l=o>2?arguments[2]:void 0,c=void 0===l?r:n(l,r);c>a;)e[a++]=t;return e}},57612:(t,e,r)=>{"use strict";var i=r(2960).forEach,n=r(16834)("forEach");t.exports=n?[].forEach:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}},2231:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(90690),o=r(19429),a=r(13807),l=r(5185),c=r(22302),h=r(91664),u=r(54849),d=r(76058),p=r(88277),f=r(44201),m=r(29019),g=r(62489).toArray,A=f("asyncIterator"),y=n(p("Array","values")),v=n(y([]).next),x=function(){return new b(this)},b=function(t){this.iterator=y(t)};b.prototype.next=function(){return v(this.iterator)},t.exports=function(t){var e=this,r=arguments.length,n=r>1?arguments[1]:void 0,p=r>2?arguments[2]:void 0;return new(d("Promise"))((function(r){var d=s(t);void 0!==n&&(n=i(n,p));var f=u(d,A),y=f?void 0:h(d)||x,v=o(e)?new e:[],b=f?a(d,f):new m(c(l(d,y)));r(g(b,n,v))}))}},59976:(t,e,r)=>{"use strict";var i=r(6310);t.exports=function(t,e,r){for(var n=0,s=arguments.length>2?r:i(e),o=new t(s);s>n;)o[n]=e[n++];return o}},21055:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(90690),o=r(71228),a=r(93292),l=r(19429),c=r(6310),h=r(76522),u=r(5185),d=r(91664),p=Array;t.exports=function(t){var e=s(t),r=l(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=i(m,f>2?arguments[2]:void 0));var A,y,v,x,b,_,w=d(e),E=0;if(!w||this===p&&a(w))for(A=c(e),y=r?new this(A):p(A);A>E;E++)_=g?m(e[E],E):e[E],h(y,E,_);else for(b=(x=u(e,w)).next,y=r?new this:[];!(v=n(b,x)).done;E++)_=g?o(x,m,[v.value,E],!0):v.value,h(y,E,_);return y.length=E,y}},44416:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(6310),l=r(83914),c=l.Map,h=l.get,u=l.has,d=l.set,p=n([].push);t.exports=function(t){for(var e,r,n=o(this),l=s(n),f=i(t,arguments.length>1?arguments[1]:void 0),m=new c,g=a(l),A=0;g>A;A++)e=f(r=l[A],A,n),u(m,e)?p(h(m,e),r):d(m,e,[r]);return m}},64976:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(18360),l=r(6310),c=r(25391),h=r(59976),u=Array,d=n([].push);t.exports=function(t,e,r,n){for(var p,f,m,g=o(t),A=s(g),y=i(e,r),v=c(null),x=l(A),b=0;x>b;b++)m=A[b],(f=a(y(m,b,g)))in v?d(v[f],m):v[f]=[m];if(n&&(p=n(g))!==u)for(f in v)v[f]=h(p,v[f]);return v}},84328:(t,e,r)=>{"use strict";var i=r(65290),n=r(27578),s=r(6310),o=function(t){return function(e,r,o){var a,l=i(e),c=s(l),h=n(o,c);if(t&&r!=r){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===r)return t||h||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},61969:(t,e,r)=>{"use strict";var i=r(54071),n=r(94413),s=r(90690),o=r(6310),a=function(t){var e=1===t;return function(r,a,l){for(var c,h=s(r),u=n(h),d=o(u),p=i(a,l);d-- >0;)if(p(c=u[d],d,h))switch(t){case 0:return c;case 1:return d}return e?-1:void 0}};t.exports={findLast:a(0),findLastIndex:a(1)}},2960:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(6310),l=r(27120),c=n([].push),h=function(t){var e=1===t,r=2===t,n=3===t,h=4===t,u=6===t,d=7===t,p=5===t||u;return function(f,m,g,A){for(var y,v,x=o(f),b=s(x),_=a(b),w=i(m,g),E=0,M=A||l,S=e?M(f,_):r||d?M(f,0):void 0;_>E;E++)if((p||E in b)&&(v=w(y=b[E],E,x),t))if(e)S[E]=v;else if(v)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:c(S,y)}else switch(t){case 4:return!1;case 7:c(S,y)}return u?-1:n||h?h:S}};t.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6),filterReject:h(7)}},60953:(t,e,r)=>{"use strict";var i=r(61735),n=r(65290),s=r(68700),o=r(6310),a=r(16834),l=Math.min,c=[].lastIndexOf,h=!!c&&1/[1].lastIndexOf(1,-0)<0,u=a("lastIndexOf"),d=h||!u;t.exports=d?function(t){if(h)return i(c,this,arguments)||0;var e=n(this),r=o(e),a=r-1;for(arguments.length>1&&(a=l(a,s(arguments[1]))),a<0&&(a=r+a);a>=0;a--)if(a in e&&e[a]===t)return a||0;return-1}:c},29042:(t,e,r)=>{"use strict";var i=r(3689),n=r(44201),s=r(3615),o=n("species");t.exports=function(t){return s>=51||!i((function(){var e=[];return(e.constructor={})[o]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},16834:(t,e,r)=>{"use strict";var i=r(3689);t.exports=function(t,e){var r=[][t];return!!r&&i((function(){r.call(null,e||function(){return 1},1)}))}},88820:(t,e,r)=>{"use strict";var i=r(10509),n=r(90690),s=r(94413),o=r(6310),a=TypeError,l=function(t){return function(e,r,l,c){var h=n(e),u=s(h),d=o(h);i(r);var p=t?d-1:0,f=t?-1:1;if(l<2)for(;;){if(p in u){c=u[p],p+=f;break}if(p+=f,t?p<0:d<=p)throw new a("Reduce of empty array with no initial value")}for(;t?p>=0:d>p;p+=f)p in u&&(c=r(c,u[p],p,h));return c}};t.exports={left:l(!1),right:l(!0)}},5649:(t,e,r)=>{"use strict";var i=r(67697),n=r(92297),s=TypeError,o=Object.getOwnPropertyDescriptor,a=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=a?function(t,e){if(n(t)&&!o(t,"length").writable)throw new s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},9015:(t,e,r)=>{"use strict";var i=r(27578),n=r(6310),s=r(76522),o=Array,a=Math.max;t.exports=function(t,e,r){for(var l=n(t),c=i(e,l),h=i(void 0===r?l:r,l),u=o(a(h-c,0)),d=0;c{"use strict";var i=r(68844);t.exports=i([].slice)},50382:(t,e,r)=>{"use strict";var i=r(9015),n=Math.floor,s=function(t,e){var r=t.length,l=n(r/2);return r<8?o(t,e):a(t,s(i(t,0,l),e),s(i(t,l),e),e)},o=function(t,e){for(var r,i,n=t.length,s=1;s0;)t[i]=t[--i];i!==s++&&(t[i]=r)}return t},a=function(t,e,r,i){for(var n=e.length,s=r.length,o=0,a=0;o{"use strict";var i=r(92297),n=r(19429),s=r(48999),o=r(44201)("species"),a=Array;t.exports=function(t){var e;return i(t)&&(e=t.constructor,(n(e)&&(e===a||i(e.prototype))||s(e)&&null===(e=e[o]))&&(e=void 0)),void 0===e?a:e}},27120:(t,e,r)=>{"use strict";var i=r(25271);t.exports=function(t,e){return new(i(t))(0===e?0:e)}},26166:(t,e,r)=>{"use strict";var i=r(6310);t.exports=function(t,e){for(var r=i(t),n=new e(r),s=0;s{"use strict";var i=r(68844),n=r(10509),s=r(981),o=r(6310),a=r(90690),l=r(83914),c=r(10613),h=l.Map,u=l.has,d=l.set,p=i([].push);t.exports=function(t){var e,r,i,l=a(this),f=o(l),m=[],g=new h,A=s(t)?function(t){return t}:n(t);for(e=0;e{"use strict";var i=r(6310),n=r(68700),s=RangeError;t.exports=function(t,e,r,o){var a=i(t),l=n(r),c=l<0?a+l:l;if(c>=a||c<0)throw new s("Incorrect index");for(var h=new e(a),u=0;u{"use strict";var i=r(22615),n=r(85027),s=r(25391),o=r(54849),a=r(6045),l=r(618),c=r(76058),h=r(23070),u=r(27807),d=c("Promise"),p="AsyncFromSyncIterator",f=l.set,m=l.getterFor(p),g=function(t,e,r){var i=t.done;d.resolve(t.value).then((function(t){e(u(t,i))}),r)},A=function(t){t.type=p,f(this,t)};A.prototype=a(s(h),{next:function(){var t=m(this);return new d((function(e,r){var s=n(i(t.next,t.iterator));g(s,e,r)}))},return:function(){var t=m(this).iterator;return new d((function(e,r){var s=o(t,"return");if(void 0===s)return e(u(void 0,!0));var a=n(i(s,t));g(a,e,r)}))}}),t.exports=A},52399:(t,e,r)=>{"use strict";var i=r(22615),n=r(76058),s=r(54849);t.exports=function(t,e,r,o){try{var a=s(t,"return");if(a)return n("Promise").resolve(i(a,t)).then((function(){e(r)}),(function(t){o(t)}))}catch(t){return o(t)}e(r)}},17394:(t,e,r)=>{"use strict";var i=r(22615),n=r(9302),s=r(85027),o=r(25391),a=r(75773),l=r(6045),c=r(44201),h=r(618),u=r(76058),d=r(54849),p=r(23070),f=r(27807),m=r(72125),g=u("Promise"),A=c("toStringTag"),y="AsyncIteratorHelper",v="WrapForValidAsyncIterator",x=h.set,b=function(t){var e=!t,r=h.getterFor(t?v:y),a=function(t){var i=n((function(){return r(t)})),s=i.error,o=i.value;return s||e&&o.done?{exit:!0,value:s?g.reject(o):g.resolve(f(void 0,!0))}:{exit:!1,value:o}};return l(o(p),{next:function(){var t=a(this),e=t.value;if(t.exit)return e;var r=n((function(){return s(e.nextHandler(g))})),i=r.error,o=r.value;return i&&(e.done=!0),i?g.reject(o):g.resolve(o)},return:function(){var e=a(this),r=e.value;if(e.exit)return r;r.done=!0;var o,l,c=r.iterator,h=n((function(){if(r.inner)try{m(r.inner.iterator,"normal")}catch(t){return m(c,"throw",t)}return d(c,"return")}));return o=l=h.value,h.error?g.reject(l):void 0===o?g.resolve(f(void 0,!0)):(l=(h=n((function(){return i(o,c)}))).value,h.error?g.reject(l):t?g.resolve(l):g.resolve(l).then((function(t){return s(t),f(void 0,!0)})))}})},_=b(!0),w=b(!1);a(w,A,"Async Iterator Helper"),t.exports=function(t,e){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=e?v:y,i.nextHandler=t,i.counter=0,i.done=!1,x(this,i)};return r.prototype=e?_:w,r}},40164:(t,e,r)=>{"use strict";var i=r(22615),n=r(82412),s=function(t,e){return[e,t]};t.exports=function(){return i(n,this,s)}},62489:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(48999),a=r(55565),l=r(76058),c=r(22302),h=r(52399),u=function(t){var e=0===t,r=1===t,u=2===t,d=3===t;return function(t,p,f){s(t);var m=void 0!==p;!m&&e||n(p);var g=c(t),A=l("Promise"),y=g.iterator,v=g.next,x=0;return new A((function(t,n){var l=function(t){h(y,n,t,n)},c=function(){try{if(m)try{a(x)}catch(t){l(t)}A.resolve(s(i(v,y))).then((function(i){try{if(s(i).done)e?(f.length=x,t(f)):t(!d&&(u||void 0));else{var a=i.value;try{if(m){var g=p(a,x),v=function(i){if(r)c();else if(u)i?c():h(y,t,!1,n);else if(e)try{f[x++]=i,c()}catch(t){l(t)}else i?h(y,t,d||a,n):c()};o(g)?A.resolve(g).then(v,l):v(g)}else f[x++]=a,c()}catch(t){l(t)}}}catch(t){n(t)}}),n)}catch(t){n(t)}};c()}))}};t.exports={toArray:u(0),forEach:u(1),every:u(2),some:u(3),find:u(4)}},82412:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(48999),a=r(22302),l=r(17394),c=r(27807),h=r(52399),u=l((function(t){var e=this,r=e.iterator,n=e.mapper;return new t((function(a,l){var u=function(t){e.done=!0,l(t)},d=function(t){h(r,u,t,u)};t.resolve(s(i(e.next,r))).then((function(r){try{if(s(r).done)e.done=!0,a(c(void 0,!0));else{var i=r.value;try{var l=n(i,e.counter++),h=function(t){a(c(t,!1))};o(l)?t.resolve(l).then(h,d):h(l)}catch(t){d(t)}}}catch(t){u(t)}}),u)}))}));t.exports=function(t){return s(this),n(t),new u(a(this),{mapper:t})}},23070:(t,e,r)=>{"use strict";var i,n,s=r(19037),o=r(84091),a=r(69985),l=r(25391),c=r(61868),h=r(11880),u=r(44201),d=r(53931),p="USE_FUNCTION_CONSTRUCTOR",f=u("asyncIterator"),m=s.AsyncIterator,g=o.AsyncIteratorPrototype;if(g)i=g;else if(a(m))i=m.prototype;else if(o[p]||s[p])try{n=c(c(c(Function("return async function*(){}()")()))),c(n)===Object.prototype&&(i=n)}catch(t){}i?d&&(i=l(i)):i={},a(i[f])||h(i,f,(function(){return this})),t.exports=i},40219:(t,e,r)=>{"use strict";var i=r(22615),n=r(17394);t.exports=n((function(){return i(this.next,this.iterator)}),!0)},18368:t=>{"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=e+"+/",i=e+"-_",n=function(t){for(var e={},r=0;r<64;r++)e[t.charAt(r)]=r;return e};t.exports={i2c:r,c2i:n(r),i2cUrl:i,c2iUrl:n(i)}},71228:(t,e,r)=>{"use strict";var i=r(85027),n=r(72125);t.exports=function(t,e,r,s){try{return s?e(i(r)[0],r[1]):e(r)}catch(e){n(t,"throw",e)}}},86431:(t,e,r)=>{"use strict";var i=r(44201)("iterator"),n=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){n=!0}};o[i]=function(){return this},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){try{if(!e&&!n)return!1}catch(t){return!1}var r=!1;try{var s={};s[i]=function(){return{next:function(){return{done:r=!0}}}},t(s)}catch(t){}return r}},6648:(t,e,r)=>{"use strict";var i=r(68844),n=i({}.toString),s=i("".slice);t.exports=function(t){return s(n(t),8,-1)}},50926:(t,e,r)=>{"use strict";var i=r(23043),n=r(69985),s=r(6648),o=r(44201)("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());t.exports=i?s:function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=a(t),o))?r:l?s(e):"Object"===(i=s(e))&&n(e.callee)?"Arguments":i}},28737:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(10509),o=r(52655),a=r(981),l=r(18734),c=[].push;t.exports=function(t){var e,r,h,u,d=arguments.length,p=d>1?arguments[1]:void 0;return o(this),(e=void 0!==p)&&s(p),a(t)?new this:(r=[],e?(h=0,u=i(p,d>2?arguments[2]:void 0),l(t,(function(t){n(c,r,u(t,h++))}))):l(t,c,{that:r}),new this(r))}},1114:(t,e,r)=>{"use strict";var i=r(96004);t.exports=function(){return new this(i(arguments))}},70800:(t,e,r)=>{"use strict";var i=r(25391),n=r(62148),s=r(6045),o=r(54071),a=r(767),l=r(981),c=r(18734),h=r(91934),u=r(27807),d=r(14241),p=r(67697),f=r(45375).fastKey,m=r(618),g=m.set,A=m.getterFor;t.exports={getConstructor:function(t,e,r,h){var u=t((function(t,n){a(t,d),g(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),p||(t.size=0),l(n)||c(n,t[h],{that:t,AS_ENTRIES:r})})),d=u.prototype,m=A(e),y=function(t,e,r){var i,n,s=m(t),o=v(t,e);return o?o.value=r:(s.last=o={index:n=f(e,!0),key:e,value:r,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=o),i&&(i.next=o),p?s.size++:t.size++,"F"!==n&&(s.index[n]=o)),t},v=function(t,e){var r,i=m(t),n=f(e);if("F"!==n)return i.index[n];for(r=i.first;r;r=r.next)if(r.key===e)return r};return s(d,{clear:function(){for(var t=m(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,p?t.size=0:this.size=0},delete:function(t){var e=this,r=m(e),i=v(e,t);if(i){var n=i.next,s=i.previous;delete r.index[i.index],i.removed=!0,s&&(s.next=n),n&&(n.previous=s),r.first===i&&(r.first=n),r.last===i&&(r.last=s),p?r.size--:e.size--}return!!i},forEach:function(t){for(var e,r=m(this),i=o(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!v(this,t)}}),s(d,r?{get:function(t){var e=v(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),p&&n(d,"size",{configurable:!0,get:function(){return m(this).size}}),u},setStrong:function(t,e,r){var i=e+" Iterator",n=A(e),s=A(i);h(t,e,(function(t,e){g(this,{type:i,target:t,state:n(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?u("keys"===e?r.key:"values"===e?r.value:[r.key,r.value],!1):(t.target=void 0,u(void 0,!0))}),r?"entries":"values",!r,!0),d(e)}}},70637:(t,e,r)=>{"use strict";var i=r(68844),n=r(6045),s=r(45375).getWeakData,o=r(767),a=r(85027),l=r(981),c=r(48999),h=r(18734),u=r(2960),d=r(36812),p=r(618),f=p.set,m=p.getterFor,g=u.find,A=u.findIndex,y=i([].splice),v=0,x=function(t){return t.frozen||(t.frozen=new b)},b=function(){this.entries=[]},_=function(t,e){return g(t.entries,(function(t){return t[0]===e}))};b.prototype={get:function(t){var e=_(this,t);if(e)return e[1]},has:function(t){return!!_(this,t)},set:function(t,e){var r=_(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=A(this.entries,(function(e){return e[0]===t}));return~e&&y(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,r,i){var u=t((function(t,n){o(t,p),f(t,{type:e,id:v++,frozen:void 0}),l(n)||h(n,t[i],{that:t,AS_ENTRIES:r})})),p=u.prototype,g=m(e),A=function(t,e,r){var i=g(t),n=s(a(e),!0);return!0===n?x(i).set(e,r):n[i.id]=r,t};return n(p,{delete:function(t){var e=g(this);if(!c(t))return!1;var r=s(t);return!0===r?x(e).delete(t):r&&d(r,e.id)&&delete r[e.id]},has:function(t){var e=g(this);if(!c(t))return!1;var r=s(t);return!0===r?x(e).has(t):r&&d(r,e.id)}}),n(p,r?{get:function(t){var e=g(this);if(c(t)){var r=s(t);return!0===r?x(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return A(this,t,e)}}:{add:function(t){return A(this,t,!0)}}),u}}},20319:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(35266),a=r(11880),l=r(45375),c=r(18734),h=r(767),u=r(69985),d=r(981),p=r(48999),f=r(3689),m=r(86431),g=r(55997),A=r(33457);t.exports=function(t,e,r){var y=-1!==t.indexOf("Map"),v=-1!==t.indexOf("Weak"),x=y?"set":"add",b=n[t],_=b&&b.prototype,w=b,E={},M=function(t){var e=s(_[t]);a(_,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(v&&!p(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return v&&!p(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(v&&!p(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(o(t,!u(b)||!(v||_.forEach&&!f((function(){(new b).entries().next()})))))w=r.getConstructor(e,t,y,x),l.enable();else if(o(t,!0)){var S=new w,C=S[x](v?{}:-0,1)!==S,T=f((function(){S.has(1)})),I=m((function(t){new b(t)})),R=!v&&f((function(){for(var t=new b,e=5;e--;)t[x](e,e);return!t.has(-0)}));I||((w=e((function(t,e){h(t,_);var r=A(new b,t,w);return d(e)||c(e,r[x],{that:r,AS_ENTRIES:y}),r}))).prototype=_,_.constructor=w),(T||R)&&(M("delete"),M("has"),y&&M("get")),(R||C)&&M(x),v&&_.clear&&delete _.clear}return E[t]=w,i({global:!0,constructor:!0,forced:w!==b},E),g(w,t),v||r.setStrong(w,t,y),w}},41544:(t,e,r)=>{"use strict";r(56646),r(51090);var i=r(76058),n=r(25391),s=r(48999),o=Object,a=TypeError,l=i("Map"),c=i("WeakMap"),h=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=n(null)};h.prototype.get=function(t,e){return this[t]||(this[t]=e())},h.prototype.next=function(t,e,r){var i=r?this.objectsByIndex[t]||(this.objectsByIndex[t]=new c):this.primitives||(this.primitives=new l),n=i.get(e);return n||i.set(e,n=new h),n};var u=new h;t.exports=function(){var t,e,r=u,i=arguments.length;for(t=0;t{"use strict";var i=r(36812),n=r(19152),s=r(82474),o=r(72560);t.exports=function(t,e,r){for(var a=n(e),l=o.f,c=s.f,h=0;h{"use strict";var i=r(44201)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[i]=!1,"/./"[t](e)}catch(t){}}return!1}},81748:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},71568:(t,e,r)=>{"use strict";var i=r(68844),n=r(74684),s=r(34327),o=/"/g,a=i("".replace);t.exports=function(t,e,r,i){var l=s(n(t)),c="<"+e;return""!==r&&(c+=" "+r+'="'+a(s(i),o,""")+'"'),c+">"+l+""}},27807:t=>{"use strict";t.exports=function(t,e){return{value:t,done:e}}},75773:(t,e,r)=>{"use strict";var i=r(67697),n=r(72560),s=r(75684);t.exports=i?function(t,e,r){return n.f(t,e,s(1,r))}:function(t,e,r){return t[e]=r,t}},75684:t=>{"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},76522:(t,e,r)=>{"use strict";var i=r(18360),n=r(72560),s=r(75684);t.exports=function(t,e,r){var o=i(e);o in t?n.f(t,o,s(0,r)):t[o]=r}},99455:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(77254).start,o=RangeError,a=isFinite,l=Math.abs,c=Date.prototype,h=c.toISOString,u=i(c.getTime),d=i(c.getUTCDate),p=i(c.getUTCFullYear),f=i(c.getUTCHours),m=i(c.getUTCMilliseconds),g=i(c.getUTCMinutes),A=i(c.getUTCMonth),y=i(c.getUTCSeconds);t.exports=n((function(){return"0385-07-25T07:06:39.999Z"!==h.call(new Date(-50000000000001))}))||!n((function(){h.call(new Date(NaN))}))?function(){if(!a(u(this)))throw new o("Invalid time value");var t=this,e=p(t),r=m(t),i=e<0?"-":e>9999?"+":"";return i+s(l(e),i?6:4,0)+"-"+s(A(t)+1,2,0)+"-"+s(d(t),2,0)+"T"+s(f(t),2,0)+":"+s(g(t),2,0)+":"+s(y(t),2,0)+"."+s(r,3,0)+"Z"}:h},81797:(t,e,r)=>{"use strict";var i=r(85027),n=r(35899),s=TypeError;t.exports=function(t){if(i(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new s("Incorrect hint");return n(this,t)}},62148:(t,e,r)=>{"use strict";var i=r(98702),n=r(72560);t.exports=function(t,e,r){return r.get&&i(r.get,e,{getter:!0}),r.set&&i(r.set,e,{setter:!0}),n.f(t,e,r)}},11880:(t,e,r)=>{"use strict";var i=r(69985),n=r(72560),s=r(98702),o=r(95014);t.exports=function(t,e,r,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(i(r)&&s(r,c,a),a.global)l?t[e]=r:o(e,r);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=r:n.f(t,e,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},6045:(t,e,r)=>{"use strict";var i=r(11880);t.exports=function(t,e,r){for(var n in e)i(t,n,e[n],r);return t}},95014:(t,e,r)=>{"use strict";var i=r(19037),n=Object.defineProperty;t.exports=function(t,e){try{n(i,t,{value:e,configurable:!0,writable:!0})}catch(r){i[t]=e}return e}},98494:(t,e,r)=>{"use strict";var i=r(23691),n=TypeError;t.exports=function(t,e){if(!delete t[e])throw new n("Cannot delete property "+i(e)+" of "+i(t))}},67697:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},21420:(t,e,r)=>{"use strict";var i,n,s,o,a=r(19037),l=r(21905),c=r(63514),h=a.structuredClone,u=a.ArrayBuffer,d=a.MessageChannel,p=!1;if(c)p=function(t){h(t,{transfer:[t]})};else if(u)try{d||(i=l("worker_threads"))&&(d=i.MessageChannel),d&&(n=new d,s=new u(2),o=function(t){n.port1.postMessage(null,[t])},2===s.byteLength&&(o(s),0===s.byteLength&&(p=o)))}catch(t){}t.exports=p},22659:t=>{"use strict";var e="object"==typeof document&&document.all,r=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:r}},36420:(t,e,r)=>{"use strict";var i=r(19037),n=r(48999),s=i.document,o=n(s)&&n(s.createElement);t.exports=function(t){return o?s.createElement(t):{}}},55565:t=>{"use strict";var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},37136:t=>{"use strict";t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},66338:t=>{"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},33265:(t,e,r)=>{"use strict";var i=r(36420)("span").classList,n=i&&i.constructor&&i.constructor.prototype;t.exports=n===Object.prototype?void 0:n},97365:(t,e,r)=>{"use strict";var i=r(30071).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},72532:(t,e,r)=>{"use strict";var i=r(88563),n=r(50806);t.exports=!i&&!n&&"object"==typeof window&&"object"==typeof document},83127:t=>{"use strict";t.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},88563:t=>{"use strict";t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},37298:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/MSIE|Trident/.test(i)},63221:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/ipad|iphone|ipod/i.test(i)&&"undefined"!=typeof Pebble},4764:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},50806:(t,e,r)=>{"use strict";var i=r(19037),n=r(6648);t.exports="process"===n(i.process)},27486:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/web0s(?!.*chrome)/i.test(i)},30071:t=>{"use strict";t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3615:(t,e,r)=>{"use strict";var i,n,s=r(19037),o=r(30071),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,h=c&&c.v8;h&&(n=(i=h.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!n&&o&&(!(i=o.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=o.match(/Chrome\/(\d+)/))&&(n=+i[1]),t.exports=n},27922:(t,e,r)=>{"use strict";var i=r(30071).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},72739:t=>{"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},56610:(t,e,r)=>{"use strict";var i=r(68844),n=Error,s=i("".replace),o=String(new n("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(o);t.exports=function(t,e){if(l&&"string"==typeof t&&!n.prepareStackTrace)for(;e--;)t=s(t,a,"");return t}},65411:(t,e,r)=>{"use strict";var i=r(75773),n=r(56610),s=r(49599),o=Error.captureStackTrace;t.exports=function(t,e,r,a){s&&(o?o(t,e):i(t,"stack",n(r,a)))}},49599:(t,e,r)=>{"use strict";var i=r(3689),n=r(75684);t.exports=!i((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",n(1,7)),7!==t.stack)}))},20445:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(85027),o=r(13841),a=Error.prototype.toString,l=n((function(){if(i){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==a.call(t))return!0}return"2: 1"!==a.call({message:1,name:2})||"Error"!==a.call({})}));t.exports=l?function(){var t=s(this),e=o(t.name,"Error"),r=o(t.message);return e?r?e+": "+r:e:r}:a},79989:(t,e,r)=>{"use strict";var i=r(19037),n=r(82474).f,s=r(75773),o=r(11880),a=r(95014),l=r(8758),c=r(35266);t.exports=function(t,e){var r,h,u,d,p,f=t.target,m=t.global,g=t.stat;if(r=m?i:g?i[f]||a(f,{}):(i[f]||{}).prototype)for(h in e){if(d=e[h],u=t.dontCallGetSet?(p=n(r,h))&&p.value:r[h],!c(m?h:f+(g?".":"#")+h,t.forced)&&void 0!==u){if(typeof d==typeof u)continue;l(d,u)}(t.sham||u&&u.sham)&&s(d,"sham",!0),o(r,h,d,t)}}},3689:t=>{"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},65773:(t,e,r)=>{"use strict";r(64043);var i=r(46576),n=r(11880),s=r(56308),o=r(3689),a=r(44201),l=r(75773),c=a("species"),h=RegExp.prototype;t.exports=function(t,e,r,u){var d=a(t),p=!o((function(){var e={};return e[d]=function(){return 7},7!==""[t](e)})),f=p&&!o((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[d]=/./[d]),r.exec=function(){return e=!0,null},r[d](""),!e}));if(!p||!f||r){var m=i(/./[d]),g=e(d,""[t],(function(t,e,r,n,o){var a=i(t),l=e.exec;return l===s||l===h.exec?p&&!o?{done:!0,value:m(e,r,n)}:{done:!0,value:a(r,e,n)}:{done:!1}}));n(String.prototype,t,g[0]),n(h,d,g[1])}u&&l(h[d],"sham",!0)}},37809:(t,e,r)=>{"use strict";var i=r(92297),n=r(6310),s=r(55565),o=r(54071),a=function(t,e,r,l,c,h,u,d){for(var p,f,m=c,g=0,A=!!u&&o(u,d);g0&&i(p)?(f=n(p),m=a(t,e,p,f,m,h-1)-1):(s(m+1),t[m]=p),m++),g++;return m};t.exports=a},71594:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},61735:(t,e,r)=>{"use strict";var i=r(97215),n=Function.prototype,s=n.apply,o=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?o.bind(s):function(){return o.apply(s,arguments)})},54071:(t,e,r)=>{"use strict";var i=r(46576),n=r(10509),s=r(97215),o=i(i.bind);t.exports=function(t,e){return n(t),void 0===e?t:s?o(t,e):function(){return t.apply(e,arguments)}}},97215:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},86761:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509),s=r(48999),o=r(36812),a=r(96004),l=r(97215),c=Function,h=i([].concat),u=i([].join),d={};t.exports=l?c.bind:function(t){var e=n(this),r=e.prototype,i=a(arguments,1),l=function(){var r=h(i,a(arguments));return this instanceof l?function(t,e,r){if(!o(d,e)){for(var i=[],n=0;n{"use strict";var i=r(97215),n=Function.prototype.call;t.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},33505:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509);t.exports=function(){return i(n(this))}},41236:(t,e,r)=>{"use strict";var i=r(67697),n=r(36812),s=Function.prototype,o=i&&Object.getOwnPropertyDescriptor,a=n(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!i||i&&o(s,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},52743:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509);t.exports=function(t,e,r){try{return i(n(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},46576:(t,e,r)=>{"use strict";var i=r(6648),n=r(68844);t.exports=function(t){if("Function"===i(t))return n(t)}},68844:(t,e,r)=>{"use strict";var i=r(97215),n=Function.prototype,s=n.call,o=i&&n.bind.bind(s,s);t.exports=i?o:function(t){return function(){return s.apply(t,arguments)}}},9093:t=>{"use strict";var e=TypeError;t.exports=function(t){var r=t&&t.alphabet;if(void 0===r||"base64"===r||"base64url"===r)return r||"base64";throw new e("Incorrect `alphabet` option")}},11427:(t,e,r)=>{"use strict";var i=r(22615),n=r(69985),s=r(85027),o=r(22302),a=r(91664),l=r(54849),c=r(44201),h=r(29019),u=c("asyncIterator");t.exports=function(t){var e,r=s(t),c=!0,d=l(r,u);return n(d)||(d=a(r),c=!1),void 0!==d?e=i(d,r):(e=r,c=!0),s(e),o(c?e:new h(o(e)))}},13807:(t,e,r)=>{"use strict";var i=r(22615),n=r(29019),s=r(85027),o=r(5185),a=r(22302),l=r(54849),c=r(44201)("asyncIterator");t.exports=function(t,e){var r=arguments.length<2?l(t,c):e;return r?s(i(r,t)):new n(a(o(t)))}},88277:(t,e,r)=>{"use strict";var i=r(19037);t.exports=function(t,e){var r=i[t],n=r&&r.prototype;return n&&n[e]}},76058:(t,e,r)=>{"use strict";var i=r(19037),n=r(69985);t.exports=function(t,e){return arguments.length<2?(r=i[t],n(r)?r:void 0):i[t]&&i[t][e];var r}},22302:t=>{"use strict";t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},36752:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(22302),o=r(91664);t.exports=function(t,e){e&&"string"==typeof t||n(t);var r=o(t);return s(n(void 0!==r?i(r,t):t))}},91664:(t,e,r)=>{"use strict";var i=r(50926),n=r(54849),s=r(981),o=r(9478),a=r(44201)("iterator");t.exports=function(t){if(!s(t))return n(t,a)||n(t,"@@iterator")||o[i(t)]}},5185:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(23691),a=r(91664),l=TypeError;t.exports=function(t,e){var r=arguments.length<2?a(t):e;if(n(r))return s(i(r,t));throw new l(o(t)+" is not iterable")}},92643:(t,e,r)=>{"use strict";var i=r(68844),n=r(92297),s=r(69985),o=r(6648),a=r(34327),l=i([].push);t.exports=function(t){if(s(t))return t;if(n(t)){for(var e=t.length,r=[],i=0;i{"use strict";var i=r(10509),n=r(981);t.exports=function(t,e){var r=t[e];return n(r)?void 0:i(r)}},41074:(t,e,r)=>{"use strict";var i=r(10509),n=r(85027),s=r(22615),o=r(68700),a=r(22302),l="Invalid size",c=RangeError,h=TypeError,u=Math.max,d=function(t,e,r,i){this.set=t,this.size=e,this.has=r,this.keys=i};d.prototype={getIterator:function(){return a(n(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}},t.exports=function(t){n(t);var e=+t.size;if(e!=e)throw new h(l);var r=o(e);if(r<0)throw new c(l);return new d(t,u(r,0),i(t.has),i(t.keys))}},27017:(t,e,r)=>{"use strict";var i=r(68844),n=r(90690),s=Math.floor,o=i("".charAt),a=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,i,u,d){var p=r+t.length,f=i.length,m=h;return void 0!==u&&(u=n(u),m=c),a(d,m,(function(n,a){var c;switch(o(a,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,r);case"'":return l(e,p);case"<":c=u[l(a,1,-1)];break;default:var h=+a;if(0===h)return n;if(h>f){var d=s(h/10);return 0===d?n:d<=f?void 0===i[d-1]?o(a,1):i[d-1]+o(a,1):n}c=i[h-1]}return void 0===c?"":c}))}},19037:function(t,e,r){"use strict";var i=function(t){return t&&t.Math===Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r.g&&r.g)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},36812:(t,e,r)=>{"use strict";var i=r(68844),n=r(90690),s=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(n(t),e)}},57248:t=>{"use strict";t.exports={}},20920:t=>{"use strict";t.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}},2688:(t,e,r)=>{"use strict";var i=r(76058);t.exports=i("document","documentElement")},68506:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(36420);t.exports=!i&&!n((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},15477:t=>{"use strict";var e=Array,r=Math.abs,i=Math.pow,n=Math.floor,s=Math.log,o=Math.LN2;t.exports={pack:function(t,a,l){var c,h,u,d=e(l),p=8*l-a-1,f=(1<>1,g=23===a?i(2,-24)-i(2,-77):0,A=t<0||0===t&&1/t<0?1:0,y=0;for((t=r(t))!=t||t===1/0?(h=t!=t?1:0,c=f):(c=n(s(t)/o),t*(u=i(2,-c))<1&&(c--,u*=2),(t+=c+m>=1?g/u:g*i(2,1-m))*u>=2&&(c++,u/=2),c+m>=f?(h=0,c=f):c+m>=1?(h=(t*u-1)*i(2,a),c+=m):(h=t*i(2,m-1)*i(2,a),c=0));a>=8;)d[y++]=255&h,h/=256,a-=8;for(c=c<0;)d[y++]=255&c,c/=256,p-=8;return d[--y]|=128*A,d},unpack:function(t,e){var r,n=t.length,s=8*n-e-1,o=(1<>1,l=s-7,c=n-1,h=t[c--],u=127&h;for(h>>=7;l>0;)u=256*u+t[c--],l-=8;for(r=u&(1<<-l)-1,u>>=-l,l+=e;l>0;)r=256*r+t[c--],l-=8;if(0===u)u=1-a;else{if(u===o)return r?NaN:h?-1/0:1/0;r+=i(2,e),u-=a}return(h?-1:1)*r*i(2,u-e)}}},94413:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(6648),o=Object,a=i("".split);t.exports=n((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?a(t,""):o(t)}:o},33457:(t,e,r)=>{"use strict";var i=r(69985),n=r(48999),s=r(49385);t.exports=function(t,e,r){var o,a;return s&&i(o=e.constructor)&&o!==r&&n(a=o.prototype)&&a!==r.prototype&&s(t,a),t}},6738:(t,e,r)=>{"use strict";var i=r(68844),n=r(69985),s=r(84091),o=i(Function.toString);n(s.inspectSource)||(s.inspectSource=function(t){return o(t)}),t.exports=s.inspectSource},62570:(t,e,r)=>{"use strict";var i=r(48999),n=r(75773);t.exports=function(t,e){i(e)&&"cause"in e&&n(t,"cause",e.cause)}},45375:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(57248),o=r(48999),a=r(36812),l=r(72560).f,c=r(72741),h=r(26062),u=r(27049),d=r(14630),p=r(71594),f=!1,m=d("meta"),g=0,A=function(t){l(t,m,{value:{objectID:"O"+g++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},f=!0;var t=c.f,e=n([].splice),r={};r[m]=1,t(r).length&&(c.f=function(r){for(var i=t(r),n=0,s=i.length;n{"use strict";var i,n,s,o=r(59834),a=r(19037),l=r(48999),c=r(75773),h=r(36812),u=r(84091),d=r(2713),p=r(57248),f="Object already initialized",m=a.TypeError,g=a.WeakMap;if(o||u.state){var A=u.state||(u.state=new g);A.get=A.get,A.has=A.has,A.set=A.set,i=function(t,e){if(A.has(t))throw new m(f);return e.facade=t,A.set(t,e),e},n=function(t){return A.get(t)||{}},s=function(t){return A.has(t)}}else{var y=d("state");p[y]=!0,i=function(t,e){if(h(t,y))throw new m(f);return e.facade=t,c(t,y,e),e},n=function(t){return h(t,y)?t[y]:{}},s=function(t){return h(t,y)}}t.exports={set:i,get:n,has:s,enforce:function(t){return s(t)?n(t):i(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=n(e)).type!==t)throw new m("Incompatible receiver, "+t+" required");return r}}}},93292:(t,e,r)=>{"use strict";var i=r(44201),n=r(9478),s=i("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||o[s]===t)}},92297:(t,e,r)=>{"use strict";var i=r(6648);t.exports=Array.isArray||function(t){return"Array"===i(t)}},9401:(t,e,r)=>{"use strict";var i=r(50926);t.exports=function(t){var e=i(t);return"BigInt64Array"===e||"BigUint64Array"===e}},69985:(t,e,r)=>{"use strict";var i=r(22659),n=i.all;t.exports=i.IS_HTMLDDA?function(t){return"function"==typeof t||t===n}:function(t){return"function"==typeof t}},19429:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(69985),o=r(50926),a=r(76058),l=r(6738),c=function(){},h=[],u=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=i(d.exec),f=!d.test(c),m=function(t){if(!s(t))return!1;try{return u(c,h,t),!0}catch(t){return!1}},g=function(t){if(!s(t))return!1;switch(o(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(d,l(t))}catch(t){return!0}};g.sham=!0,t.exports=!u||n((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?g:m},76251:(t,e,r)=>{"use strict";var i=r(36812);t.exports=function(t){return void 0!==t&&(i(t,"value")||i(t,"writable"))}},35266:(t,e,r)=>{"use strict";var i=r(3689),n=r(69985),s=/#|\.prototype\./,o=function(t,e){var r=l[a(t)];return r===h||r!==c&&(n(e)?i(e):!!e)},a=o.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",h=o.POLYFILL="P";t.exports=o},71973:(t,e,r)=>{"use strict";var i=r(48999),n=Math.floor;t.exports=Number.isInteger||function(t){return!i(t)&&isFinite(t)&&n(t)===t}},9603:(t,e,r)=>{"use strict";var i=r(50926),n=r(36812),s=r(981),o=r(44201),a=r(9478),l=o("iterator"),c=Object;t.exports=function(t){if(s(t))return!1;var e=c(t);return void 0!==e[l]||"@@iterator"in e||n(a,i(e))}},981:t=>{"use strict";t.exports=function(t){return null==t}},48999:(t,e,r)=>{"use strict";var i=r(69985),n=r(22659),s=n.all;t.exports=n.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:i(t)||t===s}:function(t){return"object"==typeof t?null!==t:i(t)}},53931:t=>{"use strict";t.exports=!1},55670:(t,e,r)=>{"use strict";var i=r(48999),n=r(618).get;t.exports=function(t){if(!i(t))return!1;var e=n(t);return!!e&&"RawJSON"===e.type}},91245:(t,e,r)=>{"use strict";var i=r(48999),n=r(6648),s=r(44201)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[s])?!!e:"RegExp"===n(t))}},30734:(t,e,r)=>{"use strict";var i=r(76058),n=r(69985),s=r(23622),o=r(39525),a=Object;t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return n(e)&&s(e.prototype,a(t))}},96704:(t,e,r)=>{"use strict";var i=r(22615);t.exports=function(t,e,r){for(var n,s,o=r?t:t.iterator,a=t.next;!(n=i(a,o)).done;)if(void 0!==(s=e(n.value)))return s}},18734:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(85027),o=r(23691),a=r(93292),l=r(6310),c=r(23622),h=r(5185),u=r(91664),d=r(72125),p=TypeError,f=function(t,e){this.stopped=t,this.result=e},m=f.prototype;t.exports=function(t,e,r){var g,A,y,v,x,b,_,w=r&&r.that,E=!(!r||!r.AS_ENTRIES),M=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),T=i(e,w),I=function(t){return g&&d(g,"normal",t),new f(!0,t)},R=function(t){return E?(s(t),C?T(t[0],t[1],I):T(t[0],t[1])):C?T(t,I):T(t)};if(M)g=t.iterator;else if(S)g=t;else{if(!(A=u(t)))throw new p(o(t)+" is not iterable");if(a(A)){for(y=0,v=l(t);v>y;y++)if((x=R(t[y]))&&c(m,x))return x;return new f(!1)}g=h(t,A)}for(b=M?t.next:g.next;!(_=n(b,g)).done;){try{x=R(_.value)}catch(t){d(g,"throw",t)}if("object"==typeof x&&x&&c(m,x))return x}return new f(!1)}},72125:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(54849);t.exports=function(t,e,r){var o,a;n(t);try{if(!(o=s(t,"return"))){if("throw"===e)throw r;return r}o=i(o,t)}catch(t){a=!0,o=t}if("throw"===e)throw r;if(a)throw o;return n(o),r}},30974:(t,e,r)=>{"use strict";var i=r(12013).IteratorPrototype,n=r(25391),s=r(75684),o=r(55997),a=r(9478),l=function(){return this};t.exports=function(t,e,r,c){var h=e+" Iterator";return t.prototype=n(i,{next:s(+!c,r)}),o(t,h,!1,!0),a[h]=l,t}},65419:(t,e,r)=>{"use strict";var i=r(22615),n=r(25391),s=r(75773),o=r(6045),a=r(44201),l=r(618),c=r(54849),h=r(12013).IteratorPrototype,u=r(27807),d=r(72125),p=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",g=l.set,A=function(t){var e=l.getterFor(t?m:f);return o(n(h),{next:function(){var r=e(this);if(t)return r.nextHandler();try{var i=r.done?void 0:r.nextHandler();return u(i,r.done)}catch(t){throw r.done=!0,t}},return:function(){var r=e(this),n=r.iterator;if(r.done=!0,t){var s=c(n,"return");return s?i(s,n):u(void 0,!0)}if(r.inner)try{d(r.inner.iterator,"normal")}catch(t){return d(n,"throw",t)}return d(n,"normal"),u(void 0,!0)}})},y=A(!0),v=A(!1);s(v,p,"Iterator Helper"),t.exports=function(t,e){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=e?m:f,i.nextHandler=t,i.counter=0,i.done=!1,g(this,i)};return r.prototype=e?y:v,r}},91934:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(53931),o=r(41236),a=r(69985),l=r(30974),c=r(61868),h=r(49385),u=r(55997),d=r(75773),p=r(11880),f=r(44201),m=r(9478),g=r(12013),A=o.PROPER,y=o.CONFIGURABLE,v=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,b=f("iterator"),_="keys",w="values",E="entries",M=function(){return this};t.exports=function(t,e,r,o,f,g,S){l(r,e,o);var C,T,I,R=function(t){if(t===f&&O)return O;if(!x&&t&&t in P)return P[t];switch(t){case _:case w:case E:return function(){return new r(this,t)}}return function(){return new r(this)}},B=e+" Iterator",L=!1,P=t.prototype,D=P[b]||P["@@iterator"]||f&&P[f],O=!x&&D||R(f),k="Array"===e&&P.entries||D;if(k&&(C=c(k.call(new t)))!==Object.prototype&&C.next&&(s||c(C)===v||(h?h(C,v):a(C[b])||p(C,b,M)),u(C,B,!0,!0),s&&(m[B]=M)),A&&f===w&&D&&D.name!==w&&(!s&&y?d(P,"name",w):(L=!0,O=function(){return n(D,this)})),f)if(T={values:R(w),keys:g?O:R(_),entries:R(E)},S)for(I in T)(x||L||!(I in P))&&p(P,I,T[I]);else i({target:e,proto:!0,forced:x||L},T);return s&&!S||P[b]===O||p(P,b,O,{name:f}),m[e]=O,T}},47082:(t,e,r)=>{"use strict";var i=r(22615),n=r(88983),s=function(t,e){return[e,t]};t.exports=function(){return i(n,this,s)}},88983:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(22302),a=r(65419),l=r(71228),c=a((function(){var t=this.iterator,e=s(i(this.next,t));if(!(this.done=!!e.done))return l(t,this.mapper,[e.value,this.counter++],!0)}));t.exports=function(t){return s(this),n(t),new c(o(this),{mapper:t})}},12013:(t,e,r)=>{"use strict";var i,n,s,o=r(3689),a=r(69985),l=r(48999),c=r(25391),h=r(61868),u=r(11880),d=r(44201),p=r(53931),f=d("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(n=h(h(s)))!==Object.prototype&&(i=n):m=!0),!l(i)||o((function(){var t={};return i[f].call(t)!==t}))?i={}:p&&(i=c(i)),a(i[f])||u(i,f,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:m}},9478:t=>{"use strict";t.exports={}},6310:(t,e,r)=>{"use strict";var i=r(43126);t.exports=function(t){return i(t.length)}},98702:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(69985),o=r(36812),a=r(67697),l=r(41236).CONFIGURABLE,c=r(6738),h=r(618),u=h.enforce,d=h.get,p=String,f=Object.defineProperty,m=i("".slice),g=i("".replace),A=i([].join),y=a&&!n((function(){return 8!==f((function(){}),"length",{value:8}).length})),v=String(String).split("String"),x=t.exports=function(t,e,r){"Symbol("===m(p(e),0,7)&&(e="["+g(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!o(t,"name")||l&&t.name!==e)&&(a?f(t,"name",{value:e,configurable:!0}):t.name=e),y&&r&&o(r,"arity")&&t.length!==r.arity&&f(t,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=u(t);return o(i,"source")||(i.source=A(v,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return s(this)&&d(this).source||c(this)}),"toString")},83914:(t,e,r)=>{"use strict";var i=r(68844),n=Map.prototype;t.exports={Map,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete),proto:n}},10613:(t,e,r)=>{"use strict";var i=r(68844),n=r(96704),s=r(83914),o=s.Map,a=s.proto,l=i(a.forEach),c=i(a.entries),h=c(new o).next;t.exports=function(t,e,r){return r?n({iterator:c(t),next:h},(function(t){return e(t[1],t[0])})):l(t,e)}},41432:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(69985),o=r(85027),a=TypeError;t.exports=function(t,e){var r,l=o(this),c=n(l.get),h=n(l.has),u=n(l.set),d=arguments.length>2?arguments[2]:void 0;if(!s(e)&&!s(d))throw new a("At least one callback required");return i(h,l,t)?(r=i(c,l,t),s(e)&&(r=e(r),i(u,l,t,r))):s(d)&&(r=d(),i(u,l,t,r)),r}},21745:t=>{"use strict";var e=Math.expm1,r=Math.exp;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!==e(-2e-17)?function(t){var e=+t;return 0===e?e:e>-1e-6&&e<1e-6?e+e*e/2:r(e)-1}:e},76043:(t,e,r)=>{"use strict";var i=r(40134);t.exports=Math.f16round||function(t){return i(t,.0009765625,65504,6103515625e-14)}},40134:(t,e,r)=>{"use strict";var i=r(55680),n=Math.abs,s=2220446049250313e-31,o=1/s;t.exports=function(t,e,r,a){var l=+t,c=n(l),h=i(l);if(cr||d!=d?h*(1/0):h*d}},37788:(t,e,r)=>{"use strict";var i=r(40134);t.exports=Math.fround||function(t){return i(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},4736:t=>{"use strict";var e=Math.log,r=Math.LOG10E;t.exports=Math.log10||function(t){return e(t)*r}},93956:t=>{"use strict";var e=Math.log;t.exports=Math.log1p||function(t){var r=+t;return r>-1e-8&&r<1e-8?r-r*r/2:e(1+r)}},84463:t=>{"use strict";t.exports=Math.scale||function(t,e,r,i,n){var s=+t,o=+e,a=+r,l=+i,c=+n;return s!=s||o!=o||a!=a||l!=l||c!=c?NaN:s===1/0||s===-1/0?s:(s-o)*(c-l)/(a-o)+l}},55680:t=>{"use strict";t.exports=Math.sign||function(t){var e=+t;return 0===e||e!=e?e:e<0?-1:1}},58828:t=>{"use strict";var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?r:e)(i)}},80231:(t,e,r)=>{"use strict";var i,n,s,o,a,l=r(19037),c=r(54071),h=r(82474).f,u=r(99886).set,d=r(34410),p=r(4764),f=r(63221),m=r(27486),g=r(50806),A=l.MutationObserver||l.WebKitMutationObserver,y=l.document,v=l.process,x=l.Promise,b=h(l,"queueMicrotask"),_=b&&b.value;if(!_){var w=new d,E=function(){var t,e;for(g&&(t=v.domain)&&t.exit();e=w.get();)try{e()}catch(t){throw w.head&&i(),t}t&&t.enter()};p||g||m||!A||!y?!f&&x&&x.resolve?((o=x.resolve(void 0)).constructor=x,a=c(o.then,o),i=function(){a(E)}):g?i=function(){v.nextTick(E)}:(u=c(u,l),i=function(){u(E)}):(n=!0,s=y.createTextNode(""),new A(E).observe(s,{characterData:!0}),i=function(){s.data=n=!n}),_=function(t){w.head||i(),w.add(t)}}t.exports=_},22818:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t}))},48742:(t,e,r)=>{"use strict";var i=r(10509),n=TypeError,s=function(t){var e,r;this.promise=new t((function(t,i){if(void 0!==e||void 0!==r)throw new n("Bad Promise constructor");e=t,r=i})),this.resolve=i(e),this.reject=i(r)};t.exports.f=function(t){return new s(t)}},13841:(t,e,r)=>{"use strict";var i=r(34327);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},4654:t=>{"use strict";var e=RangeError;t.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},42124:(t,e,r)=>{"use strict";var i=r(91245),n=TypeError;t.exports=function(t){if(i(t))throw new n("The method doesn't accept regular expressions");return t}},70046:(t,e,r)=>{"use strict";var i=r(19037).isFinite;t.exports=Number.isFinite||function(t){return"number"==typeof t&&i(t)}},14818:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(34327),a=r(61435).trim,l=r(86350),c=s("".charAt),h=i.parseFloat,u=i.Symbol,d=u&&u.iterator,p=1/h(l+"-0")!=-1/0||d&&!n((function(){h(Object(d))}));t.exports=p?function(t){var e=a(o(t)),r=h(e);return 0===r&&"-"===c(e,0)?-0:r}:h},67897:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(34327),a=r(61435).trim,l=r(86350),c=i.parseInt,h=i.Symbol,u=h&&h.iterator,d=/^[+-]?0x/i,p=s(d.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||u&&!n((function(){c(Object(u))}));t.exports=f?function(t,e){var r=a(o(t));return c(r,e>>>0||(p(d,r)?16:10))}:c},98554:(t,e,r)=>{"use strict";var i=r(618),n=r(30974),s=r(27807),o=r(981),a=r(48999),l=r(62148),c=r(67697),h="Incorrect Iterator.range arguments",u="NumericRangeIterator",d=i.set,p=i.getterFor(u),f=RangeError,m=TypeError,g=n((function(t,e,r,i,n,s){if(typeof t!=i||e!==1/0&&e!==-1/0&&typeof e!=i)throw new m(h);if(t===1/0||t===-1/0)throw new f(h);var l,p=e>t,g=!1;if(void 0===r)l=void 0;else if(a(r))l=r.step,g=!!r.inclusive;else{if(typeof r!=i)throw new m(h);l=r}if(o(l)&&(l=p?s:-s),typeof l!=i)throw new m(h);if(l===1/0||l===-1/0||l===n&&t!==e)throw new f(h);d(this,{type:u,start:t,end:e,step:l,inclusive:g,hitsEnd:t!=t||e!=e||l!=l||e>t!=l>n,currentCount:n,zero:n}),c||(this.start=t,this.end=e,this.step=l,this.inclusive=g)}),u,(function(){var t=p(this);if(t.hitsEnd)return s(void 0,!0);var e=t.start,r=t.end,i=e+t.step*t.currentCount++;i===r&&(t.hitsEnd=!0);var n=t.inclusive;return(r>e?n?i>r:i>=r:n?r>i:r>=i)?(t.hitsEnd=!0,s(void 0,!0)):s(i,!1)})),A=function(t){l(g.prototype,t,{get:function(){return p(this)[t]},set:function(){},configurable:!0,enumerable:!1})};c&&(A("start"),A("end"),A("inclusive"),A("step")),t.exports=g},45394:(t,e,r)=>{"use strict";var i=r(67697),n=r(68844),s=r(22615),o=r(3689),a=r(20300),l=r(7518),c=r(49556),h=r(90690),u=r(94413),d=Object.assign,p=Object.defineProperty,f=n([].concat);t.exports=!d||o((function(){if(i&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!==d({},t)[r]||a(d({},e)).join("")!==n}))?function(t,e){for(var r=h(t),n=arguments.length,o=1,d=l.f,p=c.f;n>o;)for(var m,g=u(arguments[o++]),A=d?f(a(g),d(g)):a(g),y=A.length,v=0;y>v;)m=A[v++],i&&!s(p,g,m)||(r[m]=g[m]);return r}:d},25391:(t,e,r)=>{"use strict";var i,n=r(85027),s=r(98920),o=r(72739),a=r(57248),l=r(2688),c=r(36420),h=r(2713),u="prototype",d="script",p=h("IE_PROTO"),f=function(){},m=function(t){return"<"+d+">"+t+""},g=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},A=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;A="undefined"!=typeof document?document.domain&&i?g(i):(e=c("iframe"),r="java"+d+":",e.style.display="none",l.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F):g(i);for(var n=o.length;n--;)delete A[u][o[n]];return A()};a[p]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(f[u]=n(t),r=new f,f[u]=null,r[p]=t):r=A(),void 0===e?r:s.f(r,e)}},98920:(t,e,r)=>{"use strict";var i=r(67697),n=r(15648),s=r(72560),o=r(85027),a=r(65290),l=r(20300);e.f=i&&!n?Object.defineProperties:function(t,e){o(t);for(var r,i=a(e),n=l(e),c=n.length,h=0;c>h;)s.f(t,r=n[h++],i[r]);return t}},72560:(t,e,r)=>{"use strict";var i=r(67697),n=r(68506),s=r(15648),o=r(85027),a=r(18360),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",p="writable";e.f=i?s?function(t,e,r){if(o(t),e=a(e),o(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]){var i=h(t,e);i&&i[p]&&(t[e]=r.value,r={configurable:d in r?r[d]:i[d],enumerable:u in r?r[u]:i[u],writable:!1})}return c(t,e,r)}:c:function(t,e,r){if(o(t),e=a(e),o(r),n)try{return c(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},82474:(t,e,r)=>{"use strict";var i=r(67697),n=r(22615),s=r(49556),o=r(75684),a=r(65290),l=r(18360),c=r(36812),h=r(68506),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(t,e){if(t=a(t),e=l(e),h)try{return u(t,e)}catch(t){}if(c(t,e))return o(!n(s.f,t,e),t[e])}},26062:(t,e,r)=>{"use strict";var i=r(6648),n=r(65290),s=r(72741).f,o=r(9015),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"Window"===i(t)?function(t){try{return s(t)}catch(t){return o(a)}}(t):s(n(t))}},72741:(t,e,r)=>{"use strict";var i=r(54948),n=r(72739).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,n)}},7518:(t,e)=>{"use strict";e.f=Object.getOwnPropertySymbols},61868:(t,e,r)=>{"use strict";var i=r(36812),n=r(69985),s=r(90690),o=r(2713),a=r(81748),l=o("IE_PROTO"),c=Object,h=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=s(t);if(i(e,l))return e[l];var r=e.constructor;return n(r)&&e instanceof r?r.prototype:e instanceof c?h:null}},27049:(t,e,r)=>{"use strict";var i=r(3689),n=r(48999),s=r(6648),o=r(11655),a=Object.isExtensible,l=i((function(){a(1)}));t.exports=l||o?function(t){return!!n(t)&&(!o||"ArrayBuffer"!==s(t))&&(!a||a(t))}:a},23622:(t,e,r)=>{"use strict";var i=r(68844);t.exports=i({}.isPrototypeOf)},42351:(t,e,r)=>{"use strict";var i=r(618),n=r(30974),s=r(27807),o=r(36812),a=r(20300),l=r(90690),c="Object Iterator",h=i.set,u=i.getterFor(c);t.exports=n((function(t,e){var r=l(t);h(this,{type:c,mode:e,object:r,keys:a(r),index:0})}),"Object",(function(){for(var t=u(this),e=t.keys;;){if(null===e||t.index>=e.length)return t.object=t.keys=null,s(void 0,!0);var r=e[t.index++],i=t.object;if(o(i,r)){switch(t.mode){case"keys":return s(r,!1);case"values":return s(i[r],!1)}return s([r,i[r]],!1)}}}))},54948:(t,e,r)=>{"use strict";var i=r(68844),n=r(36812),s=r(65290),o=r(84328).indexOf,a=r(57248),l=i([].push);t.exports=function(t,e){var r,i=s(t),c=0,h=[];for(r in i)!n(a,r)&&n(i,r)&&l(h,r);for(;e.length>c;)n(i,r=e[c++])&&(~o(h,r)||l(h,r));return h}},20300:(t,e,r)=>{"use strict";var i=r(54948),n=r(72739);t.exports=Object.keys||function(t){return i(t,n)}},49556:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);e.f=n?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},90600:(t,e,r)=>{"use strict";var i=r(53931),n=r(19037),s=r(3689),o=r(27922);t.exports=i||!s((function(){if(!(o&&o<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete n[t]}}))},49385:(t,e,r)=>{"use strict";var i=r(52743),n=r(85027),s=r(23550);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=i(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return n(r),s(i),e?t(r,i):r.__proto__=i,r}}():void 0)},49419:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(68844),o=r(61868),a=r(20300),l=r(65290),c=s(r(49556).f),h=s([].push),u=i&&n((function(){var t=Object.create(null);return t[2]=2,!c(t,2)})),d=function(t){return function(e){for(var r,n=l(e),s=a(n),d=u&&null===o(n),p=s.length,f=0,m=[];p>f;)r=s[f++],i&&!(d?r in n:c(n,r))||h(m,t?[r,n[r]]:n[r]);return m}};t.exports={entries:d(!0),values:d(!1)}},65073:(t,e,r)=>{"use strict";var i=r(23043),n=r(50926);t.exports=i?{}.toString:function(){return"[object "+n(this)+"]"}},35899:(t,e,r)=>{"use strict";var i=r(22615),n=r(69985),s=r(48999),o=TypeError;t.exports=function(t,e){var r,a;if("string"===e&&n(r=t.toString)&&!s(a=i(r,t)))return a;if(n(r=t.valueOf)&&!s(a=i(r,t)))return a;if("string"!==e&&n(r=t.toString)&&!s(a=i(r,t)))return a;throw new o("Can't convert object to primitive value")}},19152:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=r(72741),o=r(7518),a=r(85027),l=n([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=s.f(a(t)),r=o.f;return r?l(e,r(t)):e}},46675:(t,e,r)=>{"use strict";var i=r(68844),n=r(36812),s=SyntaxError,o=parseInt,a=String.fromCharCode,l=i("".charAt),c=i("".slice),h=i(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var r=!0,i="";e{"use strict";var i=r(19037);t.exports=i},9302:t=>{"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},87073:(t,e,r)=>{"use strict";var i=r(19037),n=r(17919),s=r(69985),o=r(35266),a=r(6738),l=r(44201),c=r(72532),h=r(88563),u=r(53931),d=r(3615),p=n&&n.prototype,f=l("species"),m=!1,g=s(i.PromiseRejectionEvent),A=o("Promise",(function(){var t=a(n),e=t!==String(n);if(!e&&66===d)return!0;if(u&&(!p.catch||!p.finally))return!0;if(!d||d<51||!/native code/.test(t)){var r=new n((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};if((r.constructor={})[f]=i,!(m=r.then((function(){}))instanceof i))return!0}return!e&&(c||h)&&!g}));t.exports={CONSTRUCTOR:A,REJECTION_EVENT:g,SUBCLASSING:m}},17919:(t,e,r)=>{"use strict";var i=r(19037);t.exports=i.Promise},72945:(t,e,r)=>{"use strict";var i=r(85027),n=r(48999),s=r(48742);t.exports=function(t,e){if(i(t),n(e)&&e.constructor===t)return e;var r=s.f(t);return(0,r.resolve)(e),r.promise}},562:(t,e,r)=>{"use strict";var i=r(17919),n=r(86431),s=r(87073).CONSTRUCTOR;t.exports=s||!n((function(t){i.all(t).then(void 0,(function(){}))}))},38055:(t,e,r)=>{"use strict";var i=r(72560).f;t.exports=function(t,e,r){r in t||i(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},34410:t=>{"use strict";var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},33666:(t,e,r)=>{"use strict";r(56646),r(51090);var i=r(76058),n=r(68844),s=r(83430),o=i("Map"),a=i("WeakMap"),l=n([].push),c=s("metadata"),h=c.store||(c.store=new a),u=function(t,e,r){var i=h.get(t);if(!i){if(!r)return;h.set(t,i=new o)}var n=i.get(e);if(!n){if(!r)return;i.set(e,n=new o)}return n};t.exports={store:h,getMap:u,has:function(t,e,r){var i=u(e,r,!1);return void 0!==i&&i.has(t)},get:function(t,e,r){var i=u(e,r,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,r,i){u(r,i,!0).set(t,e)},keys:function(t,e){var r=u(t,e,!1),i=[];return r&&r.forEach((function(t,e){l(i,e)})),i},toKey:function(t){return void 0===t||"symbol"==typeof t?t:String(t)}}},66100:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(69985),o=r(6648),a=r(56308),l=TypeError;t.exports=function(t,e){var r=t.exec;if(s(r)){var c=i(r,t,e);return null!==c&&n(c),c}if("RegExp"===o(t))return i(a,t,e);throw new l("RegExp#exec called on incompatible receiver")}},56308:(t,e,r)=>{"use strict";var i,n,s=r(22615),o=r(68844),a=r(34327),l=r(69633),c=r(87901),h=r(83430),u=r(25391),d=r(618).get,p=r(62100),f=r(26738),m=h("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,A=g,y=o("".charAt),v=o("".indexOf),x=o("".replace),b=o("".slice),_=(n=/b*/g,s(g,i=/a/,"a"),s(g,n,"a"),0!==i.lastIndex||0!==n.lastIndex),w=c.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(_||E||w||p||f)&&(A=function(t){var e,r,i,n,o,c,h,p=this,f=d(p),M=a(t),S=f.raw;if(S)return S.lastIndex=p.lastIndex,e=s(A,S,M),p.lastIndex=S.lastIndex,e;var C=f.groups,T=w&&p.sticky,I=s(l,p),R=p.source,B=0,L=M;if(T&&(I=x(I,"y",""),-1===v(I,"g")&&(I+="g"),L=b(M,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(M,p.lastIndex-1))&&(R="(?: "+R+")",L=" "+L,B++),r=new RegExp("^(?:"+R+")",I)),E&&(r=new RegExp("^"+R+"$(?!\\s)",I)),_&&(i=p.lastIndex),n=s(g,T?r:p,L),T?n?(n.input=b(n.input,B),n[0]=b(n[0],B),n.index=p.lastIndex,p.lastIndex+=n[0].length):p.lastIndex=0:_&&n&&(p.lastIndex=p.global?n.index+n[0].length:i),E&&n&&n.length>1&&s(m,n[0],r,(function(){for(o=1;o{"use strict";var i=r(85027);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},63477:(t,e,r)=>{"use strict";var i=r(22615),n=r(36812),s=r(23622),o=r(69633),a=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in a||n(t,"flags")||!s(a,t)?e:i(o,t)}},87901:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp,s=i((function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),o=s||i((function(){return!n("a","y").sticky})),a=s||i((function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},62100:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp;t.exports=i((function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},26738:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp;t.exports=i((function(){var t=n("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},74684:(t,e,r)=>{"use strict";var i=r(981),n=TypeError;t.exports=function(t){if(i(t))throw new n("Can't call method on "+t);return t}},68600:t=>{"use strict";t.exports=function(t,e){return t===e||t!=t&&e!=e}},70953:t=>{"use strict";t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},8552:(t,e,r)=>{"use strict";var i,n=r(19037),s=r(61735),o=r(69985),a=r(83127),l=r(30071),c=r(96004),h=r(21500),u=n.Function,d=/MSIE .\./.test(l)||a&&((i=n.Bun.version.split(".")).length<3||"0"===i[0]&&(i[1]<3||"3"===i[1]&&"0"===i[2]));t.exports=function(t,e){var r=e?2:1;return d?function(i,n){var a=h(arguments.length,1)>r,l=o(i)?i:u(i),d=a?c(arguments,r):[],p=a?function(){s(l,this,d)}:l;return e?t(p,n):t(p)}:t}},3097:(t,e,r)=>{"use strict";var i=r(61034),n=r(48774),s=i.Set,o=i.add;t.exports=function(t){var e=new s;return n(t,(function(t){o(e,t)})),e}},27748:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(3097),o=r(17026),a=r(41074),l=r(48774),c=r(96704),h=n.has,u=n.remove;t.exports=function(t){var e=i(this),r=a(t),n=s(e);return o(e)<=r.size?l(e,(function(t){r.includes(t)&&u(n,t)})):c(r.getIterator(),(function(t){h(e,t)&&u(n,t)})),n}},61034:(t,e,r)=>{"use strict";var i=r(68844),n=Set.prototype;t.exports={Set,add:i(n.add),has:i(n.has),remove:i(n.delete),proto:n}},72948:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(17026),o=r(41074),a=r(48774),l=r(96704),c=n.Set,h=n.add,u=n.has;t.exports=function(t){var e=i(this),r=o(t),n=new c;return s(e)>r.size?l(r.getIterator(),(function(t){u(e,t)&&h(n,t)})):a(e,(function(t){r.includes(t)&&h(n,t)})),n}},97795:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).has,s=r(17026),o=r(41074),a=r(48774),l=r(96704),c=r(72125);t.exports=function(t){var e=i(this),r=o(t);if(s(e)<=r.size)return!1!==a(e,(function(t){if(r.includes(t))return!1}),!0);var h=r.getIterator();return!1!==l(h,(function(t){if(n(e,t))return c(h,"normal",!1)}))}},26951:(t,e,r)=>{"use strict";var i=r(10029),n=r(17026),s=r(48774),o=r(41074);t.exports=function(t){var e=i(this),r=o(t);return!(n(e)>r.size)&&!1!==s(e,(function(t){if(!r.includes(t))return!1}),!0)}},3894:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).has,s=r(17026),o=r(41074),a=r(96704),l=r(72125);t.exports=function(t){var e=i(this),r=o(t);if(s(e){"use strict";var i=r(68844),n=r(96704),s=r(61034),o=s.Set,a=s.proto,l=i(a.forEach),c=i(a.keys),h=c(new o).next;t.exports=function(t,e,r){return r?n({iterator:c(t),next:h},e):l(t,e)}},53234:(t,e,r)=>{"use strict";var i=r(76058),n=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var e=i("Set");try{(new e)[t](n(0));try{return(new e)[t](n(-1)),!1}catch(t){return!0}}catch(t){return!1}}},17026:(t,e,r)=>{"use strict";var i=r(52743),n=r(61034);t.exports=i(n.proto,"size","get")||function(t){return t.size}},14241:(t,e,r)=>{"use strict";var i=r(76058),n=r(62148),s=r(44201),o=r(67697),a=s("species");t.exports=function(t){var e=i(t);o&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},62289:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(3097),o=r(41074),a=r(96704),l=n.add,c=n.has,h=n.remove;t.exports=function(t){var e=i(this),r=o(t).getIterator(),n=s(e);return a(r,(function(t){c(e,t)?h(n,t):l(n,t)})),n}},55997:(t,e,r)=>{"use strict";var i=r(72560).f,n=r(36812),s=r(44201)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!n(t,s)&&i(t,s,{configurable:!0,value:e})}},75674:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).add,s=r(3097),o=r(41074),a=r(96704);t.exports=function(t){var e=i(this),r=o(t).getIterator(),l=s(e);return a(r,(function(t){n(l,t)})),l}},2713:(t,e,r)=>{"use strict";var i=r(83430),n=r(14630),s=i("keys");t.exports=function(t){return s[t]||(s[t]=n(t))}},84091:(t,e,r)=>{"use strict";var i=r(19037),n=r(95014),s="__core-js_shared__",o=i[s]||n(s,{});t.exports=o},83430:(t,e,r)=>{"use strict";var i=r(53931),n=r(84091);(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.34.0",mode:i?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE",source:"https://github.com/zloirock/core-js"})},76373:(t,e,r)=>{"use strict";var i=r(85027),n=r(52655),s=r(981),o=r(44201)("species");t.exports=function(t,e){var r,a=i(t).constructor;return void 0===a||s(r=i(a)[o])?e:n(r)}},8195:(t,e,r)=>{"use strict";var i=r(68844),n=r(65290),s=r(34327),o=r(6310),a=TypeError,l=i([].push),c=i([].join);t.exports=function(t){var e=n(t),r=o(e);if(!r)return"";for(var i=arguments.length,h=[],u=0;;){var d=e[u++];if(void 0===d)throw new a("Incorrect template");if(l(h,s(d)),u===r)return c(h,"");u{"use strict";var i=r(3689);t.exports=function(t){return i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},10730:(t,e,r)=>{"use strict";var i=r(68844),n=r(68700),s=r(34327),o=r(74684),a=i("".charAt),l=i("".charCodeAt),c=i("".slice),h=function(t){return function(e,r){var i,h,u=s(o(e)),d=n(r),p=u.length;return d<0||d>=p?t?"":void 0:(i=l(u,d))<55296||i>56319||d+1===p||(h=l(u,d+1))<56320||h>57343?t?a(u,d):i:t?c(u,d,d+2):h-56320+(i-55296<<10)+65536}};t.exports={codeAt:h(!1),charAt:h(!0)}},35947:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(i)},77254:(t,e,r)=>{"use strict";var i=r(68844),n=r(43126),s=r(34327),o=r(90534),a=r(74684),l=i(o),c=i("".slice),h=Math.ceil,u=function(t){return function(e,r,i){var o,u,d=s(a(e)),p=n(r),f=d.length,m=void 0===i?" ":s(i);return p<=f||""===m?d:((u=l(m,h((o=p-f)/m.length))).length>o&&(u=c(u,0,o)),t?d+u:u+d)}};t.exports={start:u(!1),end:u(!0)}},98985:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=String.fromCharCode,o=i("String","fromCodePoint"),a=n("".charAt),l=n("".charCodeAt),c=n("".indexOf),h=n("".slice),u=function(t,e){var r=l(t,e);return r>=48&&r<=57},d=function(t,e,r){if(r>=t.length)return-1;for(var i=0;e=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1};t.exports=function(t){for(var e,r="",i=0,n=0;(n=c(t,"\\",n))>-1;){if(r+=h(t,i,n),++n===t.length)return;var l=a(t,n++);switch(l){case"b":r+="\b";break;case"t":r+="\t";break;case"n":r+="\n";break;case"v":r+="\v";break;case"f":r+="\f";break;case"r":r+="\r";break;case"\r":n1114111)return;r+=o(e);break;default:if(u(l,0))return;r+=l}i=n}return r+h(t,i)}},6430:(t,e,r)=>{"use strict";var i=r(68844),n=2147483647,s=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",l=RangeError,c=i(o.exec),h=Math.floor,u=String.fromCharCode,d=i("".charCodeAt),p=i([].join),f=i([].push),m=i("".replace),g=i("".split),A=i("".toLowerCase),y=function(t){return t+22+75*(t<26)},v=function(t,e,r){var i=0;for(t=r?h(t/700):t>>1,t+=h(t/e);t>455;)t=h(t/35),i+=36;return h(i+36*t/(t+38))},x=function(t){var e=[];t=function(t){for(var e=[],r=0,i=t.length;r=55296&&n<=56319&&r=o&&ih((n-c)/b))throw new l(a);for(c+=(x-o)*b,o=x,r=0;rn)throw new l(a);if(i===o){for(var _=c,w=36;;){var E=w<=m?1:w>=m+26?26:w-m;if(_{"use strict";var i=r(68700),n=r(34327),s=r(74684),o=RangeError;t.exports=function(t){var e=n(s(this)),r="",a=i(t);if(a<0||a===1/0)throw new o("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(e+=e))1&a&&(r+=e);return r}},79558:(t,e,r)=>{"use strict";var i=r(61435).end,n=r(75984);t.exports=n("trimEnd")?function(){return i(this)}:"".trimEnd},75984:(t,e,r)=>{"use strict";var i=r(41236).PROPER,n=r(3689),s=r(86350);t.exports=function(t){return n((function(){return!!s[t]()||"​…᠎"!=="​…᠎"[t]()||i&&s[t].name!==t}))}},72291:(t,e,r)=>{"use strict";var i=r(61435).start,n=r(75984);t.exports=n("trimStart")?function(){return i(this)}:"".trimStart},61435:(t,e,r)=>{"use strict";var i=r(68844),n=r(74684),s=r(34327),o=r(86350),a=i("".replace),l=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),h=function(t){return function(e){var r=s(n(e));return 1&t&&(r=a(r,l,"")),2&t&&(r=a(r,c,"$1")),r}};t.exports={start:h(1),end:h(2),trim:h(3)}},63514:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(3615),o=r(72532),a=r(88563),l=r(50806),c=i.structuredClone;t.exports=!!c&&!n((function(){if(a&&s>92||l&&s>94||o&&s>97)return!1;var t=new ArrayBuffer(8),e=c(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength}))},50146:(t,e,r)=>{"use strict";var i=r(3615),n=r(3689),s=r(19037).String;t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},13032:(t,e,r)=>{"use strict";var i=r(22615),n=r(76058),s=r(44201),o=r(11880);t.exports=function(){var t=n("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,a=s("toPrimitive");e&&!e[a]&&o(e,a,(function(t){return i(r,this)}),{arity:1})}},18992:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=i("Symbol"),o=s.keyFor,a=n(s.prototype.valueOf);t.exports=s.isRegisteredSymbol||function(t){try{return void 0!==o(a(t))}catch(t){return!1}}},8957:(t,e,r)=>{"use strict";for(var i=r(83430),n=r(76058),s=r(68844),o=r(30734),a=r(44201),l=n("Symbol"),c=l.isWellKnownSymbol,h=n("Object","getOwnPropertyNames"),u=s(l.prototype.valueOf),d=i("wks"),p=0,f=h(l),m=f.length;p{"use strict";var i=r(50146);t.exports=i&&!!Symbol.for&&!!Symbol.keyFor},99886:(t,e,r)=>{"use strict";var i,n,s,o,a=r(19037),l=r(61735),c=r(54071),h=r(69985),u=r(36812),d=r(3689),p=r(2688),f=r(96004),m=r(36420),g=r(21500),A=r(4764),y=r(50806),v=a.setImmediate,x=a.clearImmediate,b=a.process,_=a.Dispatch,w=a.Function,E=a.MessageChannel,M=a.String,S=0,C={},T="onreadystatechange";d((function(){i=a.location}));var I=function(t){if(u(C,t)){var e=C[t];delete C[t],e()}},R=function(t){return function(){I(t)}},B=function(t){I(t.data)},L=function(t){a.postMessage(M(t),i.protocol+"//"+i.host)};v&&x||(v=function(t){g(arguments.length,1);var e=h(t)?t:w(t),r=f(arguments,1);return C[++S]=function(){l(e,void 0,r)},n(S),S},x=function(t){delete C[t]},y?n=function(t){b.nextTick(R(t))}:_&&_.now?n=function(t){_.now(R(t))}:E&&!A?(o=(s=new E).port2,s.port1.onmessage=B,n=c(o.postMessage,o)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&i&&"file:"!==i.protocol&&!d(L)?(n=L,a.addEventListener("message",B,!1)):n=T in m("script")?function(t){p.appendChild(m("script"))[T]=function(){p.removeChild(this),I(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:v,clear:x}},23648:(t,e,r)=>{"use strict";var i=r(68844);t.exports=i(1..valueOf)},27578:(t,e,r)=>{"use strict";var i=r(68700),n=Math.max,s=Math.min;t.exports=function(t,e){var r=i(t);return r<0?n(r+e,0):s(r,e)}},71530:(t,e,r)=>{"use strict";var i=r(88732),n=TypeError;t.exports=function(t){var e=i(t,"number");if("number"==typeof e)throw new n("Can't convert number to bigint");return BigInt(e)}},19842:(t,e,r)=>{"use strict";var i=r(68700),n=r(43126),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=i(t),r=n(e);if(e!==r)throw new s("Wrong length or index");return r}},65290:(t,e,r)=>{"use strict";var i=r(94413),n=r(74684);t.exports=function(t){return i(n(t))}},68700:(t,e,r)=>{"use strict";var i=r(58828);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},43126:(t,e,r)=>{"use strict";var i=r(68700),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},90690:(t,e,r)=>{"use strict";var i=r(74684),n=Object;t.exports=function(t){return n(i(t))}},83250:(t,e,r)=>{"use strict";var i=r(15904),n=RangeError;t.exports=function(t,e){var r=i(t);if(r%e)throw new n("Wrong offset");return r}},15904:(t,e,r)=>{"use strict";var i=r(68700),n=RangeError;t.exports=function(t){var e=i(t);if(e<0)throw new n("The argument can't be less than 0");return e}},88732:(t,e,r)=>{"use strict";var i=r(22615),n=r(48999),s=r(30734),o=r(54849),a=r(35899),l=r(44201),c=TypeError,h=l("toPrimitive");t.exports=function(t,e){if(!n(t)||s(t))return t;var r,l=o(t,h);if(l){if(void 0===e&&(e="default"),r=i(l,t,e),!n(r)||s(r))return r;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},18360:(t,e,r)=>{"use strict";var i=r(88732),n=r(30734);t.exports=function(t){var e=i(t,"string");return n(e)?e:e+""}},2939:(t,e,r)=>{"use strict";var i=r(76058),n=r(69985),s=r(9603),o=r(48999),a=i("Set");t.exports=function(t){return function(t){return o(t)&&"number"==typeof t.size&&n(t.has)&&n(t.keys)}(t)?t:s(t)?new a(t):t}},23043:(t,e,r)=>{"use strict";var i={};i[r(44201)("toStringTag")]="z",t.exports="[object z]"===String(i)},34327:(t,e,r)=>{"use strict";var i=r(50926),n=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}},87191:t=>{"use strict";var e=Math.round;t.exports=function(t){var r=e(t);return r<0?0:r>255?255:255&r}},21905:(t,e,r)=>{"use strict";var i=r(50806);t.exports=function(t){try{if(i)return Function('return require("'+t+'")')()}catch(t){}}},23691:t=>{"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},31158:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(22615),o=r(67697),a=r(39800),l=r(54872),c=r(83999),h=r(767),u=r(75684),d=r(75773),p=r(71973),f=r(43126),m=r(19842),g=r(83250),A=r(87191),y=r(18360),v=r(36812),x=r(50926),b=r(48999),_=r(30734),w=r(25391),E=r(23622),M=r(49385),S=r(72741).f,C=r(41304),T=r(2960).forEach,I=r(14241),R=r(62148),B=r(72560),L=r(82474),P=r(618),D=r(33457),O=P.get,k=P.set,U=P.enforce,N=B.f,F=L.f,z=n.RangeError,G=c.ArrayBuffer,Q=G.prototype,j=c.DataView,V=l.NATIVE_ARRAY_BUFFER_VIEWS,H=l.TYPED_ARRAY_TAG,W=l.TypedArray,q=l.TypedArrayPrototype,Z=l.aTypedArrayConstructor,Y=l.isTypedArray,X="BYTES_PER_ELEMENT",J="Wrong length",K=function(t,e){Z(t);for(var r=0,i=e.length,n=new t(i);i>r;)n[r]=e[r++];return n},$=function(t,e){R(t,e,{configurable:!0,get:function(){return O(this)[e]}})},tt=function(t){var e;return E(Q,t)||"ArrayBuffer"===(e=x(t))||"SharedArrayBuffer"===e},et=function(t,e){return Y(t)&&!_(e)&&e in t&&p(+e)&&e>=0},rt=function(t,e){return e=y(e),et(t,e)?u(2,t[e]):F(t,e)},it=function(t,e,r){return e=y(e),!(et(t,e)&&b(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?N(t,e,r):(t[e]=r.value,t)};o?(V||(L.f=rt,B.f=it,$(q,"buffer"),$(q,"byteOffset"),$(q,"byteLength"),$(q,"length")),i({target:"Object",stat:!0,forced:!V},{getOwnPropertyDescriptor:rt,defineProperty:it}),t.exports=function(t,e,r){var o=t.match(/\d+/)[0]/8,l=t+(r?"Clamped":"")+"Array",c="get"+t,u="set"+t,p=n[l],y=p,v=y&&y.prototype,x={},_=function(t,e){N(t,e,{get:function(){return function(t,e){var r=O(t);return r.view[c](e*o+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,i){var n=O(t);n.view[u](e*o+n.byteOffset,r?A(i):i,!0)}(this,e,t)},enumerable:!0})};V?a&&(y=e((function(t,e,r,i){return h(t,v),D(b(e)?tt(e)?void 0!==i?new p(e,g(r,o),i):void 0!==r?new p(e,g(r,o)):new p(e):Y(e)?K(y,e):s(C,y,e):new p(m(e)),t,y)})),M&&M(y,W),T(S(p),(function(t){t in y||d(y,t,p[t])})),y.prototype=v):(y=e((function(t,e,r,i){h(t,v);var n,a,l,c=0,u=0;if(b(e)){if(!tt(e))return Y(e)?K(y,e):s(C,y,e);n=e,u=g(r,o);var d=e.byteLength;if(void 0===i){if(d%o)throw new z(J);if((a=d-u)<0)throw new z(J)}else if((a=f(i)*o)+u>d)throw new z(J);l=a/o}else l=m(e),n=new G(a=l*o);for(k(t,{buffer:n,byteOffset:u,byteLength:a,length:l,view:new j(n)});c{"use strict";var i=r(19037),n=r(3689),s=r(86431),o=r(54872).NATIVE_ARRAY_BUFFER_VIEWS,a=i.ArrayBuffer,l=i.Int8Array;t.exports=!o||!n((function(){l(1)}))||!n((function(){new l(-1)}))||!s((function(t){new l,new l(null),new l(1.5),new l(t)}),!0)||n((function(){return 1!==new l(new a(2),1,void 0).length}))},20716:(t,e,r)=>{"use strict";var i=r(59976),n=r(47338);t.exports=function(t,e){return i(n(t),e)}},41304:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(52655),o=r(90690),a=r(6310),l=r(5185),c=r(91664),h=r(93292),u=r(9401),d=r(54872).aTypedArrayConstructor,p=r(71530);t.exports=function(t){var e,r,f,m,g,A,y,v,x=s(this),b=o(t),_=arguments.length,w=_>1?arguments[1]:void 0,E=void 0!==w,M=c(b);if(M&&!h(M))for(v=(y=l(b,M)).next,b=[];!(A=n(v,y)).done;)b.push(A.value);for(E&&_>2&&(w=i(w,arguments[2])),r=a(b),f=new(d(x))(r),m=u(f),e=0;r>e;e++)g=E?w(b[e],e):b[e],f[e]=m?p(g):+g;return f}},47338:(t,e,r)=>{"use strict";var i=r(54872),n=r(76373),s=i.aTypedArrayConstructor,o=i.getTypedArrayConstructor;t.exports=function(t){return s(n(t,o(t)))}},14630:(t,e,r)=>{"use strict";var i=r(68844),n=0,s=Math.random(),o=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++n+s,36)}},76837:(t,e,r)=>{"use strict";var i=r(3689),n=r(44201),s=r(67697),o=r(53931),a=n("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),i="";return t.pathname="c%20d",e.forEach((function(t,r){e.delete("b"),i+=r+t})),r.delete("a",2),r.delete("b",void 0),o&&(!t.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!e.size&&(o||!s)||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},39525:(t,e,r)=>{"use strict";var i=r(50146);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},15648:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689);t.exports=i&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},21500:t=>{"use strict";var e=TypeError;t.exports=function(t,r){if(t{"use strict";var i=r(19037),n=r(69985),s=i.WeakMap;t.exports=n(s)&&/native code/.test(String(s))},16803:(t,e,r)=>{"use strict";var i=r(68844),n=WeakMap.prototype;t.exports={WeakMap,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete)}},78616:(t,e,r)=>{"use strict";var i=r(68844),n=WeakSet.prototype;t.exports={WeakSet,add:i(n.add),has:i(n.has),remove:i(n.delete)}},35405:(t,e,r)=>{"use strict";var i=r(50496),n=r(36812),s=r(96145),o=r(72560).f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});n(e,t)||o(e,t,{value:s.f(t)})}},96145:(t,e,r)=>{"use strict";var i=r(44201);e.f=i},44201:(t,e,r)=>{"use strict";var i=r(19037),n=r(83430),s=r(36812),o=r(14630),a=r(50146),l=r(39525),c=i.Symbol,h=n("wks"),u=l?c.for||c:c&&c.withoutSetter||o;t.exports=function(t){return s(h,t)||(h[t]=a&&s(c,t)?c[t]:u("Symbol."+t)),h[t]}},86350:t=>{"use strict";t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},51064:(t,e,r)=>{"use strict";var i=r(76058),n=r(36812),s=r(75773),o=r(23622),a=r(49385),l=r(8758),c=r(38055),h=r(33457),u=r(13841),d=r(62570),p=r(65411),f=r(67697),m=r(53931);t.exports=function(t,e,r,g){var A="stackTraceLimit",y=g?2:1,v=t.split("."),x=v[v.length-1],b=i.apply(null,v);if(b){var _=b.prototype;if(!m&&n(_,"cause")&&delete _.cause,!r)return b;var w=i("Error"),E=e((function(t,e){var r=u(g?e:t,void 0),i=g?new b(t):new b;return void 0!==r&&s(i,"message",r),p(i,E,i.stack,2),this&&o(_,this)&&h(i,this,E),arguments.length>y&&d(i,arguments[y]),i}));if(E.prototype=_,"Error"!==x?a?a(E,w):l(E,w,{name:!0}):f&&A in b&&(c(E,b,A),c(E,b,"prepareStackTrace")),l(E,b),!m)try{_.name!==x&&s(_,"name",x),_.constructor=E}catch(t){}return E}}},54927:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(3689),a=r(51064),l="AggregateError",c=n(l),h=!o((function(){return 1!==c([1]).errors[0]}))&&o((function(){return 7!==c([1],l,{cause:7}).cause}));i({global:!0,constructor:!0,arity:2,forced:h},{AggregateError:a(l,(function(t){return function(e,r){return s(t,this,arguments)}}),h,!0)})},39382:(t,e,r)=>{"use strict";var i=r(79989),n=r(23622),s=r(61868),o=r(49385),a=r(8758),l=r(25391),c=r(75773),h=r(75684),u=r(62570),d=r(65411),p=r(18734),f=r(13841),m=r(44201)("toStringTag"),g=Error,A=[].push,y=function(t,e){var r,i=n(v,this);o?r=o(new g,i?s(this):v):(r=i?this:l(v),c(r,m,"Error")),void 0!==e&&c(r,"message",f(e)),d(r,y,r.stack,1),arguments.length>2&&u(r,arguments[2]);var a=[];return p(t,A,{that:a}),c(r,"errors",a),r};o?o(y,g):a(y,g,{name:!0});var v=y.prototype=l(g.prototype,{constructor:h(1,y),message:h(1,""),name:h(1,"AggregateError")});i({global:!0,constructor:!0,arity:2},{AggregateError:y})},95879:(t,e,r)=>{"use strict";r(39382)},69365:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(83999),o=r(14241),a="ArrayBuffer",l=s[a];i({global:!0,constructor:!0,forced:n[a]!==l},{ArrayBuffer:l}),o(a)},33870:(t,e,r)=>{"use strict";var i=r(79989),n=r(54872);i({target:"ArrayBuffer",stat:!0,forced:!n.NATIVE_ARRAY_BUFFER_VIEWS},{isView:n.isView})},99211:(t,e,r)=>{"use strict";var i=r(79989),n=r(46576),s=r(3689),o=r(83999),a=r(85027),l=r(27578),c=r(43126),h=r(76373),u=o.ArrayBuffer,d=o.DataView,p=d.prototype,f=n(u.prototype.slice),m=n(p.getUint8),g=n(p.setUint8);i({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:s((function(){return!new u(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(f&&void 0===e)return f(a(this),t);for(var r=a(this).byteLength,i=l(t,r),n=l(void 0===e?r:e,r),s=new(h(this,u))(c(n-i)),o=new d(this),p=new d(s),A=0;i{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(68700),a=r(87370);i({target:"Array",proto:!0},{at:function(t){var e=n(this),r=s(e),i=o(t),a=i>=0?i:r+i;return a<0||a>=r?void 0:e[a]}}),a("at")},34338:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(92297),o=r(48999),a=r(90690),l=r(6310),c=r(55565),h=r(76522),u=r(27120),d=r(29042),p=r(44201),f=r(3615),m=p("isConcatSpreadable"),g=f>=51||!n((function(){var t=[];return t[m]=!1,t.concat()[0]!==t})),A=function(t){if(!o(t))return!1;var e=t[m];return void 0!==e?!!e:s(t)};i({target:"Array",proto:!0,arity:1,forced:!g||!d("concat")},{concat:function(t){var e,r,i,n,s,o=a(this),d=u(o,0),p=0;for(e=-1,i=arguments.length;e{"use strict";var i=r(79989),n=r(70357),s=r(87370);i({target:"Array",proto:!0},{copyWithin:n}),s("copyWithin")},55791:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).every;i({target:"Array",proto:!0,forced:!r(16834)("every")},{every:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},97895:(t,e,r)=>{"use strict";var i=r(79989),n=r(62872),s=r(87370);i({target:"Array",proto:!0},{fill:n}),s("fill")},38077:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filter;i({target:"Array",proto:!0,forced:!r(29042)("filter")},{filter:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},39772:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).findIndex,s=r(87370),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{findIndex:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},93383:(t,e,r)=>{"use strict";var i=r(79989),n=r(61969).findLastIndex,s=r(87370);i({target:"Array",proto:!0},{findLastIndex:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLastIndex")},59867:(t,e,r)=>{"use strict";var i=r(79989),n=r(61969).findLast,s=r(87370);i({target:"Array",proto:!0},{findLast:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLast")},25728:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).find,s=r(87370),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},54564:(t,e,r)=>{"use strict";var i=r(79989),n=r(37809),s=r(10509),o=r(90690),a=r(6310),l=r(27120);i({target:"Array",proto:!0},{flatMap:function(t){var e,r=o(this),i=a(r);return s(t),(e=l(r,0)).length=n(e,r,r,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},62795:(t,e,r)=>{"use strict";var i=r(79989),n=r(37809),s=r(90690),o=r(6310),a=r(68700),l=r(27120);i({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=s(this),r=o(e),i=l(e,0);return i.length=n(i,e,e,r,0,void 0===t?1:a(t)),i}})},49693:(t,e,r)=>{"use strict";var i=r(79989),n=r(57612);i({target:"Array",proto:!0,forced:[].forEach!==n},{forEach:n})},77049:(t,e,r)=>{"use strict";var i=r(79989),n=r(21055);i({target:"Array",stat:!0,forced:!r(86431)((function(t){Array.from(t)}))},{from:n})},76801:(t,e,r)=>{"use strict";var i=r(79989),n=r(84328).includes,s=r(3689),o=r(87370);i({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},97195:(t,e,r)=>{"use strict";var i=r(79989),n=r(46576),s=r(84328).indexOf,o=r(16834),a=n([].indexOf),l=!!a&&1/a([1],1,-0)<0;i({target:"Array",proto:!0,forced:l||!o("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return l?a(this,t,e)||0:s(this,t,e)}})},63975:(t,e,r)=>{"use strict";r(79989)({target:"Array",stat:!0},{isArray:r(92297)})},752:(t,e,r)=>{"use strict";var i=r(65290),n=r(87370),s=r(9478),o=r(618),a=r(72560).f,l=r(91934),c=r(27807),h=r(53931),u=r(67697),d="Array Iterator",p=o.set,f=o.getterFor(d);t.exports=l(Array,"Array",(function(t,e){p(this,{type:d,target:i(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,c(void 0,!0);switch(t.kind){case"keys":return c(r,!1);case"values":return c(e[r],!1)}return c([r,e[r]],!1)}),"values");var m=s.Arguments=s.Array;if(n("keys"),n("values"),n("entries"),!h&&u&&"values"!==m.name)try{a(m,"name",{value:"values"})}catch(t){}},6203:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(94413),o=r(65290),a=r(16834),l=n([].join);i({target:"Array",proto:!0,forced:s!==Object||!a("join",",")},{join:function(t){return l(o(this),void 0===t?",":t)}})},72410:(t,e,r)=>{"use strict";var i=r(79989),n=r(60953);i({target:"Array",proto:!0,forced:n!==[].lastIndexOf},{lastIndexOf:n})},50886:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).map;i({target:"Array",proto:!0,forced:!r(29042)("map")},{map:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},37593:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(19429),o=r(76522),a=Array;i({target:"Array",stat:!0,forced:n((function(){function t(){}return!(a.of.call(t)instanceof t)}))},{of:function(){for(var t=0,e=arguments.length,r=new(s(this)?this:a)(e);e>t;)o(r,t,arguments[t++]);return r.length=e,r}})},70560:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(5649),a=r(55565);i({target:"Array",proto:!0,arity:1,forced:r(3689)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=n(this),r=s(e),i=arguments.length;a(r+i);for(var l=0;l{"use strict";var i=r(79989),n=r(88820).right,s=r(16834),o=r(3615);i({target:"Array",proto:!0,forced:!r(50806)&&o>79&&o<83||!s("reduceRight")},{reduceRight:function(t){return n(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},278:(t,e,r)=>{"use strict";var i=r(79989),n=r(88820).left,s=r(16834),o=r(3615);i({target:"Array",proto:!0,forced:!r(50806)&&o>79&&o<83||!s("reduce")},{reduce:function(t){var e=arguments.length;return n(this,t,e,e>1?arguments[1]:void 0)}})},93374:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(92297),o=n([].reverse),a=[1,2];i({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),o(this)}})},89730:(t,e,r)=>{"use strict";var i=r(79989),n=r(92297),s=r(19429),o=r(48999),a=r(27578),l=r(6310),c=r(65290),h=r(76522),u=r(44201),d=r(29042),p=r(96004),f=d("slice"),m=u("species"),g=Array,A=Math.max;i({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var r,i,u,d=c(this),f=l(d),y=a(t,f),v=a(void 0===e?f:e,f);if(n(d)&&(r=d.constructor,(s(r)&&(r===g||n(r.prototype))||o(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return p(d,y,v);for(i=new(void 0===r?g:r)(A(v-y,0)),u=0;y{"use strict";var i=r(79989),n=r(2960).some;i({target:"Array",proto:!0,forced:!r(16834)("some")},{some:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},65137:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(90690),a=r(6310),l=r(98494),c=r(34327),h=r(3689),u=r(50382),d=r(16834),p=r(97365),f=r(37298),m=r(3615),g=r(27922),A=[],y=n(A.sort),v=n(A.push),x=h((function(){A.sort(void 0)})),b=h((function(){A.sort(null)})),_=d("sort"),w=!h((function(){if(m)return m<70;if(!(p&&p>3)){if(f)return!0;if(g)return g<603;var t,e,r,i,n="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)A.push({k:e+i,v:r})}for(A.sort((function(t,e){return e.v-t.v})),i=0;ic(r)?1:-1}}(t)),r=a(n),i=0;i{"use strict";r(14241)("Array")},62506:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(27578),o=r(68700),a=r(6310),l=r(5649),c=r(55565),h=r(27120),u=r(76522),d=r(98494),p=r(29042)("splice"),f=Math.max,m=Math.min;i({target:"Array",proto:!0,forced:!p},{splice:function(t,e){var r,i,p,g,A,y,v=n(this),x=a(v),b=s(t,x),_=arguments.length;for(0===_?r=i=0:1===_?(r=0,i=x-b):(r=_-2,i=m(f(o(e),0),x-b)),c(x+r-i),p=h(v,i),g=0;gx-i+r;g--)d(v,g-1)}else if(r>i)for(g=x-i;g>b;g--)y=g+r-1,(A=g+i-1)in v?v[y]=v[A]:d(v,y);for(g=0;g{"use strict";var i=r(79989),n=r(26166),s=r(65290),o=r(87370),a=Array;i({target:"Array",proto:!0},{toReversed:function(){return n(s(this),a)}}),o("toReversed")},12894:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(65290),a=r(59976),l=r(88277),c=r(87370),h=Array,u=n(l("Array","sort"));i({target:"Array",proto:!0},{toSorted:function(t){void 0!==t&&s(t);var e=o(this),r=a(h,e);return u(r,t)}}),c("toSorted")},93530:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370),s=r(55565),o=r(6310),a=r(27578),l=r(65290),c=r(68700),h=Array,u=Math.max,d=Math.min;i({target:"Array",proto:!0},{toSpliced:function(t,e){var r,i,n,p,f=l(this),m=o(f),g=a(t,m),A=arguments.length,y=0;for(0===A?r=i=0:1===A?(r=0,i=m-g):(r=A-2,i=d(u(c(e),0),m-g)),n=s(m+r-i),p=h(n);y{"use strict";r(87370)("flatMap")},13383:(t,e,r)=>{"use strict";r(87370)("flat")},91719:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(5649),a=r(98494),l=r(55565);i({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}}()},{unshift:function(t){var e=n(this),r=s(e),i=arguments.length;if(i){l(r+i);for(var c=r;c--;){var h=c+i;c in e?e[h]=e[c]:a(e,h)}for(var u=0;u{"use strict";var i=r(79989),n=r(16134),s=r(65290),o=Array;i({target:"Array",proto:!0},{with:function(t,e){return n(s(this),o,t,e)}})},87347:(t,e,r)=>{"use strict";var i=r(79989),n=r(83999);i({global:!0,constructor:!0,forced:!r(37075)},{DataView:n.DataView})},18201:(t,e,r)=>{"use strict";r(87347)},55635:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(3689)((function(){return 120!==new Date(16e11).getYear()})),o=n(Date.prototype.getFullYear);i({target:"Date",proto:!0,forced:s},{getYear:function(){return o(this)-1900}})},42227:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=Date,o=n(s.prototype.getTime);i({target:"Date",stat:!0},{now:function(){return o(new s)}})},99679:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=Date.prototype,a=n(o.getTime),l=n(o.setFullYear);i({target:"Date",proto:!0},{setYear:function(t){a(this);var e=s(t);return l(this,e>=0&&e<=99?e+1900:e)}})},24343:(t,e,r)=>{"use strict";r(79989)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},65007:(t,e,r)=>{"use strict";var i=r(79989),n=r(99455);i({target:"Date",proto:!0,forced:Date.prototype.toISOString!==n},{toISOString:n})},78150:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(90690),o=r(88732);i({target:"Date",proto:!0,arity:1,forced:n((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=s(this),r=o(e,"number");return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},59903:(t,e,r)=>{"use strict";var i=r(36812),n=r(11880),s=r(81797),o=r(44201)("toPrimitive"),a=Date.prototype;i(a,o)||n(a,o,s)},30024:(t,e,r)=>{"use strict";var i=r(68844),n=r(11880),s=Date.prototype,o="Invalid Date",a="toString",l=i(s[a]),c=i(s.getTime);String(new Date(NaN))!==o&&n(s,a,(function(){var t=c(this);return t==t?l(this):o}))},21057:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(61735),o=r(51064),a="WebAssembly",l=n[a],c=7!==new Error("e",{cause:7}).cause,h=function(t,e){var r={};r[t]=o(t,e,c),i({global:!0,constructor:!0,arity:1,forced:c},r)},u=function(t,e){if(l&&l[t]){var r={};r[t]=o(a+"."+t,e,c),i({target:a,stat:!0,constructor:!0,arity:1,forced:c},r)}};h("Error",(function(t){return function(e){return s(t,this,arguments)}})),h("EvalError",(function(t){return function(e){return s(t,this,arguments)}})),h("RangeError",(function(t){return function(e){return s(t,this,arguments)}})),h("ReferenceError",(function(t){return function(e){return s(t,this,arguments)}})),h("SyntaxError",(function(t){return function(e){return s(t,this,arguments)}})),h("TypeError",(function(t){return function(e){return s(t,this,arguments)}})),h("URIError",(function(t){return function(e){return s(t,this,arguments)}})),u("CompileError",(function(t){return function(e){return s(t,this,arguments)}})),u("LinkError",(function(t){return function(e){return s(t,this,arguments)}})),u("RuntimeError",(function(t){return function(e){return s(t,this,arguments)}}))},68932:(t,e,r)=>{"use strict";var i=r(11880),n=r(20445),s=Error.prototype;s.toString!==n&&i(s,"toString",n)},60428:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=n("".charAt),a=n("".charCodeAt),l=n(/./.exec),c=n(1..toString),h=n("".toUpperCase),u=/[\w*+\-./@]/,d=function(t,e){for(var r=c(t,16);r.length{"use strict";var i=r(79989),n=r(86761);i({target:"Function",proto:!0,forced:Function.bind!==n},{bind:n})},56269:(t,e,r)=>{"use strict";var i=r(69985),n=r(48999),s=r(72560),o=r(61868),a=r(44201),l=r(98702),c=a("hasInstance"),h=Function.prototype;c in h||s.f(h,c,{value:l((function(t){if(!i(this)||!n(t))return!1;var e=this.prototype;if(!n(e))return t instanceof this;for(;t=o(t);)if(e===t)return!0;return!1}),c)})},34284:(t,e,r)=>{"use strict";var i=r(67697),n=r(41236).EXISTS,s=r(68844),o=r(62148),a=Function.prototype,l=s(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,h=s(c.exec);i&&!n&&o(a,"name",{configurable:!0,get:function(){try{return h(c,l(this))[1]}catch(t){return""}}})},45398:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037);i({global:!0,forced:n.globalThis!==n},{globalThis:n})},48324:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(22615),a=r(68844),l=r(3689),c=r(69985),h=r(30734),u=r(96004),d=r(92643),p=r(50146),f=String,m=n("JSON","stringify"),g=a(/./.exec),A=a("".charAt),y=a("".charCodeAt),v=a("".replace),x=a(1..toString),b=/[\uD800-\uDFFF]/g,_=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,E=!p||l((function(){var t=n("Symbol")("stringify detection");return"[null]"!==m([t])||"{}"!==m({a:t})||"{}"!==m(Object(t))})),M=l((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),S=function(t,e){var r=u(arguments),i=d(e);if(c(i)||void 0!==t&&!h(t))return r[1]=function(t,e){if(c(i)&&(e=o(i,this,f(t),e)),!h(e))return e},s(m,null,r)},C=function(t,e,r){var i=A(r,e-1),n=A(r,e+1);return g(_,t)&&!g(w,n)||g(w,t)&&!g(_,i)?"\\u"+x(y(t,0),16):t};m&&i({target:"JSON",stat:!0,arity:3,forced:E||M},{stringify:function(t,e,r){var i=u(arguments),n=s(E?S:m,null,i);return M&&"string"==typeof n?v(n,b,C):n}})},7629:(t,e,r)=>{"use strict";var i=r(19037);r(55997)(i.JSON,"JSON",!0)},9322:(t,e,r)=>{"use strict";r(20319)("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70800))},89348:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(74684),a=r(18734),l=r(83914),c=r(53931),h=l.Map,u=l.has,d=l.get,p=l.set,f=n([].push);i({target:"Map",stat:!0,forced:c},{groupBy:function(t,e){o(t),s(e);var r=new h,i=0;return a(t,(function(t){var n=e(t,i++);u(r,n)?f(d(r,n),t):p(r,n,[t])})),r}})},56646:(t,e,r)=>{"use strict";r(9322)},6557:(t,e,r)=>{"use strict";var i=r(79989),n=r(93956),s=Math.acosh,o=Math.log,a=Math.sqrt,l=Math.LN2;i({target:"Math",stat:!0,forced:!s||710!==Math.floor(s(Number.MAX_VALUE))||s(1/0)!==1/0},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?o(e)+l:n(e-1+a(e-1)*a(e+1))}})},62428:(t,e,r)=>{"use strict";var i=r(79989),n=Math.asinh,s=Math.log,o=Math.sqrt;i({target:"Math",stat:!0,forced:!(n&&1/n(0)>0)},{asinh:function t(e){var r=+e;return isFinite(r)&&0!==r?r<0?-t(-r):s(r+o(r*r+1)):r}})},45263:(t,e,r)=>{"use strict";var i=r(79989),n=Math.atanh,s=Math.log;i({target:"Math",stat:!0,forced:!(n&&1/n(-0)<0)},{atanh:function(t){var e=+t;return 0===e?e:s((1+e)/(1-e))/2}})},74712:(t,e,r)=>{"use strict";var i=r(79989),n=r(55680),s=Math.abs,o=Math.pow;i({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return n(e)*o(s(e),1/3)}})},54986:(t,e,r)=>{"use strict";var i=r(79989),n=Math.floor,s=Math.log,o=Math.LOG2E;i({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-n(s(e+.5)*o):32}})},47221:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745),s=Math.cosh,o=Math.abs,a=Math.E;i({target:"Math",stat:!0,forced:!s||s(710)===1/0},{cosh:function(t){var e=n(o(t)-1)+1;return(e+1/(e*a*a))*(a/2)}})},94992:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745);i({target:"Math",stat:!0,forced:n!==Math.expm1},{expm1:n})},25499:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{fround:r(37788)})},59944:(t,e,r)=>{"use strict";var i=r(79989),n=Math.hypot,s=Math.abs,o=Math.sqrt;i({target:"Math",stat:!0,arity:2,forced:!!n&&n(1/0,NaN)!==1/0},{hypot:function(t,e){for(var r,i,n=0,a=0,l=arguments.length,c=0;a0?(i=r/c)*i:r;return c===1/0?1/0:c*o(n)}})},78527:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=Math.imul;i({target:"Math",stat:!0,forced:n((function(){return-5!==s(4294967295,5)||2!==s.length}))},{imul:function(t,e){var r=65535,i=+t,n=+e,s=r&i,o=r&n;return 0|s*o+((r&i>>>16)*o+s*(r&n>>>16)<<16>>>0)}})},75239:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{log10:r(4736)})},92076:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{log1p:r(93956)})},68813:(t,e,r)=>{"use strict";var i=r(79989),n=Math.log,s=Math.LN2;i({target:"Math",stat:!0},{log2:function(t){return n(t)/s}})},96976:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{sign:r(55680)})},62700:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(21745),o=Math.abs,a=Math.exp,l=Math.E;i({target:"Math",stat:!0,forced:n((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(t){var e=+t;return o(e)<1?(s(e)-s(-e))/2:(a(e-1)-a(-e-1))*(l/2)}})},91554:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745),s=Math.exp;i({target:"Math",stat:!0},{tanh:function(t){var e=+t,r=n(e),i=n(-e);return r===1/0?1:i===1/0?-1:(r-i)/(s(e)+s(-e))}})},77509:(t,e,r)=>{"use strict";r(55997)(Math,"Math",!0)},21416:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{trunc:r(58828)})},79288:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(67697),o=r(19037),a=r(50496),l=r(68844),c=r(35266),h=r(36812),u=r(33457),d=r(23622),p=r(30734),f=r(88732),m=r(3689),g=r(72741).f,A=r(82474).f,y=r(72560).f,v=r(23648),x=r(61435).trim,b="Number",_=o[b],w=a[b],E=_.prototype,M=o.TypeError,S=l("".slice),C=l("".charCodeAt),T=c(b,!_(" 0o1")||!_("0b1")||_("+0x1")),I=function(t){var e,r=arguments.length<1?0:_(function(t){var e=f(t,"number");return"bigint"==typeof e?e:function(t){var e,r,i,n,s,o,a,l,c=f(t,"number");if(p(c))throw new M("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=x(c),43===(e=C(c,0))||45===e){if(88===(r=C(c,2))||120===r)return NaN}else if(48===e){switch(C(c,1)){case 66:case 98:i=2,n=49;break;case 79:case 111:i=8,n=55;break;default:return+c}for(o=(s=S(c,2)).length,a=0;an)return NaN;return parseInt(s,i)}return+c}(e)}(t));return d(E,e=this)&&m((function(){v(e)}))?u(Object(r),this,I):r};I.prototype=E,T&&!n&&(E.constructor=I),i({global:!0,constructor:!0,wrap:!0,forced:T},{Number:I});var R=function(t,e){for(var r,i=s?g(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),n=0;i.length>n;n++)h(e,r=i[n])&&!h(t,r)&&y(t,r,A(e,r))};n&&w&&R(a[b],w),(T||n)&&R(a[b],_)},53584:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},82243:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isFinite:r(70046)})},95765:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isInteger:r(71973)})},45993:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},92547:(t,e,r)=>{"use strict";var i=r(79989),n=r(71973),s=Math.abs;i({target:"Number",stat:!0},{isSafeInteger:function(t){return n(t)&&s(t)<=9007199254740991}})},7936:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},32704:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},52362:(t,e,r)=>{"use strict";var i=r(79989),n=r(14818);i({target:"Number",stat:!0,forced:Number.parseFloat!==n},{parseFloat:n})},21552:(t,e,r)=>{"use strict";var i=r(79989),n=r(67897);i({target:"Number",stat:!0,forced:Number.parseInt!==n},{parseInt:n})},10704:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=r(23648),a=r(90534),l=r(4736),c=r(3689),h=RangeError,u=String,d=isFinite,p=Math.abs,f=Math.floor,m=Math.pow,g=Math.round,A=n(1..toExponential),y=n(a),v=n("".slice),x="-6.9000e-11"===A(-69e-12,4)&&"1.25e+0"===A(1.255,2)&&"1.235e+4"===A(12345,3)&&"3e+1"===A(25,0);i({target:"Number",proto:!0,forced:!x||!(c((function(){A(1,1/0)}))&&c((function(){A(1,-1/0)})))||!!c((function(){A(1/0,1/0),A(NaN,1/0)}))},{toExponential:function(t){var e=o(this);if(void 0===t)return A(e);var r=s(t);if(!d(e))return String(e);if(r<0||r>20)throw new h("Incorrect fraction digits");if(x)return A(e,r);var i="",n="",a=0,c="",b="";if(e<0&&(i="-",e=-e),0===e)a=0,n=y("0",r+1);else{var _=l(e);a=f(_);var w=0,E=m(10,a-r);2*e>=(2*(w=g(e/E))+1)*E&&(w+=1),w>=m(10,r+1)&&(w/=10,a+=1),n=u(w)}return 0!==r&&(n=v(n,0,1)+"."+v(n,1)),0===a?(c="+",b="0"):(c=a>0?"+":"-",b=u(p(a))),i+(n+"e")+c+b}})},97389:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=r(23648),a=r(90534),l=r(3689),c=RangeError,h=String,u=Math.floor,d=n(a),p=n("".slice),f=n(1..toFixed),m=function(t,e,r){return 0===e?r:e%2==1?m(t,e-1,r*t):m(t*t,e/2,r)},g=function(t,e,r){for(var i=-1,n=r;++i<6;)n+=e*t[i],t[i]=n%1e7,n=u(n/1e7)},A=function(t,e){for(var r=6,i=0;--r>=0;)i+=t[r],t[r]=u(i/e),i=i%e*1e7},y=function(t){for(var e=6,r="";--e>=0;)if(""!==r||0===e||0!==t[e]){var i=h(t[e]);r=""===r?i:r+d("0",7-i.length)+i}return r};i({target:"Number",proto:!0,forced:l((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!l((function(){f({})}))},{toFixed:function(t){var e,r,i,n,a=o(this),l=s(t),u=[0,0,0,0,0,0],f="",v="0";if(l<0||l>20)throw new c("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return h(a);if(a<0&&(f="-",a=-a),a>1e-21)if(r=(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(a*m(2,69,1))-69)<0?a*m(2,-e,1):a/m(2,e,1),r*=4503599627370496,(e=52-e)>0){for(g(u,0,r),i=l;i>=7;)g(u,1e7,0),i-=7;for(g(u,m(10,i,1),0),i=e-1;i>=23;)A(u,1<<23),i-=23;A(u,1<0?f+((n=v.length)<=l?"0."+d("0",l-n)+v:p(v,0,n-l)+"."+p(v,n-l)):f+v}})},25284:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(3689),o=r(23648),a=n(1..toPrecision);i({target:"Number",proto:!0,forced:s((function(){return"1"!==a(1,void 0)}))||!s((function(){a({})}))},{toPrecision:function(t){return void 0===t?a(o(this)):a(o(this),t)}})},60429:(t,e,r)=>{"use strict";var i=r(79989),n=r(45394);i({target:"Object",stat:!0,arity:2,forced:Object.assign!==n},{assign:n})},51013:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0,sham:!r(67697)},{create:r(25391)})},33994:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(10509),a=r(90690),l=r(72560);n&&i({target:"Object",proto:!0,forced:s},{__defineGetter__:function(t,e){l.f(a(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},35082:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(98920).f;i({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!n},{defineProperties:s})},40739:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(72560).f;i({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!n},{defineProperty:s})},47409:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(10509),a=r(90690),l=r(72560);n&&i({target:"Object",proto:!0,forced:s},{__defineSetter__:function(t,e){l.f(a(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},36585:(t,e,r)=>{"use strict";var i=r(79989),n=r(49419).entries;i({target:"Object",stat:!0},{entries:function(t){return n(t)}})},41830:(t,e,r)=>{"use strict";var i=r(79989),n=r(71594),s=r(3689),o=r(48999),a=r(45375).onFreeze,l=Object.freeze;i({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!n},{freeze:function(t){return l&&o(t)?l(a(t)):t}})},85415:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(76522);i({target:"Object",stat:!0},{fromEntries:function(t){var e={};return n(t,(function(t,r){s(e,t,r)}),{AS_ENTRIES:!0}),e}})},81919:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(65290),o=r(82474).f,a=r(67697);i({target:"Object",stat:!0,forced:!a||n((function(){o(1)})),sham:!a},{getOwnPropertyDescriptor:function(t,e){return o(s(t),e)}})},99474:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19152),o=r(65290),a=r(82474),l=r(76522);i({target:"Object",stat:!0,sham:!n},{getOwnPropertyDescriptors:function(t){for(var e,r,i=o(t),n=a.f,c=s(i),h={},u=0;c.length>u;)void 0!==(r=n(i,e=c[u++]))&&l(h,e,r);return h}})},79997:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(26062).f;i({target:"Object",stat:!0,forced:n((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:s})},79434:(t,e,r)=>{"use strict";var i=r(79989),n=r(50146),s=r(3689),o=r(7518),a=r(90690);i({target:"Object",stat:!0,forced:!n||s((function(){o.f(1)}))},{getOwnPropertySymbols:function(t){var e=o.f;return e?e(a(t)):[]}})},88052:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(90690),o=r(61868),a=r(81748);i({target:"Object",stat:!0,forced:n((function(){o(1)})),sham:!a},{getPrototypeOf:function(t){return o(s(t))}})},44079:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(68844),o=r(10509),a=r(74684),l=r(18360),c=r(18734),h=n("Object","create"),u=s([].push);i({target:"Object",stat:!0},{groupBy:function(t,e){a(t),o(e);var r=h(null),i=0;return c(t,(function(t){var n=l(e(t,i++));n in r?u(r[n],t):r[n]=[t]})),r}})},14566:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{hasOwn:r(36812)})},36446:(t,e,r)=>{"use strict";var i=r(79989),n=r(27049);i({target:"Object",stat:!0,forced:Object.isExtensible!==n},{isExtensible:n})},35140:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(48999),o=r(6648),a=r(11655),l=Object.isFrozen;i({target:"Object",stat:!0,forced:a||n((function(){l(1)}))},{isFrozen:function(t){return!s(t)||!(!a||"ArrayBuffer"!==o(t))||!!l&&l(t)}})},4179:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(48999),o=r(6648),a=r(11655),l=Object.isSealed;i({target:"Object",stat:!0,forced:a||n((function(){l(1)}))},{isSealed:function(t){return!s(t)||!(!a||"ArrayBuffer"!==o(t))||!!l&&l(t)}})},76101:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{is:r(70953)})},69358:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(20300);i({target:"Object",stat:!0,forced:r(3689)((function(){s(1)}))},{keys:function(t){return s(n(t))}})},75450:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(90690),a=r(18360),l=r(61868),c=r(82474).f;n&&i({target:"Object",proto:!0,forced:s},{__lookupGetter__:function(t){var e,r=o(this),i=a(t);do{if(e=c(r,i))return e.get}while(r=l(r))}})},54993:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(90690),a=r(18360),l=r(61868),c=r(82474).f;n&&i({target:"Object",proto:!0,forced:s},{__lookupSetter__:function(t){var e,r=o(this),i=a(t);do{if(e=c(r,i))return e.set}while(r=l(r))}})},48115:(t,e,r)=>{"use strict";var i=r(79989),n=r(48999),s=r(45375).onFreeze,o=r(71594),a=r(3689),l=Object.preventExtensions;i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{preventExtensions:function(t){return l&&n(t)?l(s(t)):t}})},19330:(t,e,r)=>{"use strict";var i=r(67697),n=r(62148),s=r(48999),o=r(90690),a=r(74684),l=Object.getPrototypeOf,c=Object.setPrototypeOf,h=Object.prototype,u="__proto__";if(i&&l&&c&&!(u in h))try{n(h,u,{configurable:!0,get:function(){return l(o(this))},set:function(t){var e=a(this);(s(t)||null===t)&&s(e)&&c(e,t)}})}catch(t){}},30658:(t,e,r)=>{"use strict";var i=r(79989),n=r(48999),s=r(45375).onFreeze,o=r(71594),a=r(3689),l=Object.seal;i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{seal:function(t){return l&&n(t)?l(s(t)):t}})},5399:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{setPrototypeOf:r(49385)})},60228:(t,e,r)=>{"use strict";var i=r(23043),n=r(11880),s=r(65073);i||n(Object.prototype,"toString",s,{unsafe:!0})},86466:(t,e,r)=>{"use strict";var i=r(79989),n=r(49419).values;i({target:"Object",stat:!0},{values:function(t){return n(t)}})},80939:(t,e,r)=>{"use strict";var i=r(79989),n=r(14818);i({global:!0,forced:parseFloat!==n},{parseFloat:n})},32320:(t,e,r)=>{"use strict";var i=r(79989),n=r(67897);i({global:!0,forced:parseInt!==n},{parseInt:n})},41195:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{allSettled:function(t){var e=this,r=o.f(e),i=r.resolve,c=r.reject,h=a((function(){var r=s(e.resolve),o=[],a=0,c=1;l(t,(function(t){var s=a++,l=!1;c++,n(r,e,t).then((function(t){l||(l=!0,o[s]={status:"fulfilled",value:t},--c||i(o))}),(function(t){l||(l=!0,o[s]={status:"rejected",reason:t},--c||i(o))}))})),--c||i(o)}));return h.error&&c(h.value),r.promise}})},81692:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{all:function(t){var e=this,r=o.f(e),i=r.resolve,c=r.reject,h=a((function(){var r=s(e.resolve),o=[],a=0,h=1;l(t,(function(t){var s=a++,l=!1;h++,n(r,e,t).then((function(t){l||(l=!0,o[s]=t,--h||i(o))}),c)})),--h||i(o)}));return h.error&&c(h.value),r.promise}})},87609:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(76058),a=r(48742),l=r(9302),c=r(18734),h=r(562),u="No one promise resolved";i({target:"Promise",stat:!0,forced:h},{any:function(t){var e=this,r=o("AggregateError"),i=a.f(e),h=i.resolve,d=i.reject,p=l((function(){var i=s(e.resolve),o=[],a=0,l=1,p=!1;c(t,(function(t){var s=a++,c=!1;l++,n(i,e,t).then((function(t){c||p||(p=!0,h(t))}),(function(t){c||p||(c=!0,o[s]=t,--l||d(new r(o,u)))}))})),--l||d(new r(o,u))}));return p.error&&d(p.value),i.promise}})},75089:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(87073).CONSTRUCTOR,o=r(17919),a=r(76058),l=r(69985),c=r(11880),h=o&&o.prototype;if(i({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(t){return this.then(void 0,t)}}),!n&&l(o)){var u=a("Promise").prototype.catch;h.catch!==u&&c(h,"catch",u,{unsafe:!0})}},56697:(t,e,r)=>{"use strict";var i,n,s,o=r(79989),a=r(53931),l=r(50806),c=r(19037),h=r(22615),u=r(11880),d=r(49385),p=r(55997),f=r(14241),m=r(10509),g=r(69985),A=r(48999),y=r(767),v=r(76373),x=r(99886).set,b=r(80231),_=r(20920),w=r(9302),E=r(34410),M=r(618),S=r(17919),C=r(87073),T=r(48742),I="Promise",R=C.CONSTRUCTOR,B=C.REJECTION_EVENT,L=C.SUBCLASSING,P=M.getterFor(I),D=M.set,O=S&&S.prototype,k=S,U=O,N=c.TypeError,F=c.document,z=c.process,G=T.f,Q=G,j=!!(F&&F.createEvent&&c.dispatchEvent),V="unhandledrejection",H=function(t){var e;return!(!A(t)||!g(e=t.then))&&e},W=function(t,e){var r,i,n,s=e.value,o=1===e.state,a=o?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{a?(o||(2===e.rejection&&J(e),e.rejection=1),!0===a?r=s:(u&&u.enter(),r=a(s),u&&(u.exit(),n=!0)),r===t.promise?c(new N("Promise-chain cycle")):(i=H(r))?h(i,r,l,c):l(r)):c(s)}catch(t){u&&!n&&u.exit(),c(t)}},q=function(t,e){t.notified||(t.notified=!0,b((function(){for(var r,i=t.reactions;r=i.get();)W(r,t);t.notified=!1,e&&!t.rejection&&Y(t)})))},Z=function(t,e,r){var i,n;j?((i=F.createEvent("Event")).promise=e,i.reason=r,i.initEvent(t,!1,!0),c.dispatchEvent(i)):i={promise:e,reason:r},!B&&(n=c["on"+t])?n(i):t===V&&_("Unhandled promise rejection",r)},Y=function(t){h(x,c,(function(){var e,r=t.facade,i=t.value;if(X(t)&&(e=w((function(){l?z.emit("unhandledRejection",i,r):Z(V,r,i)})),t.rejection=l||X(t)?2:1,e.error))throw e.value}))},X=function(t){return 1!==t.rejection&&!t.parent},J=function(t){h(x,c,(function(){var e=t.facade;l?z.emit("rejectionHandled",e):Z("rejectionhandled",e,t.value)}))},K=function(t,e,r){return function(i){t(e,i,r)}},$=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,q(t,!0))},tt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new N("Promise can't be resolved itself");var i=H(e);i?b((function(){var r={done:!1};try{h(i,e,K(tt,r,t),K($,r,t))}catch(e){$(r,e,t)}})):(t.value=e,t.state=1,q(t,!1))}catch(e){$({done:!1},e,t)}}};if(R&&(U=(k=function(t){y(this,U),m(t),h(i,this);var e=P(this);try{t(K(tt,e),K($,e))}catch(t){$(e,t)}}).prototype,(i=function(t){D(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=u(U,"then",(function(t,e){var r=P(this),i=G(v(this,k));return r.parent=!0,i.ok=!g(t)||t,i.fail=g(e)&&e,i.domain=l?z.domain:void 0,0===r.state?r.reactions.add(i):b((function(){W(i,r)})),i.promise})),n=function(){var t=new i,e=P(t);this.promise=t,this.resolve=K(tt,e),this.reject=K($,e)},T.f=G=function(t){return t===k||void 0===t?new n(t):Q(t)},!a&&g(S)&&O!==Object.prototype)){s=O.then,L||u(O,"then",(function(t,e){var r=this;return new k((function(t,e){h(s,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete O.constructor}catch(t){}d&&d(O,U)}o({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:k}),p(k,I,!1,!0),f(I)},36409:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(17919),o=r(3689),a=r(76058),l=r(69985),c=r(76373),h=r(72945),u=r(11880),d=s&&s.prototype;if(i({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=c(this,a("Promise")),r=l(t);return this.then(r?function(r){return h(e,t()).then((function(){return r}))}:t,r?function(r){return h(e,t()).then((function(){throw r}))}:t)}}),!n&&l(s)){var p=a("Promise").prototype.finally;d.finally!==p&&u(d,"finally",p,{unsafe:!0})}},73964:(t,e,r)=>{"use strict";r(56697),r(81692),r(75089),r(58829),r(42092),r(57905)},58829:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{race:function(t){var e=this,r=o.f(e),i=r.reject,c=a((function(){var o=s(e.resolve);l(t,(function(t){n(o,e,t).then(r.resolve,i)}))}));return c.error&&i(c.value),r.promise}})},42092:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(48742);i({target:"Promise",stat:!0,forced:r(87073).CONSTRUCTOR},{reject:function(t){var e=s.f(this);return n(e.reject,void 0,t),e.promise}})},57905:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(53931),o=r(17919),a=r(87073).CONSTRUCTOR,l=r(72945),c=n("Promise"),h=s&&!a;i({target:"Promise",stat:!0,forced:s||a},{resolve:function(t){return l(h&&this===c?o:this,t)}})},13505:(t,e,r)=>{"use strict";var i=r(79989),n=r(48742);i({target:"Promise",stat:!0},{withResolvers:function(){var t=n.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},54333:(t,e,r)=>{"use strict";var i=r(79989),n=r(61735),s=r(10509),o=r(85027);i({target:"Reflect",stat:!0,forced:!r(3689)((function(){Reflect.apply((function(){}))}))},{apply:function(t,e,r){return n(s(t),e,o(r))}})},30050:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(86761),a=r(52655),l=r(85027),c=r(48999),h=r(25391),u=r(3689),d=n("Reflect","construct"),p=Object.prototype,f=[].push,m=u((function(){function t(){}return!(d((function(){}),[],t)instanceof t)})),g=!u((function(){d((function(){}))})),A=m||g;i({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(t,e){a(t),l(e);var r=arguments.length<3?t:a(arguments[2]);if(g&&!m)return d(t,e,r);if(t===r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return s(f,i,e),new(s(o,t,i))}var n=r.prototype,u=h(c(n)?n:p),A=s(t,u,e);return c(A)?A:u}})},99871:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(85027),o=r(18360),a=r(72560);i({target:"Reflect",stat:!0,forced:r(3689)((function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})})),sham:!n},{defineProperty:function(t,e,r){s(t);var i=o(e);s(r);try{return a.f(t,i,r),!0}catch(t){return!1}}})},1049:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(82474).f;i({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var r=s(n(t),e);return!(r&&!r.configurable)&&delete t[e]}})},50149:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(85027),o=r(82474);i({target:"Reflect",stat:!0,sham:!n},{getOwnPropertyDescriptor:function(t,e){return o.f(s(t),e)}})},43792:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(61868);i({target:"Reflect",stat:!0,sham:!r(81748)},{getPrototypeOf:function(t){return s(n(t))}})},32349:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(48999),o=r(85027),a=r(76251),l=r(82474),c=r(61868);i({target:"Reflect",stat:!0},{get:function t(e,r){var i,h,u=arguments.length<3?e:arguments[2];return o(e)===u?e[r]:(i=l.f(e,r))?a(i)?i.value:void 0===i.get?void 0:n(i.get,u):s(h=c(e))?t(h,r,u):void 0}})},69707:(t,e,r)=>{"use strict";r(79989)({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},63545:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(27049);i({target:"Reflect",stat:!0},{isExtensible:function(t){return n(t),s(t)}})},62087:(t,e,r)=>{"use strict";r(79989)({target:"Reflect",stat:!0},{ownKeys:r(19152)})},51505:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(85027);i({target:"Reflect",stat:!0,sham:!r(71594)},{preventExtensions:function(t){s(t);try{var e=n("Object","preventExtensions");return e&&e(t),!0}catch(t){return!1}}})},22373:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(23550),o=r(49385);o&&i({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){n(t),s(e);try{return o(t,e),!0}catch(t){return!1}}})},45247:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(48999),a=r(76251),l=r(3689),c=r(72560),h=r(82474),u=r(61868),d=r(75684);i({target:"Reflect",stat:!0,forced:l((function(){var t=function(){},e=c.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}))},{set:function t(e,r,i){var l,p,f,m=arguments.length<4?e:arguments[3],g=h.f(s(e),r);if(!g){if(o(p=u(e)))return t(p,r,i,m);g=d(0)}if(a(g)){if(!1===g.writable||!o(m))return!1;if(l=h.f(m,r)){if(l.get||l.set||!1===l.writable)return!1;l.value=i,c.f(m,r,l)}else c.f(m,r,d(0,i))}else{if(void 0===(f=g.set))return!1;n(f,m,i)}return!0}})},76034:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(55997);i({global:!0},{Reflect:{}}),s(n.Reflect,"Reflect",!0)},52003:(t,e,r)=>{"use strict";var i=r(67697),n=r(19037),s=r(68844),o=r(35266),a=r(33457),l=r(75773),c=r(25391),h=r(72741).f,u=r(23622),d=r(91245),p=r(34327),f=r(63477),m=r(87901),g=r(38055),A=r(11880),y=r(3689),v=r(36812),x=r(618).enforce,b=r(14241),_=r(44201),w=r(62100),E=r(26738),M=_("match"),S=n.RegExp,C=S.prototype,T=n.SyntaxError,I=s(C.exec),R=s("".charAt),B=s("".replace),L=s("".indexOf),P=s("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,O=/a/g,k=/a/g,U=new S(O)!==O,N=m.MISSED_STICKY,F=m.UNSUPPORTED_Y;if(o("RegExp",i&&(!U||N||w||E||y((function(){return k[M]=!1,S(O)!==O||S(k)===k||"/a/i"!==String(S(O,"i"))}))))){for(var z=function(t,e){var r,i,n,s,o,h,m=u(C,this),g=d(t),A=void 0===e,y=[],b=t;if(!m&&g&&A&&t.constructor===z)return t;if((g||u(C,t))&&(t=t.source,A&&(e=f(b))),t=void 0===t?"":p(t),e=void 0===e?"":p(e),b=t,w&&"dotAll"in O&&(i=!!e&&L(e,"s")>-1)&&(e=B(e,/s/g,"")),r=e,N&&"sticky"in O&&(n=!!e&&L(e,"y")>-1)&&F&&(e=B(e,/y/g,"")),E&&(s=function(t){for(var e,r=t.length,i=0,n="",s=[],o=c(null),a=!1,l=!1,h=0,u="";i<=r;i++){if("\\"===(e=R(t,i)))e+=R(t,++i);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:I(D,P(t,i+1))&&(i+=2,l=!0),n+=e,h++;continue;case">"===e&&l:if(""===u||v(o,u))throw new T("Invalid capture group name");o[u]=!0,s[s.length]=[u,h],l=!1,u="";continue}l?u+=e:n+=e}return[n,s]}(t),t=s[0],y=s[1]),o=a(S(t,e),m?this:C,z),(i||n||y.length)&&(h=x(o),i&&(h.dotAll=!0,h.raw=z(function(t){for(var e,r=t.length,i=0,n="",s=!1;i<=r;i++)"\\"!==(e=R(t,i))?s||"."!==e?("["===e?s=!0:"]"===e&&(s=!1),n+=e):n+="[\\s\\S]":n+=e+R(t,++i);return n}(t),r)),n&&(h.sticky=!0),y.length&&(h.groups=y)),t!==b)try{l(o,"source",""===b?"(?:)":b)}catch(t){}return o},G=h(S),Q=0;G.length>Q;)g(z,S,G[Q++]);C.constructor=z,z.prototype=C,A(n,"RegExp",z,{constructor:!0})}b("RegExp")},68518:(t,e,r)=>{"use strict";var i=r(67697),n=r(62100),s=r(6648),o=r(62148),a=r(618).get,l=RegExp.prototype,c=TypeError;i&&n&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},64043:(t,e,r)=>{"use strict";var i=r(79989),n=r(56308);i({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})},25847:(t,e,r)=>{"use strict";var i=r(19037),n=r(67697),s=r(62148),o=r(69633),a=r(3689),l=i.RegExp,c=l.prototype;n&&a((function(){var t=!0;try{l(".","d")}catch(e){t=!1}var e={},r="",i=t?"dgimsy":"gimsy",n=function(t,i){Object.defineProperty(e,t,{get:function(){return r+=i,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in t&&(s.hasIndices="d"),s)n(o,s[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(e)!==i||r!==i}))&&s(c,"flags",{configurable:!0,get:o})},13440:(t,e,r)=>{"use strict";var i=r(67697),n=r(87901).MISSED_STICKY,s=r(6648),o=r(62148),a=r(618).get,l=RegExp.prototype,c=TypeError;i&&n&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},7409:(t,e,r)=>{"use strict";r(64043);var i,n,s=r(79989),o=r(22615),a=r(69985),l=r(85027),c=r(34327),h=(i=!1,(n=/[ac]/).exec=function(){return i=!0,/./.exec.apply(this,arguments)},!0===n.test("abc")&&i),u=/./.test;s({target:"RegExp",proto:!0,forced:!h},{test:function(t){var e=l(this),r=c(t),i=e.exec;if(!a(i))return o(u,e,r);var n=o(i,e,r);return null!==n&&(l(n),!0)}})},12826:(t,e,r)=>{"use strict";var i=r(41236).PROPER,n=r(11880),s=r(85027),o=r(34327),a=r(3689),l=r(63477),c="toString",h=RegExp.prototype[c],u=a((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),d=i&&h.name!==c;(u||d)&&n(RegExp.prototype,c,(function(){var t=s(this);return"/"+o(t.source)+"/"+o(l(t))}),{unsafe:!0})},17985:(t,e,r)=>{"use strict";r(20319)("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70800))},19649:(t,e,r)=>{"use strict";r(17985)},90343:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("anchor")},{anchor:function(t){return n(this,"a","name",t)}})},7961:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(68700),a=r(34327),l=r(3689),c=n("".charAt);i({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(t){var e=a(s(this)),r=e.length,i=o(t),n=i>=0?i:r+i;return n<0||n>=r?void 0:c(e,n)}})},21444:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("big")},{big:function(){return n(this,"big","","")}})},25906:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("blink")},{blink:function(){return n(this,"blink","","")}})},95682:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("bold")},{bold:function(){return n(this,"b","","")}})},86239:(t,e,r)=>{"use strict";var i=r(79989),n=r(10730).codeAt;i({target:"String",proto:!0},{codePointAt:function(t){return n(this,t)}})},2918:(t,e,r)=>{"use strict";var i,n=r(79989),s=r(46576),o=r(82474).f,a=r(43126),l=r(34327),c=r(42124),h=r(74684),u=r(27413),d=r(53931),p=s("".endsWith),f=s("".slice),m=Math.min,g=u("endsWith");n({target:"String",proto:!0,forced:!(!d&&!g&&(i=o(String.prototype,"endsWith"),i&&!i.writable)||g)},{endsWith:function(t){var e=l(h(this));c(t);var r=arguments.length>1?arguments[1]:void 0,i=e.length,n=void 0===r?i:m(a(r),i),s=l(t);return p?p(e,s,n):f(e,n-s.length,n)===s}})},98041:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fixed")},{fixed:function(){return n(this,"tt","","")}})},6364:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fontcolor")},{fontcolor:function(t){return n(this,"font","color",t)}})},82954:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fontsize")},{fontsize:function(t){return n(this,"font","size",t)}})},20283:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(27578),o=RangeError,a=String.fromCharCode,l=String.fromCodePoint,c=n([].join);i({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(t){for(var e,r=[],i=arguments.length,n=0;i>n;){if(e=+arguments[n++],s(e,1114111)!==e)throw new o(e+" is not a valid code point");r[n]=e<65536?a(e):a(55296+((e-=65536)>>10),e%1024+56320)}return c(r,"")}})},43843:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(42124),o=r(74684),a=r(34327),l=r(27413),c=n("".indexOf);i({target:"String",proto:!0,forced:!l("includes")},{includes:function(t){return!!~c(a(o(this)),a(s(t)),arguments.length>1?arguments[1]:void 0)}})},12281:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(34327),a=n("".charCodeAt);i({target:"String",proto:!0},{isWellFormed:function(){for(var t=o(s(this)),e=t.length,r=0;r=56320||++r>=e||56320!=(64512&a(t,r))))return!1}return!0}})},19162:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("italics")},{italics:function(){return n(this,"i","","")}})},21694:(t,e,r)=>{"use strict";var i=r(10730).charAt,n=r(34327),s=r(618),o=r(91934),a=r(27807),l="String Iterator",c=s.set,h=s.getterFor(l);o(String,"String",(function(t){c(this,{type:l,string:n(t),index:0})}),(function(){var t,e=h(this),r=e.string,n=e.index;return n>=r.length?a(void 0,!0):(t=i(r,n),e.index+=t.length,a(t,!1))}))},37960:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("link")},{link:function(t){return n(this,"a","href",t)}})},79866:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(46576),o=r(30974),a=r(27807),l=r(74684),c=r(43126),h=r(34327),u=r(85027),d=r(981),p=r(6648),f=r(91245),m=r(63477),g=r(54849),A=r(11880),y=r(3689),v=r(44201),x=r(76373),b=r(71514),_=r(66100),w=r(618),E=r(53931),M=v("matchAll"),S="RegExp String",C=S+" Iterator",T=w.set,I=w.getterFor(C),R=RegExp.prototype,B=TypeError,L=s("".indexOf),P=s("".matchAll),D=!!P&&!y((function(){P("a",/./)})),O=o((function(t,e,r,i){T(this,{type:C,regexp:t,string:e,global:r,unicode:i,done:!1})}),S,(function(){var t=I(this);if(t.done)return a(void 0,!0);var e=t.regexp,r=t.string,i=_(e,r);return null===i?(t.done=!0,a(void 0,!0)):t.global?(""===h(i[0])&&(e.lastIndex=b(r,c(e.lastIndex),t.unicode)),a(i,!1)):(t.done=!0,a(i,!1))})),k=function(t){var e,r,i,n=u(this),s=h(t),o=x(n,RegExp),a=h(m(n));return e=new o(o===RegExp?n.source:n,a),r=!!~L(a,"g"),i=!!~L(a,"u"),e.lastIndex=c(n.lastIndex),new O(e,s,r,i)};i({target:"String",proto:!0,forced:D},{matchAll:function(t){var e,r,i,s,o=l(this);if(d(t)){if(D)return P(o,t)}else{if(f(t)&&(e=h(l(m(t))),!~L(e,"g")))throw new B("`.matchAll` does not allow non-global regexes");if(D)return P(o,t);if(void 0===(i=g(t,M))&&E&&"RegExp"===p(t)&&(i=k),i)return n(i,t,o)}return r=h(o),s=new RegExp(t,"g"),E?n(k,s,r):s[M](r)}}),E||M in R||A(R,M,k)},22462:(t,e,r)=>{"use strict";var i=r(22615),n=r(65773),s=r(85027),o=r(981),a=r(43126),l=r(34327),c=r(74684),h=r(54849),u=r(71514),d=r(66100);n("match",(function(t,e,r){return[function(e){var r=c(this),n=o(e)?void 0:h(e,t);return n?i(n,e,r):new RegExp(e)[t](l(r))},function(t){var i=s(this),n=l(t),o=r(e,i,n);if(o.done)return o.value;if(!i.global)return d(i,n);var c=i.unicode;i.lastIndex=0;for(var h,p=[],f=0;null!==(h=d(i,n));){var m=l(h[0]);p[f]=m,""===m&&(i.lastIndex=u(n,a(i.lastIndex),c)),f++}return 0===f?null:p}]}))},72940:(t,e,r)=>{"use strict";var i=r(79989),n=r(77254).end;i({target:"String",proto:!0,forced:r(35947)},{padEnd:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},8472:(t,e,r)=>{"use strict";var i=r(79989),n=r(77254).start;i({target:"String",proto:!0,forced:r(35947)},{padStart:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},92404:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(65290),o=r(90690),a=r(34327),l=r(6310),c=n([].push),h=n([].join);i({target:"String",stat:!0},{raw:function(t){var e=s(o(t).raw),r=l(e);if(!r)return"";for(var i=arguments.length,n=[],u=0;;){if(c(n,a(e[u++])),u===r)return h(n,"");u{"use strict";r(79989)({target:"String",proto:!0},{repeat:r(90534)})},56532:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(68844),o=r(74684),a=r(69985),l=r(981),c=r(91245),h=r(34327),u=r(54849),d=r(63477),p=r(27017),f=r(44201),m=r(53931),g=f("replace"),A=TypeError,y=s("".indexOf),v=s("".replace),x=s("".slice),b=Math.max,_=function(t,e,r){return r>t.length?-1:""===e?r:y(t,e,r)};i({target:"String",proto:!0},{replaceAll:function(t,e){var r,i,s,f,w,E,M,S,C,T=o(this),I=0,R=0,B="";if(!l(t)){if((r=c(t))&&(i=h(o(d(t))),!~y(i,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(s=u(t,g))return n(s,t,T,e);if(m&&r)return v(h(T),t,e)}for(f=h(T),w=h(t),(E=a(e))||(e=h(e)),M=w.length,S=b(1,M),I=_(f,w,0);-1!==I;)C=E?h(e(w,I,f)):p(w,f,I,[],void 0,e),B+=x(f,R,I)+C,R=I+M,I=_(f,w,I+S);return R{"use strict";var i=r(61735),n=r(22615),s=r(68844),o=r(65773),a=r(3689),l=r(85027),c=r(69985),h=r(981),u=r(68700),d=r(43126),p=r(34327),f=r(74684),m=r(71514),g=r(54849),A=r(27017),y=r(66100),v=r(44201)("replace"),x=Math.max,b=Math.min,_=s([].concat),w=s([].push),E=s("".indexOf),M=s("".slice),S="$0"==="a".replace(/./,"$0"),C=!!/./[v]&&""===/./[v]("a","$0");o("replace",(function(t,e,r){var s=C?"$":"$0";return[function(t,r){var i=f(this),s=h(t)?void 0:g(t,v);return s?n(s,t,i,r):n(e,p(i),t,r)},function(t,n){var o=l(this),a=p(t);if("string"==typeof n&&-1===E(n,s)&&-1===E(n,"$<")){var h=r(e,o,a,n);if(h.done)return h.value}var f=c(n);f||(n=p(n));var g,v=o.global;v&&(g=o.unicode,o.lastIndex=0);for(var S,C=[];null!==(S=y(o,a))&&(w(C,S),v);)""===p(S[0])&&(o.lastIndex=m(a,d(o.lastIndex),g));for(var T,I="",R=0,B=0;B=R&&(I+=M(a,R,D)+L,R=D+P.length)}return I+M(a,R)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!S||C)},61514:(t,e,r)=>{"use strict";var i=r(22615),n=r(65773),s=r(85027),o=r(981),a=r(74684),l=r(70953),c=r(34327),h=r(54849),u=r(66100);n("search",(function(t,e,r){return[function(e){var r=a(this),n=o(e)?void 0:h(e,t);return n?i(n,e,r):new RegExp(e)[t](c(r))},function(t){var i=s(this),n=c(t),o=r(e,i,n);if(o.done)return o.value;var a=i.lastIndex;l(a,0)||(i.lastIndex=0);var h=u(i,n);return l(i.lastIndex,a)||(i.lastIndex=a),null===h?-1:h.index}]}))},470:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("small")},{small:function(){return n(this,"small","","")}})},9873:(t,e,r)=>{"use strict";var i=r(61735),n=r(22615),s=r(68844),o=r(65773),a=r(85027),l=r(981),c=r(91245),h=r(74684),u=r(76373),d=r(71514),p=r(43126),f=r(34327),m=r(54849),g=r(9015),A=r(66100),y=r(56308),v=r(87901),x=r(3689),b=v.UNSUPPORTED_Y,_=4294967295,w=Math.min,E=[].push,M=s(/./.exec),S=s(E),C=s("".slice);o("split",(function(t,e,r){var s;return s="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var s=f(h(this)),o=void 0===r?_:r>>>0;if(0===o)return[];if(void 0===t)return[s];if(!c(t))return n(e,s,t,o);for(var a,l,u,d=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),m=0,A=new RegExp(t.source,p+"g");(a=n(y,A,s))&&!((l=A.lastIndex)>m&&(S(d,C(s,m,a.index)),a.length>1&&a.index=o));)A.lastIndex===a.index&&A.lastIndex++;return m===s.length?!u&&M(A,"")||S(d,""):S(d,C(s,m)),d.length>o?g(d,0,o):d}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:n(e,this,t,r)}:e,[function(e,r){var i=h(this),o=l(e)?void 0:m(e,t);return o?n(o,e,i,r):n(s,f(i),e,r)},function(t,i){var n=a(this),o=f(t),l=r(s,n,o,i,s!==e);if(l.done)return l.value;var c=u(n,RegExp),h=n.unicode,m=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(b?"g":"y"),g=new c(b?"^(?:"+n.source+")":n,m),y=void 0===i?_:i>>>0;if(0===y)return[];if(0===o.length)return null===A(g,o)?[o]:[];for(var v=0,x=0,E=[];x{"use strict";var i,n=r(79989),s=r(46576),o=r(82474).f,a=r(43126),l=r(34327),c=r(42124),h=r(74684),u=r(27413),d=r(53931),p=s("".startsWith),f=s("".slice),m=Math.min,g=u("startsWith");n({target:"String",proto:!0,forced:!(!d&&!g&&(i=o(String.prototype,"startsWith"),i&&!i.writable)||g)},{startsWith:function(t){var e=l(h(this));c(t);var r=a(m(arguments.length>1?arguments[1]:void 0,e.length)),i=l(t);return p?p(e,i,r):f(e,r,r+i.length)===i}})},67446:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("strike")},{strike:function(){return n(this,"strike","","")}})},47729:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("sub")},{sub:function(){return n(this,"sub","","")}})},20372:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(68700),a=r(34327),l=n("".slice),c=Math.max,h=Math.min;i({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,e){var r,i,n=a(s(this)),u=n.length,d=o(t);return d===1/0&&(d=0),d<0&&(d=c(u+d,0)),(r=void 0===e?u:o(e))<=0||r===1/0||d>=(i=h(d+r,u))?"":l(n,d,i)}})},2e3:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("sup")},{sup:function(){return n(this,"sup","","")}})},35237:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(68844),o=r(74684),a=r(34327),l=r(3689),c=Array,h=s("".charAt),u=s("".charCodeAt),d=s([].join),p="".toWellFormed,f=p&&l((function(){return"1"!==n(p,1)}));i({target:"String",proto:!0,forced:f},{toWellFormed:function(){var t=a(o(this));if(f)return n(p,t);for(var e=t.length,r=c(e),i=0;i=56320||i+1>=e||56320!=(64512&u(t,i+1))?r[i]="�":(r[i]=h(t,i),r[++i]=h(t,i))}return d(r,"")}})},16386:(t,e,r)=>{"use strict";r(61313);var i=r(79989),n=r(79558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==n},{trimEnd:n})},10974:(t,e,r)=>{"use strict";var i=r(79989),n=r(72291);i({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==n},{trimLeft:n})},61313:(t,e,r)=>{"use strict";var i=r(79989),n=r(79558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==n},{trimRight:n})},3255:(t,e,r)=>{"use strict";r(10974);var i=r(79989),n=r(72291);i({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==n},{trimStart:n})},28436:(t,e,r)=>{"use strict";var i=r(79989),n=r(61435).trim;i({target:"String",proto:!0,forced:r(75984)("trim")},{trim:function(){return n(this)}})},58373:(t,e,r)=>{"use strict";r(35405)("asyncIterator")},37855:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(22615),o=r(68844),a=r(53931),l=r(67697),c=r(50146),h=r(3689),u=r(36812),d=r(23622),p=r(85027),f=r(65290),m=r(18360),g=r(34327),A=r(75684),y=r(25391),v=r(20300),x=r(72741),b=r(26062),_=r(7518),w=r(82474),E=r(72560),M=r(98920),S=r(49556),C=r(11880),T=r(62148),I=r(83430),R=r(2713),B=r(57248),L=r(14630),P=r(44201),D=r(96145),O=r(35405),k=r(13032),U=r(55997),N=r(618),F=r(2960).forEach,z=R("hidden"),G="Symbol",Q="prototype",j=N.set,V=N.getterFor(G),H=Object[Q],W=n.Symbol,q=W&&W[Q],Z=n.RangeError,Y=n.TypeError,X=n.QObject,J=w.f,K=E.f,$=b.f,tt=S.f,et=o([].push),rt=I("symbols"),it=I("op-symbols"),nt=I("wks"),st=!X||!X[Q]||!X[Q].findChild,ot=function(t,e,r){var i=J(H,e);i&&delete H[e],K(t,e,r),i&&t!==H&&K(H,e,i)},at=l&&h((function(){return 7!==y(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?ot:K,lt=function(t,e){var r=rt[t]=y(q);return j(r,{type:G,tag:t,description:e}),l||(r.description=e),r},ct=function(t,e,r){t===H&&ct(it,e,r),p(t);var i=m(e);return p(r),u(rt,i)?(r.enumerable?(u(t,z)&&t[z][i]&&(t[z][i]=!1),r=y(r,{enumerable:A(0,!1)})):(u(t,z)||K(t,z,A(1,{})),t[z][i]=!0),at(t,i,r)):K(t,i,r)},ht=function(t,e){p(t);var r=f(e),i=v(r).concat(ft(r));return F(i,(function(e){l&&!s(ut,r,e)||ct(t,e,r[e])})),t},ut=function(t){var e=m(t),r=s(tt,this,e);return!(this===H&&u(rt,e)&&!u(it,e))&&(!(r||!u(this,e)||!u(rt,e)||u(this,z)&&this[z][e])||r)},dt=function(t,e){var r=f(t),i=m(e);if(r!==H||!u(rt,i)||u(it,i)){var n=J(r,i);return!n||!u(rt,i)||u(r,z)&&r[z][i]||(n.enumerable=!0),n}},pt=function(t){var e=$(f(t)),r=[];return F(e,(function(t){u(rt,t)||u(B,t)||et(r,t)})),r},ft=function(t){var e=t===H,r=$(e?it:f(t)),i=[];return F(r,(function(t){!u(rt,t)||e&&!u(H,t)||et(i,rt[t])})),i};c||(C(q=(W=function(){if(d(q,this))throw new Y("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,e=L(t),r=function(t){var i=void 0===this?n:this;i===H&&s(r,it,t),u(i,z)&&u(i[z],e)&&(i[z][e]=!1);var o=A(1,t);try{at(i,e,o)}catch(t){if(!(t instanceof Z))throw t;ot(i,e,o)}};return l&&st&&at(H,e,{configurable:!0,set:r}),lt(e,t)})[Q],"toString",(function(){return V(this).tag})),C(W,"withoutSetter",(function(t){return lt(L(t),t)})),S.f=ut,E.f=ct,M.f=ht,w.f=dt,x.f=b.f=pt,_.f=ft,D.f=function(t){return lt(P(t),t)},l&&(T(q,"description",{configurable:!0,get:function(){return V(this).description}}),a||C(H,"propertyIsEnumerable",ut,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:W}),F(v(nt),(function(t){O(t)})),i({target:G,stat:!0,forced:!c},{useSetter:function(){st=!0},useSimple:function(){st=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(t,e){return void 0===e?y(t):ht(y(t),e)},defineProperty:ct,defineProperties:ht,getOwnPropertyDescriptor:dt}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:pt}),k(),U(W,G),B[z]=!0},86544:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19037),o=r(68844),a=r(36812),l=r(69985),c=r(23622),h=r(34327),u=r(62148),d=r(8758),p=s.Symbol,f=p&&p.prototype;if(n&&l(p)&&(!("description"in f)||void 0!==p().description)){var m={},g=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:h(arguments[0]),e=c(f,this)?new p(t):void 0===t?p():p(t);return""===t&&(m[e]=!0),e};d(g,p),g.prototype=f,f.constructor=g;var A="Symbol(description detection)"===String(p("description detection")),y=o(f.valueOf),v=o(f.toString),x=/^Symbol\((.*)\)[^)]+$/,b=o("".replace),_=o("".slice);u(f,"description",{configurable:!0,get:function(){var t=y(this);if(a(m,t))return"";var e=v(t),r=A?_(e,7,-1):b(e,x,"$1");return""===r?void 0:r}}),i({global:!0,constructor:!0,forced:!0},{Symbol:g})}},43975:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(36812),o=r(34327),a=r(83430),l=r(46549),c=a("string-to-symbol-registry"),h=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{for:function(t){var e=o(t);if(s(c,e))return c[e];var r=n("Symbol")(e);return c[e]=r,h[r]=e,r}})},96157:(t,e,r)=>{"use strict";r(35405)("hasInstance")},82529:(t,e,r)=>{"use strict";r(35405)("isConcatSpreadable")},84254:(t,e,r)=>{"use strict";r(35405)("iterator")},59749:(t,e,r)=>{"use strict";r(37855),r(43975),r(81445),r(48324),r(79434)},81445:(t,e,r)=>{"use strict";var i=r(79989),n=r(36812),s=r(30734),o=r(23691),a=r(83430),l=r(46549),c=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{keyFor:function(t){if(!s(t))throw new TypeError(o(t)+" is not a symbol");if(n(c,t))return c[t]}})},93531:(t,e,r)=>{"use strict";r(35405)("matchAll")},64155:(t,e,r)=>{"use strict";r(35405)("match")},95906:(t,e,r)=>{"use strict";r(35405)("replace")},50549:(t,e,r)=>{"use strict";r(35405)("search")},96285:(t,e,r)=>{"use strict";r(35405)("species")},18200:(t,e,r)=>{"use strict";r(35405)("split")},69373:(t,e,r)=>{"use strict";var i=r(35405),n=r(13032);i("toPrimitive"),n()},66793:(t,e,r)=>{"use strict";var i=r(76058),n=r(35405),s=r(55997);n("toStringTag"),s(i("Symbol"),"Symbol")},44578:(t,e,r)=>{"use strict";r(35405)("unscopables")},95194:(t,e,r)=>{"use strict";var i=r(54872),n=r(6310),s=r(68700),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",(function(t){var e=o(this),r=n(e),i=s(t),a=i>=0?i:r+i;return a<0||a>=r?void 0:e[a]}))},36664:(t,e,r)=>{"use strict";var i=r(68844),n=r(54872),s=i(r(70357)),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("copyWithin",(function(t,e){return s(o(this),t,e,arguments.length>2?arguments[2]:void 0)}))},55980:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).every,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("every",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},79943:(t,e,r)=>{"use strict";var i=r(54872),n=r(62872),s=r(71530),o=r(50926),a=r(22615),l=r(68844),c=r(3689),h=i.aTypedArray,u=i.exportTypedArrayMethod,d=l("".slice);u("fill",(function(t){var e=arguments.length;h(this);var r="Big"===d(o(this),0,3)?s(t):+t;return a(n,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),c((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},96089:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filter,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filter",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}))},48690:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).findIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},82:(t,e,r)=>{"use strict";var i=r(54872),n=r(61969).findLastIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},20522:(t,e,r)=>{"use strict";var i=r(54872),n=r(61969).findLast,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},18539:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).find,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("find",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},29068:(t,e,r)=>{"use strict";r(31158)("Float32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},70292:(t,e,r)=>{"use strict";r(31158)("Float64",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},45385:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).forEach,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("forEach",(function(t){n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},59495:(t,e,r)=>{"use strict";var i=r(39800);(0,r(54872).exportTypedArrayStaticMethod)("from",r(41304),i)},85552:(t,e,r)=>{"use strict";var i=r(54872),n=r(84328).includes,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("includes",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},31803:(t,e,r)=>{"use strict";var i=r(54872),n=r(84328).indexOf,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("indexOf",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},89988:(t,e,r)=>{"use strict";r(31158)("Int16",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},854:(t,e,r)=>{"use strict";r(31158)("Int32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},55304:(t,e,r)=>{"use strict";r(31158)("Int8",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},91565:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(54872),a=r(752),l=r(44201)("iterator"),c=i.Uint8Array,h=s(a.values),u=s(a.keys),d=s(a.entries),p=o.aTypedArray,f=o.exportTypedArrayMethod,m=c&&c.prototype,g=!n((function(){m[l].call([1])})),A=!!m&&m.values&&m[l]===m.values&&"values"===m.values.name,y=function(){return h(p(this))};f("entries",(function(){return d(p(this))}),g),f("keys",(function(){return u(p(this))}),g),f("values",y,g||!A,{name:"values"}),f(l,y,g||!A,{name:"values"})},67987:(t,e,r)=>{"use strict";var i=r(54872),n=r(68844),s=i.aTypedArray,o=i.exportTypedArrayMethod,a=n([].join);o("join",(function(t){return a(s(this),t)}))},49365:(t,e,r)=>{"use strict";var i=r(54872),n=r(61735),s=r(60953),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return n(s,o(this),e>1?[t,arguments[1]]:[t])}))},80677:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).map,s=r(47338),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("map",(function(t){return n(o(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(s(t))(e)}))}))},19038:(t,e,r)=>{"use strict";var i=r(54872),n=r(39800),s=i.aTypedArrayConstructor;(0,i.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,e=arguments.length,r=new(s(this))(e);e>t;)r[t]=arguments[t++];return r}),n)},41165:(t,e,r)=>{"use strict";var i=r(54872),n=r(88820).right,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},18118:(t,e,r)=>{"use strict";var i=r(54872),n=r(88820).left,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},71522:(t,e,r)=>{"use strict";var i=r(54872),n=i.aTypedArray,s=i.exportTypedArrayMethod,o=Math.floor;s("reverse",(function(){for(var t,e=this,r=n(e).length,i=o(r/2),s=0;s{"use strict";var i=r(19037),n=r(22615),s=r(54872),o=r(6310),a=r(83250),l=r(90690),c=r(3689),h=i.RangeError,u=i.Int8Array,d=u&&u.prototype,p=d&&d.set,f=s.aTypedArray,m=s.exportTypedArrayMethod,g=!c((function(){var t=new Uint8ClampedArray(2);return n(p,t,{length:1,0:3},1),3!==t[1]})),A=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new u(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));m("set",(function(t){f(this);var e=a(arguments.length>1?arguments[1]:void 0,1),r=l(t);if(g)return n(p,this,r,e);var i=this.length,s=o(r),c=0;if(s+e>i)throw new h("Wrong length");for(;c{"use strict";var i=r(54872),n=r(47338),s=r(3689),o=r(96004),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("slice",(function(t,e){for(var r=o(a(this),t,e),i=n(this),s=0,l=r.length,c=new i(l);l>s;)c[s]=r[s++];return c}),s((function(){new Int8Array(1).slice()})))},7300:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).some,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("some",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},93356:(t,e,r)=>{"use strict";var i=r(19037),n=r(46576),s=r(3689),o=r(10509),a=r(50382),l=r(54872),c=r(97365),h=r(37298),u=r(3615),d=r(27922),p=l.aTypedArray,f=l.exportTypedArrayMethod,m=i.Uint16Array,g=m&&n(m.prototype.sort),A=!(!g||s((function(){g(new m(2),null)}))&&s((function(){g(new m(2),{})}))),y=!!g&&!s((function(){if(u)return u<74;if(c)return c<67;if(h)return!0;if(d)return d<602;var t,e,r=new m(516),i=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,i[t]=t-2*e+3;for(g(r,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==i[t])return!0}));f("sort",(function(t){return void 0!==t&&o(t),y?g(this,t):a(p(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!y||A)},62533:(t,e,r)=>{"use strict";var i=r(54872),n=r(43126),s=r(27578),o=r(47338),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("subarray",(function(t,e){var r=a(this),i=r.length,l=s(t,i);return new(o(r))(r.buffer,r.byteOffset+l*r.BYTES_PER_ELEMENT,n((void 0===e?i:s(e,i))-l))}))},99724:(t,e,r)=>{"use strict";var i=r(19037),n=r(61735),s=r(54872),o=r(3689),a=r(96004),l=i.Int8Array,c=s.aTypedArray,h=s.exportTypedArrayMethod,u=[].toLocaleString,d=!!l&&o((function(){u.call(new l(1))}));h("toLocaleString",(function(){return n(u,d?a(c(this)):c(this),a(arguments))}),o((function(){return[1,2].toLocaleString()!==new l([1,2]).toLocaleString()}))||!o((function(){l.prototype.toLocaleString.call([1,2])})))},24224:(t,e,r)=>{"use strict";var i=r(26166),n=r(54872),s=n.aTypedArray,o=n.exportTypedArrayMethod,a=n.getTypedArrayConstructor;o("toReversed",(function(){return i(s(this),a(this))}))},61121:(t,e,r)=>{"use strict";var i=r(54872),n=r(68844),s=r(10509),o=r(59976),a=i.aTypedArray,l=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,h=n(i.TypedArrayPrototype.sort);c("toSorted",(function(t){void 0!==t&&s(t);var e=a(this),r=o(l(e),e);return h(r,t)}))},99901:(t,e,r)=>{"use strict";var i=r(54872).exportTypedArrayMethod,n=r(3689),s=r(19037),o=r(68844),a=s.Uint8Array,l=a&&a.prototype||{},c=[].toString,h=o([].join);n((function(){c.call({})}))&&(c=function(){return h(this)});var u=l.toString!==c;i("toString",c,u)},75679:(t,e,r)=>{"use strict";r(31158)("Uint16",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},18557:(t,e,r)=>{"use strict";r(31158)("Uint32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},28607:(t,e,r)=>{"use strict";r(31158)("Uint8",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},30938:(t,e,r)=>{"use strict";r(31158)("Uint8",(function(t){return function(e,r,i){return t(this,e,r,i)}}),!0)},37133:(t,e,r)=>{"use strict";var i=r(16134),n=r(54872),s=r(9401),o=r(68700),a=r(71530),l=n.aTypedArray,c=n.getTypedArrayConstructor,h=n.exportTypedArrayMethod,u=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();h("with",{with:function(t,e){var r=l(this),n=o(t),h=s(r)?a(e):+e;return i(r,c(r),n,h)}}.with,!u)},622:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=String.fromCharCode,a=n("".charAt),l=n(/./.exec),c=n("".slice),h=/^[\da-f]{2}$/i,u=/^[\da-f]{4}$/i;i({global:!0},{unescape:function(t){for(var e,r,i=s(t),n="",d=i.length,p=0;p{"use strict";var i,n=r(71594),s=r(19037),o=r(68844),a=r(6045),l=r(45375),c=r(20319),h=r(70637),u=r(48999),d=r(618).enforce,p=r(3689),f=r(59834),m=Object,g=Array.isArray,A=m.isExtensible,y=m.isFrozen,v=m.isSealed,x=m.freeze,b=m.seal,_={},w={},E=!s.ActiveXObject&&"ActiveXObject"in s,M=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},S=c("WeakMap",M,h),C=S.prototype,T=o(C.set);if(f)if(E){i=h.getConstructor(M,"WeakMap",!0),l.enable();var I=o(C.delete),R=o(C.has),B=o(C.get);a(C,{delete:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),I(this,t)||e.frozen.delete(t)}return I(this,t)},has:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),R(this,t)||e.frozen.has(t)}return R(this,t)},get:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),R(this,t)?B(this,t):e.frozen.get(t)}return B(this,t)},set:function(t,e){if(u(t)&&!A(t)){var r=d(this);r.frozen||(r.frozen=new i),R(this,t)?T(this,t,e):r.frozen.set(t,e)}else T(this,t,e);return this}})}else n&&p((function(){var t=x([]);return T(new S,t,1),!y(t)}))&&a(C,{set:function(t,e){var r;return g(t)&&(y(t)?r=_:v(t)&&(r=w)),T(this,t,e),r===_&&x(t),r===w&&b(t),this}})},51090:(t,e,r)=>{"use strict";r(45164)},87884:(t,e,r)=>{"use strict";r(20319)("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70637))},50414:(t,e,r)=>{"use strict";r(87884)},89503:(t,e,r)=>{"use strict";r(95879)},86247:(t,e,r)=>{"use strict";var i=r(67697),n=r(62148),s=r(22961),o=ArrayBuffer.prototype;i&&!("detached"in o)&&n(o,"detached",{configurable:!0,get:function(){return s(this)}})},43097:(t,e,r)=>{"use strict";var i=r(79989),n=r(29195);n&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},21412:(t,e,r)=>{"use strict";var i=r(79989),n=r(29195);n&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},4154:(t,e,r)=>{"use strict";r(92176)},7802:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filterReject,s=r(87370);i({target:"Array",proto:!0,forced:!0},{filterOut:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("filterOut")},54883:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filterReject,s=r(87370);i({target:"Array",proto:!0,forced:!0},{filterReject:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("filterReject")},20097:(t,e,r)=>{"use strict";r(93383)},38197:(t,e,r)=>{"use strict";r(59867)},18073:(t,e,r)=>{"use strict";r(79989)({target:"Array",stat:!0},{fromAsync:r(2231)})},96882:(t,e,r)=>{"use strict";var i=r(79989),n=r(16834),s=r(87370),o=r(44416);i({target:"Array",proto:!0,name:"groupToMap",forced:r(53931)||!n("groupByToMap")},{groupByToMap:o}),s("groupByToMap")},22525:(t,e,r)=>{"use strict";var i=r(79989),n=r(64976),s=r(16834),o=r(87370);i({target:"Array",proto:!0,forced:!s("groupBy")},{groupBy:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),o("groupBy")},32539:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370),s=r(44416);i({target:"Array",proto:!0,forced:r(53931)},{groupToMap:s}),n("groupToMap")},36208:(t,e,r)=>{"use strict";var i=r(79989),n=r(64976),s=r(87370);i({target:"Array",proto:!0},{group:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("group")},5082:(t,e,r)=>{"use strict";var i=r(79989),n=r(92297),s=Object.isFrozen,o=function(t,e){if(!s||!n(t)||!s(t))return!1;for(var r,i=0,o=t.length;i{"use strict";var i=r(67697),n=r(87370),s=r(90690),o=r(6310),a=r(62148);i&&(a(Array.prototype,"lastIndex",{configurable:!0,get:function(){var t=s(this),e=o(t);return 0===e?0:e-1}}),n("lastIndex"))},32221:(t,e,r)=>{"use strict";var i=r(67697),n=r(87370),s=r(90690),o=r(6310),a=r(62148);i&&(a(Array.prototype,"lastItem",{configurable:!0,get:function(){var t=s(this),e=o(t);return 0===e?void 0:t[e-1]},set:function(t){var e=s(this),r=o(e);return e[0===r?0:r-1]=t}}),n("lastItem"))},67890:(t,e,r)=>{"use strict";r(29830)},47041:(t,e,r)=>{"use strict";r(12894)},86322:(t,e,r)=>{"use strict";r(93530)},92253:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370);i({target:"Array",proto:!0,forced:!0},{uniqueBy:r(12397)}),n("uniqueBy")},97554:(t,e,r)=>{"use strict";r(21319)},11070:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(76058),o=r(10509),a=r(767),l=r(11880),c=r(6045),h=r(62148),u=r(44201),d=r(618),p=r(29199),f=s("Promise"),m=s("SuppressedError"),g=ReferenceError,A=u("asyncDispose"),y=u("toStringTag"),v="AsyncDisposableStack",x=d.set,b=d.getterFor(v),_="async-dispose",w="disposed",E=function(t){var e=b(t);if(e.state===w)throw new g(v+" already disposed");return e},M=function(){x(a(this,S),{type:v,state:"pending",stack:[]}),n||(this.disposed=!1)},S=M.prototype;c(S,{disposeAsync:function(){var t=this;return new f((function(e,r){var i=b(t);if(i.state===w)return e(void 0);i.state=w,n||(t.disposed=!0);var s,o=i.stack,a=o.length,l=!1,c=function(t){l?s=new m(t,s):(l=!0,s=t),h()},h=function(){if(a){var t=o[--a];o[a]=null;try{f.resolve(t()).then(h,c)}catch(t){c(t)}}else i.stack=null,l?r(s):e(void 0)};h()}))},use:function(t){return p(E(this),t,_),t},adopt:function(t,e){var r=E(this);return o(e),p(r,void 0,_,(function(){return e(t)})),t},defer:function(t){var e=E(this);o(t),p(e,void 0,_,t)},move:function(){var t=E(this),e=new M;return b(e).stack=t.stack,t.stack=[],t.state=w,n||(this.disposed=!0),e}}),n&&h(S,"disposed",{configurable:!0,get:function(){return b(this).state===w}}),l(S,A,S.disposeAsync,{name:"disposeAsync"}),l(S,y,v,{nonWritable:!0}),i({global:!0,constructor:!0},{AsyncDisposableStack:M})},77299:(t,e,r)=>{"use strict";r(79989)({target:"AsyncIterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(40164)})},15694:(t,e,r)=>{"use strict";var i=r(22615),n=r(11880),s=r(76058),o=r(54849),a=r(36812),l=r(44201),c=r(23070),h=l("asyncDispose"),u=s("Promise");a(c,h)||n(c,h,(function(){var t=this;return new u((function(e,r){var n=o(t,"return");n?u.resolve(i(n,t)).then((function(){e(void 0)}),r):e(void 0)}))}))},64578:(t,e,r)=>{"use strict";var i=r(79989),n=r(767),s=r(61868),o=r(75773),a=r(36812),l=r(44201),c=r(23070),h=r(53931),u=l("toStringTag"),d=TypeError,p=function(){if(n(this,c),s(this)===c)throw new d("Abstract class AsyncIterator not directly constructable")};p.prototype=c,a(c,u)||o(c,u,"AsyncIterator"),!h&&a(c,"constructor")&&c.constructor!==Object||o(c,"constructor",p),i({global:!0,constructor:!0,forced:h},{AsyncIterator:p})},17815:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(17394),h=r(27807),u=r(53931),d=c((function(t){var e=this;return new t((function(r,i){var o=function(t){e.done=!0,i(t)},a=function(){try{t.resolve(s(n(e.next,e.iterator))).then((function(t){try{s(t).done?(e.done=!0,r(h(void 0,!0))):e.remaining?(e.remaining--,a()):r(h(t.value,!1))}catch(t){o(t)}}),o)}catch(t){o(t)}};a()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:u},{drop:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},19029:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).every;i({target:"AsyncIterator",proto:!0,real:!0},{every:function(t){return n(this,t)}})},6237:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(22302),c=r(17394),h=r(27807),u=r(52399),d=r(53931),p=c((function(t){var e=this,r=e.iterator,i=e.predicate;return new t((function(s,l){var c=function(t){e.done=!0,l(t)},d=function(t){u(r,c,t,c)},p=function(){try{t.resolve(o(n(e.next,r))).then((function(r){try{if(o(r).done)e.done=!0,s(h(void 0,!0));else{var n=r.value;try{var l=i(n,e.counter++),u=function(t){t?s(h(n,!1)):p()};a(l)?t.resolve(l).then(u,d):u(l)}catch(t){d(t)}}}catch(t){c(t)}}),c)}catch(t){c(t)}};p()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:d},{filter:function(t){return o(this),s(t),new p(l(this),{predicate:t})}})},81954:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).find;i({target:"AsyncIterator",proto:!0,real:!0},{find:function(t){return n(this,t)}})},87152:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(22302),c=r(17394),h=r(27807),u=r(11427),d=r(52399),p=r(53931),f=c((function(t){var e=this,r=e.iterator,i=e.mapper;return new t((function(s,l){var c=function(t){e.done=!0,l(t)},p=function(t){d(r,c,t,c)},f=function(){try{t.resolve(o(n(e.next,r))).then((function(r){try{if(o(r).done)e.done=!0,s(h(void 0,!0));else{var n=r.value;try{var l=i(n,e.counter++),d=function(t){try{e.inner=u(t),m()}catch(t){p(t)}};a(l)?t.resolve(l).then(d,p):d(l)}catch(t){p(t)}}}catch(t){c(t)}}),c)}catch(t){c(t)}},m=function(){var r=e.inner;if(r)try{t.resolve(o(n(r.next,r.iterator))).then((function(t){try{o(t).done?(e.inner=null,f()):s(h(t.value,!1))}catch(t){p(t)}}),p)}catch(t){p(t)}else f()};m()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:p},{flatMap:function(t){return o(this),s(t),new f(l(this),{mapper:t,inner:null})}})},89667:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).forEach;i({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(t){return n(this,t)}})},49118:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(23622),o=r(11427),a=r(23070),l=r(40219);i({target:"AsyncIterator",stat:!0,forced:r(53931)},{from:function(t){var e=o("string"==typeof t?n(t):t);return s(a,e.iterator)?e.iterator:new l(e)}})},32411:(t,e,r)=>{"use strict";r(79989)({target:"AsyncIterator",proto:!0,real:!0,forced:!0},{indexed:r(40164)})},3256:(t,e,r)=>{"use strict";var i=r(79989),n=r(82412);i({target:"AsyncIterator",proto:!0,real:!0,forced:r(53931)},{map:n})},85625:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(76058),c=r(22302),h=r(52399),u=l("Promise"),d=TypeError;i({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(t){o(this),s(t);var e=c(this),r=e.iterator,i=e.next,l=arguments.length<2,p=l?void 0:arguments[1],f=0;return new u((function(e,s){var c=function(t){h(r,s,t,s)},m=function(){try{u.resolve(o(n(i,r))).then((function(r){try{if(o(r).done)l?s(new d("Reduce of empty iterator with no initial value")):e(p);else{var i=r.value;if(l)l=!1,p=i,m();else try{var n=t(p,i,f),h=function(t){p=t,m()};a(n)?u.resolve(n).then(h,c):h(n)}catch(t){c(t)}}f++}catch(t){s(t)}}),s)}catch(t){s(t)}};m()}))}})},10914:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).some;i({target:"AsyncIterator",proto:!0,real:!0},{some:function(t){return n(this,t)}})},14494:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(17394),h=r(27807),u=r(53931),d=c((function(t){var e,r=this,i=r.iterator;if(!r.remaining--){var o=h(void 0,!0);return r.done=!0,void 0!==(e=i.return)?t.resolve(n(e,i,void 0)).then((function(){return o})):o}return t.resolve(n(r.next,i)).then((function(t){return s(t).done?(r.done=!0,h(void 0,!0)):h(t.value,!1)})).then(null,(function(t){throw r.done=!0,t}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:u},{take:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},9468:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).toArray;i({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return n(this,void 0,[])}})},24587:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554);"function"==typeof BigInt&&i({target:"BigInt",stat:!0,forced:!0},{range:function(t,e,r){return new n(t,e,r,"bigint",BigInt(0),BigInt(1))}})},60779:(t,e,r)=>{"use strict";var i=r(79989),n=r(61735),s=r(41544),o=r(76058),a=r(25391),l=Object,c=function(){var t=o("Object","freeze");return t?t(a(null)):a(null)};i({global:!0,forced:!0},{compositeKey:function(){return n(s,l,arguments).get("object",c)}})},65503:(t,e,r)=>{"use strict";var i=r(79989),n=r(41544),s=r(76058),o=r(61735);i({global:!0,forced:!0},{compositeSymbol:function(){return 1===arguments.length&&"string"==typeof arguments[0]?s("Symbol").for(arguments[0]):o(n,null,arguments).get("symbol",s("Symbol"))}})},50236:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(15477).unpack,o=n(DataView.prototype.getUint16);i({target:"DataView",proto:!0},{getFloat16:function(t){var e=o(this,t,arguments.length>1&&arguments[1]);return s([255&e,e>>8&255],10)}})},89246:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844)(DataView.prototype.getUint8);i({target:"DataView",proto:!0,forced:!0},{getUint8Clamped:function(t){return n(this,t)}})},31186:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(50926),o=r(19842),a=r(15477).pack,l=r(76043),c=TypeError,h=n(DataView.prototype.setUint16);i({target:"DataView",proto:!0},{setFloat16:function(t,e){if("DataView"!==s(this))throw new c("Incorrect receiver");var r=o(t),i=a(l(e),10,2);return h(this,r,i[1]<<8|i[0],arguments.length>2&&arguments[2])}})},9279:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(50926),o=r(19842),a=r(87191),l=TypeError,c=n(DataView.prototype.setUint8);i({target:"DataView",proto:!0,forced:!0},{setUint8Clamped:function(t,e){if("DataView"!==s(this))throw new l("Incorrect receiver");var r=o(t);return c(this,r,a(e))}})},26725:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(76058),o=r(10509),a=r(767),l=r(11880),c=r(6045),h=r(62148),u=r(44201),d=r(618),p=r(29199),f=s("SuppressedError"),m=ReferenceError,g=u("dispose"),A=u("toStringTag"),y="DisposableStack",v=d.set,x=d.getterFor(y),b="sync-dispose",_="disposed",w=function(t){var e=x(t);if(e.state===_)throw new m(y+" already disposed");return e},E=function(){v(a(this,M),{type:y,state:"pending",stack:[]}),n||(this.disposed=!1)},M=E.prototype;c(M,{dispose:function(){var t=x(this);if(t.state!==_){t.state=_,n||(this.disposed=!0);for(var e,r=t.stack,i=r.length,s=!1;i;){var o=r[--i];r[i]=null;try{o()}catch(t){s?e=new f(t,e):(s=!0,e=t)}}if(t.stack=null,s)throw e}},use:function(t){return p(w(this),t,b),t},adopt:function(t,e){var r=w(this);return o(e),p(r,void 0,b,(function(){e(t)})),t},defer:function(t){var e=w(this);o(t),p(e,void 0,b,t)},move:function(){var t=w(this),e=new E;return x(e).stack=t.stack,t.stack=[],t.state=_,n||(this.disposed=!0),e}}),n&&h(M,"disposed",{configurable:!0,get:function(){return x(this).state===_}}),l(M,g,M.dispose,{name:"dispose"}),l(M,A,y,{nonWritable:!0}),i({global:!0,constructor:!0},{DisposableStack:E})},26125:(t,e,r)=>{"use strict";r(79989)({target:"Function",proto:!0,forced:!0},{demethodize:r(33505)})},2820:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(69985),o=r(6738),a=r(36812),l=r(67697),c=Object.getOwnPropertyDescriptor,h=/^\s*class\b/,u=n(h.exec);i({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(t){return s(t)&&!function(t){try{if(!l||!u(h,o(t)))return!1}catch(t){}var e=c(t,"prototype");return!!e&&a(e,"writable")&&!e.writable}(t)}})},62517:(t,e,r)=>{"use strict";r(79989)({target:"Function",stat:!0,forced:!0},{isConstructor:r(19429)})},54947:(t,e,r)=>{"use strict";var i=r(44201),n=r(72560).f,s=i("metadata"),o=Function.prototype;void 0===o[s]&&n(o,s,{value:null})},74993:(t,e,r)=>{"use strict";r(79989)({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:r(33505)})},78832:(t,e,r)=>{"use strict";r(45398)},50647:(t,e,r)=>{"use strict";r(79989)({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(47082)})},67602:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(767),o=r(85027),a=r(69985),l=r(61868),c=r(62148),h=r(76522),u=r(3689),d=r(36812),p=r(44201),f=r(12013).IteratorPrototype,m=r(67697),g=r(53931),A="constructor",y="Iterator",v=p("toStringTag"),x=TypeError,b=n[y],_=g||!a(b)||b.prototype!==f||!u((function(){b({})})),w=function(){if(s(this,f),l(this)===f)throw new x("Abstract class Iterator not directly constructable")},E=function(t,e){m?c(f,t,{configurable:!0,get:function(){return e},set:function(e){if(o(this),this===f)throw new x("You can't redefine this property");d(this,t)?this[t]=e:h(this,t,e)}}):f[t]=e};d(f,v)||E(v,y),!_&&d(f,A)&&f[A]!==Object||E(A,w),w.prototype=f,i({global:!0,constructor:!0,forced:_},{Iterator:w})},82639:(t,e,r)=>{"use strict";var i=r(22615),n=r(11880),s=r(54849),o=r(36812),a=r(44201),l=r(12013).IteratorPrototype,c=a("dispose");o(l,c)||n(l,c,(function(){var t=s(this,"return");t&&i(t,this)}))},63986:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(65419),h=r(53931),u=c((function(){for(var t,e=this.iterator,r=this.next;this.remaining;)if(this.remaining--,t=s(n(r,e)),this.done=!!t.done)return;if(t=s(n(r,e)),!(this.done=!!t.done))return t.value}));i({target:"Iterator",proto:!0,real:!0,forced:h},{drop:function(t){s(this);var e=l(a(+t));return new u(o(this),{remaining:e})}})},16054:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{every:function(t){o(this),s(t);var e=a(this),r=0;return!n(e,(function(e,i){if(!t(e,r++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},53476:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(22302),l=r(65419),c=r(71228),h=r(53931),u=l((function(){for(var t,e,r=this.iterator,i=this.predicate,s=this.next;;){if(t=o(n(s,r)),this.done=!!t.done)return;if(e=t.value,c(r,i,[e,this.counter++],!0))return e}}));i({target:"Iterator",proto:!0,real:!0,forced:h},{filter:function(t){return o(this),s(t),new u(a(this),{predicate:t})}})},70928:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{find:function(t){o(this),s(t);var e=a(this),r=0;return n(e,(function(e,i){if(t(e,r++))return i(e)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},49411:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(22302),l=r(36752),c=r(65419),h=r(72125),u=r(53931),d=c((function(){for(var t,e,r=this.iterator,i=this.mapper;;){if(e=this.inner)try{if(!(t=o(n(e.next,e.iterator))).done)return t.value;this.inner=null}catch(t){h(r,"throw",t)}if(t=o(n(this.next,r)),this.done=!!t.done)return;try{this.inner=l(i(t.value,this.counter++),!1)}catch(t){h(r,"throw",t)}}}));i({target:"Iterator",proto:!0,real:!0,forced:u},{flatMap:function(t){return o(this),s(t),new d(a(this),{mapper:t,inner:null})}})},30005:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{forEach:function(t){o(this),s(t);var e=a(this),r=0;n(e,(function(e){t(e,r++)}),{IS_RECORD:!0})}})},73494:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(90690),o=r(23622),a=r(12013).IteratorPrototype,l=r(65419),c=r(36752),h=r(53931),u=l((function(){return n(this.next,this.iterator)}),!0);i({target:"Iterator",stat:!0,forced:h},{from:function(t){var e=c("string"==typeof t?s(t):t,!0);return o(a,e.iterator)?e.iterator:new u(e)}})},94564:(t,e,r)=>{"use strict";r(79989)({target:"Iterator",proto:!0,real:!0,forced:!0},{indexed:r(47082)})},41792:(t,e,r)=>{"use strict";var i=r(79989),n=r(88983);i({target:"Iterator",proto:!0,real:!0,forced:r(53931)},{map:n})},5985:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554),s=TypeError;i({target:"Iterator",stat:!0,forced:!0},{range:function(t,e,r){if("number"==typeof t)return new n(t,e,r,"number",0,1);if("bigint"==typeof t)return new n(t,e,r,"bigint",BigInt(0),BigInt(1));throw new s("Incorrect Iterator.range arguments")}})},31107:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302),l=TypeError;i({target:"Iterator",proto:!0,real:!0},{reduce:function(t){o(this),s(t);var e=a(this),r=arguments.length<2,i=r?void 0:arguments[1],c=0;if(n(e,(function(e){r?(r=!1,i=e):i=t(i,e,c),c++}),{IS_RECORD:!0}),r)throw new l("Reduce of empty iterator with no initial value");return i}})},28244:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{some:function(t){o(this),s(t);var e=a(this),r=0;return n(e,(function(e,i){if(t(e,r++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3645:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(65419),h=r(72125),u=r(53931),d=c((function(){var t=this.iterator;if(!this.remaining--)return this.done=!0,h(t,"normal",void 0);var e=s(n(this.next,t));return(this.done=!!e.done)?void 0:e.value}));i({target:"Iterator",proto:!0,real:!0,forced:u},{take:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},58429:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(18734),o=r(22302),a=[].push;i({target:"Iterator",proto:!0,real:!0},{toArray:function(){var t=[];return s(o(n(this)),a,{that:t,IS_RECORD:!0}),t}})},39569:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(29019),o=r(40219),a=r(22302);i({target:"Iterator",proto:!0,real:!0,forced:r(53931)},{toAsync:function(){return new o(a(new s(a(n(this)))))}})},74320:(t,e,r)=>{"use strict";r(79989)({target:"JSON",stat:!0,forced:!r(22818)},{isRawJSON:r(55670)})},20691:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19037),o=r(76058),a=r(68844),l=r(22615),c=r(69985),h=r(48999),u=r(92297),d=r(36812),p=r(34327),f=r(6310),m=r(76522),g=r(3689),A=r(46675),y=r(50146),v=s.JSON,x=s.Number,b=s.SyntaxError,_=v&&v.parse,w=o("Object","keys"),E=Object.getOwnPropertyDescriptor,M=a("".charAt),S=a("".slice),C=a(/./.exec),T=a([].push),I=/^\d$/,R=/^[1-9]$/,B=/^(?:-|\d)$/,L=/^[\t\n\r ]$/,P=function(t,e,r,i){var n,s,o,a,c,p=t[e],m=i&&p===i.value,g=m&&"string"==typeof i.source?{source:i.source}:{};if(h(p)){var A=u(p),y=m?i.nodes:A?[]:{};if(A)for(n=y.length,o=f(p),a=0;a{"use strict";var i=r(79989),n=r(71594),s=r(22818),o=r(76058),a=r(22615),l=r(68844),c=r(69985),h=r(55670),u=r(34327),d=r(76522),p=r(46675),f=r(92643),m=r(14630),g=r(618).set,A=String,y=SyntaxError,v=o("JSON","parse"),x=o("JSON","stringify"),b=o("Object","create"),_=o("Object","freeze"),w=l("".charAt),E=l("".slice),M=l(/./.exec),S=l([].push),C=m(),T=C.length,I="Unacceptable as raw JSON",R=/^[\t\n\r ]$/;i({target:"JSON",stat:!0,forced:!s},{rawJSON:function(t){var e=u(t);if(""===e||M(R,w(e,0))||M(R,w(e,e.length-1)))throw new y(I);var r=v(e);if("object"==typeof r&&null!==r)throw new y(I);var i=b(null);return g(i,{type:"RawJSON"}),d(i,"rawJSON",e),n?_(i):i}}),x&&i({target:"JSON",stat:!0,arity:3,forced:!s},{stringify:function(t,e,r){var i=f(e),n=[],s=x(t,(function(t,e){var r=c(i)?a(i,this,A(t),e):e;return h(r)?C+(S(n,r.rawJSON)-1):r}),r);if("string"!=typeof s)return s;for(var o="",l=s.length,u=0;u{"use strict";var i=r(79989),n=r(9945),s=r(83914).remove;i({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(9945),s=r(83914),o=s.get,a=s.has,l=s.set;i({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,i,s=n(this);return a(s,t)?(r=o(s,t),"update"in e&&(r=e.update(r,t,s),l(s,t,r)),r):(i=e.insert(t,s),l(s,t,i),i)}})},747:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!1!==o(e,(function(t,i){if(!r(t,i,e))return!1}),!0)}})},41099:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){r(t,n,e)&&c(i,n,t)})),i}})},20876:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t,i){if(r(t,i,e))return{key:i}}),!0);return i&&i.key}})},26320:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t,i){if(r(t,i,e))return{value:t}}),!0);return i&&i.value}})},6052:(t,e,r)=>{"use strict";r(79989)({target:"Map",stat:!0,forced:!0},{from:r(28737)})},39879:(t,e,r)=>{"use strict";r(89348)},76791:(t,e,r)=>{"use strict";var i=r(79989),n=r(68600),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(t){return!0===o(s(this),(function(e){if(n(e,t))return!0}),!0)}})},75341:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(18734),o=r(69985),a=r(10509),l=r(83914).Map;i({target:"Map",stat:!0,forced:!0},{keyBy:function(t,e){var r=new(o(this)?this:l);a(e);var i=a(r.set);return s(t,(function(t){n(i,r,e(t),t)})),r}})},40019:(t,e,r)=>{"use strict";var i=r(79989),n=r(9945),s=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(t){var e=s(n(this),(function(e,r){if(e===t)return{key:r}}),!0);return e&&e.key}})},92343:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){c(i,r(t,n,e),t)})),i}})},51096:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){c(i,n,r(t,n,e))})),i}})},4314:(t,e,r)=>{"use strict";var i=r(79989),n=r(9945),s=r(18734),o=r(83914).set;i({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(t){for(var e=n(this),r=arguments.length,i=0;i{"use strict";r(79989)({target:"Map",stat:!0,forced:!0},{of:r(1114)})},23346:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(9945),o=r(10613),a=TypeError;i({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),r=arguments.length<2,i=r?void 0:arguments[1];if(n(t),o(e,(function(n,s){r?(r=!1,i=n):i=t(i,n,s,e)})),r)throw new a("Reduce of empty map with no initial value");return i}})},64984:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!0===o(e,(function(t,i){if(r(t,i,e))return!0}),!0)}})},24453:(t,e,r)=>{"use strict";r(79989)({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:r(41432)})},64078:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(9945),o=r(83914),a=TypeError,l=o.get,c=o.has,h=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{update:function(t,e){var r=s(this),i=arguments.length;n(e);var o=c(r,t);if(!o&&i<3)throw new a("Updating absent value");var u=o?l(r,t):n(i>2?arguments[2]:void 0)(t,r);return h(r,t,e(u,t,r)),r}})},66190:(t,e,r)=>{"use strict";r(79989)({target:"Map",proto:!0,real:!0,forced:!0},{upsert:r(41432)})},25684:(t,e,r)=>{"use strict";var i=r(79989),n=Math.min,s=Math.max;i({target:"Math",stat:!0,forced:!0},{clamp:function(t,e,r){return n(r,s(e,t))}})},31789:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180})},8677:(t,e,r)=>{"use strict";var i=r(79989),n=180/Math.PI;i({target:"Math",stat:!0,forced:!0},{degrees:function(t){return t*n}})},59151:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{f16round:r(76043)})},346:(t,e,r)=>{"use strict";var i=r(79989),n=r(84463),s=r(37788);i({target:"Math",stat:!0,forced:!0},{fscale:function(t,e,r,i,o){return s(n(t,e,r,i,o))}})},91069:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{iaddh:function(t,e,r,i){var n=t>>>0,s=r>>>0;return(e>>>0)+(i>>>0)+((n&s|(n|s)&~(n+s>>>0))>>>31)|0}})},18886:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{imulh:function(t,e){var r=65535,i=+t,n=+e,s=i&r,o=n&r,a=i>>16,l=n>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>16)+((s*l>>>0)+(c&r)>>16)}})},88065:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{isubh:function(t,e,r,i){var n=t>>>0,s=r>>>0;return(e>>>0)-(i>>>0)-((~n&s|~(n^s)&n-s>>>0)>>>31)|0}})},68172:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},60445:(t,e,r)=>{"use strict";var i=r(79989),n=Math.PI/180;i({target:"Math",stat:!0,forced:!0},{radians:function(t){return t*n}})},99457:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{scale:r(84463)})},613:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(70046),o=r(30974),a=r(27807),l=r(618),c="Seeded Random",h=c+" Generator",u=l.set,d=l.getterFor(h),p=TypeError,f=o((function(t){u(this,{type:h,seed:t%2147483647})}),c,(function(){var t=d(this),e=t.seed=(1103515245*t.seed+12345)%2147483647;return a((1073741823&e)/1073741823,!1)}));i({target:"Math",stat:!0,forced:!0},{seededPRNG:function(t){var e=n(t).seed;if(!s(e))throw new p('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new f(e)}})},835:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{signbit:function(t){var e=+t;return e==e&&0===e?1/e==-1/0:e<0}})},926:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{umulh:function(t,e){var r=65535,i=+t,n=+e,s=i&r,o=n&r,a=i>>>16,l=n>>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>>16)+((s*l>>>0)+(c&r)>>>16)}})},82899:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o="Invalid number representation",a=RangeError,l=SyntaxError,c=TypeError,h=parseInt,u=Math.pow,d=/^[\d.a-z]+$/,p=n("".charAt),f=n(d.exec),m=n(1..toString),g=n("".slice),A=n("".split);i({target:"Number",stat:!0,forced:!0},{fromString:function(t,e){var r=1;if("string"!=typeof t)throw new c(o);if(!t.length)throw new l(o);if("-"===p(t,0)&&(r=-1,!(t=g(t,1)).length))throw new l(o);var i=void 0===e?10:s(e);if(i<2||i>36)throw new a("Invalid radix");if(!f(d,t))throw new l(o);var n=A(t,"."),y=h(n[0],i);if(n.length>1&&(y+=h(n[1],i)/u(i,n[1].length)),10===i&&m(y,i)!==t)throw new l(o);return r*y}})},29977:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554);i({target:"Number",stat:!0,forced:!0},{range:function(t,e,r){return new n(t,e,r,"number",0,1)}})},3210:(t,e,r)=>{"use strict";r(44079)},53669:(t,e,r)=>{"use strict";r(14566)},31927:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateEntries:function(t){return new n(t,"entries")}})},77131:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateKeys:function(t){return new n(t,"keys")}})},55174:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateValues:function(t){return new n(t,"values")}})},63503:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(67697),o=r(14241),a=r(10509),l=r(85027),c=r(767),h=r(69985),u=r(981),d=r(48999),p=r(54849),f=r(11880),m=r(6045),g=r(62148),A=r(20920),y=r(44201),v=r(618),x=y("observable"),b="Observable",_="Subscription",w="SubscriptionObserver",E=v.getterFor,M=v.set,S=E(b),C=E(_),T=E(w),I=function(t){this.observer=l(t),this.cleanup=void 0,this.subscriptionObserver=void 0};I.prototype={type:_,clean:function(){var t=this.cleanup;if(t){this.cleanup=void 0;try{t()}catch(t){A(t)}}},close:function(){if(!s){var t=this.facade,e=this.subscriptionObserver;t.closed=!0,e&&(e.closed=!0)}this.observer=void 0},isClosed:function(){return void 0===this.observer}};var R=function(t,e){var r,i=M(this,new I(t));s||(this.closed=!1);try{(r=p(t,"start"))&&n(r,t,this)}catch(t){A(t)}if(!i.isClosed()){var o=i.subscriptionObserver=new B(i);try{var l=e(o),c=l;u(l)||(i.cleanup=h(l.unsubscribe)?function(){c.unsubscribe()}:a(l))}catch(t){return void o.error(t)}i.isClosed()&&i.clean()}};R.prototype=m({},{unsubscribe:function(){var t=C(this);t.isClosed()||(t.close(),t.clean())}}),s&&g(R.prototype,"closed",{configurable:!0,get:function(){return C(this).isClosed()}});var B=function(t){M(this,{type:w,subscriptionState:t}),s||(this.closed=!1)};B.prototype=m({},{next:function(t){var e=T(this).subscriptionState;if(!e.isClosed()){var r=e.observer;try{var i=p(r,"next");i&&n(i,r,t)}catch(t){A(t)}}},error:function(t){var e=T(this).subscriptionState;if(!e.isClosed()){var r=e.observer;e.close();try{var i=p(r,"error");i?n(i,r,t):A(t)}catch(t){A(t)}e.clean()}},complete:function(){var t=T(this).subscriptionState;if(!t.isClosed()){var e=t.observer;t.close();try{var r=p(e,"complete");r&&n(r,e)}catch(t){A(t)}t.clean()}}}),s&&g(B.prototype,"closed",{configurable:!0,get:function(){return T(this).subscriptionState.isClosed()}});var L=function(t){c(this,P),M(this,{type:b,subscriber:a(t)})},P=L.prototype;m(P,{subscribe:function(t){var e=arguments.length;return new R(h(t)?{next:t,error:e>1?arguments[1]:void 0,complete:e>2?arguments[2]:void 0}:d(t)?t:{},S(this).subscriber)}}),f(P,x,(function(){return this})),i({global:!0,constructor:!0,forced:!0},{Observable:L}),o(b)},9818:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(22615),o=r(85027),a=r(19429),l=r(5185),c=r(54849),h=r(18734),u=r(44201)("observable");i({target:"Observable",stat:!0,forced:!0},{from:function(t){var e=a(this)?this:n("Observable"),r=c(o(t),u);if(r){var i=o(s(r,t));return i.constructor===e?i:new e((function(t){return i.subscribe(t)}))}var d=l(t);return new e((function(t){h(d,(function(e,r){if(t.next(e),t.closed)return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),t.complete()}))}})},76314:(t,e,r)=>{"use strict";r(63503),r(9818),r(38771)},38771:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(19429),o=n("Array");i({target:"Observable",stat:!0,forced:!0},{of:function(){for(var t=s(this)?this:n("Observable"),e=arguments.length,r=o(e),i=0;i{"use strict";r(41195)},40393:(t,e,r)=>{"use strict";r(87609)},6616:(t,e,r)=>{"use strict";var i=r(79989),n=r(48742),s=r(9302);i({target:"Promise",stat:!0,forced:!0},{try:function(t){var e=n.f(this),r=s(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}})},90810:(t,e,r)=>{"use strict";r(13505)},19959:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.set;i({target:"Reflect",stat:!0},{defineMetadata:function(t,e,r){var i=arguments.length<4?void 0:o(arguments[3]);a(t,e,s(r),i)}})},73347:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.getMap,l=n.store;i({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var r=arguments.length<3?void 0:o(arguments[2]),i=a(s(e),r,!1);if(void 0===i||!i.delete(t))return!1;if(i.size)return!0;var n=l.get(e);return n.delete(r),!!n.size||l.delete(e)}})},70003:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(33666),o=r(85027),a=r(61868),l=n(r(12397)),c=n([].concat),h=s.keys,u=s.toKey,d=function(t,e){var r=h(t,e),i=a(t);if(null===i)return r;var n=d(i,e);return n.length?r.length?l(c(r,n)):n:r};i({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:u(arguments[1]);return d(o(t),e)}})},71913:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=r(61868),a=n.has,l=n.get,c=n.toKey,h=function(t,e,r){if(a(t,e,r))return l(t,e,r);var i=o(e);return null!==i?h(t,i,r):void 0};i({target:"Reflect",stat:!0},{getMetadata:function(t,e){var r=arguments.length<3?void 0:c(arguments[2]);return h(t,s(e),r)}})},7859:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.keys,a=n.toKey;i({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:a(arguments[1]);return o(s(t),e)}})},79955:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.get,a=n.toKey;i({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var r=arguments.length<3?void 0:a(arguments[2]);return o(t,s(e),r)}})},31138:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=r(61868),a=n.has,l=n.toKey,c=function(t,e,r){if(a(t,e,r))return!0;var i=o(e);return null!==i&&c(t,i,r)};i({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var r=arguments.length<3?void 0:l(arguments[2]);return c(t,s(e),r)}})},28809:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.has,a=n.toKey;i({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var r=arguments.length<3?void 0:a(arguments[2]);return o(t,s(e),r)}})},2946:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.set;i({target:"Reflect",stat:!0},{metadata:function(t,e){return function(r,i){a(t,e,s(r),o(i))}}})},32460:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=r(86350),a=n("".charCodeAt),l=n("".replace),c=RegExp("[!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^`{|}~"+o+"]","g");i({target:"RegExp",stat:!0,forced:!0},{escape:function(t){var e=s(t),r=a(e,0);return(r>47&&r<58?"\\x3":"")+l(e,c,"\\$&")}})},57282:(t,e,r)=>{"use strict";var i=r(79989),n=r(10029),s=r(61034).add;i({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,r=arguments.length;e{"use strict";var i=r(79989),n=r(10029),s=r(61034).remove;i({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(27748);i({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(t){return n(o,this,s(t))}})},15716:(t,e,r)=>{"use strict";var i=r(79989),n=r(27748);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("difference")},{difference:n})},30349:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!1!==o(e,(function(t){if(!r(t,t,e))return!1}),!0)}})},96986:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(61034),a=r(48774),l=o.Set,c=o.add;i({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t){r(t,t,e)&&c(i,t)})),i}})},95681:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t){if(r(t,t,e))return{value:t}}),!0);return i&&i.value}})},13781:(t,e,r)=>{"use strict";r(79989)({target:"Set",stat:!0,forced:!0},{from:r(28737)})},98873:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(72948);i({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(t){return n(o,this,s(t))}})},33442:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(72948);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("intersection")||n((function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:s})},50308:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(97795);i({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(t){return n(o,this,s(t))}})},61964:(t,e,r)=>{"use strict";var i=r(79989),n=r(97795);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isDisjointFrom")},{isDisjointFrom:n})},18955:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(26951);i({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(t){return n(o,this,s(t))}})},69878:(t,e,r)=>{"use strict";var i=r(79989),n=r(26951);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isSubsetOf")},{isSubsetOf:n})},65115:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(3894);i({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(t){return n(o,this,s(t))}})},52915:(t,e,r)=>{"use strict";var i=r(79989),n=r(3894);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isSupersetOf")},{isSupersetOf:n})},19490:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10029),o=r(48774),a=r(34327),l=n([].join),c=n([].push);i({target:"Set",proto:!0,real:!0,forced:!0},{join:function(t){var e=s(this),r=void 0===t?",":a(t),i=[];return o(e,(function(t){c(i,t)})),l(i,r)}})},95752:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(61034),a=r(48774),l=o.Set,c=o.add;i({target:"Set",proto:!0,real:!0,forced:!0},{map:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t){c(i,r(t,t,e))})),i}})},32789:(t,e,r)=>{"use strict";r(79989)({target:"Set",stat:!0,forced:!0},{of:r(1114)})},27913:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(10029),o=r(48774),a=TypeError;i({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),r=arguments.length<2,i=r?void 0:arguments[1];if(n(t),o(e,(function(n){r?(r=!1,i=n):i=t(i,n,n,e)})),r)throw new a("Reduce of empty set with no initial value");return i}})},6831:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!0===o(e,(function(t){if(r(t,t,e))return!0}),!0)}})},90243:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(62289);i({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(t){return n(o,this,s(t))}})},98686:(t,e,r)=>{"use strict";var i=r(79989),n=r(62289);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("symmetricDifference")},{symmetricDifference:n})},98030:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(75674);i({target:"Set",proto:!0,real:!0,forced:!0},{union:function(t){return n(o,this,s(t))}})},22275:(t,e,r)=>{"use strict";var i=r(79989),n=r(75674);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("union")},{union:n})},86220:(t,e,r)=>{"use strict";var i=r(79989),n=r(10730).charAt,s=r(74684),o=r(68700),a=r(34327);i({target:"String",proto:!0,forced:!0},{at:function(t){var e=a(s(this)),r=e.length,i=o(t),l=i>=0?i:r+i;return l<0||l>=r?void 0:n(e,l)}})},95853:(t,e,r)=>{"use strict";var i=r(79989),n=r(30974),s=r(27807),o=r(74684),a=r(34327),l=r(618),c=r(10730),h=c.codeAt,u=c.charAt,d="String Iterator",p=l.set,f=l.getterFor(d),m=n((function(t){p(this,{type:d,string:t,index:0})}),"String",(function(){var t,e=f(this),r=e.string,i=e.index;return i>=r.length?s(void 0,!0):(t=u(r,i),e.index+=t.length,s({codePoint:h(t,0),position:i},!1))}));i({target:"String",proto:!0,forced:!0},{codePoints:function(){return new m(a(o(this)))}})},21917:(t,e,r)=>{"use strict";r(79989)({target:"String",stat:!0,forced:!0},{cooked:r(8195)})},66084:(t,e,r)=>{"use strict";var i=r(71594),n=r(79989),s=r(98702),o=r(68844),a=r(61735),l=r(85027),c=r(90690),h=r(69985),u=r(6310),d=r(72560).f,p=r(9015),f=r(16803),m=r(8195),g=r(98985),A=r(86350),y=new f.WeakMap,v=f.get,x=f.has,b=f.set,_=Array,w=TypeError,E=Object.freeze||Object,M=Object.isFrozen,S=Math.min,C=o("".charAt),T=o("".slice),I=o("".split),R=o(/./.exec),B=/([\n\u2028\u2029]|\r\n?)/g,L=RegExp("^["+A+"]*"),P=RegExp("[^"+A+"]"),D="Invalid tag",O=function(t,e){if(void 0===e||t===e)return t;for(var r=0,i=S(t.length,e.length);r0)throw new w("Invalid opening line");e[1]=""}if(p){if(1===e.length||R(P,e[e.length-1]))throw new w("Invalid closing line");e[e.length-2]="",e[e.length-1]=""}for(var f=2;f{"use strict";r(12281)},59012:(t,e,r)=>{"use strict";r(79866)},38320:(t,e,r)=>{"use strict";r(56532)},78988:(t,e,r)=>{"use strict";r(35237)},26810:(t,e,r)=>{"use strict";var i=r(79989),n=r(23622),s=r(61868),o=r(49385),a=r(8758),l=r(25391),c=r(75773),h=r(75684),u=r(65411),d=r(13841),p=r(44201)("toStringTag"),f=Error,m=function(t,e,r){var i,a=n(g,this);return o?i=o(new f,a?s(this):g):(i=a?this:l(g),c(i,p,"Error")),void 0!==r&&c(i,"message",d(r)),u(i,m,i.stack,1),c(i,"error",t),c(i,"suppressed",e),i};o?o(m,f):a(m,f,{name:!0});var g=m.prototype=l(f.prototype,{constructor:h(1,m),message:h(1,""),name:h(1,"SuppressedError")});i({global:!0,constructor:!0,arity:3},{SuppressedError:m})},80546:(t,e,r)=>{"use strict";var i=r(19037),n=r(35405),s=r(72560).f,o=r(82474).f,a=i.Symbol;if(n("asyncDispose"),a){var l=o(a,"asyncDispose");l.enumerable&&l.configurable&&l.writable&&s(a,"asyncDispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},62586:(t,e,r)=>{"use strict";var i=r(19037),n=r(35405),s=r(72560).f,o=r(82474).f,a=i.Symbol;if(n("dispose"),a){var l=o(a,"dispose");l.enumerable&&l.configurable&&l.writable&&s(a,"dispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},46019:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(18992)})},5010:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(18992)})},45749:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(8957)})},4835:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(8957)})},58799:(t,e,r)=>{"use strict";r(35405)("matcher")},27041:(t,e,r)=>{"use strict";r(35405)("metadataKey")},18134:(t,e,r)=>{"use strict";r(35405)("metadata")},44767:(t,e,r)=>{"use strict";r(35405)("observable")},92981:(t,e,r)=>{"use strict";r(35405)("patternMatch")},85044:(t,e,r)=>{"use strict";r(35405)("replaceAll")},96256:(t,e,r)=>{"use strict";r(95194)},18241:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filterReject,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filterOut",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},59359:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filterReject,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filterReject",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},1274:(t,e,r)=>{"use strict";r(82)},54302:(t,e,r)=>{"use strict";r(20522)},76677:(t,e,r)=>{"use strict";var i=r(76058),n=r(52655),s=r(2231),o=r(54872),a=r(59976),l=o.aTypedArrayConstructor;(0,o.exportTypedArrayStaticMethod)("fromAsync",(function(t){var e=this,r=arguments.length,o=r>1?arguments[1]:void 0,c=r>2?arguments[2]:void 0;return new(i("Promise"))((function(r){n(e),r(s(t,o,c))})).then((function(t){return a(l(e),t)}))}),!0)},30548:(t,e,r)=>{"use strict";var i=r(54872),n=r(64976),s=r(47338),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("groupBy",(function(t){var e=arguments.length>1?arguments[1]:void 0;return n(o(this),t,e,s)}),!0)},25298:(t,e,r)=>{"use strict";r(24224)},11882:(t,e,r)=>{"use strict";r(61121)},915:(t,e,r)=>{"use strict";var i=r(54872),n=r(6310),s=r(9401),o=r(27578),a=r(71530),l=r(68700),c=r(3689),h=i.aTypedArray,u=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,p=Math.max,f=Math.min;d("toSpliced",(function(t,e){var r,i,c,d,m,g,A,y=h(this),v=u(y),x=n(y),b=o(t,x),_=arguments.length,w=0;if(0===_)r=i=0;else if(1===_)r=0,i=x-b;else if(i=f(p(l(e),0),x-b),r=_-2){d=new v(r),c=s(d);for(var E=2;E<_;E++)m=arguments[E],d[E-2]=c?a(m):+m}for(A=new v(g=x+r-i);w{"use strict";var i=r(68844),n=r(54872),s=r(59976),o=r(12397),a=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,h=i(o);c("uniqueBy",(function(t){return a(this),s(l(this),h(this,t))}),!0)},17911:(t,e,r)=>{"use strict";r(37133)},23579:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(33425),a=r(51082),l=r(36812),c=r(59976),h=r(18368),u=r(9093),d=h.c2i,p=h.c2iUrl,f=n.Uint8Array,m=n.SyntaxError,g=s("".charAt),A=s("".replace),y=s("".slice),v=s([].push),x=/[\t\n\f\r ]/g,b="Extra bits";f&&i({target:"Uint8Array",stat:!0,forced:!0},{fromBase64:function(t){a(t);var e=arguments.length>1?o(arguments[1]):void 0,r="base64"===u(e)?d:p,i=!!e&&!!e.strict,n=i?t:A(t,x,"");if(n.length%4==0)"=="===y(n,-2)?n=y(n,0,-2):"="===y(n,-1)&&(n=y(n,0,-1));else if(i)throw new m("Input is not correctly padded");var s=n.length%4;switch(s){case 1:throw new m("Bad input length");case 2:n+="AA";break;case 3:n+="A"}for(var h=[],_=0,w=n.length,E=function(t){var e=g(n,_+t);if(!l(r,e))throw new m('Bad char in input: "'+e+'"');return r[e]<<18-6*t};_>16&255,M>>8&255,255&M)}var S=h.length;if(2===s){if(i&&0!==h[S-2])throw new m(b);S-=2}else if(3===s){if(i&&0!==h[S-1])throw new m(b);S--}return c(f,h,S)}})},91117:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(51082),a=n.Uint8Array,l=n.SyntaxError,c=n.parseInt,h=/[^\da-f]/i,u=s(h.exec),d=s("".slice);a&&i({target:"Uint8Array",stat:!0,forced:!0},{fromHex:function(t){o(t);var e=t.length;if(e%2)throw new l("String should have an even number of characters");if(u(h,t))throw new l("String should only contain hex characters");for(var r=new a(e/2),i=0;i{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(33425),a=r(95668),l=r(18368),c=r(9093),h=l.i2c,u=l.i2cUrl,d=n.Uint8Array,p=s("".charAt);d&&i({target:"Uint8Array",proto:!0,forced:!0},{toBase64:function(){for(var t,e=a(this),r=arguments.length?o(arguments[0]):void 0,i="base64"===c(r)?h:u,n="",s=0,l=e.length,d=function(e){return p(i,t>>6*e&63)};s+2{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(95668),a=n.Uint8Array,l=s(1..toString);a&&i({target:"Uint8Array",proto:!0,forced:!0},{toHex:function(){o(this);for(var t="",e=0,r=this.length;e{"use strict";var i=r(79989),n=r(457),s=r(16803).remove;i({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(457),s=r(16803),o=s.get,a=s.has,l=s.set;i({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,i,s=n(this);return a(s,t)?(r=o(s,t),"update"in e&&(r=e.update(r,t,s),l(s,t,r)),r):(i=e.insert(t,s),l(s,t,i),i)}})},99369:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",stat:!0,forced:!0},{from:r(28737)})},22983:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",stat:!0,forced:!0},{of:r(1114)})},13466:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",proto:!0,real:!0,forced:!0},{upsert:r(41432)})},23321:(t,e,r)=>{"use strict";var i=r(79989),n=r(53499),s=r(78616).add;i({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,r=arguments.length;e{"use strict";var i=r(79989),n=r(53499),s=r(78616).remove;i({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";r(79989)({target:"WeakSet",stat:!0,forced:!0},{from:r(28737)})},45738:(t,e,r)=>{"use strict";r(79989)({target:"WeakSet",stat:!0,forced:!0},{of:r(1114)})},52586:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(68844),a=r(22615),l=r(3689),c=r(34327),h=r(21500),u=r(18368).c2i,d=/[^\d+/a-z]/i,p=/[\t\n\f\r ]+/g,f=/[=]{1,2}$/,m=s("atob"),g=String.fromCharCode,A=o("".charAt),y=o("".replace),v=o(d.exec),x=!!m&&!l((function(){return"hi"!==m("aGk=")})),b=x&&l((function(){return""!==m(" ")})),_=x&&!l((function(){m("a")})),w=x&&!l((function(){m()})),E=x&&1!==m.length;i({global:!0,bind:!0,enumerable:!0,forced:!x||b||_||w||E},{atob:function(t){if(h(arguments.length,1),x&&!b&&!_)return a(m,n,t);var e,r,i,o=y(c(t),p,""),l="",w=0,E=0;if(o.length%4==0&&(o=y(o,f,"")),(e=o.length)%4==1||v(d,o))throw new(s("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;w>(-2*E&6)));return l}})},84645:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(68844),a=r(22615),l=r(3689),c=r(34327),h=r(21500),u=r(18368).i2c,d=s("btoa"),p=o("".charAt),f=o("".charCodeAt),m=!!d&&!l((function(){return"aGk="!==d("hi")})),g=m&&!l((function(){d()})),A=m&&l((function(){return"bnVsbA=="!==d(null)})),y=m&&1!==d.length;i({global:!0,bind:!0,enumerable:!0,forced:!m||g||A||y},{btoa:function(t){if(h(arguments.length,1),m)return a(d,n,c(t));for(var e,r,i=c(t),o="",l=0,g=u;p(i,l)||(g="=",l%1);){if((r=f(i,l+=3/4))>255)throw new(s("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=p(g,63&(e=e<<8|r)>>8-l%1*8)}return o}})},19742:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(99886).clear;i({global:!0,bind:!0,enumerable:!0,forced:n.clearImmediate!==s},{clearImmediate:s})},47522:(t,e,r)=>{"use strict";var i=r(19037),n=r(66338),s=r(33265),o=r(57612),a=r(75773),l=function(t){if(t&&t.forEach!==o)try{a(t,"forEach",o)}catch(e){t.forEach=o}};for(var c in n)n[c]&&l(i[c]&&i[c].prototype);l(s)},76265:(t,e,r)=>{"use strict";var i=r(19037),n=r(66338),s=r(33265),o=r(752),a=r(75773),l=r(55997),c=r(44201)("iterator"),h=o.values,u=function(t,e){if(t){if(t[c]!==h)try{a(t,c,h)}catch(e){t[c]=h}if(l(t,e,!0),n[e])for(var r in o)if(t[r]!==o[r])try{a(t,r,o[r])}catch(e){t[r]=o[r]}}};for(var d in n)u(i[d]&&i[d].prototype,d);u(s,"DOMTokenList")},97337:(t,e,r)=>{"use strict";var i=r(79989),n=r(21905),s=r(76058),o=r(3689),a=r(25391),l=r(75684),c=r(72560).f,h=r(11880),u=r(62148),d=r(36812),p=r(767),f=r(85027),m=r(20445),g=r(13841),A=r(37136),y=r(56610),v=r(618),x=r(67697),b=r(53931),_="DOMException",w="DATA_CLONE_ERR",E=s("Error"),M=s(_)||function(){try{(new(s("MessageChannel")||n("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name===w&&25===t.code)return t.constructor}}(),S=M&&M.prototype,C=E.prototype,T=v.set,I=v.getterFor(_),R="stack"in new E(_),B=function(t){return d(A,t)&&A[t].m?A[t].c:0},L=function(){p(this,P);var t=arguments.length,e=g(t<1?void 0:arguments[0]),r=g(t<2?void 0:arguments[1],"Error"),i=B(r);if(T(this,{type:_,name:r,message:e,code:i}),x||(this.name=r,this.message=e,this.code=i),R){var n=new E(e);n.name=_,c(this,"stack",l(1,y(n.stack,1)))}},P=L.prototype=a(C),D=function(t){return{enumerable:!0,configurable:!0,get:t}},O=function(t){return D((function(){return I(this)[t]}))};x&&(u(P,"code",O("code")),u(P,"message",O("message")),u(P,"name",O("name"))),c(P,"constructor",l(1,L));var k=o((function(){return!(new M instanceof E)})),U=k||o((function(){return C.toString!==m||"2: 1"!==String(new M(1,2))})),N=k||o((function(){return 25!==new M(1,"DataCloneError").code})),F=k||25!==M[w]||25!==S[w],z=b?U||N||F:k;i({global:!0,constructor:!0,forced:z},{DOMException:z?L:M});var G=s(_),Q=G.prototype;for(var j in U&&(b||M===G)&&h(Q,"toString",m),N&&x&&M===G&&u(Q,"code",D((function(){return B(f(this).name)}))),A)if(d(A,j)){var V=A[j],H=V.s,W=l(6,V.c);d(G,H)||c(G,H,W),d(Q,H)||c(Q,H,W)}},13429:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(75684),a=r(72560).f,l=r(36812),c=r(767),h=r(33457),u=r(13841),d=r(37136),p=r(56610),f=r(67697),m=r(53931),g="DOMException",A=s("Error"),y=s(g),v=function(){c(this,x);var t=arguments.length,e=u(t<1?void 0:arguments[0]),r=u(t<2?void 0:arguments[1],"Error"),i=new y(e,r),n=new A(e);return n.name=g,a(i,"stack",o(1,p(n.stack,1))),h(i,this,v),i},x=v.prototype=y.prototype,b="stack"in new A(g),_="stack"in new y(1,2),w=y&&f&&Object.getOwnPropertyDescriptor(n,g),E=!(!w||w.writable&&w.configurable),M=b&&!E&&!_;i({global:!0,constructor:!0,forced:m||M},{DOMException:M?v:y});var S=s(g),C=S.prototype;if(C.constructor!==S)for(var T in m||a(C,"constructor",o(1,S)),d)if(l(d,T)){var I=d[T],R=I.s;l(S,R)||a(S,R,o(6,I.c))}},37462:(t,e,r)=>{"use strict";var i=r(76058),n="DOMException";r(55997)(i(n),n)},40088:(t,e,r)=>{"use strict";r(19742),r(52731)},10455:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(80231),o=r(10509),a=r(21500),l=r(50806),c=n.process;i({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){a(arguments.length,1),o(t);var e=l&&c.domain;s(e?e.bind(t):t)}})},3650:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(62148),o=r(67697),a=TypeError,l=Object.defineProperty,c=n.self!==n;try{if(o){var h=Object.getOwnPropertyDescriptor(n,"self");!c&&h&&h.get&&h.enumerable||s(n,"self",{get:function(){return n},set:function(t){if(this!==n)throw new a("Illegal invocation");l(n,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:c},{self:n})}catch(t){}},52731:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(99886).set,o=r(8552),a=n.setImmediate?o(s,!1):s;i({global:!0,bind:!0,enumerable:!0,forced:n.setImmediate!==a},{setImmediate:a})},10209:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(8552)(n.setInterval,!0);i({global:!0,bind:!0,forced:n.setInterval!==s},{setInterval:s})},83509:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(8552)(n.setTimeout,!0);i({global:!0,bind:!0,forced:n.setTimeout!==s},{setTimeout:s})},25564:(t,e,r)=>{"use strict";var i,n=r(53931),s=r(79989),o=r(19037),a=r(76058),l=r(68844),c=r(3689),h=r(14630),u=r(69985),d=r(19429),p=r(981),f=r(48999),m=r(30734),g=r(18734),A=r(85027),y=r(50926),v=r(36812),x=r(76522),b=r(75773),_=r(6310),w=r(21500),E=r(63477),M=r(83914),S=r(61034),C=r(48774),T=r(21420),I=r(49599),R=r(63514),B=o.Object,L=o.Array,P=o.Date,D=o.Error,O=o.TypeError,k=o.PerformanceMark,U=a("DOMException"),N=M.Map,F=M.has,z=M.get,G=M.set,Q=S.Set,j=S.add,V=S.has,H=a("Object","keys"),W=l([].push),q=l((!0).valueOf),Z=l(1..valueOf),Y=l("".valueOf),X=l(P.prototype.getTime),J=h("structuredClone"),K="DataCloneError",$="Transferring",tt=function(t){return!c((function(){var e=new o.Set([7]),r=t(e),i=t(B(7));return r===e||!r.has(7)||!f(i)||7!=+i}))&&t},et=function(t,e){return!c((function(){var r=new e,i=t({a:r,b:r});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===r.stack)}))},rt=o.structuredClone,it=n||!et(rt,D)||!et(rt,U)||(i=rt,!!c((function(){var t=i(new o.AggregateError([1],J,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==J||3!==t.cause}))),nt=!rt&&tt((function(t){return new k(J,{detail:t}).detail})),st=tt(rt)||nt,ot=function(t){throw new U("Uncloneable type: "+t,K)},at=function(t,e){throw new U((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",K)},lt=function(t,e){return st||at(e),st(t)},ct=function(t,e,r){if(F(e,t))return z(e,t);var i,n,s,a,l,c;if("SharedArrayBuffer"===(r||y(t)))i=st?st(t):t;else{var h=o.DataView;h||u(t.slice)||at("ArrayBuffer");try{if(u(t.slice)&&!t.resizable)i=t.slice(0);else{n=t.byteLength,s="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0,i=new ArrayBuffer(n,s),a=new h(t),l=new h(i);for(c=0;c1&&!p(arguments[1])?A(arguments[1]):void 0,n=i?i.transfer:void 0;void 0!==n&&(r=function(t,e){if(!f(t))throw new O("Transfer option cannot be converted to a sequence");var r=[];g(t,(function(t){W(r,A(t))}));for(var i,n,s,a,l,c=0,h=_(r),p=new Q;c{"use strict";r(10209),r(83509)},2625:(t,e,r)=>{"use strict";r(752);var i=r(79989),n=r(19037),s=r(22615),o=r(68844),a=r(67697),l=r(76837),c=r(11880),h=r(62148),u=r(6045),d=r(55997),p=r(30974),f=r(618),m=r(767),g=r(69985),A=r(36812),y=r(54071),v=r(50926),x=r(85027),b=r(48999),_=r(34327),w=r(25391),E=r(75684),M=r(5185),S=r(91664),C=r(27807),T=r(21500),I=r(44201),R=r(50382),B=I("iterator"),L="URLSearchParams",P=L+"Iterator",D=f.set,O=f.getterFor(L),k=f.getterFor(P),U=Object.getOwnPropertyDescriptor,N=function(t){if(!a)return n[t];var e=U(n,t);return e&&e.value},F=N("fetch"),z=N("Request"),G=N("Headers"),Q=z&&z.prototype,j=G&&G.prototype,V=n.RegExp,H=n.TypeError,W=n.decodeURIComponent,q=n.encodeURIComponent,Z=o("".charAt),Y=o([].join),X=o([].push),J=o("".replace),K=o([].shift),$=o([].splice),tt=o("".split),et=o("".slice),rt=/\+/g,it=Array(4),nt=function(t){return it[t-1]||(it[t-1]=V("((?:%[\\da-f]{2}){"+t+"})","gi"))},st=function(t){try{return W(t)}catch(e){return t}},ot=function(t){var e=J(t,rt," "),r=4;try{return W(e)}catch(t){for(;r;)e=J(e,nt(r--),st);return e}},at=/[!'()~]|%20/g,lt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ct=function(t){return lt[t]},ht=function(t){return J(q(t),at,ct)},ut=p((function(t,e){D(this,{type:P,target:O(t).entries,index:0,kind:e})}),L,(function(){var t=k(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,C(void 0,!0);var i=e[r];switch(t.kind){case"keys":return C(i.key,!1);case"values":return C(i.value,!1)}return C([i.key,i.value],!1)}),!0),dt=function(t){this.entries=[],this.url=null,void 0!==t&&(b(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Z(t,0)?et(t,1):t:_(t)))};dt.prototype={type:L,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,i,n,o,a,l,c=this.entries,h=S(t);if(h)for(r=(e=M(t,h)).next;!(i=s(r,e)).done;){if(o=(n=M(x(i.value))).next,(a=s(o,n)).done||(l=s(o,n)).done||!s(o,n).done)throw new H("Expected sequence with length 2");X(c,{key:_(a.value),value:_(l.value)})}else for(var u in t)A(t,u)&&X(c,{key:u,value:_(t[u])})},parseQuery:function(t){if(t)for(var e,r,i=this.entries,n=tt(t,"&"),s=0;s0?arguments[0]:void 0));a||(this.size=t.entries.length)},ft=pt.prototype;if(u(ft,{append:function(t,e){var r=O(this);T(arguments.length,2),X(r.entries,{key:_(t),value:_(e)}),a||this.length++,r.updateURL()},delete:function(t){for(var e=O(this),r=T(arguments.length,1),i=e.entries,n=_(t),s=r<2?void 0:arguments[1],o=void 0===s?s:_(s),l=0;le.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=O(this).entries,i=y(t,arguments.length>1?arguments[1]:void 0),n=0;n1?At(arguments[1]):{})}}),g(z)){var yt=function(t){return m(this,Q),new z(t,arguments.length>1?At(arguments[1]):{})};Q.constructor=yt,yt.prototype=Q,i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:yt})}}t.exports={URLSearchParams:pt,getState:O}},98858:(t,e,r)=>{"use strict";var i=r(11880),n=r(68844),s=r(34327),o=r(21500),a=URLSearchParams,l=a.prototype,c=n(l.append),h=n(l.delete),u=n(l.forEach),d=n([].push),p=new a("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&i(l,"delete",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=[];u(this,(function(t,e){d(i,{key:e,value:t})})),o(e,1);for(var n,a=s(t),l=s(r),p=0,f=0,m=!1,g=i.length;p{"use strict";var i=r(11880),n=r(68844),s=r(34327),o=r(21500),a=URLSearchParams,l=a.prototype,c=n(l.getAll),h=n(l.has),u=new a("a=1");!u.has("a",2)&&u.has("a",void 0)||i(l,"has",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=c(this,t);o(e,1);for(var n=s(r),a=0;a{"use strict";r(2625)},33228:(t,e,r)=>{"use strict";var i=r(67697),n=r(68844),s=r(62148),o=URLSearchParams.prototype,a=n(o.forEach);i&&!("size"in o)&&s(o,"size",{get:function(){var t=0;return a(this,(function(){t++})),t},configurable:!0,enumerable:!0})},69822:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(3689),o=r(21500),a=r(34327),l=r(76837),c=n("URL");i({target:"URL",stat:!0,forced:!(l&&s((function(){c.canParse()})))},{canParse:function(t){var e=o(arguments.length,1),r=a(t),i=e<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return!!new c(r,i)}catch(t){return!1}}})},79391:(t,e,r)=>{"use strict";r(21694);var i,n=r(79989),s=r(67697),o=r(76837),a=r(19037),l=r(54071),c=r(68844),h=r(11880),u=r(62148),d=r(767),p=r(36812),f=r(45394),m=r(21055),g=r(9015),A=r(10730).codeAt,y=r(6430),v=r(34327),x=r(55997),b=r(21500),_=r(2625),w=r(618),E=w.set,M=w.getterFor("URL"),S=_.URLSearchParams,C=_.getState,T=a.URL,I=a.TypeError,R=a.parseInt,B=Math.floor,L=Math.pow,P=c("".charAt),D=c(/./.exec),O=c([].join),k=c(1..toString),U=c([].pop),N=c([].push),F=c("".replace),z=c([].shift),G=c("".split),Q=c("".slice),j=c("".toLowerCase),V=c([].unshift),H="Invalid scheme",W="Invalid host",q="Invalid port",Z=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,J=/^0x/i,K=/^[0-7]+$/,$=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,rt=/[\0\t\n\r #/:<>?@[\\\]^|]/,it=/^[\u0000-\u0020]+/,nt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,st=/[\t\n\r]/g,ot=function(t){var e,r,i,n;if("number"==typeof t){for(e=[],r=0;r<4;r++)V(e,t%256),t=B(t/256);return O(e,".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,r=1,i=null,n=0,s=0;s<8;s++)0!==t[s]?(n>r&&(e=i,r=n),i=null,n=0):(null===i&&(i=s),++n);return n>r&&(e=i,r=n),e}(t),r=0;r<8;r++)n&&0===t[r]||(n&&(n=!1),i===r?(e+=r?":":"::",n=!0):(e+=k(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},at={},lt=f({},at,{" ":1,'"':1,"<":1,">":1,"`":1}),ct=f({},lt,{"#":1,"?":1,"{":1,"}":1}),ht=f({},ct,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ut=function(t,e){var r=A(t,0);return r>32&&r<127&&!p(e,t)?t:encodeURIComponent(t)},dt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pt=function(t,e){var r;return 2===t.length&&D(Z,P(t,0))&&(":"===(r=P(t,1))||!e&&"|"===r)},ft=function(t){var e;return t.length>1&&pt(Q(t,0,2))&&(2===t.length||"/"===(e=P(t,2))||"\\"===e||"?"===e||"#"===e)},mt=function(t){return"."===t||"%2e"===j(t)},gt={},At={},yt={},vt={},xt={},bt={},_t={},wt={},Et={},Mt={},St={},Ct={},Tt={},It={},Rt={},Bt={},Lt={},Pt={},Dt={},Ot={},kt={},Ut=function(t,e,r){var i,n,s,o=v(t);if(e){if(n=this.parse(o))throw new I(n);this.searchParams=null}else{if(void 0!==r&&(i=new Ut(r,!0)),n=this.parse(o,null,i))throw new I(n);(s=C(new S)).bindURL(this),this.searchParams=s}};Ut.prototype={type:"URL",parse:function(t,e,r){var n,s,o,a,l,c=this,h=e||gt,u=0,d="",f=!1,A=!1,y=!1;for(t=v(t),e||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=F(t,it,""),t=F(t,nt,"$1")),t=F(t,st,""),n=m(t);u<=n.length;){switch(s=n[u],h){case gt:if(!s||!D(Z,s)){if(e)return H;h=yt;continue}d+=j(s),h=At;break;case At:if(s&&(D(Y,s)||"+"===s||"-"===s||"."===s))d+=j(s);else{if(":"!==s){if(e)return H;d="",h=yt,u=0;continue}if(e&&(c.isSpecial()!==p(dt,d)||"file"===d&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=d,e)return void(c.isSpecial()&&dt[c.scheme]===c.port&&(c.port=null));d="","file"===c.scheme?h=It:c.isSpecial()&&r&&r.scheme===c.scheme?h=vt:c.isSpecial()?h=wt:"/"===n[u+1]?(h=xt,u++):(c.cannotBeABaseURL=!0,N(c.path,""),h=Dt)}break;case yt:if(!r||r.cannotBeABaseURL&&"#"!==s)return H;if(r.cannotBeABaseURL&&"#"===s){c.scheme=r.scheme,c.path=g(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,h=kt;break}h="file"===r.scheme?It:bt;continue;case vt:if("/"!==s||"/"!==n[u+1]){h=bt;continue}h=Et,u++;break;case xt:if("/"===s){h=Mt;break}h=Pt;continue;case bt:if(c.scheme=r.scheme,s===i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query;else if("/"===s||"\\"===s&&c.isSpecial())h=_t;else if("?"===s)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query="",h=Ot;else{if("#"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.path.length--,h=Pt;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query,c.fragment="",h=kt}break;case _t:if(!c.isSpecial()||"/"!==s&&"\\"!==s){if("/"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,h=Pt;continue}h=Mt}else h=Et;break;case wt:if(h=Et,"/"!==s||"/"!==P(d,u+1))continue;u++;break;case Et:if("/"!==s&&"\\"!==s){h=Mt;continue}break;case Mt:if("@"===s){f&&(d="%40"+d),f=!0,o=m(d);for(var x=0;x65535)return q;c.port=c.isSpecial()&&w===dt[c.scheme]?null:w,d=""}if(e)return;h=Lt;continue}return q}d+=s;break;case It:if(c.scheme="file","/"===s||"\\"===s)h=Rt;else{if(!r||"file"!==r.scheme){h=Pt;continue}switch(s){case i:c.host=r.host,c.path=g(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=g(r.path),c.query="",h=Ot;break;case"#":c.host=r.host,c.path=g(r.path),c.query=r.query,c.fragment="",h=kt;break;default:ft(O(g(n,u),""))||(c.host=r.host,c.path=g(r.path),c.shortenPath()),h=Pt;continue}}break;case Rt:if("/"===s||"\\"===s){h=Bt;break}r&&"file"===r.scheme&&!ft(O(g(n,u),""))&&(pt(r.path[0],!0)?N(c.path,r.path[0]):c.host=r.host),h=Pt;continue;case Bt:if(s===i||"/"===s||"\\"===s||"?"===s||"#"===s){if(!e&&pt(d))h=Pt;else if(""===d){if(c.host="",e)return;h=Lt}else{if(a=c.parseHost(d))return a;if("localhost"===c.host&&(c.host=""),e)return;d="",h=Lt}continue}d+=s;break;case Lt:if(c.isSpecial()){if(h=Pt,"/"!==s&&"\\"!==s)continue}else if(e||"?"!==s)if(e||"#"!==s){if(s!==i&&(h=Pt,"/"!==s))continue}else c.fragment="",h=kt;else c.query="",h=Ot;break;case Pt:if(s===i||"/"===s||"\\"===s&&c.isSpecial()||!e&&("?"===s||"#"===s)){if(".."===(l=j(l=d))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===s||"\\"===s&&c.isSpecial()||N(c.path,"")):mt(d)?"/"===s||"\\"===s&&c.isSpecial()||N(c.path,""):("file"===c.scheme&&!c.path.length&&pt(d)&&(c.host&&(c.host=""),d=P(d,0)+":"),N(c.path,d)),d="","file"===c.scheme&&(s===i||"?"===s||"#"===s))for(;c.path.length>1&&""===c.path[0];)z(c.path);"?"===s?(c.query="",h=Ot):"#"===s&&(c.fragment="",h=kt)}else d+=ut(s,ct);break;case Dt:"?"===s?(c.query="",h=Ot):"#"===s?(c.fragment="",h=kt):s!==i&&(c.path[0]+=ut(s,at));break;case Ot:e||"#"!==s?s!==i&&("'"===s&&c.isSpecial()?c.query+="%27":c.query+="#"===s?"%23":ut(s,at)):(c.fragment="",h=kt);break;case kt:s!==i&&(c.fragment+=ut(s,lt))}u++}},parseHost:function(t){var e,r,i;if("["===P(t,0)){if("]"!==P(t,t.length-1))return W;if(e=function(t){var e,r,i,n,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,h=null,u=0,d=function(){return P(t,u)};if(":"===d()){if(":"!==P(t,1))return;u+=2,h=++c}for(;d();){if(8===c)return;if(":"!==d()){for(e=r=0;r<4&&D(tt,d());)e=16*e+R(d(),16),u++,r++;if("."===d()){if(0===r)return;if(u-=r,c>6)return;for(i=0;d();){if(n=null,i>0){if(!("."===d()&&i<4))return;u++}if(!D(X,d()))return;for(;D(X,d());){if(s=R(d(),10),null===n)n=s;else{if(0===n)return;n=10*n+s}if(n>255)return;u++}l[c]=256*l[c]+n,2!=++i&&4!==i||c++}if(4!==i)return;break}if(":"===d()){if(u++,!d())return}else if(d())return;l[c++]=e}else{if(null!==h)return;u++,h=++c}}if(null!==h)for(o=c-h,c=7;0!==c&&o>0;)a=l[c],l[c--]=l[h+o-1],l[h+--o]=a;else if(8!==c)return;return l}(Q(t,1,-1)),!e)return W;this.host=e}else if(this.isSpecial()){if(t=y(t),D(et,t))return W;if(e=function(t){var e,r,i,n,s,o,a,l=G(t,".");if(l.length&&""===l[l.length-1]&&l.length--,(e=l.length)>4)return t;for(r=[],i=0;i1&&"0"===P(n,0)&&(s=D(J,n)?16:8,n=Q(n,8===s?1:2)),""===n)o=0;else{if(!D(10===s?$:8===s?K:tt,n))return t;o=R(n,s)}N(r,o)}for(i=0;i=L(256,5-e))return null}else if(o>255)return null;for(a=U(r),i=0;i1?arguments[1]:void 0,i=E(e,new Ut(t,!1,r));s||(e.href=i.serialize(),e.origin=i.getOrigin(),e.protocol=i.getProtocol(),e.username=i.getUsername(),e.password=i.getPassword(),e.host=i.getHost(),e.hostname=i.getHostname(),e.port=i.getPort(),e.pathname=i.getPathname(),e.search=i.getSearch(),e.searchParams=i.getSearchParams(),e.hash=i.getHash())},Ft=Nt.prototype,zt=function(t,e){return{get:function(){return M(this)[t]()},set:e&&function(t){return M(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(u(Ft,"href",zt("serialize","setHref")),u(Ft,"origin",zt("getOrigin")),u(Ft,"protocol",zt("getProtocol","setProtocol")),u(Ft,"username",zt("getUsername","setUsername")),u(Ft,"password",zt("getPassword","setPassword")),u(Ft,"host",zt("getHost","setHost")),u(Ft,"hostname",zt("getHostname","setHostname")),u(Ft,"port",zt("getPort","setPort")),u(Ft,"pathname",zt("getPathname","setPathname")),u(Ft,"search",zt("getSearch","setSearch")),u(Ft,"searchParams",zt("getSearchParams")),u(Ft,"hash",zt("getHash","setHash"))),h(Ft,"toJSON",(function(){return M(this).serialize()}),{enumerable:!0}),h(Ft,"toString",(function(){return M(this).serialize()}),{enumerable:!0}),T){var Gt=T.createObjectURL,Qt=T.revokeObjectURL;Gt&&h(Nt,"createObjectURL",l(Gt,T)),Qt&&h(Nt,"revokeObjectURL",l(Qt,T))}x(Nt,"URL"),n({global:!0,constructor:!0,forced:!o,sham:!s},{URL:Nt})},78730:(t,e,r)=>{"use strict";r(79391)},19979:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615);i({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return n(URL.prototype.toString,this)}})},92294:(t,e,r)=>{"use strict";r.d(e,{TE:()=>Lr,th:()=>Hr});var i={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,doc:"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{js:"v2.10.0",android:"10.7.0",ios:"10.7.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0",android:"10.0.0",ios:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0",android:"10.0.0",ios:"10.0.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0",ios:"4.1.0",macos:"0.8.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."},globe:{doc:"A globe projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",requires:["source"],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{js:"2.10.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",requires:["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"2.10.0",android:"10.7.0",ios:"10.7.0"}}}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0",macos:"10.5.0"}},"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={},o={exports:{}};!function(t,e){!function(r){var i=e&&!e.nodeType&&e,s=t&&!t.nodeType&&t,o="object"==typeof n&&n;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var a,l,c=2147483647,h=36,u=26,d=38,p=700,f=/^xn--/,m=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=h-1,v=Math.floor,x=String.fromCharCode;function b(t){throw RangeError(A[t])}function _(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function w(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+_((t=t.replace(g,".")).split("."),e).join(".")}function E(t){for(var e,r,i=[],n=0,s=t.length;n=55296&&e<=56319&&n65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+x(t)})).join("")}function S(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,r){var i=0;for(t=r?v(t/p):t>>1,t+=v(t/e);t>y*u>>1;i+=h)t=v(t/y);return v(i+(y+1)*t/(t+d))}function T(t){var e,r,i,n,s,o,a,l,d,p,f,m=[],g=t.length,A=0,y=128,x=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&b("not-basic"),m.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=g&&b("invalid-input"),((l=(f=t.charCodeAt(n++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||l>v((c-A)/o))&&b("overflow"),A+=l*o,!(l<(d=a<=x?1:a>=x+u?u:a-x));a+=h)o>v(c/(p=h-d))&&b("overflow"),o*=p;x=C(A-s,e=m.length+1,0==s),v(A/e)>c-y&&b("overflow"),y+=v(A/e),A%=e,m.splice(A++,0,y)}return M(m)}function I(t){var e,r,i,n,s,o,a,l,d,p,f,m,g,A,y,_=[];for(m=(t=E(t)).length,e=128,r=0,s=72,o=0;o=e&&fv((c-r)/(g=i+1))&&b("overflow"),r+=(a-e)*g,e=a,o=0;oc&&b("overflow"),f==e){for(l=r,d=h;!(l<(p=d<=s?1:d>=s+u?u:d-s));d+=h)y=l-p,A=h-p,_.push(x(S(p+y%A,0))),l=v(y/A);_.push(x(S(l,0))),s=C(r,g,i==n),r=0,++i}++r,++e}return _.join("")}if(a={version:"1.3.2",ucs2:{decode:E,encode:M},decode:T,encode:I,toASCII:function(t){return w(t,(function(t){return m.test(t)?"xn--"+I(t):t}))},toUnicode:function(t){return w(t,(function(t){return f.test(t)?T(t.slice(4).toLowerCase()):t}))}},i&&s)if(t.exports==i)s.exports=a;else for(l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);else r.punycode=a}(n)}(o,o.exports);var a={};function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var c=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};a.decode=a.parse=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var s=/\+/g;t=t.split(e);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var a=t.length;o>0&&a>o&&(a=o);for(var c=0;c=0?(h=f.substr(0,m),u=f.substr(m+1)):(h=f,u=""),d=decodeURIComponent(h),p=decodeURIComponent(u),l(n,d)?Array.isArray(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n},a.encode=a.stringify=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(c(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(c(t))})).join(e):n+encodeURIComponent(c(t[i]))})).join(e):i?encodeURIComponent(c(i))+r+encodeURIComponent(c(t)):""};var h=o.exports,u=function(t){return"string"==typeof t},d=function(t){return"object"==typeof t&&null!==t},p=function(t){return null===t},f=function(t){return null==t};function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}s.parse=I,s.resolve=function(t,e){return I(t,!1,!0).resolve(e)},s.resolveObject=function(t,e){return t?I(t,!1,!0).resolveObject(e):e},s.format=function(t){return u(t)&&(t=I(t)),t instanceof m?t.format():m.prototype.format.call(t)},s.Url=m;var g=/^([a-z0-9.+-]+:)/i,A=/:[0-9]*$/,y=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,v=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),x=["'"].concat(v),b=["%","/","?",";","#"].concat(x),_=["/","?","#"],w=/^[+a-z0-9A-Z_-]{0,63}$/,E=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},C={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=a;function I(t,e,r){if(t&&d(t)&&t instanceof m)return t;var i=new m;return i.parse(t,e,r),i}function R(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}m.prototype.parse=function(t,e,r){if(!u(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?P+="x":P+=L[D];if(!P.match(w)){var k=R.slice(0,A),U=R.slice(A+1),N=L.match(E);N&&(k.push(N[1]),U.unshift(N[2])),U.length&&(o="/"+U.join(".")+o),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=h.toASCII(this.hostname));var F=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+F,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!M[c])for(A=0,B=x.length;A0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift())),r.search=t.search,r.query=t.query,p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=w.slice(-1)[0],T=(r.host||t.host||w.length>1)&&("."===M||".."===M)||""===M,I=0,R=w.length;R>=0;R--)"."===(M=w[R])?w.splice(R,1):".."===M?(w.splice(R,1),I++):I&&(w.splice(R,1),I--);if(!b&&!_)for(;I--;I)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),T&&"/"!==w.join("/").substr(-1)&&w.push("");var B,L=""===w[0]||w[0]&&"/"===w[0].charAt(0);return E&&(r.hostname=r.host=L?"":w.length?w.shift():"",(B=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift())),(b=b||r.host&&w.length)&&!L&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},m.prototype.parseHost=function(){var t=this.host,e=A.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};class B extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}var L=B;class P{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,r]of e)this.bindings[t]=r}concat(t){return new P(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var D=P;const O={kind:"null"},k={kind:"number"},U={kind:"string"},N={kind:"boolean"},F={kind:"color"},z={kind:"object"},G={kind:"value"},Q={kind:"collator"},j={kind:"formatted"},V={kind:"resolvedImage"};function H(t,e){return{kind:"array",itemType:t,N:e}}function W(t){if("array"===t.kind){const e=W(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const q=[O,k,U,N,F,j,z,H(G),V];function Z(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Z(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of q)if(!Z(t,e))return null}return`Expected ${W(t)} but found ${W(e)} instead.`}function Y(t,e){return e.some((e=>e.kind===t.kind))}function X(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var J,K={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 $(t){return(t=Math.round(t))<0?0:t>255?255:t}function tt(t){return t<0?0:t>1?1:t}function et(t){return"%"===t[t.length-1]?$(parseFloat(t)/100*255):$(parseInt(t))}function rt(t){return"%"===t[t.length-1]?tt(parseFloat(t)/100):tt(parseFloat(t))}function it(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{J={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in K)return K[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.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===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var s=r.substr(0,i),o=r.substr(i+1,n-(i+1)).split(","),a=1;switch(s){case"rgba":if(4!==o.length)return null;a=rt(o.pop());case"rgb":return 3!==o.length?null:[et(o[0]),et(o[1]),et(o[2]),a];case"hsla":if(4!==o.length)return null;a=rt(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,c=rt(o[1]),h=rt(o[2]),u=h<=.5?h*(c+1):h+c-h*c,d=2*h-u;return[$(255*it(d,u,l+1/3)),$(255*it(d,u,l)),$(255*it(d,u,l-1/3)),a];default:return null}}return null}}catch(t){}class nt{constructor(t,e,r,i=1){this.r=t,this.g=e,this.b=r,this.a=i}static parse(t){if(!t)return;if(t instanceof nt)return t;if("string"!=typeof t)return;const e=J(t);return e?new nt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,r,i]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(r)},${i})`}toArray(){const{r:t,g:e,b:r,a:i}=this;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*r/i,i]}toArray01(){const{r:t,g:e,b:r,a:i}=this;return 0===i?[0,0,0,0]:[t/i,e/i,r/i,i]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:r,a:i}=this;return[t,e,r,i]}}nt.black=new nt(0,0,0,1),nt.white=new nt(1,1,1,1),nt.transparent=new nt(0,0,0,0),nt.red=new nt(1,0,0,1),nt.blue=new nt(0,0,1,1);var st=nt;class ot{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class at{constructor(t,e,r,i,n){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n}}class lt{constructor(t){this.sections=t}static fromString(t){return new lt([new at(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof lt?t:lt.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const r={};e.fontStack&&(r["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(r["font-scale"]=e.scale),e.textColor&&(r["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(r)}return t}}class ct{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new ct({name:t,available:!1}):null}serialize(){return["image",this.name]}}function ht(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ut(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof st)return!0;if(t instanceof ot)return!0;if(t instanceof lt)return!0;if(t instanceof ct)return!0;if(Array.isArray(t)){for(const e of t)if(!ut(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!ut(t[e]))return!1;return!0}return!1}function dt(t){if(null===t)return O;if("string"==typeof t)return U;if("boolean"==typeof t)return N;if("number"==typeof t)return k;if(t instanceof st)return F;if(t instanceof ot)return Q;if(t instanceof lt)return j;if(t instanceof ct)return V;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=dt(e);if(r){if(r===t)continue;r=G;break}r=t}return H(r||G,e)}return z}function pt(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof st||t instanceof lt||t instanceof ct?t.toString():JSON.stringify(t)}class ft{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!ut(t[1]))return e.error("invalid value");const r=t[1];let i=dt(r);const n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new ft(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof st?["rgba"].concat(this.value.toArray()):this.value instanceof lt?this.value.serialize():this.value}}var mt=ft,gt=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const At={string:U,number:k,boolean:N,object:z};class yt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,i=1;const n=t[0];if("array"===n){let n,s;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in At)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=At[r],i++}else n=G;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],i++}r=H(n,s)}else r=At[n];const s=[];for(;it.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);const i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((t=>t.serialize())))}}var vt=yt;class xt{constructor(t){this.type=j,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const i=[];let n=!1;for(let r=1;r<=t.length-1;++r){const s=t[r];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;let t=null;if(s["font-scale"]&&(t=e.parse(s["font-scale"],1,k),!t))return null;let r=null;if(s["text-font"]&&(r=e.parse(s["text-font"],1,H(U)),!r))return null;let o=null;if(s["text-color"]&&(o=e.parse(s["text-color"],1,F),!o))return null;const a=i[i.length-1];a.scale=t,a.font=r,a.textColor=o}else{const s=e.parse(t[r],1,G);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:s,scale:null,font:null,textColor:null})}}return new xt(i)}evaluate(t){return new lt(this.sections.map((e=>{const r=e.content.evaluate(t);return dt(r)===V?new at("",r,null,null,null):new at(pt(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const r={};e.scale&&(r["font-scale"]=e.scale.serialize()),e.font&&(r["text-font"]=e.font.serialize()),e.textColor&&(r["text-color"]=e.textColor.serialize()),t.push(r)}return t}}class bt{constructor(t){this.type=V,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,U);return r?new bt(r):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),r=ct.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const _t={"to-boolean":N,"to-color":F,"to-number":k,"to-string":U};class wt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");const i=_t[r],n=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:ht(e[0],e[1],e[2],e[3]),!r))return new st(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gt(r||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const i=Number(e);if(!isNaN(i))return i}throw new gt(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?lt.fromString(pt(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ct.fromString(pt(this.args[0].evaluate(t))):pt(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new xt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new bt(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Et=wt;const Mt=["Unknown","Point","LineString","Polygon"];var St=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Mt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:r,y:i}=this.featureTileCoord,n=r*e-t[0],s=i*e-t[1];return this.featureDistanceData.bearing[0]*n+this.featureDistanceData.bearing[1]*s}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=st.parse(t)),e}};class Ct{constructor(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const r=t[0],i=Ct.definitions[r];if(!i)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(i)?i[0]:i.type,s=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,o=s.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[i,s]of o){a=new ee(e.registry,e.path,null,e.scope);const o=[];let l=!1;for(let e=1;e{return e=t,Array.isArray(e)?`(${e.map(W).join(", ")})`:`(${W(e.type)}...)`;var e})).join(" | "),i=[];for(let r=1;r=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Pt(t,e){const r=(180+t[0])/360,i=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const s=Math.pow(2,e.z);return[Math.round(r*s*Rt),Math.round(i*s*Rt)]}function Dt(t,e,r){const i=t[0]-e[0],n=t[1]-e[1],s=t[0]-r[0],o=t[1]-r[1];return i*o-s*n==0&&i*s<=0&&n*o<=0}function Ot(t,e){let r=!1;for(let o=0,a=e.length;oi[1]!=s[1]>i[1]&&i[0]<(s[0]-n[0])*(i[1]-n[1])/(s[1]-n[1])+n[0]&&(r=!r)}}var i,n,s;return r}function kt(t,e){for(let r=0;r0&&u<0||h<0&&u>0}function Nt(t,e,r,i){const n=[e[0]-t[0],e[1]-t[1]];return 0!=(s=[i[0]-r[0],i[1]-r[1]])[0]*(o=n)[1]-s[1]*o[0]&&!(!Ut(t,e,r,i)||!Ut(r,i,t,e));var s,o}function Ft(t,e,r){for(const i of r)for(let r=0;rr[2]){const e=.5*i;let n=t[0]-r[0]>e?-i:r[0]-t[0]>e?i:0;0===n&&(n=t[0]-r[2]>e?-i:r[2]-t[0]>e?i:0),t[0]+=n}Bt(e,t)}function Ht(t,e,r,i){const n=Math.pow(2,i.z)*Rt,s=[i.x*Rt,i.y*Rt],o=[];if(!t)return o;for(const i of t)for(const t of i){const i=[t.x+s[0],t.y+s[1]];Vt(i,e,r,n),o.push(i)}return o}function Wt(t,e,r,i){const n=Math.pow(2,i.z)*Rt,s=[i.x*Rt,i.y*Rt],o=[];if(!t)return o;for(const r of t){const t=[];for(const i of r){const r=[i.x+s[0],i.y+s[1]];Bt(e,r),t.push(r)}o.push(t)}if(e[2]-e[0]<=n/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of o)for(const i of t)Vt(i,e,r,n)}var a;return o}class qt{constructor(t,e){this.type=N,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(ut(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t{e&&!Yt(t)&&(e=!1)})),e}function Xt(t){if(t instanceof Tt&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Xt(t)&&(e=!1)})),e}function Jt(t,e){if(t instanceof Tt&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!Jt(t,e)&&(r=!1)})),r}class Kt{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const r=t[1];return e.scope.has(r)?new Kt(r,e.scope.get(r)):e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var $t=Kt;class te{constructor(t,e=[],r,i=new D,n=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=i,this.errors=n,this.expectedType=r}parse(t,e,r,i,n={}){return e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)}_parse(t,e){function r(t,e,r){return"assert"===r?new vt(e,[t]):"coerce"===r?new Et(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=t[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const n=this.registry[i];if(n){let i=n.parse(t,this);if(!i)return null;if(this.expectedType){const t=this.expectedType,n=i.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else i=r(i,t,e.typeAnnotation||"coerce");else i=r(i,t,e.typeAnnotation||"assert")}if(!(i instanceof mt)&&"resolvedImage"!==i.type.kind&&re(i)){const t=new St;try{i=new mt(i.type,i.evaluate(t))}catch(t){return this.error(t.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){const i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new te(this.registry,i,e||null,n,this.errors)}error(t,...e){const r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new L(r,t))}checkSubtype(t,e){const r=Z(t,e);return r&&this.error(r),r}}var ee=te;function re(t){if(t instanceof $t)return re(t.boundExpression);if(t instanceof Tt&&"error"===t.name)return!1;if(t instanceof It)return!1;if(t instanceof Zt)return!1;const e=t instanceof Et||t instanceof vt;let r=!0;return t.eachChild((t=>{r=e?r&&re(t):r&&t instanceof mt})),!!r&&Yt(t)&&Jt(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function ie(t,e){const r=t.length-1;let i,n,s=0,o=r,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),i=t[a],n=t[a+1],i<=e){if(a===r||ee))throw new gt("Input is not a number.");o=a-1}return 0}class ne{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,k);if(!r)return null;const i=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let r=1;r=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=e.parse(o,l,n);if(!c)return null;n=n||c.type,i.push([s,c])}return new ne(n,r,i)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);const n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[ie(e,i)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var se=ne,oe=ae;function ae(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=i}function le(t,e,r){return t*(1-r)+e*r}ae.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,i=0;i<8;i++){var n=this.sampleCurveX(r)-t;if(Math.abs(n)n?o=r:a=r,r=.5*(a-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var ce=Object.freeze({__proto__:null,number:le,color:function(t,e,r){return new st(le(t.r,e.r,r),le(t.g,e.g,r),le(t.b,e.b,r),le(t.a,e.a,r))},array:function(t,e,r){return t.map(((t,i)=>le(t,e[i],r)))}});const he=.95047,ue=1.08883,de=4/29,pe=6/29,fe=3*pe*pe,me=pe*pe*pe,ge=Math.PI/180,Ae=180/Math.PI;function ye(t){return t>me?Math.pow(t,1/3):t/fe+de}function ve(t){return t>pe?t*t*t:fe*(t-de)}function xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function be(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _e(t){const e=be(t.r),r=be(t.g),i=be(t.b),n=ye((.4124564*e+.3575761*r+.1804375*i)/he),s=ye((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*s-16,a:500*(n-s),b:200*(s-ye((.0193339*e+.119192*r+.9503041*i)/ue)),alpha:t.a}}function we(t){let e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*ve(e),r=he*ve(r),i=ue*ve(i),new st(xe(3.2404542*r-1.5371385*e-.4985314*i),xe(-.969266*r+1.8760108*e+.041556*i),xe(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function Ee(t,e,r){const i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}const Me={forward:_e,reverse:we,interpolate:function(t,e,r){return{l:le(t.l,e.l,r),a:le(t.a,e.a,r),b:le(t.b,e.b,r),alpha:le(t.alpha,e.alpha,r)}}},Se={forward:function(t){const{l:e,a:r,b:i}=_e(t),n=Math.atan2(i,r)*Ae;return{h:n<0?n+360:n,c:Math.sqrt(r*r+i*i),l:e,alpha:t.a}},reverse:function(t){const e=t.h*ge,r=t.c;return we({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Ee(t.h,e.h,r),c:le(t.c,e.c,r),l:le(t.l,e.l,r),alpha:le(t.alpha,e.alpha,r)}}};var Ce=Object.freeze({__proto__:null,lab:Me,hcl:Se});class Te{constructor(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[t,e]of n)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,r,i){let n=0;if("exponential"===t.name)n=Ie(e,t.base,r,i);else if("linear"===t.name)n=Ie(e,1,r,i);else if("cubic-bezier"===t.name){const s=t.controlPoints;n=new oe(s[0],s[1],s[2],s[3]).solve(Ie(e,1,r,i))}return n}static parse(t,e){let[r,i,n,...s]=t;if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const t=i[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:t}}else{if("cubic-bezier"!==i[0])return e.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const t=i.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,k),!n)return null;const o=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=F:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=e.parse(i,l,a);if(!c)return null;a=a||c.type,o.push([r,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Te(a,r,i,n,o):e.error(`Type ${W(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);const n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);const s=ie(e,i),o=e[s],a=e[s+1],l=Te.interpolationFactor(this.interpolation,i,o,a),c=r[s].evaluate(t),h=r[s+1].evaluate(t);return"interpolate"===this.operator?ce[this.type.kind.toLowerCase()](c,h,l):"interpolate-hcl"===this.operator?Se.reverse(Se.interpolate(Se.forward(c),Se.forward(h),l)):Me.reverse(Me.interpolate(Me.forward(c),Me.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;tZ(i,t.type)));return new Be(s?G:r,n)}evaluate(t){let e,r=null,i=0;for(const n of this.args){if(i++,r=n.evaluate(t),r&&r instanceof ct&&!r.available&&(e||(e=r),r=null,i===this.args.length))return e;if(null!==r)break}return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Le=Be;class Pe{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let i=1;i=r.length)throw new gt(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new gt(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var ke=Oe;class Ue{constructor(t,e){this.type=N,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,G);return r&&i?Y(r.type,[N,U,k,O,G])?new Ue(r,i):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!X(e,["boolean","string","number","null"]))throw new gt(`Expected first argument to be of type boolean, string, number or null, but found ${W(dt(e))} instead.`);if(!X(r,["string","array"]))throw new gt(`Expected second argument to be of type array or string, but found ${W(dt(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ne=Ue;class Fe{constructor(t,e,r){this.type=k,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,G);if(!r||!i)return null;if(!Y(r.type,[N,U,k,O,G]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(r.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,k);return n?new Fe(r,i,n):null}return new Fe(r,i)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!X(e,["boolean","string","number","null"]))throw new gt(`Expected first argument to be of type boolean, string, number or null, but found ${W(dt(e))} instead.`);if(!X(r,["string","array"]))throw new gt(`Expected second argument to be of type array or string, but found ${W(dt(r))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var ze=Fe;class Ge{constructor(t,e,r,i,n,s){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=s}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n={},s=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,dt(t)))return null}else r=dt(t);if(void 0!==n[String(t)])return c.error("Branch labels must be unique.");n[String(t)]=s.length}const h=e.parse(l,o,i);if(!h)return null;i=i||h.type,s.push(h)}const o=e.parse(t[1],1,G);if(!o)return null;const a=e.parse(t[t.length-1],t.length-1,i);return a?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new Ge(r,i,o,n,s,a):null}evaluate(t){const e=this.input.evaluate(t);return(dt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),r=[],i={};for(const t of e){const e=i[this.cases[t]];void 0===e?(i[this.cases[t]]=r.length,r.push([this.cases[t],[t]])):r[e][1].push(t)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,i]of r)1===i.length?t.push(n(i[0])):t.push(i.map(n)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}var Qe=Ge;class je{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const i=[];for(let n=1;ne.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Ve=je;class He{constructor(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,k);if(!r||!i)return null;if(!Y(r.type,[H(G),U,G]))return e.error(`Expected first argument to be of type array or string, but found ${W(r.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,k);return n?new He(r.type,r,i,n):null}return new He(r.type,r,i)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!X(e,["string","array"]))throw new gt(`Expected first argument to be of type array or string, but found ${W(dt(e))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var We=He;function qe(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ze(t,e,r,i){return 0===i.compare(e,r)}function Ye(t,e,r){const i="=="!==t&&"!="!==t;return class n{constructor(t,e,r){this.type=N,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let s=e.parse(t[1],1,G);if(!s)return null;if(!qe(r,s.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${W(s.type)}'.`);let o=e.parse(t[2],2,G);if(!o)return null;if(!qe(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${W(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${W(s.type)}' and '${W(o.type)}'.`);i&&("value"===s.type.kind&&"value"!==o.type.kind?s=new vt(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new vt(s.type,[o])));let a=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Q),!a)return null}return new n(s,o,a)}evaluate(n){const s=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){const e=dt(s),r=dt(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new gt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const t=dt(s),r=dt(o);if("string"!==t.kind||"string"!==r.kind)return e(n,s,o)}return this.collator?r(n,s,o,this.collator.evaluate(n)):e(n,s,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Xe=Ye("==",(function(t,e,r){return e===r}),Ze),Je=Ye("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!Ze(0,e,r,i)})),Ke=Ye("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),tr=Ye("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),er=Ye(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0}));class rr{constructor(t,e,r,i,n,s){this.type=U,this.number=t,this.locale=e,this.currency=r,this.unit=i,this.minFractionDigits=n,this.maxFractionDigits=s}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,k);if(!r)return null;const i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=e.parse(i.locale,1,U),!n))return null;let s=null;if(i.currency&&(s=e.parse(i.currency,1,U),!s))return null;let o=null;if(i.unit&&(o=e.parse(i.unit,1,U),!o))return null;let a=null;if(i["min-fraction-digits"]&&(a=e.parse(i["min-fraction-digits"],1,k),!a))return null;let l=null;return i["max-fraction-digits"]&&(l=e.parse(i["max-fraction-digits"],1,k),!l)?null:new rr(r,n,s,o,a,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class ir{constructor(t){this.type=k,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${W(r.type)} instead.`):new ir(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new gt(`Expected value to be of type string or array, but found ${W(dt(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const nr={"==":Xe,"!=":Je,">":$e,"<":Ke,">=":er,"<=":tr,array:vt,at:ke,boolean:vt,case:Ve,coalesce:Le,collator:It,format:xt,image:bt,in:Ne,"index-of":ze,interpolate:Re,"interpolate-hcl":Re,"interpolate-lab":Re,length:ir,let:De,literal:mt,match:Qe,number:vt,"number-format":rr,object:vt,slice:We,step:se,string:vt,"to-boolean":Et,"to-color":Et,"to-number":Et,"to-string":Et,var:$t,within:Zt};function sr(t,[e,r,i,n]){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);const s=n?n.evaluate(t):1,o=ht(e,r,i,s);if(o)throw new gt(o);return new st(e/255*s,r/255*s,i/255*s,s)}function or(t,e){return t in e}function ar(t,e){const r=e[t];return void 0===r?null:r}function lr(t){return{type:t}}Tt.register(nr,{error:[{kind:"error"},[U],(t,[e])=>{throw new gt(e.evaluate(t))}],typeof:[U,[G],(t,[e])=>W(dt(e.evaluate(t)))],"to-rgba":[H(k,4),[F],(t,[e])=>e.evaluate(t).toArray()],rgb:[F,[k,k,k],sr],rgba:[F,[k,k,k,k],sr],has:{type:N,overloads:[[[U],(t,[e])=>or(e.evaluate(t),t.properties())],[[U,z],(t,[e,r])=>or(e.evaluate(t),r.evaluate(t))]]},get:{type:G,overloads:[[[U],(t,[e])=>ar(e.evaluate(t),t.properties())],[[U,z],(t,[e,r])=>ar(e.evaluate(t),r.evaluate(t))]]},"feature-state":[G,[U],(t,[e])=>ar(e.evaluate(t),t.featureState||{})],properties:[z,[],t=>t.properties()],"geometry-type":[U,[],t=>t.geometryType()],id:[G,[],t=>t.id()],zoom:[k,[],t=>t.globals.zoom],pitch:[k,[],t=>t.globals.pitch||0],"distance-from-center":[k,[],t=>t.distanceFromCenter()],"heatmap-density":[k,[],t=>t.globals.heatmapDensity||0],"line-progress":[k,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[k,[],t=>t.globals.skyRadialProgress||0],accumulated:[G,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[k,lr(k),(t,e)=>{let r=0;for(const i of e)r+=i.evaluate(t);return r}],"*":[k,lr(k),(t,e)=>{let r=1;for(const i of e)r*=i.evaluate(t);return r}],"-":{type:k,overloads:[[[k,k],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[k],(t,[e])=>-e.evaluate(t)]]},"/":[k,[k,k],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[k,[k,k],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[k,[],()=>Math.LN2],pi:[k,[],()=>Math.PI],e:[k,[],()=>Math.E],"^":[k,[k,k],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[k,[k],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[k,[k],(t,[e])=>Math.log(e.evaluate(t))],log2:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[k,[k],(t,[e])=>Math.sin(e.evaluate(t))],cos:[k,[k],(t,[e])=>Math.cos(e.evaluate(t))],tan:[k,[k],(t,[e])=>Math.tan(e.evaluate(t))],asin:[k,[k],(t,[e])=>Math.asin(e.evaluate(t))],acos:[k,[k],(t,[e])=>Math.acos(e.evaluate(t))],atan:[k,[k],(t,[e])=>Math.atan(e.evaluate(t))],min:[k,lr(k),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[k,lr(k),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[k,[k],(t,[e])=>Math.abs(e.evaluate(t))],round:[k,[k],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[k,[k],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[k,[k],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[N,[U,G],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[N,[G],(t,[e])=>t.id()===e.value],"filter-type-==":[N,[U],(t,[e])=>t.geometryType()===e.value],"filter-<":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{const r=t.id(),i=e.value;return typeof r==typeof i&&r":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[N,[G],(t,[e])=>e.value in t.properties()],"filter-has-id":[N,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[N,[H(U)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[N,[H(G)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[N,[U,H(G)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[N,[U,H(G)],(t,[e,r])=>function(t,e,r,i){for(;r<=i;){const n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:N,overloads:[[[N,N],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[lr(N),(t,e)=>{for(const r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:N,overloads:[[[N,N],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[lr(N),(t,e)=>{for(const r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[N,[N],(t,[e])=>!e.evaluate(t)],"is-supported-script":[N,[U],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[U,[U],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[U,[U],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[U,lr(G),(t,e)=>e.map((e=>pt(e.evaluate(t)))).join("")],"resolved-locale":[U,[Q],(t,[e])=>e.evaluate(t).resolvedLocale()]});var cr=nr;function hr(t){return{result:"success",value:t}}function ur(t){return{result:"error",value:t}}function dr(t){return!!t.expression&&t.expression.interpolated}function pr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function fr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function mr(t){return t}function gr(t,e){const r="color"===e.type,i=t.stops&&"object"==typeof t.stops[0][0],n=i||void 0!==t.property,s=i||!n,o=t.type||(dr(e)?"exponential":"interval");if(r&&((t=R({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],st.parse(t[1])]))),t.default?t.default=st.parse(t.default):t.default=st.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!Ce[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let a,l,c;if("exponential"===o)a=xr;else if("interval"===o)a=vr;else if("categorical"===o){a=yr,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=br}if(i){const r={},i=[];for(let e=0;et[0])),evaluate:({zoom:r},i)=>xr({stops:n,base:t.base},e,r).evaluate(r,i)}}if(s){const r="exponential"===o?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Re.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>a(t,e,r,l,c)}}return{kind:"source",evaluate(r,i){const n=i&&i.properties?i.properties[t.property]:void 0;return void 0===n?Ar(t.default,e.default):a(t,e,n,l,c)}}}function Ar(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function yr(t,e,r,i,n){return Ar(typeof r===n?i[r]:void 0,t.default,e.default)}function vr(t,e,r){if("number"!==pr(r))return Ar(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const n=ie(t.stops.map((t=>t[0])),r);return t.stops[n][1]}function xr(t,e,r){const i=void 0!==t.base?t.base:1;if("number"!==pr(r))return Ar(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const s=ie(t.stops.map((t=>t[0])),r),o=function(t,e,r,i){const n=i-r,s=t-r;return 0===n?0:1===e?s/n:(Math.pow(e,s)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[s][0],t.stops[s+1][0]),a=t.stops[s][1],l=t.stops[s+1][1];let c=ce[e.type]||mr;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=Ce[t.colorSpace];c=(t,r)=>e.reverse(e.interpolate(e.forward(t),e.forward(r),o))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),r=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==r)return c(e,r,o)}}:c(a,l,o)}function br(t,e,r){return"color"===e.type?r=st.parse(r):"formatted"===e.type?r=lt.fromString(r.toString()):"resolvedImage"===e.type?r=ct.fromString(r.toString()):pr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Ar(r,t.default,e.default)}class _r{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new St,this._defaultValue=e?"color"===(r=e).type&&(fr(r.default)||Array.isArray(r.default))?new st(0,0,0,0):"color"===r.type?st.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,i,n,s,o,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,s,o,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s||null,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new gt(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function wr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in cr}function Er(t,e){const r=new ee(cr,[],e?function(t){const e={color:F,string:U,number:k,enum:U,boolean:N,formatted:j,resolvedImage:V};return"array"===t.type?H(e[t.value]||G,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?hr(new _r(i,e)):ur(r.errors)}class Mr{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Xt(e.expression)}evaluateWithoutErrorHandling(t,e,r,i,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,s)}evaluate(t,e,r,i,n,s){return this._styleExpression.evaluate(t,e,r,i,n,s)}}class Sr{constructor(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Xt(e.expression),this.interpolationType=i}evaluateWithoutErrorHandling(t,e,r,i,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,s)}evaluate(t,e,r,i,n,s){return this._styleExpression.evaluate(t,e,r,i,n,s)}interpolationFactor(t,e,r){return this.interpolationType?Re.interpolationFactor(this.interpolationType,t,e,r):0}}function Cr(t,e){if("error"===(t=Er(t,e)).result)return t;const r=t.value.expression,i=Yt(r);if(!i&&"data-driven"!==e["property-type"])return ur([new L("","data expressions not supported")]);const n=Jt(r,["zoom","pitch","distance-from-center"]);if(!n&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return ur([new L("","zoom expressions not supported")]);const s=Ir(r);if(!s&&!n)return ur([new L("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof L)return ur([s]);if(s instanceof Re&&!dr(e))return ur([new L("",'"interpolate" expressions cannot be used with this property')]);if(!s)return hr(new Mr(i?"constant":"source",t.value));const o=s instanceof Re?s.interpolation:void 0;return hr(new Sr(i?"camera":"composite",t.value,s.labels,o))}class Tr{constructor(t,e){this._parameters=t,this._specification=e,R(this,gr(this._parameters,this._specification))}static deserialize(t){return new Tr(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ir(t){let e=null;if(t instanceof De)e=Ir(t.result);else if(t instanceof Le){for(const r of t.args)if(e=Ir(r),e)break}else(t instanceof se||t instanceof Re)&&t.input instanceof Tt&&"zoom"===t.input.name&&(e=t);return e instanceof L||t.eachChild((t=>{const r=Ir(t);r instanceof L?e=r:!e&&r?e=new L("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new L("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Rr(t){if(Array.isArray(t))return t.map(Rr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const r in t)e[r]=Rr(t[r]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Br(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Br(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Lr(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Br(t)||(t=Fr(t));const r=t;let n=!0;try{n=function(t){if(!Or(t))return t;let e=Rr(t);return Dr(e),e=Pr(e),e}(r)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const s=i[`filter_${e}`],o=Er(n,s);let a=null;if("error"===o.result)throw new Error(o.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,r)=>o.value.evaluate(t,e,{},r);let l=null,c=null;if(n!==r){const t=Er(r,s);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));l=(e,r,i,n,s)=>t.value.evaluate(e,r,{},i,void 0,void 0,n,s),c=!Yt(t.value.expression)}return{filter:a,dynamicFilter:l||void 0,needGeometry:Nr(n),needFeature:!!c}}function Pr(t){if(!Array.isArray(t))return t;const e=function(t){if(kr.has(t[0]))for(let e=1;ePr(t)))}function Dr(t){let e=!1;const r=[];if("case"===t[0]){for(let i=1;i",">=","<","<=","to-boolean"]);function Ur(t,e){return te?1:0}function Nr(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?zr(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fr))):"all"===e?["all"].concat(t.slice(1).map(Fr)):"none"===e?["all"].concat(t.slice(1).map(Fr).map(jr)):"in"===e?Gr(t[1],t.slice(2)):"!in"===e?jr(Gr(t[1],t.slice(2))):"has"===e?Qr(t[1]):"!has"===e?jr(Qr(t[1])):"within"!==e||t;var r}function zr(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Gr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Ur)]]:["filter-in-small",t,["literal",e]]}}function Qr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function jr(t){return["!",t]}function Vr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}!function(t){var e=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,12],r=[1,13],i=[1,9],n=[1,10],s=[1,11],o=[1,14],a=[1,15],l=[14,18,22,24],c=[18,22],h=[22,24],u={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,r,i,n,s,o){var a=s.length-1;switch(n){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=s[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=s[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[s[a-2],s[a]];break;case 16:this.$={},this.$[s[a][0]]=s[a][1];break;case 17:this.$=s[a-2],s[a-2][s[a][0]]=s[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[s[a]];break;case 21:this.$=s[a-2],s[a-2].push(s[a])}},table:[{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,12:1,13:2,15:7,16:8,17:o,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:23,15:7,16:8,17:o,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(c,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:30,15:7,16:8,17:o,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:31,15:7,16:8,17:o,23:a},t(c,[2,17]),t(c,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=[0],r=[null],i=[],n=this.table,s="",o=0,a=0,l=i.slice.call(arguments,1),c=Object.create(this.lexer),h={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(h.yy[u]=this.yy[u]);c.setInput(t,h.yy),h.yy.lexer=c,h.yy.parser=this,void 0===c.yylloc&&(c.yylloc={});var d=c.yylloc;i.push(d);var p=c.options&&c.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,g,A,y,v,x,b,_,w={};;){if(m=e[e.length-1],this.defaultActions[m]?g=this.defaultActions[m]:(null==f&&(_=void 0,"number"!=typeof(_=c.lex()||1)&&(_=this.symbols_[_]||_),f=_),g=n[m]&&n[m][f]),void 0===g||!g.length||!g[0]){var E;for(y in b=[],n[m])this.terminals_[y]&&y>2&&b.push("'"+this.terminals_[y]+"'");E=c.showPosition?"Parse error on line "+(o+1)+":\n"+c.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(E,{text:c.match,token:this.terminals_[f]||f,line:c.yylineno,loc:d,expected:b})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(g[0]){case 1:e.push(f),r.push(c.yytext),i.push(c.yylloc),e.push(g[1]),f=null,a=c.yyleng,s=c.yytext,o=c.yylineno,d=c.yylloc;break;case 2:if(v=this.productions_[g[1]][1],w.$=r[r.length-v],w._$={first_line:i[i.length-(v||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(v||1)].first_column,last_column:i[i.length-1].last_column},p&&(w._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(A=this.performAction.apply(w,[s,a,o,h.yy,g[1],r,i].concat(l))))return A;v&&(e=e.slice(0,-1*v*2),r=r.slice(0,-1*v),i=i.slice(0,-1*v)),e.push(this.productions_[g[1]][0]),r.push(w.$),i.push(w._$),x=n[e[e.length-2]][e[e.length-1]],e.push(x);break;case 3:return!0}}return!0}},d={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=r,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,i){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function p(){this.yy={}}return u.lexer=d,p.prototype=u,u.Parser=p,new p}();void 0!==Vr&&(t.parser=e,t.Parser=e.Parser,t.parse=function(){return e.parse.apply(e,arguments)})}({}),new Set(["vector","raster","raster-dem"]);const Hr={StyleExpression:_r,isExpression:wr,isExpressionFilter:Br,createExpression:Er,createPropertyExpression:Cr,normalizePropertyExpression:function(t,e){if(fr(t))return new Tr(t,e);if(wr(t)){const r=Cr(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return"string"==typeof t&&"color"===e.type&&(r=st.parse(t)),{kind:"constant",evaluate:()=>r}}},ZoomConstantExpression:Mr,ZoomDependentExpression:Sr,StylePropertyFunction:Tr}},75153:(t,e,r)=>{"use strict";function i(t,e){return Array.from(t.getElementsByTagName(e))}function n(t){return"#"===t[0]?t:`#${t}`}function s(t){return t?.normalize(),t&&t.textContent||""}function o(t,e,r){const i=t.getElementsByTagName(e),n=i.length?i[0]:null;return n&&r&&r(n),n}function a(t,e,r){const i={};if(!t)return i;const n=t.getElementsByTagName(e),s=n.length?n[0]:null;return s&&r?r(s,i):i}function l(t,e,r){const i=s(o(t,e));return i&&r&&r(i)||{}}function c(t,e,r){const i=parseFloat(s(o(t,e)));if(!isNaN(i))return i&&r&&r(i)||{}}function h(t,e,r){const i=parseFloat(s(o(t,e)));if(!isNaN(i))return r&&r(i),i}function u(t,e){const r={};for(const i of e)l(t,i,(t=>{r[i]=t}));return r}function d(t){return 1===t?.nodeType}function p(t){return a(t,"line",(t=>Object.assign({},l(t,"color",(t=>({stroke:`#${t}`}))),c(t,"opacity",(t=>({"stroke-opacity":t}))),c(t,"width",(t=>({"stroke-width":96*t/25.4}))))))}function f(t){let e=[];if(null===t)return e;for(const r of Array.from(t.childNodes)){if(!d(r))continue;const t=m(r.nodeName);if("gpxtpx:TrackPointExtension"===t)e=e.concat(f(r));else{const i=s(r);e.push([t,g(i)])}}return e}function m(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function g(t){const e=parseFloat(t);return isNaN(e)?t:e}function A(t){const e=[parseFloat(t.getAttribute("lon")||""),parseFloat(t.getAttribute("lat")||"")];if(isNaN(e[0])||isNaN(e[1]))return null;h(t,"ele",(t=>{e.push(t)}));const r=o(t,"time");return{coordinates:e,time:r?s(r):null,extendedValues:f(o(t,"extensions"))}}function y(t){const e=u(t,["name","cmt","desc","type","time","keywords"]),r=Array.from(t.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const i of r)i.parentNode?.parentNode===t&&(e[i.tagName.replace(":","_")]=s(i));const n=i(t,"link");return n.length&&(e.links=n.map((t=>Object.assign({href:t.getAttribute("href")},u(t,["text","type"]))))),e}function v(t,e){const r=i(t,e),n=[],s=[],o={};for(let t=0;t1,l=Object.assign({_gpxType:"trk"},y(t),p(o(t,"extensions")),n.length?{coordinateProperties:{times:a?n:n[0]}}:{});for(const t of s){r.push(t.line),l.coordinateProperties||(l.coordinateProperties={});const e=l.coordinateProperties,i=Object.entries(t.extendedValues);for(let t=0;tnew Array(t.line.length).fill(null)))),e[r][t]=n):e[r]=n}}return{type:"Feature",properties:l,geometry:a?{type:"MultiLineString",coordinates:r}:{type:"LineString",coordinates:r[0]}}}function _(t){const e=Object.assign(y(t),u(t,["sym"])),r=A(t);return r?{type:"Feature",properties:e,geometry:{type:"Point",coordinates:r.coordinates}}:null}function*w(t){for(const e of i(t,"trk")){const t=b(e);t&&(yield t)}for(const e of i(t,"rte")){const t=x(e);t&&(yield t)}for(const e of i(t,"wpt")){const t=_(e);t&&(yield t)}}function E(t){return{type:"FeatureCollection",features:Array.from(w(t))}}function M(t,e){const r={},i="stroke"==e||"fill"===e?e:e+"-color";return"#"===t[0]&&(t=t.substring(1)),6===t.length||3===t.length?r[i]="#"+t:8===t.length&&(r[e+"-opacity"]=parseInt(t.substring(0,2),16)/255,r[i]="#"+t.substring(6,8)+t.substring(4,6)+t.substring(2,4)),r}function S(t,e,r){const i={};return h(t,e,(t=>{i[r]=t})),i}function C(t,e){return a(t,"color",(t=>M(s(t),e)))}function T(t){return a(t,"Icon",((t,e)=>(l(t,"href",(t=>{e.icon=t})),e)))}function I(t){return Object.assign({},function(t){return a(t,"PolyStyle",((t,e)=>Object.assign(e,a(t,"color",(t=>M(s(t),"fill"))),l(t,"fill",(t=>{if("0"===t)return{"fill-opacity":0}})),l(t,"outline",(t=>{if("0"===t)return{"stroke-opacity":0}})))))}(t),function(t){return a(t,"LineStyle",(t=>Object.assign(C(t,"stroke"),S(t,"width","stroke-width"))))}(t),function(t){return a(t,"LabelStyle",(t=>Object.assign(C(t,"label"),S(t,"scale","label-scale"))))}(t),function(t){return a(t,"IconStyle",(t=>Object.assign(C(t,"icon"),S(t,"scale","icon-scale"),S(t,"heading","icon-heading"),a(t,"hotSpot",(t=>{const e=parseFloat(t.getAttribute("x")||""),r=parseFloat(t.getAttribute("y")||""),i=t.getAttribute("xunits")||"",n=t.getAttribute("yunits")||"";return isNaN(e)||isNaN(r)?{}:{"icon-offset":[e,r],"icon-offset-units":[i,n]}})),T(t))))}(t))}r.d(e,{DS:()=>J,ng:()=>E});const R=t=>Number(t),B={string:t=>t,int:R,uint:R,short:R,ushort:R,float:R,double:R,bool:t=>Boolean(t)};function L(t,e){return a(t,"ExtendedData",((t,r)=>{for(const e of i(t,"Data"))r[e.getAttribute("name")||""]=s(o(e,"value"));for(const n of i(t,"SimpleData")){const t=n.getAttribute("name")||"",i=e[t]||B.string;r[t]=i(s(n))}return r}))}function P(t){const e=o(t,"description");for(const t of Array.from(e?.childNodes||[]))if(4===t.nodeType)return{description:{"@type":"html",value:s(t)}};return{}}function D(t){return a(t,"TimeSpan",(t=>({timespan:{begin:s(o(t,"begin")),end:s(o(t,"end"))}})))}function O(t){return a(t,"TimeStamp",(t=>({timestamp:s(o(t,"when"))})))}function k(t,e){return l(t,"styleUrl",(t=>(t=n(t),e[t]?Object.assign({styleUrl:t},e[t]):{styleUrl:t})))}const U=/\s*/g,N=/^\s*|\s*$/g,F=/\s+/;function z(t){return t.replace(U,"").split(",").map(parseFloat).filter((t=>!isNaN(t))).slice(0,3)}function G(t){return t.replace(N,"").split(F).map(z).filter((t=>t.length>=2))}function Q(t){let e=i(t,"coord");var r;0===e.length&&(r=t,"coord","*",e=Array.from(r.getElementsByTagNameNS("*","coord")));const n=e.map((t=>s(t).split(" ").map(parseFloat)));return 0===n.length?null:{geometry:n.length>2?{type:"LineString",coordinates:n}:{type:"Point",coordinates:n[0]},times:i(t,"when").map((t=>s(t)))}}function j(t){if(0===t.length)return t;const e=t[0],r=t[t.length-1];let i=!0;for(let t=0;t=2&&e.push({type:"Point",coordinates:t});break}case"LinearRing":case"LineString":{const t=G(V(s));t.length>=2&&e.push({type:"LineString",coordinates:t});break}case"Polygon":{const t=[];for(const e of i(s,"LinearRing")){const r=j(G(V(e)));r.length>=4&&t.push(r)}t.length&&e.push({type:"Polygon",coordinates:t});break}case"Track":case"gx:Track":{const t=Q(s);if(!t)break;const{times:i,geometry:n}=t;e.push(n),i.length&&r.push(i);break}}}return{geometries:e,coordTimes:r}}function W(t,e,r,i){const{coordTimes:n,geometries:s}=H(t),o=function(t){return 0===t.length?null:1===t.length?t[0]:{type:"GeometryCollection",geometries:t}}(s);if(!o&&i.skipNullGeometry)return null;const a={type:"Feature",geometry:o,properties:Object.assign(u(t,["name","address","visibility","open","phoneNumber","description"]),P(t),k(t,e),I(t),L(t,r),D(t),O(t),n.length?{coordinateProperties:{times:1===n.length?n[0]:n}}:{})};void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=t.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}const q=Math.PI/180;function Z(t,e,r,i){const n=function(t){return o(t,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[j(G(V(t)))]}}:function(t){const e=o(t,"LatLonBox");if(e){const t=h(e,"north"),r=h(e,"west"),i=h(e,"east"),n=h(e,"south"),s=h(e,"rotation");if("number"==typeof t&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i){const e=[r,n,i,t];let o=[[[r,t],[i,t],[i,n],[r,n],[r,t]]];return"number"==typeof s&&(o=function(t,e,r){const i=[(t[0]+t[2])/2,(t[1]+t[3])/2];return[e[0].map((t=>{const e=t[1]-i[1],n=t[0]-i[0],s=Math.sqrt(Math.pow(e,2)+Math.pow(n,2)),o=Math.atan2(e,n)+r*q;return[i[0]+Math.cos(o)*s,i[1]+Math.sin(o)*s]}))]}(e,o,s)),{bbox:e,geometry:{type:"Polygon",coordinates:o}}}}return null}(t)}(t),s=n?.geometry||null;if(!s&&i.skipNullGeometry)return null;const a={type:"Feature",geometry:s,properties:Object.assign({"@geometry-type":"groundoverlay"},u(t,["name","address","visibility","open","phoneNumber","description"]),P(t),k(t,e),I(t),T(t),L(t,r),D(t),O(t))};n?.bbox&&(a.bbox=n.bbox),void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=t.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}function Y(t){let e=t.getAttribute("id");const r=t.parentNode;return!e&&d(r)&&"CascadingStyle"===r.localName&&(e=r.getAttribute("kml:id")||r.getAttribute("id")),n(e||"")}function*X(t,e={skipNullGeometry:!1}){const r=function(t){const e={};for(const r of i(t,"Style"))e[Y(r)]=I(r);for(const r of i(t,"StyleMap")){const t=n(r.getAttribute("id")||"");l(r,"styleUrl",(r=>{r=n(r),e[r]&&(e[t]=e[r])}))}return e}(t),s=function(t){const e={};for(const r of i(t,"SimpleField"))e[r.getAttribute("name")||""]=B[r.getAttribute("type")||""]||B.string;return e}(t);for(const n of i(t,"Placemark")){const t=W(n,r,s,e);t&&(yield t)}for(const n of i(t,"GroundOverlay")){const t=Z(n,r,s,e);t&&(yield t)}}function J(t,e={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(X(t,e))}}},61861:(t,e,r)=>{"use strict";r.d(e,{Q:()=>Y,Z:()=>lt});var i=r(99477);const n=1e3/60,s=function(t){t.id&&(clearInterval(t.id),t.id=void 0),t.waitTimer&&(clearInterval(t.waitTimer),t.waitTimer=void 0),t.keyframe=0},o=function(t){s(t),t.isEnded()&&t.dispatchEvent({type:"animation-ended"}),t.dispatchEvent({type:"animation-stopped"}),t.duration=0};class a extends i.EventDispatcher{constructor(){super(),this.id=null,this.keyframe=0,this.duration=0,this.state=0,this.waitTimer=null,this.callback=()=>{}}isPlaying(){return 1===this.state}isStopped(){return 0===this.state}isEnded(){return 2===this.state}setCallback(t){this.callback=t}play(t){this.duration=t,this.dispatchEvent({type:"animation-started"}),this.state=1,s(this),this.id=setInterval(this.frame.bind(this),n)}playLater(t,e){const r=Math.floor(n*e);window.clearInterval(this.waitTimer);const i=this;this.waitTimer=window.setTimeout((()=>{i.play(t)}),r)}stop(){this.state=0,o(this)}frame(){this.keyframe1&&void 0!==arguments[1]?arguments[1]:{};super(),this._view=t,this._domElement=t.domElement;let r=!0;Object.defineProperty(this,"enabled",{get:()=>r,set:t=>{t||(this.onKeyUp(),this.onPointerUp()),r=t}});let n=!0;Object.defineProperty(this,"enableKeys",{get:()=>n,set:t=>{t||this.onKeyUp(),n=t}}),this.NONE={};let s=this.NONE;Object.defineProperty(this,"currentState",{get:()=>s,set:t=>{if(s!==t){const e=s;s=t,this.dispatchEvent({type:"state-changed",viewCoords:p,previous:e})}}}),this._clickTimeStamp=0,this._lastMousePressed={viewCoords:new i.Vector2},this._currentMousePressed=void 0,this._currentKeyPressed=void 0,this._onPointerDown=this.onPointerDown.bind(this),this._onPointerMove=this.onPointerMove.bind(this),this._onPointerUp=this.onPointerUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onBlur=this.onBlur.bind(this),this._onContextMenu=this.onContextMenu.bind(this),this._domElement.addEventListener("pointerdown",this._onPointerDown,!1),this._domElement.addEventListener("wheel",this._onMouseWheel,!1),this._domElement.addEventListener("keydown",this._onKeyDown,!1),this._domElement.addEventListener("keyup",this._onKeyUp,!1),this._domElement.addEventListener("blur",this._onBlur),this._domElement.addEventListener("contextmenu",this._onContextMenu,!1),this.setFromOptions(e)}inputToState(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const i of Object.keys(d)){const n=this[i];if(n.enable&&n.mouseButton===t&&n.keyboard===e&&n.double===r){if(!n._trigger)return n;this.dispatchEvent({type:n._event,viewCoords:void 0!==t&&p,direction:n._direction})}}return this.NONE}touchToState(t){for(const e of Object.keys(d)){const r=this[e];if(r.enable&&t==r.finger)return r}return this.NONE}setFromOptions(t){for(const e in d)if({}.hasOwnProperty.call(d,e)){let r={};r=t[e]||this[e]||Object.assign(r,d[e]),t[e]&&void 0===t[e].enable&&(r.enable=this[e].enable),r.double=!!r.double,r._event=d[e]._event,r._trigger=d[e]._trigger,r._direction=d[e]._direction,this[e]=r}}onPointerDown(t){this.enabled&&(p.copy(this._view.eventToViewCoords(t)),"mouse"===t.pointerType&&(this._currentMousePressed=t.button,void 0===this._currentKeyPressed&&(t.ctrlKey?this._currentKeyPressed=17:t.shiftKey?this._currentKeyPressed=16:t.metaKey&&(this._currentKeyPressed=91)),this.currentState=this.inputToState(this._currentMousePressed,this._currentKeyPressed,t.timeStamp-this._clickTimeStamp<500&&this._lastMousePressed.button===this._currentMousePressed&&this._lastMousePressed.viewCoords.distanceTo(p)<5),this._clickTimeStamp=t.timeStamp,this._lastMousePressed.button=this._currentMousePressed,this._lastMousePressed.viewCoords.copy(p)),this._domElement.addEventListener("pointermove",this._onPointerMove,!1),this._domElement.addEventListener("pointerup",this._onPointerUp,!1),this._domElement.addEventListener("mouseleave",this._onPointerUp,!1))}onPointerMove(t){t.preventDefault(),this.enabled&&(p.copy(this._view.eventToViewCoords(t)),"mouse"===t.pointerType)&&this.dispatchEvent({type:this.currentState._event,viewCoords:p})}onPointerUp(){this.enabled&&(this._currentMousePressed=void 0,this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("mouseleave",this._onPointerUp,!1),this.currentState=this.NONE)}onMouseWheel(t){t.preventDefault(),this.enabled&&this.ZOOM.enable&&this.dispatchEvent({type:this.ZOOM._event,delta:t.deltaY})}onKeyDown(t){this.enabled&&this.enableKeys&&(this._currentKeyPressed=t.keyCode,this.inputToState(this._currentMousePressed,this._currentKeyPressed))}onKeyUp(){this.enabled&&this.enableKeys&&(this._currentKeyPressed=void 0,void 0===this._currentMousePressed&&(this.currentState=this.NONE))}onBlur(){this.onKeyUp(),this.onPointerUp()}onContextMenu(t){t.preventDefault()}dispose(){this._clickTimeStamp=0,this._lastMousePressed=void 0,this._currentKeyPressed=void 0,this._domElement.removeEventListener("pointerdown",this._onPointerDown,!1),this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("wheel",this._onMouseWheel,!1),this._domElement.removeEventListener("keydown",this._onKeyDown,!1),this._domElement.removeEventListener("keyup",this._onKeyUp,!1),this._domElement.removeEventListener("blur",this._onBlur),this._domElement.removeEventListener("contextmenu",this._onContextMenu,!1)}}const m=f;var g=r(73502);const A=1e-6,y={up:new i.Vector2(0,1),bottom:new i.Vector2(0,-1),left:new i.Vector2(1,0),right:new i.Vector2(-1,0)},v=new i.Vector2,x=new i.Vector2,b=new i.Vector2,_=new i.Spherical(1,.01,0),w=new i.Spherical(1,0,0);let E=1;const M=new i.Vector2,S=new i.Vector2,C=new i.Vector2,T=new i.Vector3,I=new i.Vector2,R=new i.Vector2,B=new i.Vector2;let L;const P=new i.Quaternion,D=new i.Object3D,O=new c.Z("EPSG:4978");D.matrixWorldInverse=new i.Matrix4;const k=new c.Z("EPSG:4978",0,0,0),U=new c.Z("EPSG:4326",0,0,0);function N(t,e){k.setFromVector3(t).as("EPSG:4326",U),e.position.copy(t),e.lookAt(U.geodesicNormal.add(t)),e.rotateX(.5*Math.PI),e.updateMatrixWorld(!0)}let F=0,z=!0;const G=new i.Quaternion(0,0,0,1),Q=new i.Vector3,j=new i.Vector3,V=new i.Quaternion,H=new i.Sphere,W=new i.Vector3,q=new i.Vector3,Z={},Y={PAN_CHANGED:"pan-changed",ORIENTATION_CHANGED:"orientation-changed",RANGE_CHANGED:"range-changed",CAMERA_TARGET_CHANGED:"camera-target-changed"},X=new i.Quaternion,J=new i.Quaternion,K=new i.Vector3(1,0,0);let $=1/0;const tt=new i.Vector3,et=new i.Vector3,rt=new i.Raycaster,it=new i.Vector3,nt=new i.Vector3,st=new i.Sphere;let ot;class at extends i.EventDispatcher{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.player=new l,this.view=t,this.camera=t.camera3D,this.states=new m(this.view),Object.defineProperty(this,"enabled",{get:()=>this.states.enabled,set:t=>{console.warn("GlobeControls.enabled property is deprecated. Use StateControl.enabled instead - which you can access with GlobeControls.states.enabled."),this.states.enabled=t}}),r.zoomSpeed&&(console.warn("Controls zoomSpeed parameter is deprecated. Use zoomFactor instead."),r.zoomFactor=r.zoomFactor||r.zoomSpeed),this.zoomFactor=r.zoomFactor||1.25,this.minDistance=r.minDistance||250,this.maxDistance=r.maxDistance||8*h.c.x,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.rotateSpeed=r.rotateSpeed||.25,this.keyPanSpeed=r.keyPanSpeed||7,this.minPolarAngle=i.MathUtils.degToRad(r.minPolarAngle??.5),this.maxPolarAngle=i.MathUtils.degToRad(r.minPolarAngle??86),this.minAzimuthAngle=r.minAzimuthAngle?i.MathUtils.degToRad(r.minAzimuthAngle):-1/0,this.maxAzimuthAngle=r.maxAzimuthAngle?i.MathUtils.degToRad(r.maxAzimuthAngle):1/0,this.handleCollision=void 0===r.handleCollision||r.handleCollision,this.minDistanceCollision=60,Object.defineProperty(this,"enableKeys",{get:()=>this.states.enableKeys,set:t=>{console.warn("GlobeControls.enableKeys property is deprecated. Use StateControl.enableKeys instead - which you can access with GlobeControls.states.enableKeys."),this.states.enableKeys=t}}),this.enableDamping=!1!==r.enableDamping,this.dampingMoveFactor=null!=r.dampingMoveFactor?r.dampingMoveFactor:.25,this.startEvent={type:"start"},this.endEvent={type:"end"},this.updateHelper=function(){},this._onEndingMove=null,this._onTravel=this.travel.bind(this),this._onTouchStart=this.onTouchStart.bind(this),this._onTouchEnd=this.onTouchEnd.bind(this),this._onTouchMove=this.onTouchMove.bind(this),this._onStateChange=this.onStateChange.bind(this),this._onRotation=this.handleRotation.bind(this),this._onDrag=this.handleDrag.bind(this),this._onDolly=this.handleDolly.bind(this),this._onPan=this.handlePan.bind(this),this._onPanoramic=this.handlePanoramic.bind(this),this._onZoom=this.handleZoom.bind(this),this.states.addEventListener("state-changed",this._onStateChange,!1),this.states.addEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.addEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.addEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.addEventListener(this.states.PAN._event,this._onPan,!1),this.states.addEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.addEventListener("zoom",this._onZoom,!1),this.view.domElement.addEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.addEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.addEventListener("touchmove",this._onTouchMove,!1),this.states.addEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.addEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),t.scene.add(D),e.isExtent?e.center().as("EPSG:4978",k):(e.coord.as("EPSG:4978",k),e.tilt=e.tilt||89.5,e.heading=e.heading||0),N(k,D),this.lookAtCoordinate(e,!1),O.crs=this.view.referenceCrs}get dollyInScale(){return this.zoomFactor}get dollyOutScale(){return 1/this.zoomFactor}get isPaused(){return this.states.currentState===this.states.NONE&&!this.player.isPlaying()}onEndingMove(t){this._onEndingMove&&(this.player.removeEventListener("animation-stopped",this._onEndingMove),this._onEndingMove=null),this.handlingEvent(t)}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.theta-=t}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.phi-=t}panLeft(t){const e=this.camera.matrix.elements;T.fromArray(e),T.multiplyScalar(-t),Q.add(T)}panUp(t){const e=this.camera.matrix.elements;T.fromArray(e,4),T.multiplyScalar(t),Q.add(T)}mouseToPan(t,e){const r=this.view.mainLoop.gfxEngine;if(this.camera.isPerspectiveCamera){let n=this.camera.position.distanceTo(this.getCameraTargetPosition());n*=2*Math.tan(i.MathUtils.degToRad(.5*this.camera.fov)),this.panLeft(t*n/r.width*this.camera.aspect),this.panUp(e*n/r.height)}else this.camera.isOrthographicCamera&&(this.panLeft(t*(this.camera.right-this.camera.left)/r.width),this.panUp(e*(this.camera.top-this.camera.bottom)/r.height))}dolly(t){0!==t&&(L=t>0?this.dollyInScale:this.dollyOutScale,this.camera.isPerspectiveCamera?E/=L:this.camera.isOrthographicCamera&&(this.camera.zoom=i.MathUtils.clamp(this.camera.zoom*L,this.minZoom,this.maxZoom),this.camera.updateProjectionMatrix(),this.view.notifyChange(this.camera)))}getMinDistanceCameraBoundingSphereObbsUp(t){if(t.level>10&&1==t.children.length&&t.geometry){const e=t.obb;st.center.copy(this.camera.position),st.radius=this.minDistanceCollision,e.isSphereAboveXYBox(st)&&($=Math.min(st.center.z-e.box3D.max.z,$))}}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.states.currentState;if($=1/0,this.handleCollision&&this.view.tileLayer)for(const t of this.view.tileLayer.level0Nodes)t.traverse(this.getMinDistanceCameraBoundingSphereObbsUp.bind(this));switch(t){case this.states.MOVE_GLOBE:if($<0)D.translateY(-$),this.camera.position.setLength(this.camera.position.length()-$);else if($r&&w.phi>0){const t=e-r,i=1-(t-($-r))/t;w.phi*=i*i}else if($-r&&w.phi>n){let t=-Math.asin(.25*(r-$)/_.radius);t=i.MathUtils.clamp(t,n,0);const e=1-(r-$)/(2*r);w.phi=i.MathUtils.lerp(w.phi,t,e),$-=Math.sin(w.phi)*_.radius}_.theta+=w.theta,_.phi+=w.phi,_.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,_.theta)),_.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,_.phi)),_.radius=this.camera.position.length()*E,_.makeSafe(),_.radius=Math.max(this.minDistance,Math.min(this.maxDistance,_.radius)),this.camera.position.setFromSpherical(_),$<0&&(this.camera.position.y-=$,_.setFromVector3(this.camera.position),w.phi=0),D.localToWorld(this.camera.position)}}this.camera.up.copy(D.position).normalize(),this.camera.lookAt(D.position),this.enableDamping?(w.theta*=.75,w.phi*=.75,P.slerp(G,.2*this.dampingMoveFactor)):(w.theta=0,w.phi=0,P.set(0,0,0,1)),E=1,Q.set(0,0,0),(j.distanceToSquared(this.camera.position)>A||8*(1-V.dot(this.camera.quaternion))>A)&&(this.view.notifyChange(this.camera),j.copy(this.camera.position),V.copy(this.camera.quaternion)),this.enableDamping&&t===this.states.ORBIT&&this.player.isStopped()&&(w.theta>A||w.phi>A)&&(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.playLater(60,2)),this.view.dispatchEvent({type:g.b.CAMERA_MOVED,coord:O.setFromVector3(D.position),range:_.radius,heading:-i.MathUtils.radToDeg(_.theta),tilt:90-i.MathUtils.radToDeg(_.phi)})}onStateChange(t){this.states.currentState!==this.states.NONE?(u.ZP.stop(this.view,this.camera),this.onEndingMove(),this.player.stop(),this.updateTarget(),ot=u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,nt),v.copy(t.viewCoords),this.view.getPickingPositionFromDepth(t.viewCoords,W)&&(H.radius=W.length(),tt.copy(W).normalize(),this.updateHelper(W,Z.picking)),I.copy(t.viewCoords),M.copy(t.viewCoords)):this.handleEndMovement(t)}handleRotation(t){this.player.stop(),this.handlePanoramic(t)}handleDrag(t){const e=this.view.viewToNormalizedCoords(t.viewCoords);this.camera.updateMatrixWorld(),rt.setFromCamera(e,this.camera),rt.ray.intersectSphere(H,q)?(et.copy(q).normalize(),P.setFromUnitVectors(et,tt),F=Date.now(),this.update()):this.states.onPointerUp()}handleDolly(t){R.copy(t.viewCoords),B.subVectors(R,I),this.dolly(-B.y),I.copy(R),this.update()}handlePan(t){t.viewCoords?(S.copy(t.viewCoords),C.subVectors(S,M),M.copy(S)):t.direction&&C.copy(y[t.direction]).multiplyScalar(this.keyPanSpeed),this.mouseToPan(C.x,C.y),this.update(this.states.PAN)}handlePanoramic(t){x.copy(t.viewCoords),b.subVectors(x,v);const e=this.view.mainLoop.gfxEngine;w.theta-=2*Math.PI*b.x/e.width*this.rotateSpeed,w.phi-=2*Math.PI*b.y/e.height*this.rotateSpeed,v.copy(x),this.update()}handleEndMovement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dispatchEvent(this.endEvent),this.player.stop(),this.enableDamping?t.previous===this.states.ORBIT&&(w.theta>A||w.phi>A)?(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.play(60),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):t.previous===this.states.MOVE_GLOBE&&Date.now()-F<50?(this.player.setCallback((()=>{this.update(this.states.MOVE_GLOBE)})),this.player.play(120),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):this.onEndingMove():this.onEndingMove()}updateTarget(){if(this.view.getPickingPositionFromDepth(null,nt)){const t=isNaN(nt.x)?100:this.camera.position.distanceTo(nt);it.set(0,0,-t),this.camera.localToWorld(it),N(it,D),D.matrixWorldInverse.copy(D.matrixWorld).invert(),it.copy(this.camera.position),it.applyMatrix4(D.matrixWorldInverse),_.setFromVector3(it)}}handlingEvent(t){t=t||u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera);const e=u.ZP.getDiffParams(ot,t);if(e&&(e.range&&this.dispatchEvent({type:Y.RANGE_CHANGED,previous:e.range.previous,new:e.range.new}),e.coord&&this.dispatchEvent({type:Y.CAMERA_TARGET_CHANGED,previous:e.coord.previous,new:e.coord.new}),e.tilt||e.heading)){const t={type:Y.ORIENTATION_CHANGED};e.tilt&&(t.previous={tilt:e.tilt.previous},t.new={tilt:e.tilt.new}),e.heading&&(t.previous=t.previous||{},t.new=t.new||{},t.new.heading=e.heading.new,t.previous.heading=e.heading.previous),this.dispatchEvent(t)}}travel(t){this.player.stop();const e=this.view.getPickingPositionFromDepth(t.viewCoords),r=this.getRange(e);if(e&&r>this.minDistance)return this.lookAtCoordinate({coord:new c.Z("EPSG:4978",e),range:r*("out"===t.direction?1/.6:.6),time:1500})}handleZoom(t){this.player.stop(),u.ZP.stop(this.view,this.camera),this.updateTarget();const e=-t.delta;this.dolly(e);const r=this.getRange(nt);this.update();const i=this.getRange(nt);Math.abs(i-r)/r>.001&&this.dispatchEvent({type:Y.RANGE_CHANGED,previous:r,new:i}),this.dispatchEvent(this.startEvent),this.dispatchEvent(this.endEvent)}onTouchStart(t){if(this.player.stop(),!1!==this.states.enabled&&(this.state=this.states.touchToState(t.touches.length),this.updateTarget(),this.state!==this.states.NONE)){switch(this.state){case this.states.MOVE_GLOBE:{const e=this.view.eventToViewCoords(t);this.view.getPickingPositionFromDepth(e,W)?(H.radius=W.length(),tt.copy(W).normalize(),this.updateHelper(W,Z.picking)):this.state=this.states.NONE;break}case this.states.ORBIT:case this.states.DOLLY:{const e=t.touches[0].pageX,r=t.touches[0].pageY,i=e-t.touches[1].pageX,n=r-t.touches[1].pageY,s=Math.sqrt(i*i+n*n);I.set(0,s),v.set(e,r);break}case this.states.PAN:M.set(t.touches[0].pageX,t.touches[0].pageY)}this.dispatchEvent(this.startEvent)}}onTouchMove(t){if(this.player.isPlaying()&&this.player.stop(),!1!==this.states.enabled){switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case this.states.MOVE_GLOBE.finger:{const e=this.view.eventToViewCoords(t),r=this.view.viewToNormalizedCoords(e);this.camera.updateMatrixWorld(),rt.setFromCamera(r,this.camera),rt.ray.intersectSphere(H,q)?(et.copy(q).normalize(),P.setFromUnitVectors(et,tt),F=Date.now()):this.onTouchEnd();break}case this.states.ORBIT.finger:case this.states.DOLLY.finger:{const e=this.view.mainLoop.gfxEngine;x.set(t.touches[0].pageX,t.touches[0].pageY),b.subVectors(x,v),this.rotateLeft(2*Math.PI*b.x/e.width*this.rotateSpeed),this.rotateUp(2*Math.PI*b.y/e.height*this.rotateSpeed),v.copy(x);const r=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(r*r+i*i);R.set(0,n),B.subVectors(R,I),this.dolly(B.y),I.copy(R);break}case this.states.PAN.finger:S.set(t.touches[0].pageX,t.touches[0].pageY),C.subVectors(S,M),this.mouseToPan(C.x,C.y),M.copy(S);break;default:this.state=this.states.NONE}this.state!==this.states.NONE&&this.update(this.state)}}onTouchEnd(){this.handleEndMovement({previous:this.state}),this.state=this.states.NONE}dispose(){this.view.domElement.removeEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.removeEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.removeEventListener("touchmove",this._onTouchMove,!1),this.states.dispose(),this.states.removeEventListener("state-changed",this._onStateChange,!1),this.states.removeEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.removeEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.removeEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.removeEventListener(this.states.PAN._event,this._onPan,!1),this.states.removeEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.removeEventListener("zoom",this._onZoom,!1),this.states.removeEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.removeEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),this.dispatchEvent({type:"dispose"})}setTilt(t,e){return this.lookAtCoordinate({tilt:t},e)}setHeading(t,e){return this.lookAtCoordinate({heading:t},e)}setRange(t,e){return this.lookAtCoordinate({range:t},e)}getCameraTargetPosition(){return D.position}getRange(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).range}getTilt(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).tilt}getHeading(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).heading}pan(t){return this.mouseToPan(t.x,t.y),this.update(this.states.PAN),Promise.resolve()}getCameraOrientation(){return this.view.getPickingPositionFromDepth(null,nt),[this.getTilt(nt),this.getHeading(nt)]}getCameraCoordinate(){return new c.Z("EPSG:4978",this.camera.position).as("EPSG:4326")}getLookAtCoordinate(){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera).coord}setAnimationEnabled(t){z=t}isAnimationEnabled(){return z}getZoom(){return this.view.tileLayer.computeTileZoomFromDistanceCamera(this.getRange(),this.view.camera)}setZoom(t,e){return this.lookAtCoordinate({zoom:t},e)}getScale(t){return console.warn("Deprecated, use View#getScale instead."),this.view.getScale(t)}pixelsToMeters(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;return console.warn("Deprecated use View#getPixelsToMeters instead."),t*e/this.getScale(e)/1e3}pixelsToDegrees(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.");const r=this.pixelsToMeters(t,e);return i.MathUtils.radToDeg(2*Math.asin(r/(2*h.c.x)))}metersToPixels(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getMetersToPixels instead.");const r=this.getScale(e);return e/=1e3,t*r/e}setScale(t,e,r){return this.lookAtCoordinate({scale:t,pitch:e},r)}lookAtCoordinate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isAnimationEnabled();if(this.player.stop(),!t.isExtent&&(t.zoom?t.range=this.view.tileLayer.computeDistanceCameraFromTileZoom(t.zoom,this.view.camera):t.scale&&(t.range=this.view.getScaleFromDistance(t.pitch,t.scale),(t.rangethis.maxDistance)&&(console.warn(`This scale ${t.scale} can not be reached`),t.range=i.MathUtils.clamp(t.range,this.minDistance,this.maxDistance))),void 0!==t.tilt)){const e=90-i.MathUtils.radToDeg(this.maxPolarAngle),r=90-i.MathUtils.radToDeg(this.minPolarAngle);(t.tiltr)&&(t.tilt=i.MathUtils.clamp(t.tilt,e,r),console.warn("Tilt was clamped to ",t.tilt,` the interval is between ${e} and ${r} degree`))}return ot=u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera),e?(t.callback=t=>D.position.copy(t.targetWorldPosition),this.dispatchEvent({type:"animation-started"}),u.ZP.animateCameraToLookAtTarget(this.view,this.camera,t).then((t=>(this.dispatchEvent({type:"animation-ended"}),this.handlingEvent(t),t)))):u.ZP.transformCameraToLookAtTarget(this.view,this.camera,t).then((t=>(D.position.copy(t.targetWorldPosition),this.handlingEvent(t),t)))}pickGeoPosition(t){const e=this.view.getPickingPositionFromDepth(t);if(e)return new c.Z("EPSG:4978",e).as("EPSG:4326")}}const lt=at},29571:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>Q,uZ:()=>z});var i=r(99477),n=r(99617);const s=i.MOUSE.LEFT,o=i.MOUSE.MIDDLE,a=i.MOUSE.RIGHT;let l;const c=new i.Vector3,h=new i.Quaternion;let u=0;const d=new i.Vector3,p=-1,f={default:"auto",drag:"move",pan:"cell",travel:"wait",rotate:"move",ortho_zoom:"wait"},m=new i.Vector3,g=new i.Vector2,A=new i.Vector2,y=new i.Vector2(0,0),v=new i.Vector3,x=new i.Vector3,b=new i.Vector3,_=new i.Vector3(0,0,0);let w=0;const E=new i.Vector3,M=new i.Quaternion,S=new i.Vector2,C=new i.Vector3,T=new i.Vector3,I=new i.Quaternion,R=new i.Quaternion;let B=0,L=0,P=!1,D=!1,O=0,k=0;const U=new i.Raycaster,N=new i.Plane(new i.Vector3(0,0,-1)),F={enabled:!0,enableRotation:!0,rotateSpeed:2,minPanSpeed:.05,maxPanSpeed:15,zoomTravelTime:.2,zoomFactor:2,maxResolution:0,minResolution:1/0,maxAltitude:5e7,groundLevel:200,autoTravelTimeMin:1.5,autoTravelTimeMax:4,autoTravelTimeDist:5e4,smartTravelHeightMin:75,smartTravelHeightMax:500,instantTravel:!1,minZenithAngle:0,maxZenithAngle:82.5,handleCollision:!0,minDistanceCollision:30,enableSmartTravel:!0,enablePan:!0},z={MOVED:"moved"};class G extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.camera=t.camera3D,this.enabled="boolean"==typeof e.enabled?e.enabled:F.enabled,this.camera.isOrthographicCamera?(u=this.camera.zoom,this.enableRotation=!1,this.enablePan=!1,this.maxAltitude=1/0,this.zoomTravelTime="number"==typeof e.zoomTravelTime?e.zoomTravelTime:F.zoomTravelTime):(this.enableRotation=void 0===e.enableRotation?F.enableRotation:e.enableRotation,this.rotateSpeed=e.rotateSpeed||F.rotateSpeed,this.enablePan=void 0===e.enablePan?F.enablePan:e.enablePan,this.minPanSpeed=e.minPanSpeed||F.minPanSpeed,this.maxPanSpeed=e.maxPanSpeed||F.maxPanSpeed,this.maxAltitude=e.maxAltitude||F.maxAltitude,this.zoomTravelTime=e.zoomTravelTime||F.zoomTravelTime),e.zoomInFactor&&(console.warn("Controls zoomInFactor parameter is deprecated. Use zoomFactor instead."),e.zoomFactor=e.zoomFactor||e.zoomInFactor),e.zoomOutFactor&&(console.warn("Controls zoomOutFactor parameter is deprecated. Use zoomFactor instead."),e.zoomFactor=e.zoomFactor||e.zoomInFactor||1/e.zoomOutFactor),0===e.zoomFactor&&(console.warn("Controls zoomFactor parameter can not be equal to 0. Its value will be set to default."),e.zoomFactor=F.zoomFactor),this.zoomInFactor=e.zoomFactor||F.zoomFactor,this.zoomOutFactor=1/(e.zoomFactor||F.zoomFactor),this.maxResolution=e.maxResolution||F.maxResolution,this.minResolution=e.minResolution||F.minResolution,this.groundLevel=e.groundLevel||F.groundLevel,this.autoTravelTimeMin=e.autoTravelTimeMin||F.autoTravelTimeMin,this.autoTravelTimeMax=e.autoTravelTimeMax||F.autoTravelTimeMax,this.autoTravelTimeDist=e.autoTravelTimeDist||F.autoTravelTimeDist,e.smartZoomHeightMin&&(console.warn("Controls smartZoomHeightMin parameter is deprecated. Use smartTravelHeightMin instead."),e.smartTravelHeightMin=e.smartTravelHeightMin||e.smartZoomHeightMin),e.smartZoomHeightMax&&(console.warn("Controls smartZoomHeightMax parameter is deprecated. Use smartTravelHeightMax instead."),e.smartTravelHeightMax=e.smartTravelHeightMax||e.smartZoomHeightMax),this.smartTravelHeightMin=e.smartTravelHeightMin||F.smartTravelHeightMin,this.smartTravelHeightMax=e.smartTravelHeightMax||F.smartTravelHeightMax,this.instantTravel=e.instantTravel||F.instantTravel,this.minZenithAngle=(e.minZenithAngle||F.minZenithAngle)*Math.PI/180,this.maxZenithAngle=(e.maxZenithAngle||F.maxZenithAngle)*Math.PI/180,e.focusOnMouseOver&&console.warn("Planar controls 'focusOnMouseOver' optional parameter has been removed."),e.focusOnMouseClick&&console.warn("Planar controls 'focusOnMouseClick' optional parameter has been removed."),this.handleCollision=void 0===e.handleCollision?F.handleCollision:e.handleCollision,this.minDistanceCollision=F.minDistanceCollision,this.enableSmartTravel=void 0===e.enableSmartTravel?F.enableSmartTravel:e.enableSmartTravel,c.copy(this.camera.position),h.copy(this.camera.quaternion),this.state=p,this.cursor=f,this.view.controls&&(console.warn("Deprecated use of PlanarControls. See examples to correct PlanarControls implementation."),this.view.controls.dispose()),this.view.controls=this,this._handlerOnKeyDown=this.onKeyDown.bind(this),this._handlerOnMouseDown=this.onMouseDown.bind(this),this._handlerOnMouseUp=this.onMouseUp.bind(this),this._handlerOnMouseMove=this.onMouseMove.bind(this),this._handlerOnMouseWheel=this.onMouseWheel.bind(this),this._handlerContextMenu=this.onContextMenu.bind(this),this._handlerUpdate=this.update.bind(this),this.view.addFrameRequester(n.Ao.AFTER_CAMERA_UPDATE,this._handlerUpdate),this.addInputListeners()}dispose(){this.removeInputListeners(),this.view.removeFrameRequester(n.Ao.AFTER_CAMERA_UPDATE,this._handlerUpdate)}update(t,e){e&&(t=16);const r=this.state!==p;switch(this.state){case 3:this.handleTravel(t),this.view.notifyChange(this.camera);break;case 4:this.handleZoomOrtho(t),this.view.notifyChange(this.camera);break;case 0:this.handleDragMovement(),this.view.notifyChange(this.camera);break;case 2:this.handleRotation(),this.view.notifyChange(this.camera);break;case 1:this.handlePanMovement(),this.view.notifyChange(this.camera)}this.handleCollision&&this.view.camera.adjustAltitudeToAvoidCollisionWithLayer(this.view,this.view.tileLayer,this.minDistanceCollision),r&&this.view.dispatchEvent({type:z.MOVED}),y.set(0,0)}initiateDrag(){this.state=0,v.copy(this.getWorldPointAtScreenXY(g)),b.set(0,0,0)}handleDragMovement(){this.getWorldPointFromMathPlaneAtScreenXY(g,v.z,x),b.subVectors(v,x),this.camera.position.add(b),b.set(0,0,0)}initiatePan(){this.state=1}handlePanMovement(){E.set(-y.x,y.y,0),this.camera.localToWorld(E),this.camera.position.copy(E)}initiateRotation(){this.state=2,_.copy(this.getWorldPointAtScreenXY(new i.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height)));const t=this.camera.position.distanceTo(_);w=Math.acos((this.camera.position.z-_.z)/t)}handleRotation(){const t=-this.rotateSpeed*y.x/this.view.mainLoop.gfxEngine.width,e=-this.rotateSpeed*y.y/this.view.mainLoop.gfxEngine.height,r=this.camera.position.clone().sub(_);0===t&&0===e||(w+e>=this.minZenithAngle&&w+e<=this.maxZenithAngle&&0!==e&&(w+=e,E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E),r.applyQuaternion(M),E.setFromMatrixColumn(this.camera.matrix,0),M.setFromAxisAngle(E,e),r.applyQuaternion(M),E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E).invert(),r.applyQuaternion(M)),0!==t&&(E.set(0,0,1),M.setFromAxisAngle(E,t),r.applyQuaternion(M))),this.camera.position.copy(r),this.camera.lookAt(m),this.camera.position.add(_),this.camera.updateMatrixWorld()}initiateZoom(t){const e=-t.deltaY;d.copy(this.getWorldPointAtScreenXY(g));const r=new i.Vector3;if(e>0||e<0&&this.maxAltitude>this.camera.position.z){const t=e>0?this.zoomInFactor:this.zoomOutFactor,i=this.view.getPixelsToMeters()/t;if(this.maxResolution>i||i>this.minResolution)return;this.camera.isOrthographicCamera?(this.state=4,this.view.notifyChange(this.camera),O=this.camera.zoom,k=O*t,d.z=this.camera.position.z,B=0,L=this.zoomTravelTime,this.updateMouseCursorType()):(r.lerpVectors(this.camera.position,d,1-1/t),this.initiateTravel(r,this.zoomTravelTime,null,!1))}}handleZoomOrtho(t){B=Math.min(B+t/1e3/L,1);const e=O+B*(k-O);this.camera.zoom!==e&&(this.camera.zoom=e,this.camera.updateProjectionMatrix(),this.view.viewToNormalizedCoords(g,E),E.z=0,E.unproject(this.camera),this.camera.position.x+=d.x-E.x,this.camera.position.y+=d.y-E.y,this.camera.updateMatrixWorld(!0)),this.testAnimationEnd()}initiateSmartTravel(){const t=this.getWorldPointAtScreenXY(g),e=new i.Vector3;e.copy(t).sub(this.camera.position),e.z=0,e.normalize();const r=this.camera.position.distanceTo(t),n=i.MathUtils.lerp(this.smartTravelHeightMin,this.smartTravelHeightMax,Math.min(r/5e3,1)),s=new i.Vector3;s.copy(t),this.enableRotation&&s.add(e.multiplyScalar(2*-n)),s.z=t.z+n,this.camera.isOrthographicCamera&&(O=this.camera.zoom,k=O*(1+Math.min(r/5e3,1)),s.z=this.camera.position.z),this.initiateTravel(s,"auto",t,!0)}initiateTravel(t,e,r,n){if(this.state=3,this.view.notifyChange(this.camera),B=0,this.updateMouseCursorType(),P=this.enableRotation&&r&&(r.isQuaternion||r.isVector3),D=n,T.copy(this.camera.position),I.copy(this.camera.quaternion),P&&(r.isQuaternion?R.copy(r):r.isVector3&&(t===r?(this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I)):(this.camera.position.copy(t),this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I),this.camera.position.copy(T)))),C.copy(t),this.instantTravel)L=0;else if("auto"===e){const e=Math.min(1,t.distanceTo(this.camera.position)/this.autoTravelTimeDist);if(L=i.MathUtils.lerp(this.autoTravelTimeMin,this.autoTravelTimeMax,e),P){const t=.5-.5*R.normalize().dot(this.camera.quaternion.normalize());L*=1+2*t,L=Math.min(L,this.autoTravelTimeMax)}}else L=e}handleTravel(t){B=Math.min(B+t/1e3/L,1);const e=D?this.smooth(B):B;this.camera.position.lerpVectors(T,C,e);const r=O+e*(k-O);this.camera.isOrthographicCamera&&this.camera.zoom!==r&&(this.camera.zoom=r,this.camera.updateProjectionMatrix()),!0===P&&this.camera.quaternion.slerpQuaternions(I,R,e),this.testAnimationEnd()}testAnimationEnd(){1===B&&(this.state=p,this.updateMouseCursorType())}goToTopView(){const t=new i.Vector3,e=new i.Quaternion;t.copy(this.getWorldPointAtScreenXY(new i.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height))),t.z+=Math.min(this.maxAltitude,this.camera.position.distanceTo(t)),e.setFromAxisAngle(new i.Vector3(1,0,0),0),this.initiateTravel(t,"auto",e,!0)}goToStartView(){this.camera.isOrthographicCamera&&(O=this.camera.zoom,k=u),this.initiateTravel(c,"auto",h,!0)}getWorldPointFromMathPlaneAtScreenXY(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Vector3;return S.copy(this.view.viewToNormalizedCoords(t)),U.setFromCamera(S,this.camera),N.constant=e,U.ray.intersectPlane(N,r),r}getWorldPointAtScreenXY(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;return this.view.getPickingPositionFromDepth(t,e)||this.getWorldPointFromMathPlaneAtScreenXY(t,this.groundLevel,e),e}addInputListeners(){this.view.domElement.addEventListener("keydown",this._handlerOnKeyDown,!1),this.view.domElement.addEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.addEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.addEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.addEventListener("contextmenu",this._handlerContextMenu,!1)}removeInputListeners(){this.view.domElement.removeEventListener("keydown",this._handlerOnKeyDown,!0),this.view.domElement.removeEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.removeEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.removeEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._handlerContextMenu,!1)}updateMouseCursorType(){switch(this.state){case p:this.view.domElement.style.cursor=this.cursor.default;break;case 0:this.view.domElement.style.cursor=this.cursor.drag;break;case 1:this.view.domElement.style.cursor=this.cursor.pan;break;case 3:this.view.domElement.style.cursor=this.cursor.travel;break;case 4:this.view.domElement.style.cursor=this.cursor.ortho_zoom;break;case 2:this.view.domElement.style.cursor=this.cursor.rotate}}updateMousePositionAndDelta(t){this.view.eventToViewCoords(t,g),y.copy(g).sub(A),A.copy(g)}setCursor(t,e){this.cursor[t]=e,this.updateMouseCursorType()}onMouseDown(t){if(this.enabled&&(t.preventDefault(),this.view.domElement.focus(),p===this.state)){if(l=t.button,this.updateMousePositionAndDelta(t),s===t.button)if(t.ctrlKey){if(!this.enableRotation)return;this.initiateRotation()}else this.initiateDrag();else if(o===t.button){if(!this.enableSmartTravel)return;this.initiateSmartTravel()}else if(a===t.button){if(!this.enablePan)return;this.initiatePan()}this.updateMouseCursorType()}}onMouseUp(t){t.preventDefault(),3!==this.state&&4!==this.state&&l===t.button&&(this.state=p),this.updateMouseCursorType()}onMouseMove(t){this.enabled&&(t.preventDefault(),this.updateMousePositionAndDelta(t),p!==this.state&&this.view.notifyChange())}onKeyDown(t){if(p===this.state&&this.enabled)switch(t.keyCode){case 84:this.camera.isOrthographicCamera||this.goToTopView();break;case 89:this.goToStartView();break;case 32:this.enableSmartTravel&&this.initiateSmartTravel(t)}}onMouseWheel(t){this.enabled&&(t.preventDefault(),t.stopPropagation(),p===this.state&&this.initiateZoom(t))}onContextMenu(t){t.preventDefault()}smooth(t){return(t**2*(3-2*t))**1.2}}const Q=G},5626:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var i=r(99477);const n={BYTE:1,UNSIGNED_BYTE:1,SHORT:2,UNSIGNED_SHORT:2,INT:4,UNSIGNED_INT:4,FLOAT:4,DOUBLE:8},s={BYTE:Int8Array,UNSIGNED_BYTE:Uint8Array,SHORT:Int16Array,UNSIGNED_SHORT:Uint16Array,INT:Int32Array,UNSIGNED_INT:Uint32Array,FLOAT:Float32Array,DOUBLE:Float64Array},o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},a={VEC2:i.Vector2,VEC3:i.Vector3,VEC4:i.Vector4},l=function(t,e,r,i,l){if(!t)throw new Error("Buffer is mandatory to parse binary property.");if(null==e)throw new Error("batchLength is mandatory to parse binary property.");if(null==r)throw new Error("byteOffset is mandatory to parse binary property.");if(!n[i])throw new Error(`Uknown component type: ${i}. Cannot access binary property.`);if(!o[l])throw new Error(`Uknown type: ${l}. Cannot access binary property.`);const c=o[l],h=new s[i](t,r,e*c);if("SCALAR"===l)return Array.from(h);{const t=[];for(let e=0;e<=h.length-c;e+=c){const r=new a[l];r.fromArray(h,e),t.push(r)}return t}};var c=r(39865);const h=new TextDecoder,u=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ArrayBuffer,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4?arguments[4]:void 0;4!==arguments.length||"object"!=typeof i||Array.isArray(i)||null===i||console.warn("You most likely used a deprecated constructor of C3DTBatchTable."),e+r!==t.byteLength&&console.error("3DTiles batch table json length and binary length are not consistent with total buffer length. The batch table may be wrong."),this.type=c.h.batchtable,this.batchLength=i;const s=t.slice(0,e),o=h.decode(new Uint8Array(s)),a=""===o?null:JSON.parse(o);if(r>0){const i=t.slice(e,e+r);for(const t in a){if(!Object.prototype.hasOwnProperty.call(a,t))continue;const e=a[t];Array.isArray(e)||(void 0!==(null==e?void 0:e.byteOffset)&&void 0!==(null==e?void 0:e.componentType)&&void 0!==(null==e?void 0:e.type)?a[t]=l(i,this.batchLength,e.byteOffset,e.componentType,e.type):console.error("Invalid 3D Tiles batch table property that is neither a JSON array nor a valid accessor to a binary body"))}}a&&a.extensions&&(this.extensions=n.parseExtensions(a.extensions,this.type),delete a.extensions),this.content=a}getInfoById(t){if(t<0&&t{"use strict";r.d(e,{Z:()=>g});var i=r(99477),n=r(2359),s=r(62310),o=r(39865);const a=new n.Z,l=new i.Vector3,c=new i.Vector3,h=new s.Z("EPSG:4326"),u=new i.Vector3,d=new s.Z("EPSG:4326"),p=new i.Vector3,f=new i.Vector3,m=new i.Vector3,g=class{constructor(t,e,r){if(this.type=o.h.boundingVolume,t.region)this.initialVolumeType=o.D.region,this.volume=function(t,e){const r=t[2],n=t[0],s=t[1],o=t[3],l=t[4],c=t[5],m=i.MathUtils.radToDeg(r),g=i.MathUtils.radToDeg(n),A=i.MathUtils.radToDeg(s),y=i.MathUtils.radToDeg(o);d.setFromValues(g,y,l),a.cartographicToCartesian(d,p),h.setFromValues(m,A,c),a.cartographicToCartesian(h,u);const v=new i.Vector3;v.lerpVectors(p,u,.5);const x=f.subVectors(p,u).length()/2,b=new i.Sphere(v,x);return b.applyMatrix4(e),b}(t.region,e);else if(t.box)this.initialVolumeType=o.D.box,this.volume=function(t){c.set(t[0],t[1],t[2]),l.set(t[3],t[7],t[11]).multiplyScalar(2);const e=new i.Box3;return e.setFromCenterAndSize(c,l),e}(t.box);else{if(!t.sphere)throw new Error(`Unknown bounding volume type: ${t}. 3D Tiles nodes must have a bounding volume of type\n region, box or sphere.`);this.initialVolumeType=o.D.sphere,this.volume=function(t){const e=new i.Vector3;return e.set(t[0],t[1],t[2]),new i.Sphere(e,t[3])}(t.sphere)}t.extensions&&(this.extensions=r.parseExtensions(t.extensions,this.type))}boundingVolumeCulling(t,e){if(this.initialVolumeType===o.D.box)return!t.isBox3Visible(this.volume,e);if(this.initialVolumeType===o.D.sphere||this.initialVolumeType===o.D.region)return!t.isSphereVisible(this.volume,e);throw new Error("Unknown bounding volume type.")}viewerRequestVolumeCulling(t,e){return this.initialVolumeType===o.D.region?(console.warn("Region viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.D.box?(console.warn("Bounding box viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.D.sphere&&(m.copy(this.volume.center),m.applyMatrix4(e),!(t.camera3D.position.distanceTo(m)<=this.volume.radius))}}},83214:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const i=class{registerExtension(t,e){this[t]=e}getExtension(t,e){if(this[t]&&this[t][e])return this[t][e];console.error(`No extension manager registered for extension ${t} and for class ${e}`)}isExtensionRegistered(t){return this[t]}parseExtensions(t,e){const r={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=new(this.getExtension(i,e))(t[i]));return r}}},84607:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var i=r(99477);function n(t){return t.batchTable?t.batchTable:t.parent?n(t.parent):null}const s=class{#t;constructor(t,e,r,i,n){this.object3d=n,this.batchId=e,this.groups=r,this.userData=i,this.tileId=t,this.#t=null}computeWorldBox3(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Box3;return t.max.x=-1/0,t.max.y=-1/0,t.max.z=-1/0,t.min.x=1/0,t.min.y=1/0,t.min.z=1/0,this.groups.forEach((e=>{const r=3*e.start,i=3*(e.start+e.count);for(let e=r;e{"use strict";r.d(e,{D:()=>n,h:()=>i});const i={tileset:"tileset",batchtable:"batchtable",boundingVolume:"boundingVolume"},n={region:"region",box:"box",sphere:"sphere"}},47274:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var i=r(99477),n=r(27245),s=r(39865);const o=new i.Matrix4,a=class{constructor(t,e,r){this.type=s.h.tileset,this.asset=t.asset,this.properties=t.properties,this.geometricError=t.geometricError,this.extensionsUsed=t.extensionsUsed,this.extensionsRequired=t.extensionsRequired,this.tiles=[],this.parseTiles(t.root,e,void 0,r),t.extensions&&(this.extensions=r.parseExtensions(t.extensions,this.type))}parseTiles(t,e,r,s){if(t.transform=t.transform?(new i.Matrix4).fromArray(t.transform):void 0,t._worldFromLocalTransform=t.transform,r&&r._worldFromLocalTransform&&(t.transform?t._worldFromLocalTransform=(new i.Matrix4).multiplyMatrices(r._worldFromLocalTransform,t.transform):t._worldFromLocalTransform=r._worldFromLocalTransform),(t.viewerRequestVolume&&t.viewerRequestVolume.region||t.boundingVolume&&t.boundingVolume.region)&&(t._worldFromLocalTransform?o.copy(t._worldFromLocalTransform).invert():o.identity()),t.viewerRequestVolume=t.viewerRequestVolume?new n.Z(t.viewerRequestVolume,o,s):null,t.boundingVolume=t.boundingVolume?new n.Z(t.boundingVolume,o,s):null,this.tiles.push(t),t.tileId=this.tiles.length-1,t.baseURL=e,t.children)for(const r of t.children)this.parseTiles(r,e,t,s)}extendTileset(t,e,r,i){this.parseTiles(t.root,r,this.tiles[e],i),this.tiles[e].children=[t.root],this.tiles[e].isTileset=!0}}},53175:(t,e,r)=>{"use strict";r.d(e,{Dx:()=>a,S_:()=>n,_F:()=>s,ie:()=>o});var i=r(5199);const n=t=>(t.fx&&(console.warn("ColorLayer fx is deprecated, use ColorLayer.effect_type and ColorLayer.effect_parameter instead."),t.fx>2?(t.effect_parameter=t.fx,t.effect_type=i.pO.removeLightColor):t.fx>0&&(t.effect_parameter=t.fx,t.effect_type=i.pO.removeWhiteColor)),t),s=t=>{if(t.crsOut||t.crsIn){console.warn("Parsing options with crsIn and crsOut are deprecated, use { in, out } structure.");const e={in:{},out:{}};return e.in.crs=t.crsIn,e.in.isInverted=t.isInverted,e.in.styles=t.styles,e.in.layers=t.layers,e.in.filter=t.filter,e.out.crs=t.crsOut,e.out.mergeFeatures=t.mergeFeatures,t.withAltitude&&t.withNormal?(console.warn("Parsing options withAltitude and withNormal is deprecated, use out.structure: 2d or 3d."),e.out.structure="3d"):e.out.structure="2d",e.out.filteringExtent=t.filteringExtent,e.out.style=t.style,void 0!==t.crsOut.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead"),e.out.filter=t.filter,e}return t.out&&(void 0===t.out.withAltitude&&void 0===t.out.withNormal||(console.warn("Parsing options out.withAltitude and out.withNormal is deprecated, use out.structure: 2d or 3d."),t.out.withAltitude&&t.out.withNormal?t.out.structure="3d":t.out.structure="2d"),void 0!==t.out.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead")),t},o=t=>{t.color&&console.error("Color convert option is removed, use Style.xxx.color"),t.extrude&&console.error("extrude convert option is removed, use Style.fill.extrusion_height instead"),t.altitude&&console.error("altitude convert option is removed, use Style.xxx.base_altitude instead")},a=t=>{!1===t.isWebGL2&&console.error("WebGL1 support ended in 2.43.0. Falling-back to the WebGL2 renderer.")}},5167:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>g,iL:()=>d,t1:()=>_,tg:()=>u});var i=r(99477),n=r(71440),s=r(62310),o=r(79323),a=r(49075);function l(t){return new n.ZP(t,1/0,-1/0,1/0,-1/0)}function c(t,e){t.normals&&e.geodesicNormal.toArray(t.normals,t._pos),t._pushValues(e.x,e.y,e.z)}const h=new s.Z("EPSG:4326",0,0,0),u={POINT:0,LINE:1,POLYGON:2};class d{#e;constructor(t){this.indices=[],this.properties={},this.size=t.size,t.extent&&(this.extent=l(t.extent.crs),this.#e=l(t.extent.crs))}startSubGeometry(t,e){const r=this.indices.length-1,i=this.extent?l(this.extent.crs):void 0,n=r>-1?this.indices[r].offset+this.indices[r].count:e.vertices.length/this.size;this.indices.push({offset:n,count:t,extent:i}),this.#e=i,function(t,e){t.vertices.length+=e*t.size,t.normals&&(t.normals.length=t.vertices.length)}(e,t)}closeSubGeometry(t,e){const r=this.indices.length-1,i=r>-1?this.indices[r].offset+this.indices[r].count:e.vertices.length/this.size-t;this.indices.push({offset:i,count:t,extent:this.#e}),this.extent&&(this.extent.union(this.#e),this.#e=l(this.extent.crs))}getLastSubGeometry(){const t=this.indices.length-1;return this.indices[t]}pushCoordinates(t,e){if(t.isCoordinates)return console.warn("Deprecated: change in arguments order, use pushCoordinates(feature, coordIn) instead"),void this.pushCoordinates(e,t);e.as(t.crs,h),t.transformToLocalSystem(h),c(t,h),this.#e&&this.#e.expandByCoordinates(t.useCrsOut?h:e)}pushCoordinatesValues(t,e,r){if((arguments.length<=3?0:arguments.length-3)>0)return console.warn("Deprecated: change in arguments, use pushCoordinatesValues(feature, {x: long, y: lat, normal}, coordProj) instead"),void this.pushCoordinatesValues(t,{x:e,y:r,normal:arguments.length<=3?void 0:arguments[3]},arguments.length<=4?void 0:arguments[4]);c(t,e),this.#e&&this.#e.expandByValuesCoordinates(e.x,e.y)}updateExtent(){if(this.extent){const t=this.indices[this.indices.length-1];t&&this.extent.union(t.extent)}}}function p(t,e){this.vertices[this._pos++]=t,this.vertices[this._pos++]=e}function f(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.vertices[this._pos++]=t,this.vertices[this._pos++]=e,this.vertices[this._pos++]=r}class m{constructor(t,e){if(!Object.keys(u).find((e=>u[e]===t)))throw new Error(`Unsupported Feature type: ${t}`);this.type=t,this.geometries=[],this.vertices=[],this.crs=e.crs,this.size=e.size,this.normals="EPSG:4978"==e.crs?[]:void 0,this.hasRawElevationData=!1,this.transformToLocalSystem=e.transformToLocalSystem.bind(e),e.extent&&(this.extent=l(e.extent.crs),this.useCrsOut=this.extent.crs==this.crs),this._pos=0,this._pushValues=(3===this.size?f:p).bind(this),this.style=a.ZP.setFromProperties}bindNewGeometry(){const t=new d(this);return this.geometries.push(t),t}updateExtent(t){this.extent&&this.extent.union(t.extent)}get geometryCount(){return this.geometries.length}}const g=m,A=()=>{},y=(t,e)=>(t.geodesicNormal.applyNormalMatrix(e.normalMatrixInverse),t.applyMatrix4(e.matrixWorldInverse)),v=(t,e)=>t.applyMatrix4(e.matrixWorldInverse),x=new i.Vector3(0,0,1),b=new i.Quaternion;class _ extends i.Object3D{#r=v;#i=A;constructor(t){var e;super(),this.isFeatureCollection=!0,this.crs=o.Z.formatToEPSG(t.accurate||null===(e=t.source)||void 0===e||!e.crs?t.crs:t.source.crs),this.features=[],this.mergeFeatures=void 0===t.mergeFeatures||t.mergeFeatures,this.size="3d"==t.structure?3:2,this.filterExtent=t.filterExtent,this.style=t.style,this.isInverted=!1,this.matrixWorldInverse=new i.Matrix4,this.center=new s.Z("EPSG:4326",0,0),2==this.size?(this.extent=!1===t.buildExtent?void 0:l(t.forcedExtentCrs||this.crs),this.#i=t=>{t.as(this.crs,this.center),this.position.copy(t),this.updateMatrixWorld(),this.#i=A}):(this.extent=t.buildExtent?l(t.forcedExtentCrs||this.crs):void 0,this.#i=t=>{t.as("EPSG:4326",this.center),"EPSG:4978"==this.crs&&(this.quaternion.setFromUnitVectors(x,t.geodesicNormal),b.setFromAxisAngle(x,i.MathUtils.degToRad(90+this.center.longitude)),this.quaternion.multiply(b)),this.position.copy(t),this.updateMatrixWorld(),this.normalMatrix.getNormalMatrix(this.matrix),this.normalMatrixInverse=(new i.Matrix3).copy(this.normalMatrix).invert(),this.#i=A},this.#r=y)}transformToLocalSystem(t){return this.#i(t),this.#r(t,this)}updateExtent(t){if(this.extent){const e=t?[t]:this.features.map((t=>t.extent));for(const t of e)this.extent.union(t)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}removeEmptyFeature(){this.features=this.features.filter((t=>t.geometries.length))}pushFeature(t){this.features.push(t),this.updateExtent(t.extent)}requestFeature(t,e){const r=this.features.find(e);if(r&&this.mergeFeatures)return r;{const e=new m(t,this);return this.features.push(e),e}}requestFeatureByType(t){return this.requestFeature(t,(e=>e.type===t))}requestFeatureById(t,e){return this.requestFeature(e,(e=>e.id===t))}newFeatureByReference(t){const e=new m(t.type,this);return e.extent=t.extent,e.geometries=t.geometries,e.normals=t.normals,e.size=t.size,e.vertices=t.vertices,e._pos=t._pos,this.features.push(e),e}}},62310:(t,e,r)=>{"use strict";r.d(e,{Z:()=>f});var i=r(99477),n=r(24472),s=r(79323),o=r(2359);n.default.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const a=new o.Z,l={},c=new i.Vector3,h=new i.Vector3;let u,d;class p{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.isCoordinates=!0,s.Z.isValid(t),this.crs=t,this.x=0,this.y=0,this.z=0,this._normal=new i.Vector3,e.length>0?this.setFromArray(e):e.isVector3||e.isCoordinates?this.setFromVector3(e):this.setFromValues(e,r,n),this._normalNeedsUpdate=!0}setCrs(t){s.Z.isValid(t),this.crs=t}setFromValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.x=null==t?0:t,this.y=null==e?0:e,this.z=null==r?0:r,this._normalNeedsUpdate=!0,this}setFromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.setFromValues(t[e],t[e+1],t[e+2])}setFromVector3(t){return this.setFromValues(t.x,t.y,t.z)}clone(){return new p(this.crs,this)}copy(t){return this.crs=t.crs,this.setFromVector3(t)}get longitude(){return this.x}get latitude(){return this.y}get altitude(){return this.z}set altitude(t){this.z=t}get geodesicNormal(){return this._normalNeedsUpdate&&(this._normalNeedsUpdate=!1,s.Z.is4326(this.crs)?a.geodeticSurfaceNormalCartographic(this,this._normal):"EPSG:4978"==this.crs?a.geodeticSurfaceNormal(this,this._normal):this._normal.set(0,0,1)),this._normal}toVector3(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector3).copy(this)}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i.Vector3.prototype.toArray.call(this,t,e)}planarDistanceTo(t){return this.toVector3(c).setZ(0),t.toVector3(h).setZ(0),c.distanceTo(h)}geodeticDistanceTo(t){return this.as("EPSG:4326",u),t.as("EPSG:4326",d),a.geodesicDistance(u,d)}spatialEuclideanDistanceTo(t){return this.as("EPSG:4978",u).toVector3(c),t.as("EPSG:4978",d).toVector3(h),c.distanceTo(h)}applyMatrix4(t){return i.Vector3.prototype.applyMatrix4.call(this,t)}as(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new p(t);var r,o;return this.crs==t?e.copy(this):(s.Z.is4326(this.crs)&&"EPSG:3857"==t&&(this.y=i.MathUtils.clamp(this.y,-89.999999,89.999999)),e.setFromArray((r=this.crs,o=t,l[r]||(l[r]={}),l[r][o]||(l[r][o]=(0,n.default)(r,o)),l[r][o]).forward([this.x,this.y,this.z]))),e.crs=t,e}}u=new p("EPSG:4326",0,0,0),d=new p("EPSG:4326",0,0,0);const f=p},79323:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var i=r(24472);function n(t){return"string"==typeof t||t instanceof String}function s(t){if(!n(t))throw new Error(`Crs parameter value must be a string: '${t}'`)}function o(t){return n(t)&&t.startsWith("TMS")}function a(t){return n(t)&&t.startsWith("EPSG")}function l(t){return s(t),a(t)?t:`EPSG:${t.match(/\d+/)[0]}`}i.default.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const c={DEGREE:1,METER:2};function h(t){return"EPSG:4326"===t}function u(t){switch(s(t),t){case"EPSG:4326":return c.DEGREE;case"EPSG:4978":return c.METER;default:{const r=i.default.defs(l(t));if(!r)return;return"degrees"===(e=r.units)?c.DEGREE:"m"===e?c.METER:void 0}}var e}function d(t){s(t);const e=u(t);if(void 0===e)throw new Error(`No unit found for crs: '${t}'`);return e}const p={UNIT:c,isValid(t){d(t)},isGeographic:t=>d(t)==c.DEGREE,isMetricUnit:t=>u(t)==c.METER,toUnit:u,is4326:h,isGeocentric:function(t){s(t);const e=i.default.defs(t);return!!e&&"geocent"==e.projName},reasonnableEpsilon:t=>h(t)?.01:.001,formatToEPSG:l,formatToTms:function(t){return s(t),o(t)?t:`TMS:${t.match(/\d+/)[0]}`},isTms:o,isEpsg:a,tms_3857:"TMS:3857",tms_4326:"TMS:4326",defs:(t,e)=>i.default.defs(t,e)}},71440:(t,e,r)=>{"use strict";r.d(e,{Mh:()=>E,ZP:()=>R,dS:()=>M});var i=r(99477),n=r(62310),s=r(79323);const o=new i.Vector2,a=new i.Vector2,l=new i.Vector2,c=new i.Box3,h=new i.Vector2,u=new i.Vector2,d=new i.Vector2(2,2),p={row:0,col:0,invDiff:0},f=new n.Z("EPSG:4326",0,0,0),m=new n.Z("EPSG:4326",0,0,0),g=new n.Z("EPSG:4326",0,0,0),A=new i.Vector3,y=new i.Vector3;function v(t,e){const r=2**(t.zoom-e);return p.invDiff=1/r,p.row=(t.row-t.row%r)*p.invDiff,p.col=(t.col-t.col%r)*p.invDiff,p}let x,b;const _=new Array(8);for(let t=_.length-1;t>=0;t--)_[t]=new n.Z("EPSG:4326",0,0,0,0);const w=new n.Z("EPSG:4326",0,0),E=new Map,M=new Map;function S(t){const e=s.Z.formatToEPSG(t),r=E.get(e),i=r.planarDimensions(a),n=s.Z.formatToTms(t);return{epsg:e,globalExtent:r,globalDimension:i,sTs:M.get(n)||M.get("default"),isInverted:!n.includes(":NI")}}function C(t,e){const r=M.get(s.Z.formatToTms(t))||M.get("default"),i=2**e;return l.set(i,i).multiply(r),l}class T{constructor(t,e,r,i,n){if(s.Z.isGeocentric(t))throw new Error(`${t} is a geocentric projection, it doesn't make sense with a geographical extent`);this.isExtent=!0,this.crs=t,this.zoom=0,s.Z.isTms(this.crs)?(this.row=0,this.col=0):(this.west=0,this.east=0,this.south=0,this.north=0),this.set(e,r,i,n)}clone(){return s.Z.isTms(this.crs)?new T(this.crs,this.zoom,this.row,this.col):new T(this.crs,this.west,this.east,this.south,this.north)}tiledCovering(t){if("EPSG:4326"==this.crs&&t==s.Z.tms_3857){const e=[],r=x.copy(this).as(s.Z.formatToEPSG(t),b),{globalExtent:i,globalDimension:n,sTs:o}=S(s.Z.formatToEPSG(t));r.clampByExtent(i),r.planarDimensions(u);const a=this.zoom+1||Math.floor(Math.log2(Math.round(n.x/(u.x*o.x)))),l=C(t,a),c=r.center(w);h.x=c.x-i.west,h.y=i.north-r.north,h.divide(n).multiply(l).floor();for(let s=Math.ceil((i.north-r.south)/n.x*l.y)-1;s>=h.y;s--)e.push(new T(t,a,s,h.x));return e}{const e=new T(t,0,0,0),{globalExtent:r,globalDimension:i,sTs:n,isInverted:s}=S(this.crs),o=this.center(w);this.planarDimensions(u);const a=Math.floor(Math.log2(Math.round(i.x/(u.x*n.x)))),l=C(t,a);return h.x=o.x-r.west,h.y=s?r.north-o.y:o.y-r.south,h.divide(i).multiply(l).floor(),e.set(a,h.y,h.x),[e]}}as(t,e){if(s.Z.isValid(t),e=e||new T("EPSG:4326",[0,0,0,0]),s.Z.isTms(this.crs)){const{epsg:r,globalExtent:i,globalDimension:n}=S(this.crs),s=C(this.crs,this.zoom);return u.set(1,1).divide(s).multiply(n),e.west=i.west+(n.x-u.x*(s.x-this.col)),e.east=e.west+u.x,e.south=i.south+u.y*(s.y-this.row-1),e.north=e.south+u.y,e.crs=r,e.zoom=this.zoom,t==r?e:e.as(t,e)}if(s.Z.isEpsg(t)){if(this.crs!=t){const r=this.center(w);_[0].setFromValues(this.west,this.north),_[1].setFromValues(r.x,this.north),_[2].setFromValues(this.east,this.north),_[3].setFromValues(this.east,r.y),_[4].setFromValues(this.east,this.south),_[5].setFromValues(r.x,this.south),_[6].setFromValues(this.west,this.south),_[7].setFromValues(this.west,r.y),e.set(1/0,-1/0,1/0,-1/0);for(let r=0;r<_.length;r++)_[r].crs=this.crs,_[r].as(t,w),e.north=Math.max(e.north,w.y),e.south=Math.min(e.south,w.y),e.east=Math.max(e.east,w.x),e.west=Math.min(e.west,w.x);return e.zoom=this.zoom,e.crs=t,e}return e.crs=t,e.zoom=this.zoom,e.set(this.west,this.east,this.south,this.north),e}}center(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Z(this.crs);if(s.Z.isTms(this.crs))throw new Error("Invalid operation for WMTS bbox");return this.planarDimensions(o),t.crs=this.crs,t.setFromValues(this.west+.5*o.x,this.south+.5*o.y),t}dimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return console.warn("Extent.dimensions is deprecated, use planarDimensions, geodeticDimensions or spatialEuclideanDimensions"),t.x=Math.abs(this.east-this.west),t.y=Math.abs(this.north-this.south),t}planarDimensions(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2).set(Math.abs(this.east-this.west),Math.abs(this.north-this.south))}geodeticDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return f.crs=this.crs,m.crs=this.crs,g.crs=this.crs,f.setFromValues(this.west,this.north,0),m.setFromValues(this.west,this.south,0),g.setFromValues(this.east,this.north,0),t.set(f.geodeticDistanceTo(g),f.geodeticDistanceTo(m))}spatialEuclideanDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return f.crs=this.crs,m.crs=this.crs,g.crs=this.crs,f.setFromValues(this.west,this.north,0),m.setFromValues(this.west,this.south,0),g.setFromValues(this.east,this.north,0),t.set(f.spatialEuclideanDistanceTo(g),f.spatialEuclideanDistanceTo(m))}isPointInside(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.crs==t.crs?w.copy(t):t.as(this.crs,w),w.x<=this.east+e&&w.x>=this.west-e&&w.y<=this.north+e&&w.y>=this.south-e}isInside(t,e){return s.Z.isTms(this.crs)?this.zoom==t.zoom?this.row==t.row&&this.col==t.col:!(this.zoom1&&void 0!==arguments[1]?arguments[1]:new i.Vector4;if(this.crs!=t.crs)throw new Error("unsupported mix");if(s.Z.isTms(this.crs))return v(this,t.zoom),e.set(this.col*p.invDiff-p.col,this.row*p.invDiff-p.row,p.invDiff,p.invDiff);t.planarDimensions(o),this.planarDimensions(a);const r=(this.west-t.west)/o.x,n=(t.north-this.north)/o.y,l=a.x/o.x,c=a.y/o.y;return e.set(r,n,l,c)}tiledExtentParent(t){return t&&t=r.east||t.east<=r.west||t.south>=r.north||t.north<=r.south)}intersect(t){return this.intersectsExtent(t)?(t.crs!=this.crs&&(t=t.as(this.crs,x)),new T(this.crs,Math.max(this.west,t.west),Math.min(this.east,t.east),Math.max(this.south,t.south),Math.min(this.north,t.north))):new T(this.crs,0,0,0,0)}set(t,e,r,i){if(null==t)throw new Error("No values to set in the extent");return t.isExtent&&(s.Z.isTms(t.crs)?(e=t.row,r=t.col,t=t.zoom):(e=t.east,r=t.south,i=t.north,t=t.west)),s.Z.isTms(this.crs)?(this.zoom=t,this.row=e,this.col=r):t.isCoordinates?(this.west=t.x,this.east=e.x,this.south=t.y,this.north=e.y):void 0!==t.west?(this.west=t.west,this.east=t.east,this.south=t.south,this.north=t.north):4==t.length?(this.west=t[0],this.east=t[1],this.south=t[2],this.north=t[3]):void 0!==i&&(this.west=t,this.east=e,this.south=r,this.north=i),this}copy(t){return this.crs=t.crs,this.set(t)}union(t){if(t.crs!=this.crs)throw new Error("unsupported union between 2 diff crs");if(this.west===1/0)this.copy(t);else{const e=t.west;ethis.east&&(this.east=r);const i=t.south;ithis.north&&(this.north=n)}}expandByCoordinates(t){const e=t.crs==this.crs?t:t.as(this.crs,w);this.expandByValuesCoordinates(e.x,e.y)}expandByValuesCoordinates(t,e){tthis.east&&(this.east=t),ethis.north&&(this.north=e)}static fromBox3(t,e){return s.Z.isGeocentric(t)&&(t="EPSG:4326",e=c.copy(e),m.crs=t,m.setFromVector3(e.min).as(t,m).toVector3(e.min),g.crs=t,g.setFromVector3(e.max).as(t,g).toVector3(e.max)),new T(t,{west:e.min.x,east:e.max.x,south:e.min.y,north:e.max.y})}toString(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return s.Z.isTms(this.crs)?`${this.zoom}${t}${this.row}${t}${this.col}`:`${this.east}${t}${this.north}${t}${this.west}${t}${this.south}`}subdivision(){return this.subdivisionByScheme()}subdivisionByScheme(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;const e=[],r=this.planarDimensions(o).divide(t);for(let i=t.x-1;i>=0;i--)for(let n=t.y-1;n>=0;n--){const t=this.west+i*r.x,s=this.south+n*r.y;e.push(new T(this.crs,t,t+r.x,s,s+r.y))}return e}applyMatrix4(t){if(!s.Z.isTms(this.crs)){if(A.set(this.west,this.south,0).applyMatrix4(t),y.set(this.east,this.north,0).applyMatrix4(t),this.west=A.x,this.east=y.x,this.south=A.y,this.north=y.y,this.west>this.east){const t=this.west;this.west=this.east,this.east=t}if(this.south>this.north){const t=this.south;this.south=this.north,this.north=t}return this}}clampSouthNorth(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.south,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.north;return this.south=Math.max(this.south,t),this.north=Math.min(this.north,e),this}clampWestEast(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.west,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.east;return this.west=Math.max(this.west,t),this.east=Math.min(this.east,e),this}clampByExtent(t){return this.clampSouthNorth(t.south,t.north),this.clampWestEast(t.west,t.east)}}x=new T("EPSG:4326",[0,0,0,0]),b=new T("EPSG:4326",[0,0,0,0]),E.set("EPSG:4326",new T("EPSG:4326",-180,180,-90,90));const I=E.get("EPSG:4326").as("EPSG:3857");I.clampSouthNorth(I.west,I.east),E.set("EPSG:3857",I),M.set("default",new i.Vector2(1,1)),M.set(s.Z.tms_3857,M.get("default")),M.set(s.Z.tms_4326,new i.Vector2(2,1));const R=T},2362:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477),n=r(62310),s=r(79323);const o=new n.Z("EPSG:4326"),a=new i.Vector2,l=class{constructor(t,e,r){s.Z.isGeographic(t.crs),this.extent=t,this.step=new i.Vector2(e.x,e.y||e.x),this.dimensions=this.extent.planarDimensions(),this.dataSize=(new i.Vector2).addVectors(this.step,this.dimensions).divide(this.step).round(),this.getData=r}getHeightAtCoordinates(t){return t.as(this.extent.crs,o),a.set((this.dataSize.x-1)*(o.x-this.extent.west)/this.dimensions.x,(this.dataSize.y-1)*(o.y-this.extent.south)/this.dimensions.y),a.x<0||a.x>=this.dataSize.x-1||a.y<0||a.y>=this.dataSize.y-1?0:function(t,e){const r=Math.floor(t.x),i=Math.floor(t.y),n=t.x-r,s=t.y-i;return(1-n)*((1-s)*e(i,r)+s*e(i+1,r))+n*((1-s)*e(i,r+1)+s*e(i+1,r+1))}(a,this.getData)}}},59947:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var i=r(99477),n=r(86541);const s=new(r(62310).Z)("EPSG:4326");let o,a="";a=void 0!==document.documentElement.style.transform?"transform":void 0!==document.documentElement.style.webkitTransform?"webkitTransform":void 0!==document.documentElement.style.mozTransform?"mozTransform":void 0!==document.documentElement.style.oTransform?"oTransform":"transform";class l extends i.Object3D{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)throw new Error("coordinates are mandatory to add a Label");arguments.length>3&&console.warn("Deprecated argument sprites in Label constructor. Sprites must be configured in style argument."),super();let i=this.visible;Object.defineProperty(this,"visible",{set(t){t!=i&&(i=t,this.content.style.display=t?"block":"none")},get:()=>i}),this.isLabel=!0,this.coordinates=e,this.projectedPosition={x:0,y:0},this.boundaries={left:0,right:0,top:0,bottom:0},"string"==typeof t?(this.content=document.createElement("div"),this.content.textContent=r.text.field):this.content=t.cloneNode(!0),this.content.classList.add("itowns-label"),this.content.style.userSelect="none",this.content.style.position="absolute",r.isStyle?(this.anchor=r.getTextAnchorPosition(),this.styleOffset=r.text.offset,"string"==typeof t&&(r.text.haloWidth>0&&this.content.classList.add("itowns-stroke-single"),r.applyToHTML(this.content).then((t=>{t&&(this.icon=t)})))):(this.anchor=[0,0],this.styleOffset=[0,0]),this.iconOffset={left:0,right:0,top:0,bottom:0},this.zoom={min:r.zoom&&null!=r.zoom.min?r.zoom.min:2,max:r.zoom&&null!=r.zoom.max?r.zoom.max:24},this.order=r.order||0,this.padding=2}updateProjectedPosition(t,e){const r=Math.round(t),i=Math.round(e);r==this.projectedPosition.x&&i==this.projectedPosition.y||(this.projectedPosition.x=r,this.projectedPosition.y=i,this.boundaries.left=t+this.offset.left-this.padding,this.boundaries.right=t+this.offset.right+this.padding,this.boundaries.top=e+this.offset.top-this.padding,this.boundaries.bottom=e+this.offset.bottom+this.padding,0===this.iconOffset.left&&0===this.iconOffset.right&&0===this.iconOffset.top&&0===this.iconOffset.bottom||(this.boundaries.left=Math.min(this.boundaries.left,t+this.iconOffset.left),this.boundaries.right=Math.max(this.boundaries.right,t+this.iconOffset.right),this.boundaries.top=Math.min(this.boundaries.top,e+this.iconOffset.top),this.boundaries.bottom=Math.max(this.boundaries.bottom,e+this.iconOffset.bottom)))}updateCSSPosition(){this.content.style[a]=`translate(${this.projectedPosition.x+this.offset.left}px, ${this.projectedPosition.y+this.offset.top}px)`,this.icon&&(this.icon.style[a]=`translate(${-this.offset.left}px, ${-this.offset.top}px)`)}initDimensions(){if(!this.offset){o=this.content.getBoundingClientRect();const t=Math.round(o.width),e=Math.round(o.height);this.offset={left:t*this.anchor[0]+this.styleOffset[0],top:e*this.anchor[1]+this.styleOffset[1]},this.offset.right=this.offset.left+t,this.offset.bottom=this.offset.top+e,this.icon&&(o=this.icon.getBoundingClientRect(),this.iconOffset={left:Math.floor(o.x),top:Math.floor(o.y),right:Math.ceil(o.x+o.width),bottom:Math.ceil(o.y+o.height)})}}update3dPosition(t){this.coordinates.as(t,s).toVector3(this.position),this.updateMatrixWorld()}updateElevationFromLayer(t,e){if(0==t.attachedLayers.filter((t=>t.isElevationLayer)).length)return;let r=Math.max(0,n.Z.getElevationValueAt(t,this.coordinates,n.Z.FAST_READ_Z,e));isNaN(r)&&(r=Math.max(0,n.Z.getElevationValueAt(t,this.coordinates,n.Z.FAST_READ_Z))),isNaN(r)||r==this.coordinates.z||(this.coordinates.z=r)}updateHorizonCullingPoint(){this.horizonCullingPoint&&this.getWorldPosition(this.horizonCullingPoint)}}const c=l},99617:(t,e,r)=>{"use strict";r.d(e,{Ao:()=>s,HR:()=>n,ZP:()=>c});var i=r(99477);const n=0,s={UPDATE_START:"update_start",BEFORE_CAMERA_UPDATE:"before_camera_update",AFTER_CAMERA_UPDATE:"after_camera_update",BEFORE_LAYER_UPDATE:"before_layer_update",AFTER_LAYER_UPDATE:"after_layer_update",BEFORE_RENDER:"before_render",AFTER_RENDER:"after_render",UPDATE_END:"update_end"};function o(t,e,r){if(r)for(const i of r){const r=e.update(t,e,i),n=e.getObjectToUpdateForAttachedLayers(i);if(n)if(n.element)for(const r of e.attachedLayers)r.ready&&(r.update(t,r,n.element,n.parent),r.cache.flush());else if(n.elements)for(let r=0;r{t===e||t.isCamera?(e.info.clear(),r=!0):t.layer===e&&i.add(t)})),r?new Set([e]):i}class l extends i.EventDispatcher{#n=!1;#s=!0;#o=0;constructor(t,e){super(),this.renderingState=n,this.scheduler=t,this.gfxEngine=e}scheduleViewUpdate(t,e){this.#n|=e,1!==this.renderingState&&(this.renderingState=1,this.gfxEngine.renderer.xr.isPresenting||requestAnimationFrame((e=>{this.step(t,e)})))}#a(t,e,r){const i={camera:t.camera,engine:this.gfxEngine,scheduler:this.scheduler,view:t};e.forEach((t=>{const r=t.layer||t;r.isLayer&&r.parent&&e.add(r.parent)}));for(const n of t.getLayers(((t,e)=>!e)))if(i.geometryLayer=n,n.ready&&n.visible&&!n.frozen){t.execFrameRequesters(s.BEFORE_LAYER_UPDATE,r,this.#s,n);const l=a(e,n);if(l.size>0){for(const t of n.attachedLayers)t.ready&&t.preUpdate&&t.preUpdate(i,l);const t=n.preUpdate(i,l);o(i,n,t),n.postUpdate(i,n,e)}n.cache.flush(),t.execFrameRequesters(s.AFTER_LAYER_UPDATE,r,this.#s,n)}}step(t,e){const r=e-this.#o;t._executeFrameRequestersRemovals(),t.execFrameRequesters(s.UPDATE_START,r,this.#s);const i=this.#n;this.#o=e,this.#n=!1,this.renderingState=n;const o=new Set(t._changeSources);t._changeSources.clear();const a=this.gfxEngine.getWindowSize();t.execFrameRequesters(s.BEFORE_CAMERA_UPDATE,r,this.#s),t.camera.update(a.x,a.y),t.execFrameRequesters(s.AFTER_CAMERA_UPDATE,r,this.#s);const l=t.camera3D.matrixAutoUpdate;t.camera3D.matrixAutoUpdate=!1,this.#a(t,o,r),0==this.scheduler.commandsWaitingExecutionCount()&&this.dispatchEvent({type:"command-queue-empty"}),i&&this.#l(t,r),this.#s=this.renderingState===n,t.camera3D.matrixAutoUpdate=l,t.execFrameRequesters(s.UPDATE_END,r,this.#s)}#l(t,e){t.execFrameRequesters(s.BEFORE_RENDER,e,this.#s),t.render?t.render():this.gfxEngine.renderView(t),t.execFrameRequesters(s.AFTER_RENDER,e,this.#s)}}const c=l},2359:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l,c:()=>o});var i=r(99477),n=r(24472),s=r(62310);const o=new i.Vector3(n.default.WGS84.a,n.default.WGS84.a,n.default.WGS84.b),a=new i.Vector3,l=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;this.size=new i.Vector3,this._radiiSquared=new i.Vector3,this._invRadiiSquared=new i.Vector3,this.eccentricity=0,this.setSize(t)}geodeticSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;return t.toVector3(e).multiply(this._invRadiiSquared).normalize()}geodeticSurfaceNormalCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;const r=i.MathUtils.degToRad(t.longitude),n=i.MathUtils.degToRad(t.latitude),s=Math.cos(n);return e.set(s*Math.cos(r),s*Math.sin(r),Math.sin(n))}setSize(t){this.size.set(t.x,t.y,t.z),this._radiiSquared.multiplyVectors(t,t),this._invRadiiSquared.x=0==t.x?0:1/this._radiiSquared.x,this._invRadiiSquared.y=0==t.y?0:1/this._radiiSquared.y,this._invRadiiSquared.z=0==t.z?0:1/this._radiiSquared.z,this.eccentricity=Math.sqrt(this._radiiSquared.x-this._radiiSquared.z)/this.size.x}cartographicToCartesian(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;a.copy(t.geodesicNormal),e.multiplyVectors(this._radiiSquared,a);const r=Math.sqrt(a.dot(e));return e.divideScalar(r),a.multiplyScalar(t.altitude),e.add(a)}cartesianToCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.Z("EPSG:4326",0,0,0);const r=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),n=this.size.x,o=this.size.z,a=Math.abs((n*n-o*o)/(n*n)),l=1-Math.sqrt(1-a),c=Math.sqrt(t.x*t.x+t.y*t.y),h=Math.atan2(t.y,t.x),u=Math.atan(t.z/c*(1-l+a*n/r)),d=Math.sin(u),p=Math.cos(u),f=Math.atan((t.z*(1-l)+a*n*d*d*d)/((1-l)*(c-a*n*p*p*p))),m=c*Math.cos(f)+t.z*Math.sin(f)-n*Math.sqrt(1-a*Math.sin(f)*Math.sin(f));return e.setFromValues(i.MathUtils.radToDeg(h),i.MathUtils.radToDeg(f),m)}cartographicToCartesianArray(t){const e=[];for(let r=0;r{"use strict";r.d(e,{Z:()=>g});var i=r(99477),n=r(14625),s=r(5199),o=r(62310);const a=new i.Vector4;function l(t,e){let r;for(let i=0;i<=t;i++){const t=i*i;for(let n=-i;n<=i;n++){const s=n*n;for(let o=-i;o<=i;o++){const i=s+o*o;if(!(i>t||i<=r||!1!==e(n,o)))return}}r=t}}function c(t){return t.layer?t.layer:t.parent?c(t.parent):void 0}const h=new i.Raycaster,u=new i.Vector2,d=new i.Vector3,p=new o.Z("EPSG:4978"),f=new i.Vector3,m=new o.Z("EPSG:4978"),g={pickTilesAt(t,e,r,o){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const h=function(t,e,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const c=t.mainLoop.gfxEngine.getWindowSize();r=r||new i.Vector2(Math.floor(c.x/2),Math.floor(c.y/2));const h=e.level0Nodes.map((t=>n.Z.push(t,n.Z.MODES.ID))),u=t.mainLoop.gfxEngine.renderViewToBuffer({camera:t.camera,scene:e.object3d},{x:r.x-o,y:r.y-o,width:1+2*o,height:1+2*o});h.forEach((t=>t()));const d=[];return l(o,((t,e)=>{const r=4*(2*e*o+t),i=u.slice(r,r+4||void 0);a.fromArray(i).divideScalar(255);const n=(0,s.On)(a,256**3),l=Math.round(n);d.includes(l)||d.push(l)})),d}(t,o,e,r),u=t=>{h.includes(t.id)&&t.isTileMesh&&c.push({object:t,layer:o})};for(const t of o.level0Nodes)t.traverse(u);return c},pickPointsAt(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!i.root)return;i.object3d.traverse((t=>{t.isPoints&&t.baseId&&t.material.enablePicking(!0)}));const s=t.mainLoop.gfxEngine.renderViewToBuffer({camera:t.camera,scene:i.object3d},{x:e.x-r,y:e.y-r,width:1+2*r,height:1+2*r}),o=[];return l(r,((t,e)=>{const i=4*(2*e*r+t),n=s.slice(i,i+4),a={objId:n[0]<<8|n[1],index:n[2]<<8|n[3]};for(let t=0;t{if(e.isPoints&&e.baseId){e.material.enablePicking(!1);for(let r=0;r4&&void 0!==arguments[4]?arguments[4]:[];if(t.viewToNormalizedCoords(e,u),r<0){h.setFromCamera(u,t.camera3D);const e=h.intersectObject(n,!0);for(const t of e)t.layer=c(t.object),s.push(t);return s}const o={x:e.x-r,y:e.y-r,width:1+2*r,height:1+2*r},a=t.mainLoop.gfxEngine.renderViewToBuffer({scene:n,camera:t.camera},o),d=new i.Color;t.mainLoop.gfxEngine.renderer.getClearColor(d);const p=Math.round(255*d.r),f=Math.round(255*d.g),m=Math.round(255*d.b),g=u.clone();return l(r,((e,i)=>{const o=4*((i+r)*(2*r+1)+(e+r)),l=a[o],d=a[o+1],A=a[o+2];if(Math.abs(p-l)<=1&&Math.abs(f-d)<=1&&Math.abs(m-A)<=1)return;g.setX(u.x+e/t.camera.width).setY(u.y+i/t.camera.height),h.setFromCamera(g,t.camera3D);const y=h.intersectObject(n,!0);for(const t of y)t.layer=c(t.object),s.push(t);return 0==s.length})),s}}},51969:(t,e,r)=>{"use strict";r.d(e,{Z:()=>f});var i=r(99477),n=r(62310),s=r(71440);const o=Math.PI/4,a=1/(2*Math.PI),l=new i.Vector3(0,0,1),c=new i.Vector3(0,1,0),h=new i.Quaternion,u=new i.Quaternion,d=new i.Quaternion;function p(t){return 1-(.5-Math.log(Math.tan(o+.5*i.MathUtils.degToRad(t)))*a)}const f=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.tmp={coords:[new n.Z("EPSG:4326",0,0),new n.Z("EPSG:4326",0,0)],position:new i.Vector3,dimension:new i.Vector2},this.crs=t.crs,this.uvCount=t.uvCount,this.computeUvs=[()=>{},t=>{const e=p(t.projected.latitude)*t.nbRow;return(isFinite(e)?e:0)-t.deltaUV1}]}prepare(t){t.nbRow=2**(t.level+1);let e=p(t.extent.south);isFinite(e)||(e=0);const r=e%(1/t.nbRow);t.deltaUV1=(e-r)*t.nbRow,t.quatNormalToZ=d.setFromAxisAngle(c,-(.5*Math.PI-i.MathUtils.degToRad(t.extent.center().latitude))),t.projected={longitude:0,latitude:0},t.extent.planarDimensions(this.tmp.dimension)}center(t){return t.center(this.tmp.coords[0]).as(this.crs,this.tmp.coords[1]).toVector3()}vertexPosition(t){return this.tmp.coords[0].setFromValues(t.projected.longitude,t.projected.latitude),this.tmp.coords[0].as(this.crs,this.tmp.coords[1]).toVector3(this.tmp.position),this.tmp.position}vertexNormal(){return this.tmp.coords[1].geodesicNormal}uProjecte(t,e){e.projected.longitude=e.extent.west+t*this.tmp.dimension.x}vProjecte(t,e){e.projected.latitude=e.extent.south+t*this.tmp.dimension.y}computeSharableExtent(t){const e=Math.abs(t.west-t.east)/2,r=new s.ZP(t.crs,-e,e,t.south,t.north),n=i.MathUtils.degToRad(t.west-r.west),o=i.MathUtils.degToRad(90-t.center(this.tmp.coords[0]).latitude);return h.setFromAxisAngle(l,n),u.setFromAxisAngle(c,o),h.multiply(u),{sharableExtent:r,quaternion:h.clone(),position:this.center(t)}}}},49401:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(99477),n=r(96021),s=r(2359),o=r(71440),a=r(51969),l=r(81189),c=r(79323);const h=new i.Matrix4,u=new i.Vector3;let d=0;const p=new i.Vector3;class f extends n.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=o.dS.get(c.Z.tms_4326),l=o.Mh.get("EPSG:4326").subdivisionByScheme(n);r.tileMatrixSets=[c.Z.tms_4326,c.Z.tms_3857];const u=r.tileMatrixSets.length,d=new a.Z({crs:"EPSG:4978",uvCount:u});super(t,e||new i.Group,l,d,r),this.isGlobeLayer=!0,this.options.defaultPickingRadius=5,this.minSubdivisionLevel=null==this.minSubdivisionLevel?2:this.minSubdivisionLevel,this.maxSubdivisionLevel=null==this.maxSubdivisionLevel?19:this.maxSubdivisionLevel,this.maxDeltaElevationLevel=this.maxDeltaElevationLevel||4,this.extent=this.schemeTile[0].clone();for(let t=1;t0:d{"use strict";r.d(e,{b:()=>R,Z:()=>L});var i=r(99477),n=r(73502),s=r(61861),o=r(62310),a=r(49401),l=r(45222),c=r(2359);const h={getSunPosition(){const t=Math,e=t.PI,r=t.sin,i=t.cos,n=t.tan,s=t.asin,o=t.atan2,a=e/180,l=23.4397*a;function c(t,e,s){return o(r(t),i(t)*r(e)-n(s)*i(e))}function h(t,e,n){return s(r(e)*r(n)+i(e)*i(n)*i(t))}return function(t,u,d){const p=a*u,f=function(t){return function(t){return t.valueOf()/864e5-.5+2440588}(t)-2451545}(t),m=function(t){return a*(357.5291+.98560028*t)}(f),g=function(t){return a*(1.9148*r(t)+.02*r(2*t)+3e-4*r(3*t))}(m),A=function(t,r){return t+r+102.9372*a+e}(m,g),y=(v=A,s(r(0)*i(l)+i(0)*r(l)*r(v)));var v;const x=function(t,e){return o(r(t)*i(l)-n(0)*r(l),i(t))}(A),b=function(t,e){return a*(280.16+360.9856235*t)-e}(f,a*-d),_=b-x;return{EclipticLongitude:A,declinaison:y,ascension:x,H:_,SiderealTime:b,altitude:h(_,p,y),azimuth:c(_,p,y)+e/2}}},getSunPositionInScene(t,e,r){const i=864e5,n=h.getSunPosition()(t,e,r).ascension+t%i/i*-360+180;return new o.Z("EPSG:4326",n,e,5e7).as("EPSG:4978").toVector3()}},u=h,d={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},v3LightPosition:{type:"v3",value:new i.Vector3},up:{type:"v3",value:new i.Vector3(0,1,0)}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( cameraPosition + position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( cameraPosition + position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 v3LightPosition;","uniform vec3 up;","varying vec3 vWorldPosition;","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","vec3 up2 = normalize(cameraPosition.xyz);","float sunfade = 1.0-clamp(1.0-exp((v3LightPosition.y/450000.0)),0.0,1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(v3LightPosition);","float sunE = sunIntensity(dot(sunDirection, up2));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up2, normalize(vWorldPosition - cameraPosition))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPosition), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up2, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPosition);","float theta = acos(direction.y); // elevation --\x3e y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --\x3e x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPosition).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1. - ( (length(cameraPosition) - 6400000.) / 1000.);","}"].join("\n")};class p extends i.Mesh{constructor(){const t=i.UniformsUtils.clone(d.uniforms),e=new i.ShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:t,side:i.BackSide,transparent:!0,depthWrite:!1});super(new i.SphereGeometry(4e4,32,15),e)}}const f=p,m="#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvec4 glowColor = vec4(0.45, 0.74, 1. ,1.0);\n\nvoid main() {\n #include \n gl_FragColor = glowColor * intensity;\n}\n\n",g="#include \n#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvoid main()\n{\n vec3 normalES = normalize( normalMatrix * normal );\n vec3 normalCAMES = normalize( normalMatrix * cameraPosition );\n\n if(atmoIN == 0) {\n intensity = pow(0.666 - dot(normalES, normalCAMES), 4. );\n } else {\n intensity = pow( 1. - dot(normalES, normalCAMES), 0.8 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n #include \n}\n\n\n",A=new i.Vector3(1,0,0),y=new i.Vector3,v=new o.Z("EPSG:4326"),x=new o.Z("EPSG:4326"),b=new i.Color(9688568),_=new i.Color,w=new i.Color(197896),E=6e5,M=160*c.c.x;class S extends l.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"atmosphere",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.source=!1,super(t,new i.Object3D,e),this.isAtmosphere=!0;const r=new i.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:0},screenSize:{type:"v2",value:new i.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:i.BackSide,blending:i.AdditiveBlending,transparent:!0,wireframe:!1}),n=new i.SphereGeometry(1,64,64),s=new i.Mesh(n,r);s.scale.copy(c.c).multiplyScalar(1.14),this.basicAtmosphere=new i.Object3D,this.realisticAtmosphere=new i.Object3D,this.realisticAtmosphere.visible=!1,this.object3d.add(this.basicAtmosphere),this.object3d.add(this.realisticAtmosphere),this.basicAtmosphere.add(s);const o=new i.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:1},screenSize:{type:"v2",value:new i.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:i.FrontSide,blending:i.AdditiveBlending,transparent:!0,depthWrite:!1}),a=new i.Mesh(n,o);a.scale.copy(c.c).multiplyScalar(1.002),this.basicAtmosphere.add(a),this.realisticLightingPosition={x:-.5,y:0,z:1},this.fog={enable:!0,distance:M},this.realisticAtmosphereInitParams=e.Kr?e:{Kr:.0025,Km:.0015,ESun:20,g:-.95,innerRadius:64e5,outerRadius:67e5,wavelength:[.65,.57,.475],scaleDepth:.25},this.object3d.updateMatrixWorld()}update(t,e,r){r.material.fogDistance=this.fog.distance,r.material.lightingEnabled=this.realisticAtmosphere.visible,r.material.lightPosition=this.realisticLightingPosition}preUpdate(t){const e=t.view.camera3D.position;if(this.fog.enable){y.setFromMatrixPosition(t.view.tileLayer.object3d.matrixWorld);const r=y.distanceTo(e);this.fog.distance=M*(.25*(r-.99*c.c.x)/c.c.x)**1.5}else this.fog.distance=1e11;const r=t.view.mainLoop.gfxEngine.renderer;v.crs=t.view.referenceCrs,v.setFromVector3(e).as("EPSG:4326",x);const i=x.altitude;it.material.uniforms.v3LightPosition.value.copy(this.realisticLightingPosition)))),this.basicAtmosphere.visible=!t,this.realisticAtmosphere.visible=t}}const C=S;var T=r(32533),I=r(79323);const R={GLOBE_INITIALIZED:n.b.INITIALIZED,LAYER_ADDED:n.b.LAYER_ADDED,LAYER_REMOVED:n.b.LAYER_REMOVED,COLOR_LAYERS_ORDER_CHANGED:n.b.COLOR_LAYERS_ORDER_CHANGED};class B extends n.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.Object3D.DEFAULT_UP.set(0,0,1),super("EPSG:4978",t,r),this.isGlobeView=!0,this.camera3D.near=Math.max(15,2352e-9*c.c.x),this.camera3D.far=10*c.c.x;const n=new a.Z("globe",r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=n.info;const l=new i.DirectionalLight;l.position.set(-.5,0,1),l.updateMatrixWorld(!0),this.scene.add(l),this.addLayer(n),this.tileLayer=n,e.isExtent||(e.coord=e.coord||new o.Z("EPSG:4326",0,0),e.tilt=e.tilt||89.5,e.heading=e.heading||0,e.range=e.range||2*c.c.x),r.noControls?T.ZP.transformCameraToLookAtTarget(this,this.camera3D,e):(this.controls=new s.Z(this,e,r.controls),this.controls.handleCollision=void 0===r.handleCollision||r.handleCollision),this.addLayer(new C("atmosphere",r.atmosphere)),this.camera.resize(t.clientWidth,t.clientHeight)}addLayer(t){if(!t||!t.isLayer)return Promise.reject(new Error("Add Layer type object"));if(t.isColorLayer){if(!this.tileLayer.tileMatrixSets.includes(I.Z.formatToTms(t.source.crs)))return t._reject(`Only ${this.tileLayer.tileMatrixSets} tileMatrixSet are currently supported for color layers`)}else if(t.isElevationLayer&&I.Z.formatToTms(t.source.crs)!==this.tileLayer.tileMatrixSets[0])return t._reject(`Only ${this.tileLayer.tileMatrixSets[0]} tileMatrixSet is currently supported for elevation layers`);return super.addLayer(t,this.tileLayer)}getPixelsToDegrees(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.getMetersToDegrees(this.getPixelsToMeters(t,e))}getPixelsToDegreesFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.getMetersToDegrees(this.getPixelsToMetersFromDistance(t,e))}getMetersToDegrees(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return i.MathUtils.radToDeg(2*Math.asin(t/(2*c.c.x)))}}const L=B},16670:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var i=r(99477),n=r(96021),s=r(71440),o=r(79323),a=r(62310);const l=new i.Quaternion,c=new i.Vector3;class h extends n.Z{constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const h=o.Z.formatToTms(e.crs);s.Mh.get(e.crs)||s.Mh.set(e.crs,e),n.tileMatrixSets=[h],super(t,r||new i.Group,[e],new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.projection&&(console.warn("PlanarTileBuilder projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs)throw new Error("options.crs is mandatory for PlanarTileBuilder");this.crs=t.crs,this.tmp={coords:new a.Z("EPSG:4326",0,0),position:new i.Vector3,normal:new i.Vector3(0,0,1)},this.uvCount=t.uvCount||1}prepare(t){t.nbRow=2**(t.zoom+1),t.projected=new i.Vector3}center(t){return t.center(this.tmp.coords),c.set(this.tmp.coords.x,this.tmp.coords.y,0),c}vertexPosition(t){return this.tmp.position.set(t.projected.x,t.projected.y,0),this.tmp.position}vertexNormal(){return this.tmp.normal}uProjecte(t,e){e.projected.x=e.extent.west+t*(e.extent.east-e.extent.west)}vProjecte(t,e){e.projected.y=e.extent.south+t*(e.extent.north-e.extent.south)}computeSharableExtent(t){return{sharableExtent:new s.ZP(t.crs,0,Math.abs(t.west-t.east),0,Math.abs(t.north-t.south)),quaternion:l,position:this.center(t).clone()}}}({crs:e.crs}),n),this.isPlanarLayer=!0,this.extent=e,this.minSubdivisionLevel=null==this.minSubdivisionLevel?0:this.minSubdivisionLevel,this.maxSubdivisionLevel=null==this.maxSubdivisionLevel?5:this.maxSubdivisionLevel,this.maxDeltaElevationLevel=this.maxDeltaElevationLevel||4}}const u=h},39510:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var i=r(99477),n=r(73502),s=r(32533),o=r(29571),a=r(16670);class l extends n.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.Object3D.DEFAULT_UP.set(0,0,1),super(e.crs,t,r),this.isPlanarView=!0;const n=e.planarDimensions(),l=Math.max(n.x,n.y);this.camera3D.near=.1,this.camera3D.far=this.camera3D.isOrthographicCamera?2e3:2*l,this.camera3D.updateProjectionMatrix();const c=new a.Z("planar",e,r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=c.info,this.addLayer(c);const h=r.placement||{};h.isExtent||(h.coord=h.coord||e.center(),h.tilt=h.tilt||90,h.heading=h.heading||0,h.range=h.range||l),s.ZP.transformCameraToLookAtTarget(this,this.camera3D,h),r.noControls||(this.controls=new o.ZP(this,r.controls)),this.tileLayer=c}addLayer(t){return super.addLayer(t,this.tileLayer)}}const c=l},74593:(t,e,r)=>{"use strict";r.d(e,{N:()=>n,Z:()=>s});var i=r(99477);function n(t,e){return 3*(t*t*2+(e?0:4*t*2))}function s(t){const e={index:null,position:null,normal:null,uvs:[]},r=[],s=t.builder,o=t.segments,a=(o+1)*(o+1)+(t.disableSkirt?0:4*o);if(a>2**32)throw new Error("Tile segments count is too big");e.position=new Float32Array(3*a),e.normal=new Float32Array(3*a);const l=t.builder.uvCount;l>1&&(e.uvs[1]=new Float32Array(a)),r[0]=()=>{};const c=n(o,t.disableSkirt);t.buildIndexAndUv_0&&(a<256?e.index=new Uint8Array(c):a<65536?e.index=new Uint16Array(c):a<2**32&&(e.index=new Uint32Array(c)),e.uvs[0]=new Float32Array(2*a),r[0]=(t,r,i)=>{e.uvs[0][2*t+0]=r,e.uvs[0][2*t+1]=i});const h=Math.max(2,Math.floor(o)||2),u=Math.max(2,Math.floor(o)||2);let d=0;const p=[];let f=[];const m=[];s.prepare(t);for(let i=0;i<=u;i++){const n=[],o=i/u;if(s.vProjecte(o,t),l>1){const i=s.computeUvs[1](t);r[1]=t=>{e.uvs[1][t]=i}}for(let a=0;a<=h;a++){const l=a/h,c=3*d;s.uProjecte(l,t);const p=s.vertexPosition(t,t.projected),g=s.vertexNormal(t);p.sub(t.center),t.quatNormalToZ&&(p.applyQuaternion(t.quatNormalToZ),g.applyQuaternion(t.quatNormalToZ)),p.toArray(e.position,c),g.toArray(e.normal,c);for(const t of r)t(d,l,o);t.disableSkirt||0!==i&&i!==u&&(a===h?f.push(d):0===a&&m.push(d)),n.push(d),d++}p.push(n),0===i?f=f.concat(n):i===u&&(f=f.concat(n.slice().reverse()))}function g(t,r,i,n){return e.index[n+0]=t,e.index[n+1]=r,e.index[n+2]=i,n+3}t.disableSkirt||(f=f.concat(m.reverse()));let A=0;if(t.buildIndexAndUv_0)for(let t=0;t1&&(e.uvs[1][d]=e.uvs[1][i]);const c=(t+1)%f.length;A=n(A,i,d,0===c?y:d+1,f[c]),d++}}return e}},55086:(t,e,r)=>{"use strict";let i;r.d(e,{D:()=>n,Z:()=>s});const n={INFINITE:1/0,TEXTURE:9e5,GEOMETRY:9e5},s=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.INFINITE;this.lifeTime=t,this.lastTimeFlush=Date.now(),this.data=new Map}getByArray(t){return this.get(t[0],t[1],t[2])}setByArray(t,e){return this.set(t,e[0],e[1],e[2])}get(t,e,r){const n=this.data.get(t);if(null!=n){if(null!=n.lastTimeUsed)i=n;else{const t=n.get(e);if(null==t)return;if(null!=t.lastTimeUsed)i=t;else{const e=t.get(r);if(null==e)return;i=e}}return i.value?(i.lastTimeUsed=Date.now(),i.value):void 0}}set(t,e,r,n){if(i={value:t,lastTimeUsed:Date.now()},null==r)return this.data.set(e,i),t;this.data.get(e)||this.data.set(e,new Map);const s=this.data.get(e);return null==n?(s.set(r,i),t):(s.get(r)||s.set(r,new Map),s.get(r).set(n,i),t)}delete(t,e,r){const i=this.data.get(t);if(void 0!==i)if(null!=i.lastTimeUsed)this.data.get(t),this.data.delete(t);else{const n=i.get(e);if(void 0===n)return;if(null!=n.lastTimeUsed)i.get(e),i.delete(e),0==i.size&&this.data.delete(t);else{if(void 0===n.get(r))return;n.get(r),n.delete(r),0==n.size&&(i.delete(e),0==i.size&&this.data.delete(t))}}}clear(){this.data.clear()}flush(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.lifeTime==n.INFINITE||this.lifeTime>t-this.lastTimeFlush||!this.data.size||(this.lastTimeFlush=1/0,this.data.forEach(((e,r)=>{this.lifeTime{this.lifeTime{this.lifeTime{"use strict";r.d(e,{uP:()=>_,ZP:()=>S,Lu:()=>m});var i=r(5167),n=r(55086),s=r(45340),o=r(92294),a=r(99477);function l(t){let e,r,i,n=t.r||t[0]/255,s=t.g||t[1]/255,o=t.b||t[2]/255;return n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,e=(.4124*n+.3576*s+.1805*o)/.95047,r=(.2126*n+.7152*s+.0722*o)/1,i=(.0193*n+.1192*s+.9505*o)/1.08883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(e-r),200*(r-i)]}function c(t,e){const r=l(t),i=l(e),n=r[0]-i[0],s=r[1]-i[1],o=r[2]-i[2],a=Math.sqrt(r[1]*r[1]+r[2]*r[2]),c=a-Math.sqrt(i[1]*i[1]+i[2]*i[2]);let h=s*s+o*o-c*c;h=h<0?0:Math.sqrt(h);const u=n/1,d=c/(1+.045*a),p=h/(1+.015*a),f=u*u+d*d+p*p;return f<0?0:Math.sqrt(f)}var h=r(62310);const u=new n.Z,d=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),p=document.createElement("canvas");function f(t,e){var r;return(null==e||null===(r=e.coordinates)||void 0===r?void 0:r.z)||0}function m(t,e){if(null!=t){if(t.expression)return t.expression.evaluate(e);if(t.stops){for(let r=t.stops.length-1;r>=0;r--){const i=t.stops[r];if(e.zoom>=i[0])return i[1]}return t.stops[0][1]}return("string"==typeof t||t instanceof String)&&(t=t.replace(/\{(.+?)\}/g,((t,r)=>e.properties[r]||"")).trim()),t instanceof Function?t(e.properties,e):t}}function g(t){if(!t)return{};if(t.stops||t.expression)return{color:t};if("string"==typeof t){const e=t.match(/(?:((hsl|rgb)a? *\(([\d.%]+(?:deg|g?rad|turn)?)[ ,]*([\d.%]+)[ ,]*([\d.%]+)[ ,/]*([\d.%]*)\))|(#((?:[\d\w]{3}){1,2})([\d\w]{1,2})?))/i);if(!e)return{color:t,opacity:1};if(e[7]){let t=1;return e[9]&&(t=.00392156862745098*parseInt(1==e[9].length?`${e[9]}${e[9]}`:e[9],16)),{color:`#${e[8]}`,opacity:t}}if(e[0])return{color:`${e[2]}(${e[3]},${e[4]},${e[5]})`,opacity:Number(e[6])||1}}}function A(t,e){if(null!=t)return o.th.isExpression(t)?o.th.createExpression(t,e).value:t}async function y(t){let e=u.get(t,"null");return e||(e=s.Z.texture(t,{crossOrigin:"anonymous"}),u.set(e,t,"null")),(await e).image}function v(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:t.naturalWidth,height:t.naturalHeight};p.width=e.width,p.height=e.height;const r=p.getContext("2d",{willReadFrequently:!0});return r.drawImage(t,e.x||0,e.y||0,e.width,e.height,0,0,e.width,e.height),r.getImageData(0,0,e.width,e.height)}const x={left:[0,-.5],right:[-1,-.5],top:[-.5,0],bottom:[-.5,-1],"top-right":[-1,0],"bottom-left":[0,-1],"bottom-right":[-1,-1],center:[-.5,-.5],"top-left":[0,0]};function b(t,e,r,i,n){let s;Object.defineProperty(t[e],r,{enumerable:!0,get:()=>{var o,a;if(null!=s)return s;if(null!=i)return m(i,t.context);const l=null===(o=t.context.featureStyle)||void 0===o||null===(a=o[e])||void 0===a?void 0:a[r];return null!=l?m(l,t.context):n instanceof Function?n(t.context.properties,t.context):n},set:t=>{s=t}})}class _{#c=new h.Z("EPSG:4326",0,0,0);#h=new h.Z("EPSG:4326",0,0,0);#u=!0;#d={};#p={};setZoom(t){this.zoom=t}setFeature(t){this.#d=t}setGeometry(t){this.#p=t}setCollection(t){this.collection=t,this.#h.setCrs(t.crs)}setLocalCoordinatesFromArray(t,e){return this.#u=!1,this.#h.setFromArray(t,e)}get properties(){return this.#p.properties}get type(){return this.#d.type}get featureStyle(){let t=this.#d.style;return t instanceof Function&&(t=t(this.properties,this)),t}get coordinates(){return this.#u||(this.#u=!0,this.#c.copy(this.#h).applyMatrix4(this.collection.matrixWorld),"EPSG:4978"!=this.#h.crs)?this.#c:this.#c.as("EPSG:4326",this.#c)}}class w{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isStyle=!0,this.context=new _,this.order=t.order||0,t.zoom=t.zoom||{},t.fill=t.fill||{},t.stroke=t.stroke||{},t.point=t.point||{},t.text=t.text||{},t.icon=t.icon||{},this.zoom={},b(this,"zoom","min",t.zoom.min),b(this,"zoom","max",t.zoom.max),this.fill={},b(this,"fill","color",t.fill.color),b(this,"fill","opacity",t.fill.opacity,1),b(this,"fill","pattern",t.fill.pattern),b(this,"fill","base_altitude",t.fill.base_altitude,f),t.fill.extrusion_height&&b(this,"fill","extrusion_height",t.fill.extrusion_height),this.stroke={},b(this,"stroke","color",t.stroke.color),b(this,"stroke","opacity",t.stroke.opacity,1),b(this,"stroke","width",t.stroke.width,1),b(this,"stroke","dasharray",t.stroke.dasharray,[]),b(this,"stroke","base_altitude",t.stroke.base_altitude,f),this.point={},b(this,"point","color",t.point.color),b(this,"point","line",t.point.line),b(this,"point","opacity",t.point.opacity,1),b(this,"point","radius",t.point.radius,2),b(this,"point","width",t.point.width,0),b(this,"point","base_altitude",t.point.base_altitude,f),t.point.model&&b(this,"point","model",t.point.model),this.text={},b(this,"text","field",t.text.field),b(this,"text","zOrder",t.text.zOrder,"auto"),b(this,"text","color",t.text.color,"#000000"),b(this,"text","anchor",t.text.anchor,"center"),b(this,"text","offset",t.text.offset,[0,0]),b(this,"text","padding",t.text.padding,2),b(this,"text","size",t.text.size,16),b(this,"text","placement",t.text.placement,"point"),b(this,"text","rotation",t.text.rotation,"auto"),b(this,"text","wrap",t.text.wrap,10),b(this,"text","spacing",t.text.spacing,0),b(this,"text","transform",t.text.transform,"none"),b(this,"text","justify",t.text.justify,"center"),b(this,"text","opacity",t.text.opacity,1),b(this,"text","font",t.text.font,["Open Sans Regular","Arial Unicode MS Regular","sans-serif"]),b(this,"text","haloColor",t.text.haloColor,"#000000"),b(this,"text","haloWidth",t.text.haloWidth,0),b(this,"text","haloBlur",t.text.haloBlur,0),this.icon={},b(this,"icon","source",t.icon.source),t.icon.key&&(console.warn("'icon.key' is deprecated: use 'icon.id' instead"),t.icon.id=t.icon.key),b(this,"icon","id",t.icon.id),b(this,"icon","cropValues",t.icon.cropValues),b(this,"icon","anchor",t.icon.anchor,"center"),b(this,"icon","size",t.icon.size,1),b(this,"icon","color",t.icon.color),b(this,"icon","opacity",t.icon.opacity,1)}copy(t){return Object.assign(this.fill,t.fill),Object.assign(this.stroke,t.stroke),Object.assign(this.point,t.point),Object.assign(this.text,t.text),Object.assign(this.icon,t.icon),this}clone(){return(new w).copy(this)}setContext(t){this.context=t}static setFromProperties(t,e){const r=e.type,n={};if(r===i.tg.POINT){const e={...void 0!==t.fill&&{color:t.fill},...void 0!==t["fill-opacity"]&&{opacity:t["fill-opacity"]},...void 0!==t.stroke&&{line:t.stroke},...void 0!==t.radius&&{radius:t.radius}};Object.keys(e).length&&(n.point=e);const r={...void 0!==t["label-color"]&&{color:t["label-color"]},...void 0!==t["label-opacity"]&&{opacity:t["label-opacity"]},...void 0!==t["label-size"]&&{size:t["label-size"]}};Object.keys(e).length&&(n.text=r);const i={...void 0!==t.icon&&{source:t.icon},...void 0!==t["icon-scale"]&&{size:t["icon-scale"]},...void 0!==t["icon-opacity"]&&{opacity:t["icon-opacity"]},...void 0!==t["icon-color"]&&{color:t["icon-color"]}};Object.keys(i).length&&(n.icon=i)}else{const e={...void 0!==t.stroke&&{color:t.stroke},...void 0!==t["stroke-width"]&&{width:t["stroke-width"]},...void 0!==t["stroke-opacity"]&&{opacity:t["stroke-opacity"]}};if(Object.keys(e).length&&(n.stroke=e),r!==i.tg.LINE){const e={...void 0!==t.fill&&{color:t.fill},...void 0!==t["fill-opacity"]&&{opacity:t["fill-opacity"]}};Object.keys(e).length&&(n.fill=e)}}return n}static setFromVectorTileLayer(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n={fill:{},stroke:{},point:{},text:{},icon:{}};if(t.layout=t.layout||{},t.paint=t.paint||{},n.order=r,"fill"===t.type){const{color:r,opacity:i}=g(A(t.paint["fill-color"]||t.paint["fill-pattern"],{type:"color"}));if(n.fill.color=r,n.fill.opacity=A(t.paint["fill-opacity"])||i,t.paint["fill-pattern"])try{n.fill.pattern={id:t.paint["fill-pattern"],source:e.source,cropValues:e[t.paint["fill-pattern"]]}}catch(e){throw e.message=`VTlayer '${t.id}': argument sprites must not be null when using layer.paint['fill-pattern']`,e}if(t.paint["fill-outline-color"]){const{color:e,opacity:r}=g(A(t.paint["fill-outline-color"],{type:"color"}));n.stroke.color=e,n.stroke.opacity=r,n.stroke.width=1,n.stroke.dasharray=[]}}else if("line"===t.type){const e=A(t.paint["line-color"],{type:"color"}),{color:r,opacity:i}=g(e);n.stroke.dasharray=A(t.paint["line-dasharray"]),n.stroke.color=r,n.stroke.lineCap=t.layout["line-cap"],n.stroke.width=A(t.paint["line-width"]),n.stroke.opacity=A(t.paint["line-opacity"])||i}else if("circle"===t.type||i){const{color:e,opacity:r}=g(A(t.paint["circle-color"],{type:"color"}));n.point.color=e,n.point.opacity=r,n.point.radius=A(t.paint["circle-radius"])}else if("symbol"===t.type){n.text.zOrder=A(t.layout["symbol-z-order"]),"auto"==n.text.zOrder?n.text.zOrder=A(t.layout["symbol-sort-key"])||"Y":"viewport-y"==n.text.zOrder?n.text.zOrder="Y":"source"==n.text.zOrder&&(n.text.zOrder=0),n.text.anchor=A(t.layout["text-anchor"]),n.text.offset=A(t.layout["text-offset"]),n.text.padding=A(t.layout["text-padding"]),n.text.size=A(t.layout["text-size"]),n.text.placement=A(t.layout["symbol-placement"]),n.text.rotation=A(t.layout["text-rotation-alignment"]),n.text.field=A(t.layout["text-field"]),n.text.wrap=A(t.layout["text-max-width"]),n.text.spacing=A(t.layout["text-letter-spacing"]),n.text.transform=A(t.layout["text-transform"]),n.text.justify=A(t.layout["text-justify"]);const{color:r,opacity:i}=g(A(t.paint["text-color"],{type:"color"}));n.text.color=r,n.text.opacity=A(t.paint["text-opacity"])||void 0!==i&&i,n.text.font=A(t.layout["text-font"]);const s=A(t.paint["text-halo-color"],{type:"color"});s&&(n.text.haloColor=s.color||s,n.text.haloWidth=A(t.paint["text-halo-width"]),n.text.haloBlur=A(t.paint["text-halo-blur"]));const o=A(t.layout["icon-image"]);if(o)try{n.icon.id=o,n.icon.source=e.source,n.icon.cropValues=e[o],n.icon.size=A(t.layout["icon-size"])||1;const{color:r,opacity:i}=g(A(t.paint["icon-color"],{type:"color"}));n.icon.color=r,n.icon.opacity=A(t.paint["icon-opacity"])||void 0!==i&&i}catch(e){throw e.message=`VTlayer '${t.id}': argument sprites must not be null when using layer.layout['icon-image']`,e}}return n.zoom={min:t.minzoom||0,max:t.maxzoom||24},n}applyToCanvasPolygon(t,e,r,i){const n=this.context;this.stroke&&this._applyStrokeToPolygon(t,r,e,n),i&&this.fill&&this._applyFillToPolygon(t,r,e,n)}_applyStrokeToPolygon(t,e,r){t.strokeStyle!==this.stroke.color&&(t.strokeStyle=this.stroke.color);const i=(this.stroke.width||2)*e;t.lineWidth!==i&&(t.lineWidth=i);const n=null==this.stroke.opacity?1:this.stroke.opacity;n!==t.globalAlpha&&"number"==typeof n&&(t.globalAlpha=n),t.lineCap!==this.stroke.lineCap&&(t.lineCap=this.stroke.lineCap),t.setLineDash(this.stroke.dasharray.map((t=>t*e*2))),t.stroke(r)}async _applyFillToPolygon(t,e,r){if(this.fill.pattern){let r=this.fill.pattern;const i=this.fill.pattern.cropValues;this.fill.pattern.source&&(r=await y(this.fill.pattern.source)),v(r,i),t.fillStyle=t.createPattern(p,"repeat"),t.fillStyle.setTransform?t.fillStyle.setTransform(d.scale(e)):console.warn("Raster pattern isn't completely supported on Ie and edge",t.fillStyle)}else t.fillStyle!==this.fill.color&&(t.fillStyle=this.fill.color);this.fill.opacity!==t.globalAlpha&&(t.globalAlpha=this.fill.opacity),t.fill(r)}async applyToHTML(t){if(arguments.length>1&&console.warn("Deprecated argument sprites. Sprites must be configured in style."),t.style.padding=`${this.text.padding}px`,t.style.maxWidth=`${this.text.wrap}em`,t.style.color=this.text.color,this.text.size>0&&(t.style.fontSize=`${this.text.size}px`),t.style.fontFamily=this.text.font.join(","),t.style.textTransform=this.text.transform,t.style.letterSpacing=`${this.text.spacing}em`,t.style.textAlign=this.text.justify,t.style["white-space"]="pre-line",this.text.haloWidth>0&&(t.style.setProperty("--text_stroke_display","block"),t.style.setProperty("--text_stroke_width",`${this.text.haloWidth}px`),t.style.setProperty("--text_stroke_color",this.text.haloColor),t.setAttribute("data-before",t.textContent)),!this.icon.source)return;const e=document.createElement("img"),r=new Promise(((r,i)=>{const n={size:this.icon.size,color:this.icon.color,opacity:this.icon.opacity,anchor:this.icon.anchor};e.onload=()=>r(function(t,e,r){const i=t.cloneNode();switch(i.setAttribute("class","itowns-icon"),i.width=t.width*r.size,i.height=t.height*r.size,i.style.color=r.color,i.style.opacity=r.opacity,i.style.position="absolute",i.style.top="0",i.style.left="0",r.anchor){case"left":i.style.top=-.5*i.height+"px";break;case"right":i.style.top=-.5*i.height+"px",i.style.left=-i.width+"px";break;case"top":i.style.left=-.5*i.width+"px";break;case"bottom":i.style.top=-i.height+"px",i.style.left=-.5*i.width+"px";break;case"bottom-left":i.style.top=-i.height+"px";break;case"bottom-right":i.style.top=-i.height+"px",i.style.left=-i.width+"px";break;case"top-left":break;case"top-right":i.style.left=-i.width+"px";break;default:i.style.top=-.5*i.height+"px",i.style.left=-.5*i.width+"px"}return i.style["z-index"]=-1,e.appendChild(i),i}(e,t,n)),e.onerror=t=>i(t)}));if(this.icon.cropValues||this.icon.color){const t=this.icon.cropValues,r=this.icon.color,i=this.icon.id||this.icon.source,n=function(t,e,r){if(!e)return t;const i=u.get(r,e);if(!i){const i=t.data,n=new a.Color(e),s=new a.Color("white");for(let t=0,e=i.length;t{M.innerHTML+=`${E[t]}\n\n`})),"undefined"!=typeof document&&document.getElementsByTagName("head")[0].appendChild(M);const S=w},28448:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});let i=!1,n=8,s=4096;function o(t,e,r){const i=t.getContext(),n=i.createShader(e);return i.shaderSource(n,r),i.compileShader(n),n}function a(){return navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}const l={isLogDepthBufferSupported:()=>i,isFirefox:a,getMaxTextureUnitsCount:()=>n,getMaxTextureSize:()=>s,updateCapabilities(t){const e=t.getContext();n=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),s=e.getParameter(e.MAX_TEXTURE_SIZE);const r=e.createProgram(),l=o(t,e.VERTEX_SHADER,"void main() {\n gl_Position = vec4( 0.0, 0.0, 0.0, 1.0 );\n}");let c=`#define SAMPLE ${n}\n`;c+="uniform sampler2D uni[SAMPLE];\nvoid main() {\n gl_FragColor += texture2D(uni[SAMPLE-1], vec2(0));\n}";const h=o(t,e.FRAGMENT_SHADER,c);if(e.attachShader(r,l),e.attachShader(r,h),e.linkProgram(r),!1===e.getProgramParameter(r,e.LINK_STATUS)){if(!(n>16))throw new Error(`The GPU capabilities could not be determined accurately.\n Impossible to link a shader with the Maximum texture units ${n}`);{const t=e.getProgramInfoLog(r);console.warn(`${t}: using a maximum of 16 texture units instead of the reported value (${n})`),a()&&console.warn("It can come from a Mesa/Firefox bug;\n the shader compiles to an error when using more than 16 sampler uniforms,\n see https://bugzilla.mozilla.org/show_bug.cgi?id=777028"),n=16}}e.deleteProgram(r),e.deleteShader(l),e.deleteShader(h),i=t.capabilities.logarithmicDepthBuffer}}},42423:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(99477),n=r(74593);class s extends i.BufferGeometry{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){t.buildIndexAndUv_0=!0,t.center=t.builder.center(t.extent).clone();const e=(0,n.Z)(t);e.index=new i.BufferAttribute(e.index,1),e.uvs[0]=new i.BufferAttribute(e.uvs[0],2),e.position=new i.BufferAttribute(e.position,3),e.normal=new i.BufferAttribute(e.normal,3);for(let r=1;r{"use strict";r.d(e,{b:()=>K,Z:()=>ct});var i=r(99477),n=r(232);var s=r(99617),o=r(28448),a=r(97112),l=r(5199);const c=class{static isWebGLAvailable(){try{const t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}static isWebGL2Available(){try{const t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(t){return!1}}static isColorSpaceAvailable(t){try{const e=document.createElement("canvas"),r=window.WebGL2RenderingContext&&e.getContext("webgl2");return r.drawingBufferColorSpace=t,r.drawingBufferColorSpace===t}catch(t){return!1}}static getWebGLErrorMessage(){return this.getErrorMessage(1)}static getWebGL2ErrorMessage(){return this.getErrorMessage(2)}static getErrorMessage(t){const e={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let r='Your $0 does not seem to support $1';const i=document.createElement("div");return i.id="webglmessage",i.style.fontFamily="monospace",i.style.fontSize="13px",i.style.fontWeight="normal",i.style.textAlign="center",i.style.background="#fff",i.style.color="#000",i.style.padding="1.5em",i.style.width="400px",i.style.margin="5em auto 0",r=e[t]?r.replace("$0","graphics card"):r.replace("$0","browser"),r=r.replace("$1",{1:"WebGL",2:"WebGL 2"}[t]),i.innerHTML=r,i}};var h=r(49652),u=r(53175);const d=new i.Vector4,p=class{constructor(t){let e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,u.Dx)(n),void 0===n.antialias&&(n.antialias=!0),void 0===n.alpha&&(n.alpha=!0),void 0===n.logarithmicDepthBuffer&&(n.logarithmicDepthBuffer=!0),t.domElement?(e=t,r=e.domElement instanceof HTMLDivElement?e.domElement:e.domElement.parentElement):r=t,this.width=r.clientWidth,this.height=r.clientHeight,this.positionBuffer=null,this._nextThreejsLayer=1,this.fullSizeRenderTarget=new i.WebGLRenderTarget(this.width,this.height),this.fullSizeRenderTarget.texture.minFilter=i.LinearFilter,this.fullSizeRenderTarget.texture.magFilter=i.NearestFilter,this.fullSizeRenderTarget.depthBuffer=!0,this.fullSizeRenderTarget.depthTexture=new i.DepthTexture,this.fullSizeRenderTarget.depthTexture.type=i.UnsignedShortType,this.renderView=function(t){this.renderer.clear(),this.renderer.render(t.scene,t.camera3D),t.tileLayer&&this.label2dRenderer.render(t.tileLayer.object3d,t.camera3D)}.bind(this),this.onWindowResize=function(t,e){this.width=t,this.height=e,this.fullSizeRenderTarget.setSize(this.width,this.height),this.renderer.setSize(this.width,this.height),this.label2dRenderer.setSize(this.width,this.height)}.bind(this);try{this.label2dRenderer=new h.Z,this.label2dRenderer.setSize(this.width,this.height),r.appendChild(this.label2dRenderer.domElement),this.renderer=e||new i.WebGLRenderer({canvas:document.createElement("canvas"),antialias:n.antialias,alpha:n.alpha,logarithmicDepthBuffer:n.logarithmicDepthBuffer}),this.renderer.domElement.style.position="relative",this.renderer.domElement.style.zIndex=0,this.renderer.domElement.style.top=0}catch(t){throw c.isWebGL2Available()||r.appendChild(c.getErrorMessage(2)),t}-1===this.renderer.domElement.tabIndex&&(this.renderer.domElement.tabIndex=-1),o.Z.updateCapabilities(this.renderer),this.renderer.setClearColor(197896),this.renderer.autoClear=!1,this.renderer.sortObjects=!0,this.renderer.debug.checkShaderErrors=!1,e||(this.renderer.setPixelRatio(r.devicePixelRatio),this.renderer.setSize(r.clientWidth,r.clientHeight),r.appendChild(this.renderer.domElement))}getWindowSize(){return new i.Vector2(this.width,this.height)}getRenderer(){return this.renderer}renderViewToBuffer(t,e){return e||(e={x:0,y:0,width:this.width,height:this.height}),e.buffer=e.buffer||new Uint8Array(4*e.width*e.height),this.renderViewToRenderTarget(t,this.fullSizeRenderTarget,e),this.renderer.readRenderTargetPixels(this.fullSizeRenderTarget,e.x,this.height-(e.y+e.height),e.width,e.height,e.buffer),e.buffer}renderViewToRenderTarget(t,e,r){e||(e=this.fullSizeRenderTarget);const i=this.renderer.getRenderTarget();return r&&(this.fullSizeRenderTarget.scissor.set(r.x,e.height-(r.y+r.height),r.width,r.height),this.fullSizeRenderTarget.scissorTest=!0),this.renderer.setRenderTarget(e),this.renderer.clear(!0,!0,!1),this.renderer.render(t.scene,t.camera.camera3D),this.renderer.setRenderTarget(i),this.fullSizeRenderTarget.scissorTest=!1,e}bufferToImage(t,e,r){const i=document.createElement("canvas"),n=i.getContext("2d",{willReadFrequently:!0});i.width=e,i.height=r;const s=n.getImageData(0,0,e,r);s.data.set(t),n.putImageData(s,0,0);const o=new Image;return o.src=i.toDataURL(),o}depthBufferRGBAValueToOrthoZ(t,e){if(d.fromArray(t).divideScalar(255),o.Z.isLogDepthBufferSupported()&&"PerspectiveCamera"==e.type)return 2**(2*(0,l.On)(d)/(2/(Math.log(e.far+1)/Math.LN2)));{let t=(0,l.On)(d);return t=2*t-1,t}}};var f=r(14625),m=r(79323),g=r(62310),A=r(29372),y=r(95307);const v={executeCommand(t){const e=t.layer,r=t.extentsSource,i=t.extentsDestination||r;return Promise.all(r.map(((t,r)=>e.getData(t,i[r]))))}},x=class{constructor(t){this.command=t,this.isCancelledCommandException=!0}toString(){return`Cancelled command ${this.command.requester.id}/${this.command.layer.id}`}},b={executeCommand(t){const e=[],r=t.layer,i=t.requester,n=t.extentsSource;if(i&&!i.material)return Promise.reject(new x(t));for(const t of n)e.push(r.convert(i,t));return Promise.all(e)}};var _=r(5626),w=r(59099),E=r(43195),M=r(61366),S=r(25542);const C=(new i.Matrix4).makeRotationX(-Math.PI/2),T=(new i.Matrix4).makeRotationZ(-Math.PI/2),I=new TextDecoder;function R(t){const e=["MODELVIEW","MODELVIEWINVERSETRANSPOSE","PROJECTION","JOINTMATRIX"];if(t.gltfShader){const r=[];for(const e in t.gltfShader.boundUniforms)r.push(e);for(const i of r){const r=t.gltfShader.boundUniforms[i].semantic;e.includes(r)||delete t.gltfShader.boundUniforms[i]}}}const B={parse(t,e){const r=!0===e.frustumCulled;if(!t)throw new Error("No array buffer provided.");const n=new DataView(t,4);let s=0;const a={};if(a.magic=I.decode(new Uint8Array(t,0,4)),a.magic){a.version=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.byteLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.FTJSONLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.FTBinaryLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.BTJSONLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.BTBinaryLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT;const l=s+4,c=[];let h={};const u=new i.Vector3;if(a.FTJSONLength>0){const e=l,r=t.slice(e,a.FTJSONLength+e),i=I.decode(new Uint8Array(r));h=JSON.parse(i),h.RTC_CENTER?u.fromArray(h.RTC_CENTER):u.set(0,0,0)}if(a.FTBinaryLength>0&&console.warn("3D Tiles feature table binary not supported yet."),a.BTJSONLength>0){const r=l+a.FTJSONLength+a.FTBinaryLength,i=t.slice(r,r+a.BTJSONLength+a.BTBinaryLength);c.push(Promise.resolve(new _.Z(i,a.BTJSONLength,a.BTBinaryLength,h.BATCH_LENGTH,e.registeredExtensions)))}else c.push(Promise.resolve(new _.Z));const d=l+a.FTJSONLength+a.FTBinaryLength+a.BTJSONLength+a.BTBinaryLength,p=t.slice(d),f=new DataView(p,0,20),m=function(t){if(t.frustumCulled=r,t.material){if(e.overrideMaterials){const r=t.material;"object"==typeof e.overrideMaterials&&e.overrideMaterials.isMaterial?t.material=e.overrideMaterials:t.material=new i.MeshBasicMaterial,(0,w.Z)(r)}else o.Z.isLogDepthBufferSupported()&&t.material.isRawShaderMaterial&&!e.doNotPatchMaterial&&(E.Z.patchMaterialForLogDepthSupport(t.material),console.warn("glTF shader has been patched to add log depth buffer support"));(0,M.Z)(t.material,e.layer)}};return c.push(S.ZP.parse(p,e).then((t=>{for(const e of t.scenes)e.traverse(R);var r,i;r=t.scene,"Z"===(i=e.gltfUpAxis)?r.applyMatrix4(C):"X"===i&&(r.applyMatrix4(C),r.applyMatrix4(T));const n=o.Z.isLogDepthBufferSupported()&&!e.doNotPatchMaterial;(!1===e.frustumCulling||e.overrideMaterials||n||e.layer)&&t.scene.traverse(m),t.scene.position.copy(u);const s=new Uint8Array(p,20,f.getUint32(12,!0)),a=I.decode(new Uint8Array(s)),l=JSON.parse(a);return l.extensions&&l.extensions.CESIUM_RTC&&(t.scene.position.fromArray(l.extensions.CESIUM_RTC.center),t.scene.updateMatrixWorld(!0)),t})).catch((t=>{throw new Error(t)}))),Promise.all(c).then((t=>({gltf:t[1],batchTable:t[0]}))).catch((t=>{throw new Error(t)}))}throw new Error("Invalid b3dm file.")}},L=new TextDecoder,P=function(t,e){if(!t)throw new Error("No array buffer provided.");const r=new DataView(t);let n=0;const s={};let o={},a={};if(s.magic=L.decode(new Uint8Array(t,n,4)),n+=4,s.magic){s.version=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.byteLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.FTJSONLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.FTBinaryLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.BTBinaryLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT;let l={};if(s.FTJSONLength>0){const e=n,r=t.slice(e,s.FTJSONLength+e),i=L.decode(new Uint8Array(r));l=JSON.parse(i)}if(s.FTBinaryLength>0&&(a=function(t,e,r){const n=new i.BufferGeometry,s=L.decode(new Uint8Array(t,e,r)),o=JSON.parse(s);let a;if(o.POINTS_LENGTH&&(a=o.POINTS_LENGTH),o.POSITION){const r=o.POSITION.byteOffset+s.length+e,l=new Float32Array(t,r,3*a);n.setAttribute("position",new i.BufferAttribute(l,3))}if(o.RGB){const r=o.RGB.byteOffset+s.length+e,l=new Uint8Array(t,r,3*a);n.setAttribute("color",new i.BufferAttribute(l,3,!0))}if(o.POSITION_QUANTIZED)throw new Error("For pnts loader, POSITION_QUANTIZED: not yet managed");if(o.RGBA)throw new Error("For pnts loader, RGBA: not yet managed");if(o.RGB565)throw new Error("For pnts loader, RGB565: not yet managed");if(o.NORMAL)throw new Error("For pnts loader, NORMAL: not yet managed");if(o.NORMAL_OCT16P)throw new Error("For pnts loader, NORMAL_OCT16P: not yet managed");if(o.BATCH_ID)throw new Error("For pnts loader, BATCH_ID: not yet managed");return{geometry:n,offset:o.RTC_CENTER?(new i.Vector3).fromArray(o.RTC_CENTER):void 0}}(t,n,s.FTJSONLength)),s.BTJSONLength>0){const r=n+s.FTJSONLength+s.FTBinaryLength,c=t.slice(r,s.BTJSONLength+s.BTBinaryLength+r);o=new _.Z(c,s.BTJSONLength,s.BTBinaryLength,l.BATCH_ID&&l.BATCH_LENGTH?l.BATCH_LENGTH:l.POINTS_LENGTH,e),a=function(t,e){if(t.geometry)return e.content&&e.content.Classification&&t.geometry.setAttribute("classification",new i.BufferAttribute(new Uint8Array(e.content.Classification),1,!0)),t}(a,o)}const c={point:a,batchTable:o};return Promise.resolve(c)}throw new Error("Invalid pnts file.")};var D=r(45340),O=r(25033);const k=new TextDecoder;function U(t,e,r){const n=i.LoaderUtils.extractUrlBase(r),s={gltfUpAxis:e.tileset.asset.gltfUpAxis,urlBase:n,overrideMaterials:e.overrideMaterials,doNotPatchMaterial:e.doNotPatchMaterial,registeredExtensions:e.registeredExtensions,layer:e};return B.parse(t,s).then((t=>({batchTable:t.batchTable,object3d:t.gltf.scene})))}function N(t,e,r){const n=i.LoaderUtils.extractUrlBase(r);return S.ZP.parse(t,n).then((t=>({object3d:t.scene})))}function F(t,e){return P(t,e.registeredExtensions).then((t=>{const r=e.material?e.material.clone():new O.ZP({size:.05,mode:e.pntsMode,shape:e.pntsShape,classification:e.classification,sizeMode:e.pntsSizeMode,minAttenuatedSize:e.pntsMinAttenuatedSize,maxAttenuatedSize:e.pntsMaxAttenuatedSize});(0,M.Z)(r,e);const n=new i.Points(t.point.geometry,r);return t.point.offset&&n.position.copy(t.point.offset),{object3d:n,batchTable:t.batchTable}}))}const z={executeCommand:function(t){const e=t.layer,r=t.metadata,n=new i.Object3D;!function(t,e,r,i){t.frustumCulled=!1,t.layer=e,r.transform&&t.applyMatrix4(r.transform),t.geometricError=r.geometricError,t.tileId=r.tileId,r.refine?t.additiveRefinement="ADD"===r.refine.toUpperCase():t.additiveRefinement=!!i&&i.additiveRefinement,t.viewerRequestVolume=r.viewerRequestVolume,t.boundingVolume=r.boundingVolume,t.updateMatrixWorld()}(n,e,r,t.requester);const s=r.content&&(r.content.url||r.content.uri),o=t=>{t.userData.metadata=r,t.layer=e};if(s){let t=s.startsWith("http")?s:r.baseURL+s;e.source.isC3DTilesGoogleSource&&(t=e.source.getTileUrl(t));const i={b3dm:U,pnts:F,gltf:N};return D.Z.arrayBuffer(t,e.source.networkOptions).then((s=>{if(void 0!==s){let a;const l=k.decode(new Uint8Array(s,0,4));if("{"===l[0]){s=JSON.parse(k.decode(new Uint8Array(s)));const i=e.source.isC3DTilesGoogleSource?e.source.baseUrl:t.slice(0,t.lastIndexOf("/")+1);e.tileset.extendTileset(s,r.tileId,i,e.registeredExtensions)}else if("b3dm"==l)a=i.b3dm;else if("pnts"==l)a=i.pnts;else{if("glTF"!=l)return Promise.reject(`Unsupported magic code ${l}`);a=i.gltf}if(a)return a(s,e,t).then((t=>(n.content=t.object3d,t.batchTable&&(n.batchTable=t.batchTable),n.add(t.object3d),n.traverse(o),n)))}return n.traverse(o),n}))}return n.traverse(o),Promise.resolve(n)}};var G=r(71440);let Q=1;const j={executeCommand(t){const e=t.layer,r=t.requester;return r.load().then((n=>{const s=new i.Points(n,e.material);return function(t){const e=t.geometry.attributes.position.count,r=new Uint8Array(4*e),n=Q++;if(e>65535||n>65535)return console.warn("Currently picking is limited to Points with less than 65535 elements and less than 65535 Points instances"),t;for(let t=0;t>24,r[4*t+1]=(16711680&e)>>16,r[4*t+2]=(65280&e)>>8,r[4*t+3]=(255&e)>>0}t.baseId=n,t.geometry.setAttribute("unique_id",new i.BufferAttribute(r,4,!0))}(s),s.frustumCulled=!1,s.matrixAutoUpdate=!1,s.position.copy(n.userData.origin||r.bbox.min),s.scale.copy(e.scale),s.updateMatrix(),s.tightbbox=n.boundingBox.applyMatrix4(s.matrix),s.layer=e,s.extent=G.ZP.fromBox3(t.view.referenceCrs,r.bbox),s.userData.node=r,s}))}};var V=r(4380);function H(t,e){const r=e.priority-t.priority;return 0===r?e.timestamp-t.timestamp:r}function W(){return{queue(t){const e=t.layer;let r=this.storages.get(e.id);r||(r={q:new y({comparator:H}),priority:1,accumulator:0},this.storages.set(e.id,r)),r.priority=e.priority||1,r.q.queue(t),this.counters.pending++},storages:new Map,counters:{executing:0,executed:0,failed:0,cancelled:0,pending:0},execute(t,e){return this.counters.pending--,this.counters.executing++,e.executeCommand(t).then((e=>{this.counters.executing--,t.resolve(e),this.counters.executed++}),(e=>{this.counters.executing--,t.reject(e),this.counters.failed++}))}}}function q(){this.defaultQueue=W(),this.hostQueues=new Map,this.providers={},this.maxCommandsPerHost=6,this.initDefaultProviders()}q.prototype.constructor=q,q.prototype.initDefaultProviders=function(){this.addProtocolProvider("tile",b),this.addProtocolProvider("3d-tiles",z),this.addProtocolProvider("pointcloud",j)},q.prototype.runCommand=function(t,e,r){const i=this.getProtocolProvider(t.layer.protocol);if(!i)throw new Error(`No known provider for layer ${t.layer.id}`);e.execute(t,i,r).then((()=>{if(t.view.notifyChange(t.requester,t.redraw),e.counters.executing{t.resolve=e,t.reject=r})),r&&!this.hostQueues.has(r)&&this.hostQueues.set(r,W());const i=r?this.hostQueues.get(r):this.defaultQueue;return t.timestamp=Date.now(),i.queue(t),i.counters.executing{if(i.counters.executing0&&(i+=t.priority,t.accumulator+=t.priority,(!e||t.accumulator>r)&&(e=t,r=t.accumulator))}if(e)return e.accumulator-=i,e.q}(t.storages);for(;e&&e.length>0;){const r=e.dequeue();if(!r.earlyDropFunction||!r.earlyDropFunction(r))return r;t.counters.pending--,t.counters.cancelled++,r.reject(new x(r))}};const Z=q;var Y=r(98675),X=r(76257),J=r(70991);const K={LAYERS_INITIALIZED:"layers-initialized",LAYER_REMOVED:"layer-removed",LAYER_ADDED:"layer-added",INITIALIZED:"initialized",COLOR_LAYERS_ORDER_CHANGED:a.i,CAMERA_MOVED:"camera-moved"},$=new i.Vector2,tt=new i.Matrix4,et=new i.Vector2,rt=new i.Ray,it=new i.Vector3,nt=new i.Vector3,st=new g.Z("EPSG:4326"),ot=[];let at;class lt extends i.EventDispatcher{#f=[];#m=new Uint8Array(4);#g;constructor(t,e){let r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("Invalid viewerDiv parameter (must non be null/undefined)");super(),this.domElement=e,this.referenceCrs=t,r=o.renderer&&o.renderer.domElement?new p(o.renderer):new p(e,o.renderer),this.mainLoop=o.mainLoop||new s.ZP(new Z,r),this.scene=o.scene3D||new i.Scene,o.scene3D||(this.scene.matrixWorldAutoUpdate=!1),this.camera=new n.Z(this.referenceCrs,this.mainLoop.gfxEngine.getWindowSize().x,this.mainLoop.gfxEngine.getWindowSize().y,o.camera),this._frameRequesters={},this._resizeListener=()=>this.resize(),window.addEventListener("resize",this._resizeListener,!1),this._changeSources=new Set,this._delayedFrameRequesterRemoval=[],this._allLayersAreReadyCallback=()=>{this.getLayers().every((t=>t.ready))&&0==this.mainLoop.scheduler.commandsWaitingExecutionCount()&&this.mainLoop.renderingState==s.HR&&(this.dispatchEvent({type:K.LAYERS_INITIALIZED}),this.removeFrameRequester(s.Ao.UPDATE_END,this._allLayersAreReadyCallback))},this.camera.resize(this.domElement.clientWidth,this.domElement.clientHeight);const a=()=>{this.removeEventListener(K.LAYERS_INITIALIZED,a),this.dispatchEvent({type:K.INITIALIZED})};let l;this.addEventListener(K.LAYERS_INITIALIZED,a),this.#g=new Uint8Array(4*this.camera.width*this.camera.height),this.domElement.tabIndex=-1,o.disableFocusOnStart||this.domElement.focus(),this.domElement.addEventListener("mouseup",(t=>{2===t.button&&(l&&t.timeStamp-l<500&&this.domElement.dispatchEvent(new MouseEvent("dblclick-right",t)),l=t.timeStamp)})),ot.push(this),o.webXR&&((t,e)=>{const r=e.scale||1,n=t.mainLoop.gfxEngine.renderer.xr;n.addEventListener("sessionstart",(()=>{const e=t.camera.camera3D,s=i=>{"Escape"===i.key&&(document.removeEventListener("keydown",s),n.enabled=!1,t.camera.camera3D=e,t.scene.scale.multiplyScalar(1/r),t.scene.updateMatrixWorld(),async function(t){t&&await t.end()}(n.getSession()),t.notifyChange(t.camera.camera3D,!0))};t.scene.scale.multiplyScalar(r),t.scene.updateMatrixWorld(),n.enabled=!0,n.getReferenceSpace("local");const o=t.camera.position(),a=(new i.Quaternion).setFromUnitVectors(new i.Vector3(0,0,1),o.geodesicNormal).invert(),l=new i.Quaternion(-1,0,0,1).normalize().multiply(a),c=e.position.clone().multiplyScalar(-r).applyQuaternion(l),h=new XRRigidTransform(c,l),u=n.getReferenceSpace().getOffsetReferenceSpace(h);n.setReferenceSpace(u),t.camera.camera3D=n.getCamera(),t.camera.resize(t.camera.width,t.camera.height),document.addEventListener("keydown",s,!1),n.setAnimationLoop((e=>{n.isPresenting&&t.camera.camera3D.cameras[0]&&(t.camera.camera3D.updateMatrix(),t.camera.camera3D.updateMatrixWorld(!0),t.notifyChange(t.camera.camera3D,!0)),t.mainLoop.step(t,e)}))}))})(this,o.webXR)}get renderer(){var t,e;return null===(t=this.mainLoop)||void 0===t||null===(e=t.gfxEngine)||void 0===e?void 0:e.getRenderer()}get camera3D(){var t;return null===(t=this.camera)||void 0===t?void 0:t.camera3D}dispose(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=ot.indexOf(this);if(-1==e)return void console.warn("View already disposed");window.removeEventListener("resize",this._resizeListener),this.controls&&("function"==typeof this.controls.dispose&&this.controls.dispose(),delete this.controls),this.removeAllFrameRequesters(),this.removeAllEvents();const r=this.getLayers((t=>!t.isTiledGeometryLayer&&!t.isAtmosphere));for(const e of r)this.removeLayer(e.id,t);const i=this.getLayers((t=>t.isAtmosphere));for(const e of i)this.removeLayer(e.id,t);const n=this.getLayers((t=>t.isTiledGeometryLayer));for(const e of n)this.removeLayer(e.id,t);ot.splice(e,1),this.scene.traverse(J.Z.cleanup)}addLayer(t,e){if(!t||!t.isLayer)return Promise.reject(new Error("Add Layer type object"));if(this.getLayerById(t.id))return t._reject(new Error(`Invalid id '${t.id}': id already used`));if(t=function(t,e,r){const i=e.source;if(r&&!e.extent&&(e.extent=r.extent,i&&!i.extent&&(i.extent=r.extent)),e.isGeometryLayer&&!e.isLabelLayer?e.crs=t.referenceCrs:e.crs||(r&&r.tileMatrixSets&&r.tileMatrixSets.includes(m.Z.formatToTms(i.crs))?e.crs=i.crs:e.crs=r&&r.extent.crs),e.isLabelLayer)t.mainLoop.gfxEngine.label2dRenderer.registerLayer(e);else if(e.labelEnabled||e.addLabelLayer){e.labelEnabled&&console.info("layer.labelEnabled is deprecated use addLabelLayer, instead of"),e.buildExtent=!0,e.structure="3d";const r=new X.Z(`${e.id}-label`,{source:i,style:e.style,zoom:e.zoom,performance:e.addLabelLayer.performance,crs:i.crs,visible:e.visible,margin:15,forceClampToTerrain:e.addLabelLayer.forceClampToTerrain});e.addEventListener("visible-property-changed",(()=>{r.visible=e.visible}));const n=i=>{i.layerId===e.id&&t.removeLayer(r.id),t.removeEventListener(K.LAYER_REMOVED,n)};t.addEventListener(K.LAYER_REMOVED,n),e.whenReady=e.whenReady.then((()=>(t.addLayer(r),e)))}return e}(this,t,e),e)if(t.isColorLayer){const r=this.getLayers((t=>t.isColorLayer));if(t.sequence=r.length,!(e.countColorLayersTextures(...r,t)<=(0,l.dn)()))return t._reject(new Error(`Cant add color layer ${t.id}: the maximum layer is reached`));e.attach(t)}else e.attach(t);else{if("function"!=typeof t.update)return t._reject(new Error("Cant add GeometryLayer: missing a update function"));if("function"!=typeof t.preUpdate)return t._reject(new Error("Cant add GeometryLayer: missing a preUpdate function"));this.#f.push(t)}return t.object3d&&!t.object3d.parent&&t.object3d!==this.scene&&this.scene.add(t.object3d),Promise.all(t._promises).then((()=>{t._resolve(),this.notifyChange(e||t,!1),this._frameRequesters[s.Ao.UPDATE_END]&&this._frameRequesters[s.Ao.UPDATE_END].includes(this._allLayersAreReadyCallback)||this.addFrameRequester(s.Ao.UPDATE_END,this._allLayersAreReadyCallback),this.dispatchEvent({type:K.LAYER_ADDED,layerId:t.id})}),t._reject),t.whenReady}removeLayer(t,e){const r=this.getLayerById(t);if(r){const i=r.parent;if(r.delete(e),i&&!i.detach(r))throw new Error(`Error to detach ${t} from ${i.id}`);if(null==i&&this.#f.splice(this.#f.findIndex((e=>e.id==t)),1),r.isColorLayer){const t=this.getLayers((t=>t.isColorLayer));for(const e of t)e.sequence>r.sequence&&e.sequence--}let n=0;for(const t of ot)n+=t.getLayers((t=>t.source.uid==r.source.uid&&t.crs==r.crs)).length;return r.source.onLayerRemoved({unusedCrs:0==n?r.crs:void 0}),this.notifyChange(this.camera),this.dispatchEvent({type:K.LAYER_REMOVED,layerId:t}),!0}throw new Error(`${t} doesn't exist`)}notifyChange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&(this._changeSources.add(t),this.mainLoop.gfxEngine.renderer.xr.isPresenting||!t.isTileMesh&&!t.isCamera||(this.#g.needsUpdate=!0)),this.mainLoop.scheduleViewUpdate(this,e)}getLayers(t){const e=[];for(const r of this.#f)if(t&&!t(r)||e.push(r),r.attachedLayers)for(const i of r.attachedLayers)t&&!t(i,r)||e.push(i);return e}getLayerById(t){return this.getLayers((e=>e.id===t))[0]}addFrameRequester(t,e){if("function"!=typeof e)throw new Error("frameRequester must be a function");this._frameRequesters[t]?this._frameRequesters[t].push(e):this._frameRequesters[t]=[e]}removeFrameRequester(t,e){this._frameRequesters[t].includes(e)?this._delayedFrameRequesterRemoval.push({when:t,frameRequester:e}):console.error("Invalid call to removeFrameRequester: frameRequester isn't registered")}removeAllFrameRequesters(){for(const t in this._frameRequesters)if(Object.prototype.hasOwnProperty.call(this._frameRequesters,t)){const e=this._frameRequesters[t];for(const r of e)this.removeFrameRequester(t,r)}this._executeFrameRequestersRemovals()}removeAllEvents(){if(void 0!==this._listeners){for(const t in this._listeners)Object.prototype.hasOwnProperty.call(this._listeners,t)&&delete this._listeners[t];this._listeners=void 0}}_executeFrameRequestersRemovals(){for(const t of this._delayedFrameRequesterRemoval){const e=this._frameRequesters[t.when].indexOf(t.frameRequester);e>=0?this._frameRequesters[t.when].splice(e,1):console.warn("FrameReq has already been removed")}this._delayedFrameRequesterRemoval.length=0}execFrameRequesters(t,e,r){if(this._frameRequesters[t]){this._delayedFrameRequesterRemoval.length>0&&this._executeFrameRequestersRemovals();for(var i=arguments.length,n=new Array(i>3?i-3:0),s=3;s1&&void 0!==arguments[1]?arguments[1]:$,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.domElement.getBoundingClientRect();if(t.touches&&t.touches.length)return e.set(t.touches[r].clientX-i.x,t.touches[r].clientY-i.y);if(void 0!==t.offsetX&&void 0!==t.offsetY){const r=t.target.getBoundingClientRect();return e.set(r.x+t.offsetX-i.x,r.y+t.offsetY-i.y)}}eventToNormalizedCoords(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewToNormalizedCoords(this.eventToViewCoords(t,$,e))}viewToNormalizedCoords(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$;return e.x=t.x/this.camera.width*2-1,e.y=t.y/this.camera.height*-2+1,e}normalizedToViewCoords(t){return $.x=.5*(t.x+1)*this.camera.width,$.y=-.5*(t.y-1)*this.camera.height,$}pickObjectsAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;const i=[];if(r&&0!==r.length||(r=this.getLayers((t=>t.isGeometryLayer))),Array.isArray(r)||(r=[r]),r.forEach((t=>{"string"==typeof t&&(t=this.getLayerById(t)),t&&(t.isGeometryLayer||t.isObject3D)&&i.push(t)})),0==i.length)return[];const n=[],s=t instanceof Event?this.eventToViewCoords(t):t;for(const t of i)if(!t.isAtmosphere)if(t.isGeometryLayer){if(!t.ready){console.warn("view.pickObjectAt : layer is not ready : ",t);continue}t.pickObjectsAt(this,s,e,n)}else Y.Z.pickObjectsAt(this,s,e,t,n);return n}getScale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28;return this.camera3D.isOrthographicCamera?.001*t/this.getPixelsToMeters():this.getScaleFromDistance(t,this.getDistanceFromCamera())}getScaleFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t/=1e3;const r=i.MathUtils.degToRad(this.camera3D.fov);return t*(this.camera.height/(2*e*Math.tan(.5*r)))}getDistanceFromCamera(t){return this.getPickingPositionFromDepth(t,nt),this.camera3D.position.distanceTo(nt)}getPixelsToMeters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(at=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,t*at/this.camera.width):this.getPixelsToMetersFromDistance(t,this.getDistanceFromCamera(e))}getPixelsToMetersFromDistance(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)/this.camera._preSSE}getMetersToPixels(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(at=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,t*this.camera.width/at):this.getMetersToPixelsFromDistance(t,this.getDistanceFromCamera(e))}getMetersToPixelsFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.camera._preSSE*t/e}pickFeaturesAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;nt.isColorLayer||t.isGeometryLayer)):i).forEach((t=>{"string"==typeof t&&(t=this.getLayerById(t)),t&&t.isLayer&&(o[t.id]=[],t.isColorLayer&&s.push(t.id))}));const a=t instanceof Event?this.eventToViewCoords(t,$):t,l=this.pickObjectsAt(a,e,...i);if(l.length>0&&l.forEach((t=>o[t.layer.id].push(t))),0==s.length)return o;let c;this.getPickingPositionFromDepth(a,nt),st.crs=this.referenceCrs,st.setFromVector3(nt);const h={M:this.getPixelsToMeters(e,a),D:.001*e};this.isPlanarView?h.D=h.M:this.getPixelsToDegrees&&(h.D=this.getMetersToDegrees(h.M));const u=Y.Z.pickTilesAt(this,a,e,this.tileLayer);for(const t of u)if(t.object.material)for(const e of t.object.material.getLayers(s))for(const t of e.textures)t.features&&(c=m.Z.isMetricUnit(t.features.crs)?h.M:h.D,A.Z.filterFeaturesUnderCoordinate(st,t.features,c).forEach((t=>{o[e.id].find((e=>e.geometry===t.geometry))||o[e.id].push(t)})));return o}readDepthBuffer(t,e,r,i,n){const s=this.mainLoop.gfxEngine,o=this.tileLayer.wireframe,a=this.tileLayer.opacity,l=this.tileLayer.visible;o&&(this.tileLayer.wireframe=!1),a<1&&(this.tileLayer.opacity=1),l||(this.tileLayer.visible=!0);const c=this.tileLayer.level0Nodes.map((t=>f.Z.push(t,f.Z.MODES.DEPTH)));return n=s.renderViewToBuffer({camera:this.camera,scene:this.tileLayer.object3d},{x:t,y:e,width:r,height:i,buffer:n}),c.forEach((t=>t())),this.tileLayer.wireframe!==o&&(this.tileLayer.wireframe=o),this.tileLayer.opacity!==a&&(this.tileLayer.opacity=a),this.tileLayer.visible!==l&&(this.tileLayer.visible=l),n}getPickingPositionFromDepth(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;if(!this.tileLayer||0==this.tileLayer.level0Nodes.length||!this.tileLayer.level0Nodes[0])return void(e=void 0);const r=this.mainLoop,n=0==r.scheduler.commandsWaitingExecutionCount()&&r.renderingState==s.HR,a=r.gfxEngine,l=a.getWindowSize();let c;if((t=t||l.clone().multiplyScalar(.5)).x=Math.floor(t.x),t.y=Math.floor(t.y),n){this.#g.needsUpdate&&(this.readDepthBuffer(0,0,l.x,l.y,this.#g),this.#g.needsUpdate=!1);const e=4*((l.y-t.y-1)*l.x+t.x);c=this.#g.slice(e,e+4)}else c=this.readDepthBuffer(t.x,t.y,1,1,this.#m);if(et.x=t.x/l.x*2-1,et.y=-t.y/l.y*2+1,o.Z.isLogDepthBufferSupported()&&"PerspectiveCamera"==this.camera3D.type){rt.origin.copy(this.camera3D.position),rt.direction.set(et.x,et.y,.5),tt.multiplyMatrices(this.camera3D.matrixWorld,tt.copy(this.camera3D.projectionMatrix).invert()),rt.direction.applyMatrix4(tt),rt.direction.sub(rt.origin),it.set(0,0,1),it.applyMatrix4(tt),it.sub(rt.origin);const t=it.angleTo(rt.direction),r=a.depthBufferRGBAValueToOrthoZ(c,this.camera3D)/Math.cos(t);e.addVectors(this.camera3D.position,rt.direction.setLength(r))}else{const t=a.depthBufferRGBAValueToOrthoZ(c,this.camera3D);e.set(et.x,et.y,t),e.unproject(this.camera3D)}return e.length()>1e7?void 0:e}pickTerrainCoordinates(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.Z(this.referenceCrs);return t instanceof Event?this.eventToViewCoords(t):t&&void 0!==t.x&&void 0!==t.y?$.copy(t):$.set(this.mainLoop.gfxEngine.width/2,this.mainLoop.gfxEngine.height/2),this.getPickingPositionFromDepth($,nt),st.crs=this.referenceCrs,st.setFromVector3(nt),st.as(e.crs,e),e}pickCoordinates(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.Z(this.referenceCrs);return console.warn("Deprecated, use View#pickTerrainCoordinates instead."),this.pickTerrainCoordinates(t,e)}resize(t,e){t<0||e<0?console.warn(`Trying to resize the View with negative height (${e}) or width (${t}). Skipping resize.`):(null==t&&(t=this.domElement.clientWidth),null==e&&(e=this.domElement.clientHeight),this.#g=new Uint8Array(4*t*e),this.mainLoop.gfxEngine.onWindowResize(t,e),0!==t&&0!==e&&(this.camera.resize(t,e),this.notifyChange(this.camera3D)))}}const ct=lt},11707:(t,e,r)=>{"use strict";r.d(e,{Z:()=>g,y:()=>u});var i=r(99477),n=r(45222),s=r(66014),o=r(47274),a=r(83214),l=r(25033),c=(r(49075),r(84607)),h=r(59099);const u={ON_TILE_CONTENT_LOADED:"on-tile-content-loaded",ON_TILE_REQUESTED:"on-tile-requested"},d=(0,s.Ti)();function p(t){let e=t,r=e.tileId;for(;isNaN(r)&&e.parent;)e=e.parent,r=e.tileId;return r}function f(t){return t.geometry&&t.geometry.attributes._BATCHID}class m extends n.Z{#A;constructor(t,e,r){super(t,new i.Group,{source:e.source}),this.isC3DTilesLayer=!0,this.sseThreshold=e.sseThreshold||16,this.cleanupDelay=e.cleanupDelay||1e3,this.protocol="3d-tiles",this.name=e.name,this.registeredExtensions=e.registeredExtensions||new a.Z,this.pntsMode=l.vj.COLOR,this.pntsShape=l.Uz.CIRCLE,this.classification=e.classification,this.pntsSizeMode=l.E7.VALUE,this.pntsMinAttenuatedSize=e.pntsMinAttenuatedSize||3,this.pntsMaxAttenuatedSize=e.pntsMaxAttenuatedSize||10,e.pntsMode&&(Object.values(l.vj).includes(e.pntsMode)?this.pntsMode=e.pntsMode:console.warn("The points cloud mode doesn't exist. Use 'COLOR' or 'CLASSIFICATION' instead.")),e.pntsShape&&(Object.values(l.Uz).includes(e.pntsShape)?this.pntsShape=e.pntsShape:console.warn("The points cloud point shape doesn't exist. Use 'CIRCLE' or 'SQUARE' instead.")),e.pntsSizeMode&&(Object.values(l.E7).includes(e.pntsSizeMode)?this.pntsSizeMode=e.pntsSizeMode:console.warn("The points cloud size mode doesn't exist. Use 'VALUE' or 'ATTENUATED' instead.")),this._style=e.style||null,this.#A=new Map,this.tilesC3DTileFeatures=new Map,e.onTileContentLoaded&&(console.warn("DEPRECATED onTileContentLoaded should not be passed at the contruction, use C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED event instead"),this.addEventListener(u.ON_TILE_CONTENT_LOADED,e.onTileContentLoaded)),e.overrideMaterials&&(console.warn("overrideMaterials is deprecated, use style API instead"),this.overrideMaterials=e.overrideMaterials),this._cleanableTiles=[];const n=this.addInitializationStep();this.source.whenReady.then((t=>{if(this.tileset=new o.Z(t,this.source.baseUrl,this.registeredExtensions),this.tileset.extensionsUsed)for(const t of this.tileset.extensionsUsed)this.registeredExtensions.isExtensionRegistered(t)||(this.tileset.extensionsRequired&&this.tileset.extensionsRequired.includes(t)?console.error(`3D Tiles tileset required extension "${t}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`):console.warn(`3D Tiles tileset used extension "${t}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`));(0,s.SR)(r,r.mainLoop.scheduler,this,t.root).then(n)}))}preUpdate(){return s.SY.bind(this)()}update(t,e,r){return d(t,e,r)}getObjectToUpdateForAttachedLayers(t){if(t.content){const e=[];t.content.traverse((r=>{r.isObject3D&&r.material&&r.layer==t.layer&&e.push(r)}));const r=t.parent;return r&&r.content?{elements:e,parent:r.content}:{elements:e}}}getC3DTileFeatureFromIntersectsArray(t){let e=null;for(let r=0;r{if(f(e)){const r=e.geometry.getAttribute("_BATCHID");let i=r.getX(0),n=0,s=0;const o=()=>{if(this.tilesC3DTileFeatures.get(t.tileId).has(i))this.tilesC3DTileFeatures.get(t.tileId).get(i).groups.push({start:n,count:s});else{const r=new c.Z(t.tileId,i,[{start:n,count:s}],{},e);this.tilesC3DTileFeatures.get(t.tileId).set(i,r)}},a=e.geometry.getAttribute("position"),l=a.count*a.itemSize;for(let t=0;t=l&&o()}}}))}updateStyle(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this._style)return!1;if(!this.object3d)return!1;const e=[],r=new Map;this.object3d.traverse((e=>{if(f(e)){const i=p(e);if(t&&!t.includes(i))return;r.has(i)||r.set(i,[]),r.get(i).push(e)}}));for(const[t,n]of r){const r=this.tilesC3DTileFeatures.get(t);n.forEach((t=>{t.geometry.clearGroups(),t.material=[];for(const[,e]of r){if(e.object3d!=t)continue;let r=null;r="function"==typeof this._style.fill.color?new i.Color(this._style.fill.color(e)):new i.Color(this._style.fill.color);let n=null;n="function"==typeof this._style.fill.opacity?this._style.fill.opacity(e):this._style.fill.opacity;const s=r.getHexString()+n;let o=null;this.#A.has(s)?o=this.#A.get(s):(o=new i.MeshStandardMaterial({color:r,opacity:n,transparent:n<1,alphaTest:.09}),this.#A.set(s,o));let a=-1;for(let e=0;e{t.geometry.addGroup(e.start,e.count,a)}))}(0,h.O)(t),t.material instanceof Array?t.material.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(t.material)||e.push(t.material)}))}for(const[t,r]of this.#A)e.includes(r)||(r.dispose(),this.#A.delete(t));return!0}get materialCount(){return this.#A.size}set style(t){this._style=t,this.updateStyle()}get style(){return this._style}}const g=m},96836:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a,c:()=>s});var i=r(78025),n=r(81590);function s(t){var e;return null==t||null===(e=t.attachedLayers.filter((t=>t.isGeoidLayer))[0])||void 0===e?void 0:e.visible}class o extends i.Z{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.isGeoidLayer=!0,this.defineLayerProperty("visible",!0)}updateNodeZ(t){t.material.geoidHeight=this.visible?t.geoidHeight:0,t.obb.updateZ({geoidHeight:t.material.geoidHeight})}update(t,e,r,i){if(!i||!r.material)return;const s=r.getExtentsByProjection(e.crs),o=s[0].zoom;if(!(o>e.zoom.max||othis.updateNodeZ(r);e.addEventListener("visible-property-changed",t),r.addEventListener("dispose",(()=>{e.removeEventListener("visible-property-changed",t)}))}if(!e.frozen&&e.visible&&r.material.visible&&r.layerUpdateState[e.id].canTryUpdate())return r.layerUpdateState[e.id].newTry(),this.getData(r.extent,s).then((t=>{r.geoidHeight=t.getHeightAtCoordinates(r.extent.center()),this.updateNodeZ(r),r.layerUpdateState[e.id].noMoreUpdatePossible()}))}}}const a=o},45222:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(78025),n=r(98675),s=r(55086),o=r(70991);class a extends i.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.cacheLifeTime=r.cacheLifeTime??s.D.GEOMETRY;const i=r.visible;if(delete r.visible,super(t,r),this.isGeometryLayer=!0,!e||!e.isObject3D)throw new Error("Missing/Invalid object3d parameter (must be a\n three.js Object3D instance)");"Group"===e.type&&""===e.name&&(e.name=t),Object.defineProperty(this,"object3d",{value:e,writable:!1,configurable:!0}),this.opacity=1,this.wireframe=!1,this.attachedLayers=[],this.visible=i??!0,Object.defineProperty(this.zoom,"max",{value:1/0,writable:!1}),this.filteringExtent=!this.source.isFileSource,this.structure="3d"}get visible(){return this.object3d.visible}set visible(t){if(this.object3d.visible!==t){const e={type:"visible-property-changed",previous:{},new:{}};e.previous.visible=this.object3d.visible,e.new.visible=t,this.dispatchEvent(e),this.object3d.visible=t}}getObjectToUpdateForAttachedLayers(t){if(t.parent&&t.material)return{element:t,parent:t.parent}}postUpdate(){}culling(){return!0}attach(t){if(!t.update)throw new Error(`Missing 'update' function -> can't attach layer\n ${t.id}`);this.attachedLayers.push(t),t.parent=this}detach(t){const e=this.attachedLayers.length;return this.attachedLayers=this.attachedLayers.filter((e=>e.id!=t.id)),t.parent=void 0,this.attachedLayers.length2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return n.Z.pickObjectsAt(t,e,r,this.object3d,i)}}const l=a},81616:(t,e,r)=>{"use strict";r.d(e,{$:()=>s,Z:()=>n});var i=r(71440);class n{constructor(t){this.layer=t}clear(){}update(){}}class s extends n{constructor(t){super(t),this.displayed={tiles:new Set},Object.defineProperty(this.displayed,"layers",{get:()=>{let t=[];return this.displayed.tiles.forEach((e=>{const r=e.material;t=[...new Set([...t,...r.colorLayerIds.filter((t=>r.getLayer(t))),...r.elevationLayerIds])]})),this.layer.attachedLayers.filter((e=>t.includes(e.id)))}}),Object.defineProperty(this.displayed,"extent",{get:()=>{const t=new i.ZP(this.layer.extent.crs,1/0,-1/0,1/0,-1/0);return t.min=1/0,t.max=-1/0,this.displayed.tiles.forEach((e=>{t.union(e.extent),t.min=Math.min(e.obb.z.min,t.min),t.max=Math.max(e.obb.z.max,t.max)})),t}})}clear(){this.displayed.tiles.clear()}update(t){t.material.visible?this.displayed.tiles.add(t):this.displayed.tiles.delete(t)}}},76257:(t,e,r)=>{"use strict";r.d(e,{Z:()=>_});var i=r(99477),n=r(81590),s=r(70991),o=r(45222),a=r(62310),l=r(71440),c=r(59947),h=r(5167),u=r(49075),d=r(49652);const p=new u.uP,f=new a.Z("EPSG:4326",0,0,0),m=new l.ZP("EPSG:4326",0,0,0,0),g=new i.Vector2,A=new i.Vector2,y=new i.Vector2;class v{#y=!1;constructor(){this.dom=document.createElement("div"),this.dom.style.display="none",this.visible=!0}get visible(){return this.#y}set visible(t){t!==this.#y&&(this.#y=t,this.dom.style.display=t?"block":"none")}hide(){this.visible=!1}show(){this.visible=!0}add(t){this.dom.append(t.dom)}}class x extends i.Group{constructor(t){super(),this.nodeParent=t,this.needsUpdate=!0}initializeDom(){this.domElements=new v,this.domElements.labels=new v,this.domElements.add(this.domElements.labels),this.domElements.labels.dom.style.opacity="0"}addLabel(t){this.add(t),this.domElements.labels.dom.append(t.content),t.initDimensions(),this.nodeParent.layer.isGlobeLayer&&this.nodeParent.level<4&&(t.horizonCullingPoint=new i.Vector3)}removeLabel(t){this.remove(t),this.domElements.labels.dom.removeChild(t.content)}updatePosition(t){this.needsUpdate&&(this.needsAltitude&&t.updateElevationFromLayer(this.nodeParent.layer,[this.nodeParent]),t.update3dPosition(this.nodeParent.layer.crs),t.updateHorizonCullingPoint())}count(){return this.children.length}get labels(){return this.children}}class b extends o.Z{#v=new d.R;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.domElement;delete e.domElement,super(t,e.object3d||new i.Group,e),this.isLabelLayer=!0,this.domElement=new v,this.domElement.show(),this.domElement.dom.id=`itowns-label-${this.id}`,this.buildExtent=!0,this.crs=e.source.crs,this.performance=e.performance||!0,this.forceClampToTerrain=e.forceClampToTerrain||!1,this.toHide=new i.Group,this.labelDomelement=r,this.margin=e.margin}get visible(){return super.visible}set visible(t){var e,r;super.visible=t,t?null===(e=this.domElement)||void 0===e||e.show():null===(r=this.domElement)||void 0===r||r.hide()}get submittedLabelNodes(){return this.object3d.children}convert(t,e){const r=[];return e.as(t.crs,m),f.crs=t.crs,p.setZoom(e.zoom),t.features.forEach((e=>{var i,n,s,o;if(e.type!==h.tg.POINT)return;p.setFeature(e);const a=null===(i=e.style)||void 0===i||null===(n=i.text)||void 0===n?void 0:n.field,l=null===(s=e.style)||void 0===s||null===(o=s.point)||void 0===o?void 0:o.base_altitude,d=l instanceof Function&&"baseAltitudeDefault"==l.name;r.needsAltitude=r.needsAltitude||!0===this.forceClampToTerrain||d&&!e.hasRawElevationData,e.geometries.forEach((i=>{if(f.setFromArray(e.vertices,i.size*i.indices[0].offset),f.applyMatrix4(t.matrixWorld),!m.isPointInside(f))return;const n=i.properties.style&&i.properties.style.text&&i.properties.style.text.field;let s;p.setGeometry(i),this.style.setContext(p);const o=this.style.text&&this.style.text.field;if(this.labelDomelement)s=(0,u.Lu)(this.labelDomelement,p);else if(!(n||a||o||i.properties.style&&(i.properties.style.icon.source||i.properties.style.icon.key)||e.style&&e.style.icon&&(e.style.icon.source||e.style.icon.key)||this.style.icon&&(this.style.icon.source||this.style.icon.key)))return;const l=new c.Z(s,f.clone(),this.style);l.layerId=this.id,l.padding=this.margin||l.padding,r.push(l)}))})),r}preUpdate(t,e){e.has(this.parent)&&(this.object3d.clear(),this.#v.width=.5*this.parent.maxScreenSizeNode,this.#v.height=.5*this.parent.maxScreenSizeNode,this.#v.resize())}#x(t){this.object3d.add(t)}#b(t){this.toHide.add(t)}#_(t){var e,r;return null!==(e=t.parent)&&void 0!==e&&e.isTileMesh?(null===(r=t.parent.link[this.id])||void 0===r?void 0:r.domElements)||this.#_(t.parent):this.domElement}#w(t){return t.children.every((t=>{var e;return t.layerUpdateState&&(null===(e=t.layerUpdateState[this.id])||void 0===e?void 0:e.hasFinished())}))}#E(t){const e=t.children.slice();this.#v.reset(),e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{t.nodeParent.extent.planarDimensions(g),f.crs=t.nodeParent.extent.crs,f.setFromValues(t.nodeParent.extent.west,t.nodeParent.extent.north,0).toVector3(A),f.copy(e.coordinates).as(t.nodeParent.extent.crs,f).toVector3(y),y.sub(A),y.y+=g.y,y.divide(g).multiplyScalar(this.#v.width),e.updateProjectedPosition(y.x,y.y),this.#v.insert(e)||t.removeLabel(e)}))}update(t,e,r,i){if(!i&&r.link[e.id])return void s.Z.removeChildrenAndCleanupRecursively(this,r);const o=r.link[e.id]||new x(r);if(r.link[e.id]=o,this.frozen||!r.visible||!this.visible)return;if(!r.material.visible&&this.#w(r))return this.#b(o);const a=r.getExtentsByProjection(this.source.crs)||[r.extent],l=a[0].zoom;if(le.zoom.max)return this.#b(o);if(void 0===r.layerUpdateState[this.id]&&(r.layerUpdateState[this.id]=new n.Z),!this.source.extentInsideLimit(r.extent,l))return void r.layerUpdateState[this.id].noMoreUpdatePossible();if(this.#w(r.parent))return r.material.visible||(o.needsUpdate=!0),void this.#x(o);if(!r.layerUpdateState[this.id].canTryUpdate())return;r.layerUpdateState[this.id].newTry();const c={layer:this,extentsSource:a,view:t.view,requester:r};return t.scheduler.execute(c).then((e=>{if(!e)return;const i=t.view.mainLoop.gfxEngine.label2dRenderer;o.initializeDom(),this.#_(r).add(o.domElements),e.forEach((t=>{r.parent?(o.needsAltitude=o.needsAltitude||t.needsAltitude,t.forEach((t=>{r.extent.isPointInside(t.coordinates)&&o.addLabel(t)}))):t.forEach((t=>{s.Z.removeChildrenAndCleanupRecursively(this,t),i.removeLabelDOM(t)}))})),o.count()&&(o.domElements.labels.hide(),o.domElements.labels.dom.style.opacity="1.0",r.addEventListener("show",(()=>o.domElements.labels.show())),r.addEventListener("hidden",(()=>this.#b(o))),r.addEventListener("removed",(()=>this.removeNodeDomElement(r))),o.needsAltitude&&r.material.getElevationLayer()&&r.material.getElevationLayer().addEventListener("rasterElevationLevelChanged",(()=>{o.needsUpdate=!0})),this.performance&&this.#E(o)),r.layerUpdateState[this.id].noMoreUpdatePossible()}))}removeLabelsFromNodeRecursive(t){t.children.forEach((t=>{t.link[this.id]&&delete t.link[this.id],this.removeLabelsFromNodeRecursive(t)})),this.removeNodeDomElement(t)}removeNodeDomElement(t){var e;if(null!==(e=t.link[this.id])&&void 0!==e&&e.domElements){const e=t.link[this.id].domElements.dom;e.parentElement.removeChild(e),delete t.link[this.id].domElements}}delete(t){t&&this.cache.clear(),this.domElement.dom.parentElement.removeChild(this.domElement.dom),this.parent.level0Nodes.forEach((t=>this.removeLabelsFromNodeRecursive(t)))}}const _=b},78025:(t,e,r)=>{"use strict";r.d(e,{M:()=>u,Z:()=>h});var i=r(99477),n=r(60465),s=r(81616),o=r(72726),a=r(55086),l=r(49075);class c extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.projection&&(console.warn("Layer projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),void 0===e.source||!0===e.source)throw new Error(`Layer ${t} needs Source`);var r;super(),this.isLayer=!0,!e.style||e.style instanceof l.ZP||("string"==typeof(null===(r=e.style.fill)||void 0===r?void 0:r.pattern)&&(console.warn("Using style.fill.pattern = { source: Img|url } is adviced"),e.style.fill.pattern={source:e.style.fill.pattern}),e.style=new l.ZP(e.style)),this.style=e.style||new l.ZP,Object.assign(this,e),Object.defineProperty(this,"id",{value:t,writable:!1}),this.options=e.options||{},this.updateStrategy||(this.updateStrategy={type:n.R3,options:{}}),this.defineLayerProperty("frozen",!1),e.zoom?(this.zoom={max:e.zoom.max,min:e.zoom.min||0},null==this.zoom.max&&(this.zoom.max=1/0)):this.zoom={max:1/0,min:0},this.info=new s.Z(this),this.source=this.source||new o.Z({url:"none"}),this.ready=!1,this._promises=[],this.whenReady=new Promise(((t,e)=>{this._resolve=t,this._reject=e})).then((()=>(this.ready=!0,this.source.onLayerAdded({out:this}),this))),this._promises.push(this.source.whenReady),this.cache=new a.Z(e.cacheLifeTime),this.mergeFeatures=void 0===this.mergeFeatures||e.mergeFeatures,this.filter=this.filter||this.source.filter}addInitializationStep(){let t;return this._promises.push(new Promise((e=>{t=e}))),t}defineLayerProperty(t,e,r){const i=Object.getOwnPropertyDescriptor(this,t);if(!i||!i.set){let i=null==this[t]?e:this[t];Object.defineProperty(this,t,{get:()=>i,set:e=>{if(i!==e){const n={type:`${t}-property-changed`,previous:{},new:{}};n.previous[t]=i,n.new[t]=e,i=e,r&&r(this,t),this.dispatchEvent(n)}}})}}convert(t){return t}getData(t,e){const r=this.source.requestToKey(this.source.isVectorSource?e:t);let i=this.cache.getByArray(r);return i||(i=this.source.loadData(t,this).then((t=>this.convert(t,e)),(t=>{throw t})),this.cache.setByArray(i,r)),i}isValidData(){}delete(){console.warn("Function delete doesn't exist for this layer")}}const h=c,u={moveLayerToIndex:function(t,e,r){e=Math.min(e,r.length-1),e=Math.max(e,0);const i=t.sequence;for(const n of r)n.id===t.id?n.sequence=e:n.sequence>i&&n.sequence<=e?n.sequence--:n.sequence>=e&&n.sequence0&&this.moveLayerToIndex(t,t.sequence-1,e)},moveLayerUp:function(t,e){const r=e.length-1;t.sequencet.sequence-e.sequence)),e.map((t=>t.id))}}},81590:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=[1,3,7,60],n=class{constructor(){this.state=0,this.lastErrorTimestamp=0,this.errorCount=0,this.failureParams={lowestLevelError:1/0}}hasFinished(){return 4==this.state}canTryUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();switch(this.state){case 0:return!0;case 3:case 1:case 4:return!1;default:return 1e3*this.secondsUntilNextTry()<=t-this.lastErrorTimestamp}}secondsUntilNextTry(){if(2!==this.state)return 0;const t=Math.max(0,Math.min(this.errorCount,i.length)-1);return i[t]}newTry(){this.state=1}success(){this.lastErrorTimestamp=0,this.state=0}noMoreUpdatePossible(){this.state=4}noData(t){this.state=0,this.failureParams.lowestLevelError=Math.min(t.targetLevel,this.failureParams.lowestLevelError)}failure(t,e,r){r&&null!=r.targetLevel&&(this.failureParams.lowestLevelError=Math.min(r.targetLevel,this.failureParams.lowestLevelError)),this.lastErrorTimestamp=t,this.state=e?3:2,this.errorCount++}inError(){return 3==this.state||2==this.state}}},60465:(t,e,r)=>{"use strict";r.d(e,{AE:()=>s,ET:()=>a,R3:()=>n,c:()=>o,k5:()=>h});var i=r(43412);const n=0,s=1,o=2,a=3;function l(t,e){const r=e.groups.filter((e=>e<=t));return r.length?r[r.length-1]:e.groups[0]}function c(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e==i.pL?r.zoom?r.zoom.min:0:Math.min(t,Math.ceil((e+t)/2))}function h(t,e){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.level,n=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0;const d=h.source.zoom?h.source.zoom.max:1/0;if(u.lowestLevelError!=1/0)r=c(u.lowestLevelError,n,h.source),r=u.lowestLevelError==r?r-1:r,t==s&&(r=l(r,h.updateStrategy.options));else{switch(t){case s:r=l(i,h.updateStrategy.options);break;case o:r=function(t,e,r){return Math.min(t,e+(r.increment||1))}(i,n,h.updateStrategy.options);break;case a:r=c(i,n,h.source);break;default:r=function(t,e,r,i){return t.pendingSubdivision&&!i.isVectorTileSource?r:e}(e,i,n,h.source)}r=Math.min(r,d)}return r}},61366:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const i=function(t,e){if(e&&e.isGeometryLayer){let r=t.transparent;t.layer=e,t.uniforms&&null!=t.uniforms.opacity?Object.defineProperty(t.uniforms.opacity,"value",{get:()=>t.layer.opacity}):null!=t.opacity&&Object.defineProperty(t,"opacity",{get:()=>t.layer.opacity}),t.uniforms&&null!=t.uniforms.mode&&Object.defineProperty(t.uniforms.mode,"value",{get:()=>t.layer.pntsMode}),t.uniforms&&null!=t.uniforms.shape&&Object.defineProperty(t.uniforms.shape,"value",{get:()=>t.layer.pntsShape}),t.uniforms&&null!=t.uniforms.sizeMode&&Object.defineProperty(t.uniforms.sizeMode,"value",{get:()=>t.layer.pntsSizeMode}),t.uniforms&&null!=t.uniforms.minAttenuatedSize&&Object.defineProperty(t.uniforms.minAttenuatedSize,"value",{get:()=>t.layer.pntsMinAttenuatedSize}),t.uniforms&&null!=t.uniforms.maxAttenuatedSize&&Object.defineProperty(t.uniforms.maxAttenuatedSize,"value",{get:()=>t.layer.pntsMaxAttenuatedSize}),Object.defineProperty(t,"wireframe",{get:()=>t.layer.wireframe}),Object.defineProperty(t,"transparent",{get:()=>(r!=t.layer.opacity<1&&(t.needsUpdate=!0,r=t.layer.opacity<1),r)})}return t}},96021:(t,e,r)=>{"use strict";r.d(e,{Z:()=>C});var i=r(99477),n=r(45222),s=r(81616),o=r(98675),a=r(79323),l=r(96836);class c extends i.Mesh{#M=new Map;#S=!0;constructor(t,e,r,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(super(t,e),!n)throw new Error("extent is mandatory to build a TileMesh");this.layer=r,this.extent=n,this.extent.zoom=s,this.level=s,this.material.objectId=this.id,this.obb=this.geometry.OBB.clone(),this.boundingSphere=new i.Sphere,this.obb.box3D.getBoundingSphere(this.boundingSphere);for(const t of r.tileMatrixSets)this.#M.set(t,this.extent.tiledCovering(t));this.frustumCulled=!1,this.matrixAutoUpdate=!1,this.rotationAutoUpdate=!1,this.layerUpdateState={},this.isTileMesh=!0,this.geoidHeight=0,this.link={},Object.defineProperty(this,"visible",{get(){return this.#S},set(t){this.#S!=t&&(this.#S=t,this.dispatchEvent({type:t?"shown":"hidden"}))}})}setBBoxZ(t){t.geoidHeight=(0,l.c)(this.layer)?this.geoidHeight:0,this.obb.updateZ(t),this.horizonCullingPointElevationScaled&&this.horizonCullingPointElevationScaled.setLength(this.obb.z.delta+this.horizonCullingPoint.length()),this.obb.box3D.getBoundingSphere(this.boundingSphere)}getExtentsByProjection(t){return this.#M.get(a.Z.formatToTms(t))}findCommonAncestor(t){if(t)return t.level==this.level?t.id==this.id?t:0!=t.level?this.parent.findCommonAncestor(t.parent):void 0:t.level{c=t})),A.set(l,o,e.level,a),e.extent=r,e.center=t.center(e.extent).clone();let h,u=g.get(a);e.buildIndexAndUv_0=!u,e.builder=t;try{h=(0,f.Z)(e)}catch(t){return Promise.reject(t)}u||(u={},u.index=new i.BufferAttribute(h.index,1),u.uv=new i.BufferAttribute(h.uvs[0],2),g.set(a,u)),h.index=u.index,h.uvs[0]=u.uv,h.position=new i.BufferAttribute(h.position,3),h.normal=new i.BufferAttribute(h.normal,3),e.builder.uvCount>1&&(h.uvs[1]=new i.BufferAttribute(h.uvs[1],1));const p=new d.Z(e,h);return p.OBB=new m.Z(p.boundingBox.min,p.boundingBox.max),p._count=0,p.dispose=()=>{p._count--,p._count<=0&&(p.index=null,delete p.attributes.uv,i.BufferGeometry.prototype.dispose.call(p),A.delete(o,e.level,a))},c(p),Promise.resolve({geometry:p,quaternion:n,position:s})}return l.then((t=>({geometry:t,quaternion:n,position:s})))}(n,a).then((t=>{t.geometry._count++;const a=r.tileMatrixSets.length,c=new u.ZP(r.materialOptions,a);(0,y.Z)(c,r);const d=new h(t.geometry,c,r,e,o);if(s&&s.isTileMesh){const e=n.computeSharableExtent(s.extent);t.position.sub(e.position).applyQuaternion(e.quaternion.invert()),t.quaternion.premultiply(e.quaternion)}if(d.position.copy(t.position),d.quaternion.copy(t.quaternion),d.visible=!1,d.updateMatrix(),function(t,e){if(e.diffuse&&(t.material.diffuse=e.diffuse),e.isGlobeLayer){t.horizonCullingPoint=t.extent.center().as("EPSG:4978").toVector3(),t.extent.planarDimensions(v).multiplyScalar(i.MathUtils.DEG2RAD);const e=v.length(),r=Math.abs(1/Math.cos(.5*e));t.horizonCullingPoint.setLength(r*t.horizonCullingPoint.length()),t.horizonCullingPointElevationScaled=t.horizonCullingPoint.clone()}}(d,r),s){d.geoidHeight=s.geoidHeight;const t=(0,l.c)(r)?d.geoidHeight:0;d.setBBoxZ({min:s.obb.z.min,max:s.obb.z.max,geoidHeight:t}),d.material.geoidHeight=t}return d}))}};var b=r(70991),_=r(81189),w=r(78025);const E=new i.Vector3,M=new i.Vector3;class S extends n.Z{constructor(t,e,r,i,n){if(n.cacheLifeTime=p.D.INFINITE,n.source=!1,super(t,e,n),this.isTiledGeometryLayer=!0,this.object3d.geoidHeight=0,this.protocol="tile",this._hideSkirt=!1,this.sseSubdivisionThreshold=this.sseSubdivisionThreshold||1,this.schemeTile=r,this.builder=i,this.info=new s.$(this),!this.schemeTile)throw new Error(`Cannot init tiled layer without schemeTile for layer ${this.id}`);if(!this.builder)throw new Error(`Cannot init tiled layer without builder for layer ${this.id}`);this.level0Nodes=[];const o=[];for(const t of this.schemeTile)o.push(this.convert(void 0,t));this._promises.push(Promise.all(o).then((t=>{this.level0Nodes=t,this.object3d.add(...t),this.object3d.updateMatrixWorld()}))),this.maxScreenSizeNode=this.sseSubdivisionThreshold*(2*_.kE)}get hideSkirt(){return this._hideSkirt}set hideSkirt(t){this._hideSkirt=t;for(const e of this.level0Nodes)e.traverse((e=>{e.isTileMesh&&(e.geometry.hideSkirt=t)}))}pickObjectsAt(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return o.Z.pickTilesAt(t,e,r,this,i)}preUpdate(t,e){if(e.has(void 0)||0==e.size)return this.level0Nodes;t.colorLayers=t.view.getLayers(((t,e)=>e&&e.id==this.id&&t.isColorLayer)),t.elevationLayers=t.view.getLayers(((t,e)=>e&&e.id==this.id&&t.isElevationLayer)),t.maxElevationLevel=-1;for(const e of t.elevationLayers)t.maxElevationLevel=Math.max(e.source.zoom.max,t.maxElevationLevel);let r;-1==t.maxElevationLevel&&(t.maxElevationLevel=1/0),this.colorLayersOrder=w.M.getColorLayersIdOrderedBySequence(t.colorLayers);for(const t of e.values()){if(t.isCamera)return this.level0Nodes;if(t.layer===this){if(r){if(r=t.findCommonAncestor(r),!r)return this.level0Nodes}else r=t;null==r.material&&(r=void 0)}}return r?[r]:this.level0Nodes}update(t,e,r){if(!r.parent)return b.Z.removeChildrenAndCleanup(this,r);if(r.parent.pendingSubdivision)return r.visible=!1,r.material.visible=!1,void this.info.update(r);if(r.visible=!this.culling(r,t.camera),r.visible){let e=!1;return r.material.visible=!0,this.info.update(r),(r.pendingSubdivision||S.hasEnoughTexturesToSubdivide(t,r)&&this.subdivision(t,this,r))&&(this.subdivideNode(t,r),r.material.visible=r.pendingSubdivision,this.info.update(r),e=!0),r.material.visible&&!e?b.Z.removeChildren(this,r):e?r.children.filter((t=>t.layer==this)):void 0}return r.material.visible=!1,this.info.update(r),b.Z.removeChildren(this,r)}convert(t,e){return x.convert(t,e,this)}countColorLayersTextures(){return arguments.length}culling(t,e){return!e.isBox3Visible(t.obb.box3D,t.matrixWorld)}static hasEnoughTexturesToSubdivide(t,e){const r=e.layerUpdateState||{};let i=e.material.getElevationLayer();for(const n of t.elevationLayers){const t=e.getExtentsByProjection(n.crs)[0].zoom;if(!(t>n.zoom.max||tn.zoom.max||tt.layer==this))){const r=e.extent.subdivision();e.pendingSubdivision=!0;const i={view:t.view,requester:e,layer:this,priority:1e4,extentsSource:r,redraw:!1};return t.scheduler.execute(i).then((r=>{for(const t of r)e.add(t),t.updateMatrixWorld(!0);e.pendingSubdivision=!1,t.view.notifyChange(e,!1)}),(t=>{if(e.pendingSubdivision=!1,!t.isCancelledCommandException)throw new Error(t)}))}}subdivision(t,e,r){if(r.level{"use strict";r.r(e),r.d(e,{$3dTilesCulling:()=>Li.y,$3dTilesSubdivisionControl:()=>Li.Y0,C3DTBatchTable:()=>Ti.Z,C3DTBatchTableHierarchyExtension:()=>Bi,C3DTBoundingVolume:()=>Ci.Z,C3DTExtensions:()=>Ii.Z,C3DTFeature:()=>Mi.Z,C3DTILES_LAYER_EVENTS:()=>Xe.y,C3DTilesBoundingVolumeTypes:()=>Ri.D,C3DTilesGoogleSource:()=>hi,C3DTilesIonSource:()=>li,C3DTilesLayer:()=>Xe.Z,C3DTilesSource:()=>ai,C3DTilesTypes:()=>Ri.h,C3DTileset:()=>Si.Z,CAMERA_TYPE:()=>te.P,CONTROL_EVENTS:()=>C.Q,CRS:()=>l.Z,CameraCalibrationParser:()=>lr,CameraUtils:()=>Zt.ZP,Capabilities:()=>$t.Z,ClassificationScheme:()=>S.wy,ColorLayer:()=>Se,ColorLayersOrdering:()=>fr.Z,Coordinates:()=>o.Z,DEMUtils:()=>qt.Z,ElevationLayer:()=>Ce,Ellipsoid:()=>c.Z,EntwinePointTileLayer:()=>Sr,EntwinePointTileSource:()=>gi,Extent:()=>s.ZP,FEATURE_TYPES:()=>lt.tg,Feature:()=>lt.ZP,Feature2Mesh:()=>Ht,FeatureCollection:()=>lt.t1,FeatureGeometry:()=>lt.iL,FeatureGeometryLayer:()=>Re,FeatureProcessing:()=>x,FeaturesUtils:()=>Wt.Z,Fetcher:()=>d.Z,FileSource:()=>Ir,FirstPersonControls:()=>Z,FlyControls:()=>U,GDFParser:()=>_i.Z,GLOBE_VIEW_EVENTS:()=>h.b,GLTFParser:()=>Ei.ZP,GTXParser:()=>wi.ZP,GeoJsonParser:()=>sr.Z,GeoidGrid:()=>a.Z,GeoidLayer:()=>y.Z,GeometryLayer:()=>Te.Z,GlobeControls:()=>C.Z,GlobeLayer:()=>mr.Z,GlobeView:()=>h.Z,GpxParser:()=>Ai.Z,ISGParser:()=>bi.Z,ImageryLayers:()=>re.M,KMLParser:()=>yi.Z,LASParser:()=>fi,Label:()=>ee.Z,LabelLayer:()=>Ar.Z,Layer:()=>re.Z,MAIN_LOOP_EVENTS:()=>p.Ao,OrientationUtils:()=>xt,OrientedImageCamera:()=>M,OrientedImageLayer:()=>dr,OrientedImageSource:()=>ti,PLANAR_CONTROL_EVENT:()=>ot.uZ,PNTS_MODE:()=>S.vj,PNTS_SHAPE:()=>S.Uz,PNTS_SIZE_MODE:()=>S.E7,PlanarControls:()=>ot.ZP,PlanarLayer:()=>gr.Z,PlanarView:()=>u.Z,PointCloudLayer:()=>Ge,PointsMaterial:()=>S.ZP,PotreeLayer:()=>Ye,PotreeSource:()=>si,REVISION:()=>Pi,STRATEGY_DICHOTOMY:()=>pr.ET,STRATEGY_GROUP:()=>pr.AE,STRATEGY_MIN_NETWORK_TRAFFIC:()=>pr.R3,STRATEGY_PROGRESSIVE:()=>pr.c,ShaderChunk:()=>Jt,ShapefileParser:()=>xi,Source:()=>Cr.Z,StreetControls:()=>st,Style:()=>bt.ZP,THREE:()=>i,TMSSource:()=>Pr,TiledGeometryLayer:()=>Je.Z,VIEW_EVENTS:()=>f.b,VectorTilesSource:()=>Kr,View:()=>f.Z,WFSSource:()=>Or,WMSSource:()=>Ur,WMTSSource:()=>Nr,colorLayerEffects:()=>Kt.pO,ellipsoidSizes:()=>c.c,enableDracoLoader:()=>Ei.qw,enableKtx2Loader:()=>Ei.hu,getMaxColorSamplerUnitsCount:()=>Kt.dn,glTFLoader:()=>Ei.zL,legacyGLTFLoader:()=>Ei.mp,process3dTilesNode:()=>Li.Ti,proj4:()=>n.default,updateLayeredMaterialNodeElevation:()=>b.pN,updateLayeredMaterialNodeImagery:()=>b.XP});var i=r(99477),n=r(24472),s=r(71440),o=r(62310),a=r(2362),l=r(79323),c=r(2359),h=r(70378),u=r(39510),d=r(45340),p=r(99617),f=r(73502),m=r(81590),g=r(70991),A=r(79159),y=r(96836);const v=new o.Z("EPSG:4326",0,0,0),x={update(t,e,r){if(!r.parent&&r.children.length)return void g.Z.removeChildrenAndCleanupRecursively(e,r);if(!r.visible)return;if(void 0===r.layerUpdateState[e.id])r.layerUpdateState[e.id]=new m.Z;else if(!r.layerUpdateState[e.id].canTryUpdate()){var i;return void(null===(i=r.link[e.id])||void 0===i||i.forEach((t=>{t.layer.object3d.add(t),t.meshes.position.z=(0,y.c)(e.parent)?r.geoidHeight:0,t.meshes.updateMatrixWorld()})))}const n=r.getExtentsByProjection(e.source.crs)||[r.extent],s=n[0].zoom;if(s!=e.zoom.min||!this.source.extentInsideLimit(r.extent,s)||e.source.isFileSource&&!r.extent.isPointInside(e.source.extent.center(v)))return void r.layerUpdateState[e.id].noMoreUpdatePossible();r.layerUpdateState[e.id].newTry();const o={layer:e,extentsSource:n,view:t.view,requester:r};return t.scheduler.execute(o).then((i=>{r.layerUpdateState[e.id].noMoreUpdatePossible(),i.forEach((i=>{i?(r.link[e.id]=r.link[e.id]||[],i.as(t.view.referenceCrs),i.meshes.position.z=(0,y.c)(e.parent)?r.geoidHeight:0,i.updateMatrixWorld(),e.onMeshCreated&&e.onMeshCreated(i,t),r.parent?(e.object3d.add(i),r.link[e.id].push(i)):g.Z.removeChildrenAndCleanupRecursively(e,i),i.layer=e):r.layerUpdateState[e.id].failure(1,!0)}))}),(i=>(0,A.Z)(i,r,e,r.level,t.view)))}};var b=r(81189);class _{constructor(t){this.size=t,this.pps=null,this.polynom=null,this.l1l2=null}setFromMicmacCalibration(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.pps=(new i.Vector2).fromArray(t.pps),this.polynom=(new i.Vector4).fromArray(t.poly357),this.l1l2=new i.Vector3,this.pps.y=e?this.size.y-this.pps.y:this.pps.y,this.polynom.w=t.limit**2,t.l1l2&&(this.l1l2.fromArray(t.l1l2),this.l1l2.z=t.etats)}clone(){const t=new _(this.size.clone());return t.pps=this.pps.clone(),t.polynom=this.polynom.clone(),t.l1l2=this.l1l2.clone(),t}}const w=new i.Vector3;class E extends i.PerspectiveCamera{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e4,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;t=t.isVector2?t:new i.Vector2(t,t),a=a||t.x/t.y,super(void 0,a,n,s),this.size=t,this.focal=e.isVector2?e:new i.Vector2(e,e),this.center=r||t.clone().multiplyScalar(.5),this.skew=o||0,this.textureMatrixWorldInverse=new i.Matrix4,Object.defineProperty(this,"fov",{get:()=>2*i.MathUtils.radToDeg(Math.atan2(this.size.y,2*this.focal.y)),set:t=>{const e=.5*this.size.y/Math.tan(i.MathUtils.degToRad(.5*t));this.focal.x=e,this.focal.y=e}}),this.distortion=new _(this.size),this.maskPath=void 0,this.mask=void 0,this.updateProjectionMatrix()}updateProjectionMatrix(){if(!this.focal)return;const t=this.near,e=t/this.focal.x,r=t/this.focal.y,i=-e*this.center.x,n=-r*this.center.y,s=i+e*this.size.x,o=n+r*this.size.y;this.projectionMatrix.makePerspective(i,s,o,n,t,this.far),this.projectionMatrix.elements[4]=2*this.skew/this.size.x;const a=this.size.x/this.size.y,l=this.aspect/a;w.set(this.zoom,this.zoom,1),l>1?w.x/=l:w.y*=l,this.projectionMatrix.scale(w)}copy(t,e){return super.copy(t,e),this.size=t.size.clone(),this.focal=t.focal.clone(),this.center=t.center.clone(),this.distortion=t.distortion.clone(),this.textureMatrixWorldInverse=t.textureMatrixWorldInverse.clone(),this.skew=t.skew,this.maskPath=t.maskPath,this.mask=t.mask,this}}const M=E;var S=r(25033),C=r(61861);const T={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"rotateZ",sign:1,noSpeed:!0},34:{method:"rotateZ",sign:-1,noSpeed:!0},wheelup:{method:"translateZ",sign:1,oneshot:!0},wheeldown:{method:"translateZ",sign:-1,oneshot:!0}};function I(t){t.preventDefault(),this._isMouseDown=!0;const e=this.view.eventToViewCoords(t);this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y}function R(t){t.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=t.touches[0].pageX,this._onMouseDownMouseY=t.touches[0].pageY}function B(t){if(!0===this._isMouseDown){const e=this.view.eventToViewCoords(t),r=i.MathUtils.degToRad(this._camera3D.fov)/this.view.mainLoop.gfxEngine.height;this._camera3D.rotateY((e.x-this._onMouseDownMouseX)*r),this._camera3D.rotateX((e.y-this._onMouseDownMouseY)*r),this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y,this.view.notifyChange(this._camera3D,!1)}}function L(){this._isMouseDown=!1}function P(t){const e=T[t.keyCode];e&&(this.moves.delete(e),t.preventDefault())}function D(t){const e=T[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(this._camera3D,!1),t.preventDefault())}function O(t){-t.deltaY<0?this.moves.add(T.wheelup):this.moves.add(T.wheeldown),this.view.notifyChange(this._camera3D,!1)}class k extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.options=e,this._camera3D=t.camera3D,this.moves=new Set,this.moveSpeed=10,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._isMouseDown=!1,t.domElement.addEventListener("mousedown",I.bind(this),!1),t.domElement.addEventListener("touchstart",R.bind(this),!1);const r=B.bind(this);t.domElement.addEventListener("mousemove",r,!1),t.domElement.addEventListener("touchmove",r,!1),t.domElement.addEventListener("mouseup",L.bind(this),!1),t.domElement.addEventListener("touchend",L.bind(this),!1),t.domElement.addEventListener("wheel",O.bind(this),!1),t.domElement.addEventListener("keyup",P.bind(this),!0),t.domElement.addEventListener("keydown",D.bind(this),!0),this.view.addFrameRequester(p.Ao.AFTER_CAMERA_UPDATE,this.update.bind(this)),e.focusOnMouseOver&&t.domElement.addEventListener("mouseover",(()=>t.domElement.focus())),e.focusOnClick&&t.domElement.addEventListener("click",(()=>t.domElement.focus()))}isUserInteracting(){return 0!==this.moves.size||this._isMouseDown}update(t,e){e&&(t=16);for(const e of this.moves)this._camera3D[e.method](e.sign*(e.noSpeed?1:this.moveSpeed)*t/1e3);if(this.moves.size>0||this._isMouseDown){this.view.notifyChange(this._camera3D);for(const t of this.moves)t.oneshot&&this.moves.delete(t)}}}const U=k;function N(t,e,r){const n=.5*i.MathUtils.degToRad(r-t.fov);return i.MathUtils.clamp(e,-n,n)}const F=new i.Vector3(0,1,0);function z(t,e,r){e.quaternion.setFromUnitVectors(F,e.up),e.rotateY(r.rotateY),e.rotateX(r.rotateX),t.notifyChange(t.camera3D)}const G={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"translateY",sign:1},34:{method:"translateY",sign:-1}};function Q(t){this.camera.position.z+=t}const j=new i.Vector3,V=new i.Quaternion,H=new i.Euler(0,0,0,"YXZ");function W(t){j.copy(this.camera.position),j.normalize(),this.camera.position.add(j.multiplyScalar(t))}class q extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.isFirstPersonControls=!0,this.camera=t.camera3D,this.view=t,this.moves=new Set,e.panoramaRatio){const t=200*e.panoramaRatio/(2*Math.PI);e.verticalFOV=2==e.panoramaRatio?180:i.MathUtils.radToDeg(2*Math.atan(200/(2*t)))}e.verticalFOV=e.verticalFOV||180,e.moveSpeed=void 0===e.moveSpeed?10:e.moveSpeed,this.options=e,this._isMouseDown=!1,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._state={rotateX:0,rotateY:0,snapshot(){return{rotateX:this.rotateX,rotateY:this.rotateY}}},this.reset(),this.eventListeners=e.disableEventListeners,e.disableEventListeners||(this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseUp=this.onMouseUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onContextMenu=this.onContextMenu.bind(this),t.domElement.addEventListener("mousedown",this._onMouseDown,!1),t.domElement.addEventListener("touchstart",this._onMouseDown,!1),t.domElement.addEventListener("mousemove",this._onMouseMove,!1),t.domElement.addEventListener("touchmove",this._onMouseMove,!1),t.domElement.addEventListener("mouseup",this._onMouseUp,!1),t.domElement.addEventListener("touchend",this._onMouseUp,!1),t.domElement.addEventListener("wheel",this._onMouseWheel,!1),t.domElement.addEventListener("contextmenu",this._onContextMenu,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)),this.view.addFrameRequester(p.Ao.AFTER_CAMERA_UPDATE,this.update.bind(this)),this._onFocus=()=>t.domElement.focus(),this.focusOnMouseOver=e.focusOnMouseOver,e.focusOnMouseOver&&t.domElement.addEventListener("mouseover",this._onFocus),this.focusOnClick=e.focusOnClick,e.focusOnClick&&t.domElement.addEventListener("click",this._onFocus),"EPSG:4978"==t.referenceCrs?this.moveCameraVertical=W:this.moveCameraVertical=Q}isUserInteracting(){return 0!==this.moves.size&&!this._isMouseDown}reset(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];V.setFromUnitVectors(F,this.camera.up),V.invert(),V.multiply(this.camera.quaternion),H.setFromQuaternion(V),t||(this._state.rotateX=H.x),this._state.rotateY=H.y}update(t,e,r){if(0!=this.enabled){e&&(t=16);for(const e of this.moves)"translateY"===e.method?this.moveCameraVertical(e.sign*this.options.moveSpeed*t/1e3):this.camera[e.method](e.sign*this.options.moveSpeed*t/1e3);!0!==this._isMouseDown&&!0!==r||z(this.view,this.camera,this._state),this.moves.size&&this.view.notifyChange(this.camera)}}onMouseDown(t){if(0==this.enabled)return;this._isMouseDown=!0;const e=this.view.eventToViewCoords(t);this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y,this._stateOnMouseDown=this._state.snapshot()}onMouseUp(){0!=this.enabled&&(this._isMouseDown=!1)}onMouseMove(t){if(0!=this.enabled&&!0===this._isMouseDown){const e=i.MathUtils.degToRad(this.camera.fov)/this.view.mainLoop.gfxEngine.height,r=this.view.eventToViewCoords(t);this._state.rotateY=(r.x-this._onMouseDownMouseX)*e+this._stateOnMouseDown.rotateY,this._state.rotateX=N(this.camera,(r.y-this._onMouseDownMouseY)*e+this._stateOnMouseDown.rotateX,this.options.verticalFOV),z(this.view,this.camera,this._state)}}onMouseWheel(t){if(0==this.enabled)return;const e=t.deltaY;this.camera.fov=i.MathUtils.clamp(this.camera.fov+Math.sign(e),10,Math.min(100,this.options.verticalFOV)),this.camera.updateProjectionMatrix(),this._state.rotateX=N(this.camera,this._state.rotateX,this.options.verticalFOV),z(this.view,this.camera,this._state)}onKeyUp(t){if(0==this.enabled)return;const e=G[t.keyCode];e&&(this.moves.delete(e),this.view.notifyChange(void 0,!1),t.preventDefault())}onKeyDown(t){if(0==this.enabled)return;const e=G[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(void 0,!1),t.preventDefault())}onContextMenu(t){t.preventDefault()}dispose(){this.eventListeners||(this.view.domElement.removeEventListener("mousedown",this._onMouseDown,!1),this.view.domElement.removeEventListener("touchstart",this._onMouseDown,!1),this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("touchmove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("touchend",this._onMouseUp,!1),this.view.domElement.removeEventListener("wheel",this._onMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._onContextMenu,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)),this.focusOnMouseOver&&this.view.domElement.removeEventListener("mouseover",this._onFocus),this.focusOnClick&&this.view.domElement.removeEventListener("click",this._onFocus),this.dispatchEvent({type:"dispose"})}}const Z=q;var Y=r(36194);const X=new i.MeshBasicMaterial({color:16777215,depthTest:!1,transparent:!0,opacity:.5});function J(t,e,r){t.position.copy(e),t.up.copy(e).normalize(),t.lookAt(r),t.updateMatrixWorld(!0)}const K=new i.Vector3,$=new i.Vector3,tt=new i.Matrix3,et=new i.Vector3,rt=new i.Quaternion;function it(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{},n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{};e.getPickingPositionFromDepth(e.eventToViewCoords(t),K);const o=e.camera3D.position.distanceTo(K),a=r?e.pickObjectsAt(t,-1,r):[];a.length&&a[0].distance1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.isStreetControls=!0,this._onMouseOut=super.onMouseUp.bind(this),t.domElement.addEventListener("mouseout",this._onMouseOut),this.previousPosition=void 0,this.currentPosition=void 0,this.nextPosition=void 0,this.keyGoToNextPosition=90,this.keyGoToPreviousPosition=83,this.keySetCameraToCurrentPositionAndLookAtNext=65,this.keySetCameraToCurrentPositionAndLookAtPrevious=81,this.tweenGroup=new Y.ZP.Group,this.surfaceGround=e.surfaceGround||function(){const t=new i.CircleGeometry(1,32);return new i.Mesh(t,X)}(),this.surfaceWall=e.surfaceWall||function(){const t=new i.PlaneGeometry(4,2,1),e=new i.Mesh(t,X);return e.rotateX(.5*-Math.PI),e}(),this.surfaces=new i.Object3D,this.surfaces.add(this.surfaceGround),this.surfaces.add(this.surfaceWall),this.view.scene.add(this.surfaces),this.wallMaxDistance=e.wallMaxDistance||1e3,this.animationDurationWall=e.animationDurationWall||200,this.buildingsLayer=e.buildingsLayer,this.computeTime=e.computeTime||nt,this.offset=e.offset||4,this.transformationPositionPickOnTheGround=e.transformationPositionPickOnTheGround||(t=>t),this.end=this.camera.clone()}setCurrentPosition(t){this.currentPosition=t}setNextPosition(t){this.nextPosition=t}setPreviousPosition(t){this.previousPosition=t}onMouseUp(t){0!=this.enabled&&(super.onMouseUp(),this._stateOnMouseDrag?this._stateOnMouseDrag=!1:it(t,this.view,this.buildingsLayer,this.onClickOnGround.bind(this),this.onClickOnWall.bind(this)))}onMouseMove(t){0!=this.enabled&&(super.onMouseMove(t),this._isMouseDown?(this._stateOnMouseDrag=!0,this.stopAnimations()):this.tween||(it(t,this.view,this.buildingsLayer,((t,e)=>{J(this.surfaces,t,e),this.surfaceGround.visible=!0,this.surfaceWall.visible=!1}),((t,e)=>{J(this.surfaces,t,e),this.surfaceWall.visible=!0,this.surfaceGround.visible=!1})),this.view.notifyChange(this.surfaces)))}setCameraToCurrentPosition(t){t?this.setCameraOnPosition(this.currentPosition,this.previousPosition):this.setCameraOnPosition(this.currentPosition,this.nextPosition)}setCameraOnPosition(t,e){t&&e&&(this.camera.position.copy(t),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?this.camera.up.copy(t).normalize():this.camera.up.set(0,0,1),this.camera.lookAt(e),this.camera.updateMatrixWorld(),this.reset())}onClickOnGround(t){t=this.transformationPositionPickOnTheGround(t),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?et.copy(t).normalize():et.set(0,0,1),t.add(et.multiplyScalar(this.offset));const e=this.camera.position.distanceTo(t),r=this.computeTime(e);this.moveCameraTo(t,r)}onClickOnWall(t){this.camera.position.distanceTo(t){this.stopAnimations()})).onUpdate((t=>{this.camera.quaternion.slerpQuaternions(rt,this.end.quaternion,t.t)})).start(),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.reset(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera)}moveCameraTo(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;if(!t)return Promise.resolve();const i=new Promise((t=>{e=t}));return this.stopAnimations(),this.tween=new Y.ZP.Tween(this.camera.position,this.tweenGroup).to(t.clone(),r).easing(Y.ZP.Easing.Quadratic.Out).onComplete((()=>{this.stopAnimations(),e()})).start(),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera),i}stopAnimations(){this.tween&&(this.tween.stop(),this.tween=void 0),this.animationFrameRequester&&(this.view.removeFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.animationFrameRequester=null)}moveCameraToCurrentPosition(){this.moveCameraTo(this.currentPosition)}onKeyDown(t){0!=this.enabled&&(super.onKeyDown(t),t.keyCode==this.keyGoToNextPosition&&this.moveCameraTo(this.nextPosition),t.keyCode==this.keyGoToPreviousPosition&&this.moveCameraTo(this.previousPosition),t.keyCode==this.keySetCameraToCurrentPositionAndLookAtNext&&(this.setCameraToCurrentPosition(),this.view.notifyChange(this.view.camera3D)),t.keyCode==this.keySetCameraToCurrentPositionAndLookAtPrevious&&(this.setCameraToCurrentPosition(!0),this.view.notifyChange(this.view.camera3D)))}dispose(){this.view.domElement.removeEventListener("mouseout",this._onMouseOut,!1),super.dispose()}};var ot=r(29571),at=r(9187),lt=r(5167),ct=r(61366),ht=r(53175);const ut=i.MathUtils.DEG2RAD,dt=new i.Matrix4,pt=new i.Vector3,ft=new i.Vector3,mt=(new i.Vector3).set(0,0,1),gt=new o.Z("EPSG:4326",0,0,0),At=new i.Euler,yt=new i.Quaternion;function vt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return t?e.set(0,0,0,1):vt}const xt={quaternionFromRollPitchHeading(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;return t*=ut,e*=ut,r*=ut,n.setFromEuler(At.set(-e,-t,-r,"YXZ"))},quaternionFromOmegaPhiKappa(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;return t*=ut,e*=ut,r*=ut,n.setFromEuler(At.set(t,e,r,"XYZ")),n.set(n.w,n.z,-n.y,-n.x),n},quaternionFromAttitude(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return void 0!==t.roll||void 0!==t.pitch||void 0!==t.heading?this.quaternionFromRollPitchHeading(t.roll,t.pitch,t.heading,e):void 0!==t.omega||void 0!==t.phi||void 0!==t.kappa?this.quaternionFromOmegaPhiKappa(t.omega,t.phi,t.kappa,e):e.set(0,0,0,1)},quaternionFromEnuToGeocent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return t?this.quaternionFromEnuToGeocent()(t,e):function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;const r=t.geodesicNormal;return 0==r.x&&0==r.y?e.set(0,0,0,1):(ft.set(-r.y,r.x,0).normalize(),pt.crossVectors(r,ft),dt.makeBasis(ft,pt,r),e.setFromRotationMatrix(dt))}},quaternionFromGeocentToEnu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;if(t)return this.quaternionFromGeocentToEnu()(t,e);const r=this.quaternionFromEnuToGeocent();return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return r(t,e).conjugate()}},quaternionFromLCCToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromLCCToEnu(t)(e,r);const n=Math.sin(t.lat0);return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;const s=e.as(gt.crs,gt).longitude*ut;return r.setFromAxisAngle(mt,n*(t.long0-s))}},quaternionFromEnuToLCC(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToLCC(t)(e,r);const n=this.quaternionFromLCCToEnu(t);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return n(t,e).conjugate()}},quaternionFromTMercToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromTMercToEnu(t)(e,r);const n=t.a*t.a,s=t.b*t.b,o=t.e*t.e,a=t.e?o/(1-o):n/s-1;return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;e.as(gt.crs,gt);const n=gt.longitude*ut,s=gt.latitude*ut,o=t.long0-n,l=Math.cos(s),c=Math.sin(s),h=l*l,u=o*o*h,d=a*h;return r.setFromAxisAngle(mt,o*c*(1+u/3*(1+3*d+2*d*d)+u*u*(2-c/l)/15))}},quaternionFromEnuToTMerc(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToTMerc(t)(e,r);const n=this.quaternionFromTMercToEnu(t);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return n(t,e).conjugate()}},quaternionFromLongLatToEnu(t){return vt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion)},quaternionFromEnuToLongLat(t){return vt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion)},quaternionUnimplemented(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;return console.warn("This quaternion function is not implemented for projections of type",t.projName),vt(e,r)},quaternionFromEnuToCRS(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToCRS(t)(e,r);const s=t.projName?t:n.default.defs(t);switch(s.projName){case"geocent":return this.quaternionFromEnuToGeocent();case"lcc":return this.quaternionFromEnuToLCC(s);case"tmerc":return this.quaternionFromEnuToTMerc(s);case"longlat":return this.quaternionFromEnuToLongLat();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromCRSToEnu(t)(e,r);const s=t.projName?t:n.default.defs(t);switch(s.projName){case"geocent":return this.quaternionFromGeocentToEnu();case"lcc":return this.quaternionFromLCCToEnu(s);case"tmerc":return this.quaternionFromTMercToEnu(s);case"longlat":return this.quaternionFromLongLatToEnu();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToCRS(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;if(r)return this.quaternionFromCRSToCRS(t,e)(r,n);if(t==e)return function(){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion).set(0,0,0,1)};const s=this.quaternionFromCRSToEnu(t),o=this.quaternionFromEnuToCRS(e);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return o(t,e).multiply(s(t,yt))}}};var bt=r(49075);const _t=new o.Z("EPSG:4326",0,0,0),wt=new bt.uP,Et=new bt.ZP;let Mt;const St=new i.Vector2,Ct=new i.Vector2,Tt=new i.Vector3,It=new i.Vector3,Rt=new i.Vector3,Bt=new i.Vector3,Lt=new s.ZP("EPSG:4326",0,0,0,0),Pt=new i.Color,Dt=255,Ot=65535,kt="EPSG:4326";class Ut extends i.Group{#C;#T;#I=new i.Group;#R=new i.Group;constructor(t,e){super(),this.meshes=(new i.Group).add(...t),this.#I=(new i.Group).add(this.meshes),this.#I.quaternion.copy(e.quaternion),this.#I.position.copy(e.position),this.#I.scale.copy(e.scale),this.#I.updateMatrix(),this.#T=e.crs,this.#C=this.#T,this.extent=e.extent,this.add(this.#R.add(this.#I))}as(t){if(this.#C!==t)if(this.#C=t,t==this.#T)this.place.position.set(0,0,0),this.position.set(0,0,0),this.scale.set(1,1,1),this.quaternion.identity();else{_t.crs=l.Z.formatToEPSG(this.#T),Lt.copy(this.extent).applyMatrix4(this.#I.matrix),Lt.as(_t.crs,Lt),Lt.spatialEuclideanDimensions(St),Lt.planarDimensions(Ct),Ct.x&&Ct.y&&this.scale.copy(St).divide(Ct).setZ(1),this.#R.position.copy(this.#I.position).negate(),_t.setFromVector3(this.#I.position);const e="EPSG:3857"==this.#T?kt:this.#T;xt.quaternionFromCRSToCRS(e,t)(_t.as(kt),this.quaternion),_t.as(t,_t).toVector3(this.position)}return this}}function Nt(t){return t?"Color"==t.type?t:Pt.set(t):Pt.set(16777215*Math.random())}function Ft(t,e){return e<=Dt?new Uint8Array(t):e<=Ot?new Uint16Array(t):new Uint32Array(t)}function zt(t,e,r,i,n){const s=t.length;t.length+=6*(i-1);for(let o=r,a=s;oe);let a=0;const l=new Float32Array(r);Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);const c=[];wt.setFeature(t);for(const e of t.geometries){const r=e.indices[0].offset,i=e.indices[0].count,h=o(e.properties,a);wt.setGeometry(e);for(let e=3*r,o=r;o1&&console.warn("Too many differents point.radius, only the first one will be used"),new i.Points(h,e.pointMaterial)}function Qt(t,e,r){const i=(e*=3)+3*r;let n=0;for(let r=i-3,s=e;s{t instanceof i.Mesh&&(t.updateMatrixWorld(),t.geometry.applyMatrix4(t.matrixWorld),e.push(t))})),e}(n).forEach((i=>t.add(jt(i,r,e)))),t}throw new Error("The format of the model object provided in the style (layer.style.point.model.object) is not supported. Only THREE.Mesh or THREE.Object3D are supported.")}(t),s.isInstancedMesh=!0}catch(r){s=Gt(t,e)}else s=Gt(t,e);break;case lt.tg.LINE:s=function(t,e){const r=t.vertices,n=new Uint8Array(r.length),s=r.length/3,o=new Uint32Array(s),a=e.batchId||((t,e)=>e);let l=0;const c=new Float32Array(r.length),h=new i.BufferGeometry,u=[];wt.setFeature(t);const d=Ft(2*(s-t.geometries.length),s);let p=0;Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);for(const e of t.geometries){wt.setGeometry(e);const r=a(e.properties,l),i=e.indices[0].offset;if(i>65535){console.warn("Feature to Line: integer overflow, too many points in lines");break}const s=i+e.indices[0].count;for(let e=3*i,a=i;a1&&console.warn("Too many differents stroke.width, only the first one will be used"),h.setAttribute("position",new i.BufferAttribute(c,3)),h.setAttribute("color",new i.BufferAttribute(n,3,!0)),h.setAttribute("batchId",new i.BufferAttribute(o,1)),h.setIndex(new i.BufferAttribute(d,1)),new i.LineSegments(h,e.lineMaterial)}(t,e);break;case lt.tg.POLYGON:s=Mt.fill&&Object.keys(Mt.fill).includes("extrusion_height")?function(t,e){const r=t.vertices,n=new Float32Array(2*r.length),s=r.length/3,o=new Uint8Array(2*r.length),a=[],l=new Uint32Array(n.length/3),c=e.batchId||((t,e)=>e);let h=0;wt.setFeature(t),Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt),_t.setCrs(wt.collection.crs);for(const e of t.geometries){wt.setGeometry(e);const i=e.indices[0].offset,u=e.indices.slice(-1)[0],d=u.offset+u.count,p=d-i,f=e.indices[0].ccw??Qt(r,i,p)<0,m=3*i,g=i+s,A=c(e.properties,h);for(let e=m,a=m+r.length,c=i;et.offset-i)).slice(1),x=at(y,v,3),b=a.length;a.length+=x.length;for(let t=0;te);wt.setFeature(t),Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);let l=0;for(const e of t.geometries){const i=e.indices[0].offset;if(i>4294967295){console.warn("Feature to Polygon: integer overflow, too many points in polygons");break}wt.setGeometry(e);const c=e.indices.slice(-1)[0],h=c.offset+c.count,u=3*i,d=a(e.properties,l);for(let e=u,s=i;et.offset-i)).slice(1),m=at(p,f,3),g=s.length;s.length+=m.length;for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};return(0,ht.ie)(t),function(e){if(!e)return;t.pointMaterial||(t.pointMaterial=(0,ct.Z)(new i.PointsMaterial,this),t.lineMaterial=(0,ct.Z)(new i.LineBasicMaterial,this),t.polygonMaterial=(0,ct.Z)(new i.MeshBasicMaterial,this)),Mt=(null==this?void 0:this.style)||(t.style?new bt.ZP(t.style):Et),wt.setCollection(e);const r=e.features;if(!r||0==r.length)return;const n=r.map((e=>{const r=Vt(e,t);return r.layer=this,r}));return new Ut(n,e)}}};var Wt=r(29372),qt=r(86541),Zt=r(32533);const Yt={color_layers_pars_fragment:"struct Layer {\n int textureOffset;\n int crs;\n int effect_type;\n float effect_parameter;\n float opacity;\n bool transparent;\n};\n\n#include \n\nuniform sampler2D colorTextures[NUM_FS_TEXTURES];\nuniform vec4 colorOffsetScales[NUM_FS_TEXTURES];\nuniform Layer colorLayers[NUM_FS_TEXTURES];\nuniform int colorTextureCount;\n\nvec3 uvs[NUM_CRS];\n\nfloat getBorderDistance(vec2 uv) {\n vec2 p2 = min(uv, 1. -uv);\n return min(p2.x, p2.y);\n}\n\nfloat tolerance = 0.99;\n\nvec4 applyWhiteToInvisibleEffect(vec4 color) {\n float a = dot(color.rgb, vec3(0.333333333));\n if (a >= tolerance) {\n color.a = 0.0;\n }\n return color;\n}\n\nvec4 applyLightColorToInvisibleEffect(vec4 color, float intensity) {\n float a = max(0.05,1. - length(color.xyz - 1.));\n color.a *= 1.0 - pow(abs(a), intensity);\n color.rgb *= color.rgb * color.rgb;\n return color;\n}\n\n#if defined(DEBUG)\nuniform bool showOutline;\nuniform vec3 outlineColors[NUM_CRS];\nuniform float outlineWidth;\n\nvec4 getOutlineColor(vec3 outlineColor, vec2 uv) {\n float alpha = 1. - clamp(getBorderDistance(uv) / outlineWidth, 0., 1.);\n return vec4(outlineColor, alpha);\n}\n#endif\n\nuniform float minBorderDistance;\nvec4 getLayerColor(int textureOffset, sampler2D tex, vec4 offsetScale, Layer layer) {\n if ( textureOffset >= colorTextureCount ) return vec4(0);\n\n vec3 uv;\n // #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++ ) {\n if ( i == layer.crs ) uv = uvs[ i ];\n }\n\n float borderDistance = getBorderDistance(uv.xy);\n if (textureOffset != layer.textureOffset + int(uv.z) || borderDistance < minBorderDistance ) return vec4(0);\n vec4 color = texture2D(tex, pitUV(uv.xy, offsetScale));\n if (layer.effect_type == 3) {\n #include \n } else {\n if (layer.transparent && color.a != 0.0) {\n color.rgb /= color.a;\n }\n\n if (layer.effect_type == 1) {\n color = applyLightColorToInvisibleEffect(color, layer.effect_parameter);\n } else if (layer.effect_type == 2) {\n color = applyWhiteToInvisibleEffect(color);\n }\n }\n color.a *= layer.opacity;\n return color;\n}\n",custom_body_colorLayer:"// no custom body",custom_header_colorLayer:"// no custom header",elevation_pars_vertex:"#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n uniform float geoidHeight;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n return texture2D( tex, uv ).r;\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n // Elevation textures are inverted along the y-axis\n uv = vec2(uv.x, 1.0 - uv.y);\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = clamp(getElevationMode(uv, tex, layer.mode), layer.zmin, layer.zmax);\n return d * layer.scale + layer.bias;\n }\n#endif\n",elevation_vertex:"#if NUM_VS_TEXTURES > 0\n if(elevationTextureCount > 0) {\n float elevation = getElevation(uv, elevationTextures[0], elevationOffsetScales[0], elevationLayers[0]);\n transformed += elevation * normal;\n }\n#endif\n",geoid_vertex:"transformed += geoidHeight * normal;\n",fog_fragment:"#if defined(USE_FOG)\n float fogFactor = 1. - min( exp(-vFogDepth / fogDistance), 1.);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n",fog_pars_fragment:"#if defined(USE_FOG)\nuniform vec3 fogColor;\nuniform float fogDistance;\nvarying float vFogDepth;\n#endif\n",lighting_fragment:"if (lightingEnabled) {\n float light = min(2. * dot(vNormal, lightPosition), 1.);\n gl_FragColor.rgb *= light;\n}\n",lighting_pars_fragment:"uniform bool lightingEnabled;\nuniform vec3 lightPosition;\nvarying vec3 vNormal;\n",mode_depth_fragment:"#if defined(USE_LOGDEPTHBUF)\ngl_FragColor = packDepthToRGBA(gl_FragDepthEXT);\n#else\nfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\ngl_FragColor = packDepthToRGBA(fragCoordZ);\n#endif\n",mode_id_fragment:"// 16777216.0 == 256.0 * 256.0 * 256.0\ngl_FragColor = packDepthToRGBA(float(objectId) / 16777216.0);\n",mode_pars_fragment:"#if MODE == MODE_ID || MODE == MODE_DEPTH\n#include \n#endif\n\n#if MODE == MODE_ID\nuniform int objectId;\n#endif\n",overlay_fragment:"gl_FragColor.rgb = mix(gl_FragColor.rgb, overlayColor, overlayAlpha);\n",overlay_pars_fragment:"uniform vec3 overlayColor;\nuniform float overlayAlpha;\n",pitUV:"vec2 pitUV(vec2 uv, vec4 pit)\n{\n return uv * pit.zw + vec2(pit.x, 1.0 - pit.w - pit.y);\n}\n\n",precision_qualifier:"precision highp float;\nprecision highp int;\n",projective_texturing_vertex:"for(int i = 0; i < ORIENTED_IMAGES_COUNT; ++i)\n projectiveTextureCoords[i] = projectiveTextureMatrix[i] * mvPosition;\n",projective_texturing_pars_vertex:"uniform mat4 projectiveTextureMatrix[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\n",projective_texturing_pars_fragment:"uniform sampler2D projectiveTexture[ORIENTED_IMAGES_COUNT];\nuniform sampler2D mask[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\nuniform float projectiveTextureAlphaBorder;\nuniform float opacity;\nuniform bool boostLight;\n\nstruct Distortion {\n vec2 size;\n#if USE_DISTORTION\n vec2 pps;\n vec4 polynom;\n vec3 l1l2;\n#endif\n};\n\nuniform Distortion projectiveTextureDistortion[ORIENTED_IMAGES_COUNT];\n\nfloat getAlphaBorder(vec2 p)\n{\n vec2 d = clamp(projectiveTextureAlphaBorder * min(p, 1. - p), 0., 1.);\n return min(d.x, d.y);\n}\n\n#if USE_DISTORTION\nvoid distort(inout vec2 p, vec4 polynom, vec2 pps)\n{\n vec2 v = p - pps;\n float v2 = dot(v, v);\n if (v2 > polynom.w) {\n p = vec2(-1.);\n }\n else {\n p += (v2 * (polynom.x + v2 * (polynom.y + v2 * polynom.z) ) ) * v;\n }\n}\n\nvoid distort(inout vec2 p, vec4 polynom, vec3 l1l2, vec2 pps)\n{\n if ((l1l2.x == 0.) && (l1l2.y == 0.)) {\n distort(p, polynom, pps);\n } else {\n vec2 AB = (p - pps) / l1l2.z;\n float R = length(AB);\n float lambda = atan(R) / R;\n vec2 ab = lambda * AB;\n float rho2 = dot(ab, ab);\n float r357 = 1. + rho2* (polynom.x + rho2* (polynom.y + rho2 * polynom.z));\n p = pps + l1l2.z * (r357 * ab + vec2(dot(l1l2.xy, ab), l1l2.y * ab.x));\n }\n}\n#endif\n\nvec4 mixBaseColor(vec4 aColor, vec4 baseColor) {\n #ifdef USE_BASE_MATERIAL\n baseColor.rgb = aColor.a == 1.0 ? aColor.rgb : mix(baseColor, aColor, aColor.a).rgb;\n baseColor.a = min(1.0, aColor.a + baseColor.a);\n #else\n baseColor.rgb += aColor.rgb * aColor.a;\n baseColor.a += aColor.a;\n #endif\n return baseColor;\n}\n\nvec4 projectiveTextureColor(vec4 coords, Distortion distortion, sampler2D tex, sampler2D mask, vec4 baseColor) {\n vec3 p = coords.xyz / coords.w;\n if(p.z * p.z < 1.) {\n#if USE_DISTORTION\n p.xy *= distortion.size;\n distort(p.xy, distortion.polynom, distortion.l1l2, distortion.pps);\n p.xy /= distortion.size;\n#endif\n\n float d = getAlphaBorder(p.xy) * texture2D(mask, p.xy).r;\n\n if(d > 0.) {\n\n#if DEBUG_ALPHA_BORDER\n vec3 r = texture2D(tex, p.xy).rgb;\n return mixBaseColor(vec4( r.r * d, r.g, r.b, 1.0), baseColor);\n#else\n vec4 color = texture2D(tex, p.xy);\n color.a *= d;\n if (boostLight) {\n return mixBaseColor(vec4(sqrt(color.rgb), color.a), baseColor);\n } else {\n return mixBaseColor(color, baseColor);\n }\n#endif\n\n }\n }\n return mixBaseColor(vec4(0.), baseColor);\n}\n"},Xt=new class{constructor(t,e){this.path=e,this.target=t,this.install()}customHeaderColorLayer(t){Yt.custom_header_colorLayer=t,this.target[`${this.path}custom_header_colorLayer`]=t}customBodyColorLayer(t){Yt.custom_body_colorLayer=t,this.target[`${this.path}custom_body_colorLayer`]=t}install(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.target,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.path;return Object.keys(e).forEach((i=>{Object.defineProperty(this,i,{get:()=>e[i]}),t[r+i]=e[i]})),t}}(i.ShaderChunk,"itowns/"),Jt=Xt;var Kt=r(5199),$t=r(28448),te=r(232),ee=r(59947),re=r(78025);const ie=new bt.ZP,ne=new bt.uP;let se;function oe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{offset:0,count:1}],i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;if(0===e.length)return;const l=new Path2D;for(const t of r)if(t.extent&&s.ZP.intersectsExtent(t.extent,n)){const r=t.offset*i,n=r+t.count*i;l.moveTo(e[r],e[r+1]);for(let t=r+i;t(t.generateMipmaps=!1,t.magFilter=e.magFilter||i.LinearFilter,t.minFilter=e.minFilter||i.LinearFilter,t),be={convert(t,e,r){let n;if(t.isFeatureCollection){const s=r.source.backgroundLayer,o=s&&s.paint?new i.Color(s.paint["background-color"]):void 0;e.as(l.Z.formatToEPSG(r.crs),ve),n=ye.createTextureFromFeature(t,ve,256,r.style,o),n.features=t,n.extent=e}else{if(!t.isTexture)throw new Error("Data type is not supported to convert into texture");n=t}return r.isColorLayer?function(t,e){return t.anisotropy=16,t.premultiplyAlpha=e.transparent,xe(t,e)}(n,r):r.isElevationLayer?(n.flipY&&(n.flipY=!1),xe(n,r)):void 0}};var _e=r(55086);class we extends re.Z{constructor(t,e){e.cacheLifeTime=e.cacheLifeTime??_e.D.TEXTURE,super(t,e)}convert(t,e){return be.convert(t,e,this)}delete(t){t&&this.cache.clear();for(const t of this.parent.level0Nodes)t.traverse((0,b.U8)(this.id))}}const Ee=we;var Me=r(43412);const Se=class extends Ee{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,ht.S_)(e),super(t,e),this.isColorLayer=!0,this.defineLayerProperty("visible",!0),this.defineLayerProperty("opacity",1),this.defineLayerProperty("sequence",0),this.transparent=e.transparent||this.opacity<1,this.noTextureParentOutsideLimit=!!e.source&&e.source.isFileSource,this.effect_type=e.effect_type??0,this.effect_parameter=e.effect_parameter??1,this.buildExtent=!0,this.structure="2d"}setupRasterNode(t){const e=new Me.AN(t.material,this);return t.material.addLayer(e),t.material.setSequence(this.parent.colorLayersOrder),e}update(t,e,r,i){return(0,b.XP)(t,this,r,i)}},Ce=class extends Ee{constructor(t){var e,r;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,i),(i.zmin||i.zmax)&&console.warn("Config using zmin and zmax are deprecated, use {clampValues: {min, max}} structure."),this.zmin=(null===(e=i.clampValues)||void 0===e?void 0:e.min)??i.zmin,this.zmax=(null===(r=i.clampValues)||void 0===r?void 0:r.max)??i.zmax,this.isElevationLayer=!0,this.defineLayerProperty("scale",this.scale||1)}setupRasterNode(t){const e=new Me.NO(t.material,this);t.material.addLayer(e),t.material.setSequenceElevation(this.id);const r=()=>t.setBBoxZ({min:e.min,max:e.max,scale:this.scale});return r(),e.addEventListener("rasterElevationLevelChanged",r),this.addEventListener("scale-property-changed",r),t.addEventListener("dispose",(()=>{this.removeEventListener("scale-property-changed",r)})),e}update(t,e,r,i){return(0,b.pN)(t,this,r,i)}};var Te=r(45222);class Ie extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.update=x.update,e.convert=Ht.convert({batchId:e.batchId}),super(t,e.object3d||new i.Group,e),this.isFeatureGeometryLayer=!0,this.accurate=e.accurate??!0,this.buildExtent=!this.accurate}preUpdate(t,e){e.has(this.parent)&&this.object3d.clear()}}const Re=Ie;var Be=r(98675);const Le=new i.Vector3,Pe=new i.Mesh,De=new i.Box3;function Oe(t,e,r,n,s){return t.camera.camera3D.isOrthographicCamera?function(t,e,r,n){const s=r/2**n.depth,o=new i.Vector4(s);o.applyMatrix4(t.camera.camera3D.projectionMatrix);const a=.5*o.x*t.camera.width,l=.5*o.y*t.camera.height,c=Math.sqrt(a*a+l*l);return Math.max(0,c-e)}(t,e,r,n):function(t,e,r,i,n){if(n<=0)return 1/0;const s=r/2**i.depth,o=t.camera.preSSE*s/n;return Math.max(0,o-e)}(t,e,r,n,s)}function ke(t){t.obj&&(t.obj.visible=!1),t.notVisibleSince||(t.notVisibleSince=Date.now(),t.sse=-1);for(const e of t.children)ke(e)}function Ue(t){var e;null===(e=t.material.intensityRange)||void 0===e||e.set(t.minIntensityRange,t.maxIntensityRange)}function Ne(t){var e;null===(e=t.material.elevationRange)||void 0===e||e.set(t.minElevationRange,t.maxElevationRange)}function Fe(t){var e;null===(e=t.material.angleRange)||void 0===e||e.set(t.minAngleRange,t.maxAngleRange)}Pe.geometry.boundingBox=De;class ze extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,new i.Group,e),this.isPointCloudLayer=!0,this.protocol="pointcloud",this.group=e.group||new i.Group,this.object3d.add(this.group),this.bboxes=e.bboxes||new i.Group,this.bboxes.visible=!1,this.object3d.add(this.bboxes),this.group.updateMatrixWorld(),this.octreeDepthLimit=e.octreeDepthLimit||-1,this.pointBudget=e.pointBudget||2e6,this.pointSize=0!==e.pointSize&&isNaN(e.pointSize)?4:e.pointSize,this.sseThreshold=e.sseThreshold||2,this.defineLayerProperty("minIntensityRange",e.minIntensityRange||1,Ue),this.defineLayerProperty("maxIntensityRange",e.maxIntensityRange||65536,Ue),this.defineLayerProperty("minElevationRange",e.minElevationRange||0,Ne),this.defineLayerProperty("maxElevationRange",e.maxElevationRange||1e3,Ne),this.defineLayerProperty("minAngleRange",e.minAngleRange||-90,Fe),this.defineLayerProperty("maxAngleRange",e.maxAngleRange||90,Fe),this.material=e.material||{},this.material.isMaterial||(e.material=e.material||{},e.material.intensityRange=new i.Vector2(this.minIntensityRange,this.maxIntensityRange),e.material.elevationRange=new i.Vector2(this.minElevationRange,this.maxElevationRange),e.material.angleRange=new i.Vector2(this.minAngleRange,this.maxAngleRange),this.material=new S.ZP(e.material)),this.material.defines=this.material.defines||{},this.mode=e.mode||S.vj.COLOR}preUpdate(t,e){let r;t.camera.preSSE=t.camera.height/(2*Math.tan(.5*i.MathUtils.degToRad(t.camera.camera3D.fov))),this.material&&(this.material.visible=this.visible,this.material.opacity=this.opacity,this.material.transparent=this.opacity<1,this.material.size=this.pointSize,this.material.scale=t.camera.preSSE,this.material.updateUniforms&&this.material.updateUniforms());for(const t of e.values()){if(t.isCamera||t==this)return[this.root];if(void 0!==t.obj&&t.obj.isPoints&&t.obj.layer==this)if(r){if(r=t.findCommonAncestor(r),!r)return[this.root]}else r=t}return r?[r]:[this.root]}update(t,e,r){if(r.visible=!1,this.octreeDepthLimit>=0&&this.octreeDepthLimit!t.requester.visible||!this.visible}).then((t=>{this.onPointsCreated&&this.onPointsCreated(e,t),r.obj=t,r.tightbbox=t.tightbbox,this.group.add(r.obj),r.obj.updateMatrixWorld(!0),r.promise=null}),(t=>{t.isCancelledCommandException&&(r.promise=null)}))}if(r.children&&r.children.length){const n=i.distanceToPoint(Le);if(r.sse=Oe(t,e.pointSize,e.spacing,r,n)/this.sseThreshold,r.sse>=1)return r.children;for(const t of r.children)ke(t)}}else ke(r)}postUpdate(){this.displayedCount=0;for(const t of this.group.children)if(t.visible){const e=t.geometry.attributes.position.count;t.geometry.setDrawRange(0,e),this.displayedCount+=e}if(this.displayedCount>this.pointBudget)if(this.supportsProgressiveDisplay){const t=this.pointBudget/this.displayedCount;for(const e of this.group.children)if(e.visible){const r=Math.floor(e.geometry.drawRange.count*t);r>0?e.geometry.setDrawRange(0,r):e.visible=!1}this.displayedCount*=t}else{this.group.children.sort(((t,e)=>e.userData.node.sse-t.userData.node.sse));let t=!1;this.displayedCount=0;for(const e of this.group.children){const r=e.geometry.attributes.position.count;t||this.displayedCount+r>this.pointBudget?(e.visible=!1,t=!0):this.displayedCount+=r}}const t=Date.now();for(let e=this.group.children.length-1;e>=0;e--){const r=this.group.children[e];!r.visible&&t-r.userData.node.notVisibleSince>1e4&&(this.group.children.splice(e,1),r.geometry.dispose(),r.material=null,r.geometry=null,r.userData.node.obj=null)}}pickObjectsAt(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Be.Z.pickPointsAt(t,e,r,this,i)}getObjectToUpdateForAttachedLayers(t){if(t.obj){const e=t.parent;return e&&e.obj?{element:t.obj,parent:e.obj}:{element:t.obj}}}}const Ge=ze;class Qe extends i.EventDispatcher{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;super(),this.numPoints=t,this.layer=e,this.children=[],this.bbox=new i.Box3,this.sse=-1}add(t,e){this.children.push(t),t.parent=this,this.createChildAABB(t,e)}load(){return this.octreeIsLoaded||this.loadOctree(),this.layer.source.fetcher(this.url,this.layer.source.networkOptions).then((t=>this.layer.source.parse(t,{out:this.layer,in:this.layer.source})))}findCommonAncestor(t){return t.depth!=this.depth?t.depth1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e),this.childrenBitField=t,this.id="",this.depth=0,this.baseurl=e.source.baseurl}add(t,e,r){super.add(t,e),t.id=this.id+e,t.depth=t.id.length,t.id.length%this.layer.hierarchyStepSize==0?t.baseurl=`${r.baseurl}/${t.id.substr(r.id.length)}`:t.baseurl=r.baseurl}createChildAABB(t,e){t.bbox.copy(this.bbox),this.bbox.getCenter(t.bbox.max),Ve.copy(t.bbox.max).sub(this.bbox.min),1===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z):3===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z,t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y):0===e||(2===e?(t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y):5===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z,t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x):7===e?(t.bbox.min.add(Ve),t.bbox.max.add(Ve)):4===e?(t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x):6===e&&(t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y,t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x))}get octreeIsLoaded(){return!(this.childrenBitField&&0===this.children.length)}get url(){return`${this.baseurl}/r${this.id}.${this.layer.source.extension}`}loadOctree(){const t=`${this.baseurl}/r${this.id}.${this.layer.source.extensionOctree}`;return this.layer.source.fetcher(t,this.layer.source.networkOptions).then((t=>{const e=new DataView(t),r=[];let i=0;for(this.childrenBitField=e.getUint8(0),i+=1,this.numPoints=e.getUint32(1,!0),i+=4,r.push(this);r.length&&i{this.scale=(new i.Vector3).addScalar(t.scale),this.spacing=t.spacing,this.hierarchyStepSize=t.hierarchyStepSize;const e=Array.isArray(t.pointAttributes)&&t.pointAttributes.find((t=>t.startsWith("NORMAL")));return e&&(this.material.defines[e]=1),this.supportsProgressiveDisplay="cin"===this.source.extension,this.root=new We(0,0,this),this.root.bbox.min.set(t.boundingBox.lx,t.boundingBox.ly,t.boundingBox.lz),this.root.bbox.max.set(t.boundingBox.ux,t.boundingBox.uy,t.boundingBox.uz),this.extent=s.ZP.fromBox3(this.source.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r)}))}};var Xe=r(11707),Je=r(96021),Ke=r(43195);const $e=new i.Matrix4(1,0,0,1,0,1,0,1,0,0,2,0,0,0,0,2),tr=new i.DataTexture(new Uint8Array([255,255,255,255]),1,1,i.RGBAFormat,i.UnsignedByteType);tr.needsUpdate=!0;const er=new i.Texture,rr=new i.ShaderMaterial;class ir extends i.ShaderMaterial{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.side=e.side??i.DoubleSide,e.transparent=e.transparent??!0,e.opacity=e.opacity??1;const r={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&void 0!==rr[t]&&(r[t]=e[t]);super(r),this.defines.ORIENTED_IMAGES_COUNT=e.OrientedImagesCount??t.length;const n=$t.Z.getMaxTextureUnitsCount();this.defines.ORIENTED_IMAGES_COUNT>n&&(console.warn(`OrientedImageMaterial: Can't project ${t.length} textures, because it's more than GPU capabilities maximum texture units (${n})`),this.defines.ORIENTED_IMAGES_COUNT=n-1,console.warn(`OrientedImageMaterial: We'll use only the first ${this.defines.ORIENTED_IMAGES_COUNT} cameras.`)),e.useBaseMaterial&&(this.defines.USE_BASE_MATERIAL=!0),this.defines.USE_DISTORTION=Number(t.some((t=>null!==t.distortion.pps))),this.alphaBorder=20|e.alphaBorder,this.defines.DEBUG_ALPHA_BORDER=0|e.debugAlphaBorder,this.cameras=t;const s=[],o=[],a=[],l=[];this.group=new i.Group;for(let e=0;e\n#include \n#include \nvarying vec3 vNormal;\n\n#ifdef USE_BASE_MATERIAL\nstruct noPT {\n vec3 lightDirection;\n vec3 ambient;\n float opacity;\n};\n\nuniform noPT noProjectiveMaterial;\n#endif\n\nvoid main(void)\n{\n #include \n #ifdef USE_BASE_MATERIAL\n float nDotVP = (max(0.1, dot(vNormal, normalize(noProjectiveMaterial.lightDirection))));\n vec4 color = vec4(noProjectiveMaterial.ambient + nDotVP, 0.0);\n #else\n vec4 color = vec4(0.0);\n #endif\n\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n\n #ifdef USE_BASE_MATERIAL\n color.a = color.a < 1.0 ? max(noProjectiveMaterial.opacity, color.a) : 1.0 ;\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n #else\n gl_FragColor = vec4(color.rgb / color.a, opacity);\n #endif\n\n}\n",this.defines)}setTextures(t,e,r){if(t){this.group.position.copy(e.position),this.group.quaternion.copy(e.quaternion);for(let e=0;et.name===r[e]));this.uniforms.mask.value[e]=t.maskTexture||tr,this.uniforms.mask.value[e].needsUpdate=!0,this.uniforms.projectiveTextureDistortion.value[e]=t.distortion,this.group.children[e]=t,t.parent=this.group}}this.group.children[e].needsUpdate=!0}this.group.updateMatrixWorld(!0)}}updateUniforms(t){for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=JSON.parse(t)),Promise.all(t.map((t=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=null==e.useMask||e.useMask,n=null==e.imageYDown||e.imageYDown,s=t.projection,o=(new i.Vector2).fromArray(t.size),a=new i.Vector2(s[0],s[4]),l=new i.Vector2(s[2],n?o.y-s[5]:s[5]),c=s[1],h=new M(o,a,l,e.near,e.far,c);h.position.fromArray(t.position);const u=ar.fromArray(t.rotation);let d;h.matrix.setFromMatrix3(u),h.quaternion.setFromRotationMatrix(h.matrix),h.rotateX(Math.PI),t.distortion&&h.distortion.setFromMicmacCalibration(t.distortion,n),h.maskPath=t.mask,h.name=t.id;const p=new Promise((t=>{d=t}));return r&&h.maskPath?or.load(h.maskPath,(t=>{h.maskTexture=t,d(h)})):d(h),p}(t,e))))}},cr=new o.Z("EPSG:4978",0,0,0),hr=t=>t.requester.id!==t.layer.currentPano.id;class ur extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.projection&&(console.warn("OrientedImageLayer projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),super(t,new i.Group,e),this.isOrientedImageLayer=!0,this.background=e.background||function(t){if(!t||t<=0)return;const e=new i.SphereGeometry(t,32,32),r=new i.MeshPhongMaterial({color:7829503,side:i.DoubleSide,transparent:!0,opacity:.5,wireframe:!0}),n=new i.Mesh(e,r);return n.visible=!0,n.name="OrientedImageBackground",n}(e.backgroundDistance),this.background&&(this.background.layer=this.background.layer??{},this.background.layer.id=this.background.layer.id??t,this.object3d.add(this.background)),this.currentPano=void 0,this.onPanoChanged=e.onPanoChanged||(()=>{}),this.getCamerasNameFromFeature=e.getCamerasNameFromFeature||(()=>{});const r=this.addInitializationStep();this.mergeFeatures=!1,this.filteringExtent=!1,this.accurate=!0;const n={out:this};this.source.whenReady.then((t=>sr.Z.parse(e.orientation||t.orientation,n).then((t=>{this.panos=t.features;const r=n.in.crs,s=e.crs,o=xt.quaternionFromCRSToCRS(r,s),a=new i.Quaternion;let l=0;for(const e of this.panos)cr.crs=e.crs,cr.setFromArray(e.vertices).applyMatrix4(t.matrix),e.position=cr.toVector3(),o(cr,a),e.quaternion=xt.quaternionFromAttitude(e.geometries[0].properties).premultiply(a),e.id=e.geometries[0].properties.id,e.index=l++})).then((()=>{lr.parse(e.calibration||t.calibration,e).then((t=>{this.cameras=t,this.material=new nr(this.cameras,e),r()}))}))))}update(){}set boostLight(t){this.material.uniforms.boostLight.value=t}get boostLight(){return this.material.uniforms.boostLight.value}preUpdate(t){var e;!function(t,e,r){const i=r.mostNearPano(e.position),n=r.currentPano?r.currentPano.id:void 0;if(i&&n!=i.id){r.currentPano=i,r.onPanoChanged({previousPanoPosition:r.getPreviousPano()?r.getPreviousPano().position:void 0,currentPanoPosition:r.getCurrentPano().position,nextPanoPosition:r.getNextPano().position});const e=i.geometries[0].properties.idSensors,n=r.cameras.map((t=>({cameraId:t.name,panoId:i.id,as:()=>{}}))).filter((t=>!e||e.includes(t.cameraId))),s={layer:r,extentsSource:n,view:t.view,requester:i,earlyDropFunction:hr};t.scheduler.execute(s).then((e=>{i.id===r.currentPano.id&&(r.material.setTextures(e,i,r.getCamerasNameFromFeature(i)),r.material.updateUniforms(t.camera.camera3D),t.view.notifyChange(r,!0))}),(()=>{}))}}(t,t.camera.camera3D,this),this.material.updateUniforms(t.camera.camera3D),(e=this).background&&e.currentPano&&(e.background.position.copy(e.currentPano.position),e.background.updateMatrixWorld(),e.background.material=e.material||e.background.material)}getNextPano(){const t=(this.currentPano.index+1)%this.panos.length;return this.panos[t]}getCurrentPano(){return this.currentPano}getPreviousPano(){const t=(this.currentPano.index-1)%this.panos.length;return this.panos[t]}delete(t){this.background&&super.delete(),t&&this.cache.clear(),this.material.visible=!1,console.warn("You need to replace OrientedImageLayer.material applied on each object. This issue will be fixed when OrientedImageLayer will be a ColorLayer. the material visibility is set to false. To follow issue see https://github.com/iTowns/itowns/issues/1018")}mostNearPano(t){let e,r=1/0;for(const i of this.panos){const n=t.distanceTo(i.position);n5&&void 0!==arguments[5]?arguments[5]:0,n),this.isEntwinePointTileNode=!0,this.depth=t,this.x=e,this.y=r,this.z=i,this.id=br(t,e,r,i),this.url=`${this.layer.source.url}/ept-data/${this.id}.${this.layer.source.extension}`}createChildAABB(t){const e=2**(t.depth-this.depth);this.bbox.getSize(yr).divideScalar(e),t.bbox.min.copy(this.bbox.min),vr.copy(this).multiplyScalar(e),xr.subVectors(t,vr).multiply(yr),t.bbox.min.add(xr),t.bbox.max.copy(t.bbox.min).add(yr)}get octreeIsLoaded(){return this.numPoints>=0}loadOctree(){return d.Z.json(`${this.layer.source.url}/ept-hierarchy/${this.id}.json`,this.layer.source.networkOptions).then((t=>{this.numPoints=t[this.id];const e=[];for(e.push(this);e.length;){const r=e.shift(),i=r.depth+1,n=2*r.x,s=2*r.y,o=2*r.z;r.findAndCreateChild(i,n,s,o,t,e),r.findAndCreateChild(i,n+1,s,o,t,e),r.findAndCreateChild(i,n,s+1,o,t,e),r.findAndCreateChild(i,n+1,s+1,o,t,e),r.findAndCreateChild(i,n,s,o+1,t,e),r.findAndCreateChild(i,n+1,s,o+1,t,e),r.findAndCreateChild(i,n,s+1,o+1,t,e),r.findAndCreateChild(i,n+1,s+1,o+1,t,e)}}))}findAndCreateChild(t,e,r,i,n,s){const o=n[br(t,e,r,i)];if("number"==typeof o){const n=new _r(t,e,r,i,this.layer,o);this.add(n),s.push(n)}}}const wr=_r,Er=new i.Mesh,Mr=new i.Box3;Er.geometry.boundingBox=Mr;const Sr=class extends Ge{constructor(t,e){super(t,e),this.isEntwinePointTileLayer=!0,this.scale=new i.Vector3(1,1,1);const r=this.addInitializationStep();this.whenReady=this.source.whenReady.then((()=>(this.root=new wr(0,0,0,0,this,-1),this.root.bbox.min.fromArray(this.source.boundsConforming,0),this.root.bbox.max.fromArray(this.source.boundsConforming,3),this.minElevationRange=this.source.boundsConforming[2],this.maxElevationRange=this.source.boundsConforming[5],this.extent=s.ZP.fromBox3(e.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r))))}get spacing(){return this.source.spacing}};var Cr=r(72726);class Tr extends Cr.Z{constructor(t){if(t.parsedData&&(console.warn("FileSource parsedData parameter is deprecated, use features instead of."),t.features=t.features||t.parsedData),t.projection&&(console.warn("FileSource projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs){if(!t.features||!t.features.crs)throw new Error("source.crs is required in FileSource");t.crs=t.features.crs}if(!t.url&&!t.fetchedData&&!t.features)throw new Error("url, fetchedData and features are not set in\n FileSource; at least one needs to be present");t.url=t.url||"fake-file-url",super(t),this.isFileSource=!0,this.fetchedData=t.fetchedData,this.fetchedData||t.features?t.features&&(this._featuresCaches[t.features.crs]=new _e.Z,this._featuresCaches[t.features.crs].setByArray(Promise.resolve(t.features),[0])):this.whenReady=this.fetcher(this.urlFromExtent(),this.networkOptions).then((t=>{this.fetchedData=t})),this.whenReady.then((()=>this.fetchedData)),this.zoom={min:0,max:1/0}}urlFromExtent(){return this.url}onLayerAdded(t){t.in=this,super.onLayerAdded(t);let e=this._featuresCaches[t.out.crs].getByArray([0]);e||(t.out.buildExtent="EPSG:4978"!=this.crs,t.out.buildExtent&&(t.out.forcedExtentCrs="EPSG:4978"!=t.out.crs?t.out.crs:l.Z.formatToEPSG(this.crs)),e=this.parser(this.fetchedData,t),this._featuresCaches[t.out.crs].setByArray(e,[0])),e.then((t=>{t.extent&&(this.extent=t.extent.clone(),this.extent.crs==t.crs&&this.extent.applyMatrix4(t.matrixWorld))}))}loadData(t,e){return this._featuresCaches[e.crs].getByArray([0])}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Ir=Tr;var Rr=r(4380);const Br=new s.ZP(l.Z.tms_4326,0,0,0);class Lr extends Cr.Z{constructor(t){if(t.format=t.format||"image/png",super(t),!t.crs)throw new Error("New TMSSource/WMTSSource: crs is required");if(this.isTMSSource=!0,t.extent||(this.extent=s.Mh.get(t.crs)),this.zoom=t.zoom,this.isInverted=t.isInverted||!1,this.crs=l.Z.formatToTms(t.crs),this.tileMatrixSetLimits=t.tileMatrixSetLimits,this.extentSetlimits={},this.tileMatrixCallback=t.tileMatrixCallback||(t=>t),!this.zoom)if(this.tileMatrixSetLimits){const t=Object.keys(this.tileMatrixSetLimits),e=t.length,r=Number(t[e-1]);this.zoom={min:r-e+1,max:r}}else this.zoom={min:0,max:1/0}}urlFromExtent(t){return Rr.Z.xyz(t,this)}onLayerAdded(t){super.onLayerAdded(t);const e=t.out.parent,r=e?e.extent.crs:t.out.crs;if(this.tileMatrixSetLimits&&!this.extentSetlimits[r]){this.extentSetlimits[r]={},Br.crs=this.crs;for(let t=this.zoom.max;t>=this.zoom.min;t--){const e=this.tileMatrixSetLimits[t],{west:i,north:n}=Br.set(t,e.minTileRow,e.minTileCol).as(r),{east:o,south:a}=Br.set(t,e.maxTileRow,e.maxTileCol).as(r);this.extentSetlimits[r][t]=new s.ZP(r,i,o,a,n)}}}extentInsideLimit(t,e){return e>=this.zoom.min&&e<=this.zoom.max&&(null==this.extentSetlimits[t.crs]||this.extentSetlimits[t.crs][e].intersectsExtent(t))}}const Pr=Lr;class Dr extends Cr.Z{constructor(t){if(t.projection&&(console.warn("WFSSource projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.typeName)throw new Error("source.typeName is required in wfs source.");if(!t.crs)throw new Error("source.crs is required in wfs source");t.format=t.format||"application/json",super(t),this.isWFSSource=!0,this.typeName=t.typeName,this.version=t.version||"2.0.2",this.bboxDigits=t.bboxDigits,this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${t.url}SERVICE=WFS&REQUEST=GetFeature&typeName=${this.typeName}&VERSION=${this.version}&SRSNAME=${this.crs}&outputFormat=${this.format}&BBOX=%bbox,${this.crs}`,this.zoom={min:0,max:1/0},this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}handlingError(t){return t.response&&400==t.response.status?t.response.text().then((e=>{const r=`${this.url}SERVICE=WFS&REQUEST=GetCapabilities&VERSION=${this.version}`,i=(new DOMParser).parseFromString(e,"application/xml").querySelector("Exception"),n=i.getAttribute("exceptionCode"),s=i.querySelector("ExceptionText").textContent;console.error(`Source ${this.typeName}: bad request when fetching data. Server says: "${n}: ${s}". \nReviewing ${r} may help.`,t)})):super.handlingError(t)}requestToKey(t){return l.Z.isTms(t.crs)?super.requestToKey(t):[t.zoom,t.south,t.west]}urlFromExtent(t){return Rr.Z.bbox(t,this)}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Or=Dr;class kr extends Cr.Z{constructor(t){if(!t.name)throw new Error("source.name is required.");if(!t.extent)throw new Error("source.extent is required");if(!t.crs&&!t.projection)throw new Error("source.crs is required");t.format=t.format||"image/png",super(t),this.isWMSSource=!0,this.name=t.name,this.zoom={min:0,max:1/0},this.style=t.style||"",this.width=t.width||t.height||256,this.height=t.height||t.width||256,this.version=t.version||"1.3.0",this.transparent=t.transparent||!1,this.bboxDigits=t.bboxDigits,t.axisOrder||("EPSG:4326"==this.crs?this.axisOrder="1.1.0"===this.version?"wsen":"swne":this.axisOrder="wsen");const e="1.3.0"===this.version?"CRS":"SRS";this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${this.url}SERVICE=WMS&REQUEST=GetMap&LAYERS=${this.name}&VERSION=${this.version}&STYLES=${this.style}&FORMAT=${this.format}&TRANSPARENT=${this.transparent}&BBOX=%bbox&${e}=${this.crs}&WIDTH=${this.width}&HEIGHT=${this.height}`,this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}urlFromExtent(t){return Rr.Z.bbox(t,this)}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Ur=kr,Nr=class extends Pr{constructor(t){if(!t.name)throw new Error("New WMTSSource: name is required");super(t),this.isWMTSSource=!0,this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${this.url}LAYER=${t.name}&FORMAT=${this.format}&SERVICE=WMTS&VERSION=${t.version||"1.0.0"}&REQUEST=GetTile&STYLE=${t.style||"normal"}&TILEMATRIXSET=${t.tileMatrixSet}&TILEMATRIX=%TILEMATRIX&TILEROW=%ROW&TILECOL=%COL`,this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}};var Fr=r(92294);const zr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/,Gr="https://api.mapbox.com",Qr=!0,jr=null;function Vr(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}function Hr(t,e){const r=qr(Gr);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==r.path&&(t.path=`${r.path}${t.path}`),!Qr)return Vr(t);if(!(e=e||jr))throw new Error("An API access token is required");if("s"===e[0])throw new Error("Use a public access token (pk.*), not a secret access token (sk.*).");return t.params=t.params.filter((t=>-1===t.indexOf("access_token"))),t.params.push(`access_token=${e}`),Vr(t)}function Wr(t){return 0===t.indexOf("mapbox:")}function qr(t){const e=t.match(zr);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}const Zr=function(t,e){if(!Wr(t))return t;const r=qr(t);return r.path=`/styles/v1${r.path}`,Hr(r,e)},Yr=function(t,e){if(!Wr(t))return t;const r=qr(t);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),Hr(r,e)},Xr=function(t,e,r,i){const n=qr(t);return Wr(t)?(n.path=`/styles/v1${n.path}/sprite${e}${r}`,Hr(n,i)):(n.path+=`${e}${r}`,Vr(n))};function Jr(t){return t.replace(/\{/g,"${")}const Kr=class extends Pr{constructor(t){t.format="application/x-protobuf;type=mapbox-vector",t.crs="EPSG:3857",t.isInverted=!0,t.url=t.url||".",super(t);const e=t.filter||(()=>!0);let r;if(this.urls=[],this.layers={},this.styles={},this.isVectorTileSource=!0,this.accessToken=t.accessToken,!t.style)throw new Error("New VectorTilesSource: style is required");if("string"==typeof t.style){const e=Zr(t.style,this.accessToken);r=d.Z.json(e,this.networkOptions)}else r=Promise.resolve(t.style);this.whenReady=r.then((e=>{this.jsonStyle=e;const r=t.sprite||e.sprite;if(r){const t=Xr(r,"",".json",this.accessToken);return d.Z.json(t,this.networkOptions).then((t=>{this.sprites=t;const i=Xr(r,"",".png",this.accessToken);return this.sprites.source=i,e}))}return e})).then((t=>{if(t.layers.forEach(((t,r)=>{if(t.sourceUid=this.uid,"background"===t.type)this.backgroundLayer=t;else if(e(t)){const e=bt.ZP.setFromVectorTileLayer(t,this.sprites,r,this.symbolToCircle);this.styles[t.id]=e,this.layers[t["source-layer"]]||(this.layers[t["source-layer"]]=[]),this.layers[t["source-layer"]].push({id:t.id,order:r,filterExpression:(0,Fr.TE)(t.filter),zoom:{min:t.minzoom||0,max:t.maxzoom||24}})}})),"."==this.url){const e=Object.values(t.sources).map((t=>{if(t.url){const e=Yr(t.url,this.accessToken);return d.Z.json(e,this.networkOptions).then((t=>{if(t.tiles[0])return Jr(t.tiles[0])}))}return t.tiles?Promise.resolve(Jr(t.tiles[0])):Promise.reject()}));return Promise.all(e)}return Promise.resolve([this.url])})).then((t=>{this.urls=Array.from(new Set(t))}))}urlFromExtent(t,e){return Rr.Z.xyz(t,{tileMatrixCallback:this.tileMatrixCallback,url:e})}onLayerAdded(t){super.onLayerAdded(t),t.out.style&&t.out.isFeatureGeometryLayer&&t.out.accurate&&(console.warn("With VectorTilesSource and FeatureGeometryLayer, the accurate option is always false"),t.out.accurate=!1)}loadData(t,e){const r=this._featuresCaches[e.crs],i=this.requestToKey(t);let n=r.getByArray(i);return n||(n=r.setByArray(Promise.all(this.urls.map((r=>this.fetcher(this.urlFromExtent(t,r),this.networkOptions).then((r=>this.parser(r,{out:e,in:this,extent:t})))))).then((t=>function(t){const e=t[0];return t.forEach(((t,r)=>{0!==r&&t.features.forEach((t=>{e.features.push(t)}))})),e}(t))).catch((t=>this.handlingError(t))),i),this.onParsedFile&&n.then((t=>(this.onParsedFile(t),console.warn("Source.onParsedFile was deprecated"),t)))),n}};class $r extends Cr.Z{constructor(t){super(t),this.isOrientedImageSource=!0;const e=[];e.push(t.orientationsUrl?d.Z.json(t.orientationsUrl,this.networkOptions):Promise.resolve()),e.push(t.calibrationUrl?d.Z.json(t.calibrationUrl,this.networkOptions):Promise.resolve()),this.whenReady=Promise.all(e).then((t=>({orientation:t[0],calibration:t[1]})))}urlFromExtent(t){return this.imageUrl(t.cameraId,t.panoId)}requestToKey(t){return[t.cameraId,t.panoId]}imageUrl(t,e){return this.url.replace("{cameraId}",t).replace("{panoId}",e)}}const ti=$r,ei={POSITION_CARTESIAN:{numElements:3,arrayType:Float32Array,attributeName:"position"},COLOR_PACKED:{numElements:4,arrayType:Uint8Array,attributeName:"color",normalized:!0},INTENSITY:{numElements:1,numByte:2,arrayType:Uint16Array,attributeName:"intensity",normalized:!0},CLASSIFICATION:{numElements:1,arrayType:Uint8Array,attributeName:"classification",normalized:!0},NORMAL_SPHEREMAPPED:{numElements:2,arrayType:Uint8Array,attributeName:"sphereMappedNormal"},NORMAL_OCT16:{numElements:2,arrayType:Uint8Array,attributeName:"oct16Normal"},NORMAL:{numElements:3,arrayType:Float32Array,attributeName:"normal"}};for(const t of Object.keys(ei)){const e=ei[t];e.potreeName=t,e.numByte=e.numByte||e.arrayType.BYTES_PER_ELEMENT,e.byteSize=e.numElements*e.numByte,e.normalized=e.normalized||!1;const r="getUint"+8*e.numByte;e.getValue=1===e.numByte?function(t,e){return t[r](e)}:function(t,e){return t[r](e,!0)}}const ri={parse:function(t,e){if(!t)throw new Error("No array buffer provided.");const r=new DataView(t);let n=0;for(const t of e.in.pointAttributes)n+=ei[t].byteSize;const s=Math.floor(t.byteLength/n),o=new i.BufferGeometry;let a=0,l=0;for(const t of e.in.pointAttributes){const e=ei[t],c=e.numElements*s,h=new e.arrayType(c);for(let t=0;t(this.pointAttributes=t.pointAttributes,this.baseurl=`${this.url}/${t.octreeDir}/r`,this.extension="CIN"===t.pointAttributes?"cin":"bin",this.parse="cin"===this.extension?ii.parse:ri.parse,t)))}}const si=ni;class oi extends Cr.Z{constructor(t){super(t),this.isC3DTilesSource=!0,this.baseUrl=this.url.slice(0,this.url.lastIndexOf("/")+1),this.whenReady=d.Z.json(this.url,this.networkOptions)}}const ai=oi,li=class extends ai{constructor(t){if(!t.accessToken)throw new Error("New 3D Tiles Ion Source: access token is required");if(!t.assetId)throw new Error("New 3D Tiles Ion Source: asset id is required");t.url=`https://api.cesium.com/v1/assets/${t.assetId}/endpoint?access_token=${t.accessToken}`,super(t),this.isC3DTilesIonSource=!0,this.accessToken=t.accessToken,this.assetId=t.assetId,this.whenReady=d.Z.json(t.url,this.networkOptions).then((t=>{if("3DTILES"!==t.type)throw new Error(`${t.type} datasets from Cesium ion are not supported with C3DTilesIonSource. Only 3D Tiles datasets are supported.`);return this.url=t.url,this.baseUrl=t.url.slice(0,t.url.lastIndexOf("/")+1),this.networkOptions.headers={},this.networkOptions.headers.Authorization=`Bearer ${t.accessToken}`,this.attribution=t.attributions,d.Z.json(this.url,this.networkOptions)}))}};function ci(t){if(!t)return null;if(t.content&&t.content.uri)return new URLSearchParams(t.content.uri.slice(t.content.uri.indexOf("?")+1)).get("session");if(t.children&&t.children.length>0)for(const e of t.children){const t=ci(e);if(t)return t}return null}const hi=class extends ai{constructor(t){if(!t.key)throw new Error("[C3DTilesGoogleSource]: A API key for the google map tiles API is required");t.url=`https://tile.googleapis.com/v1/3dtiles/root.json?key=${t.key}`,super(t),this.isC3DTilesGoogleSource=!0,this.baseUrl="https://tile.googleapis.com",this.key=t.key,this.whenReady=d.Z.json(t.url,this.networkOptions).then((t=>{if(t&&t.root&&(this.sessionId=ci(t.root),null===this.sessionId))throw new Error("[C3DTilesGoogleSource]: Cannot find sessionId from the tileset while it is mandatory to request tiles.");return t}))}getTileUrl(t){const e=`key=${this.key}&session=${this.sessionId}`;return/\?/.test(t)?`${t}&${e}`:`${t}?${e}`}};var ui=r(42622),di=r(37830);const pi=new class{constructor(){this._wasmPath="https://cdn.jsdelivr.net/npm/laz-perf@0.0.6/lib/",this._wasmPromise=null}_initDecoder(){return this._wasmPromise||(this._wasmPromise=ui.LazPerf.create({locateFile:t=>`${this._wasmPath}/${t}`})),this._wasmPromise}_parseView(t,e){const r=e.colorDepth??16,i=["X","Y","Z"].map(t.getter),n=t.getter("Intensity"),s=t.getter("ReturnNumber"),o=t.getter("NumberOfReturns"),a=t.getter("Classification"),l=t.getter("PointSourceId"),c=t.dimensions.Red?["Red","Green","Blue"].map(t.getter):void 0,h=t.getter("ScanAngle"),u=new Float32Array(3*t.pointCount),d=new Uint16Array(t.pointCount),p=new Uint8Array(t.pointCount),f=new Uint8Array(t.pointCount),m=new Uint8Array(t.pointCount),g=new Uint16Array(t.pointCount),A=c?new Uint8Array(4*t.pointCount):void 0,y=new Float32Array(t.pointCount),v=i.map((t=>t(0))).map((t=>Math.floor(t)));for(let e=0;et(e)));if(u[3*e]=t-v[0],u[3*e+1]=x-v[1],u[3*e+2]=b-v[2],d[e]=n(e),p[e]=s(e),f[e]=o(e),c){let[t,i,n]=c.map((t=>t(e)));16===r&&(t/=256,i/=256,n/=256),A[4*e]=t,A[4*e+1]=i,A[4*e+2]=n,A[4*e+3]=255}m[e]=a(e),g[e]=l(e),y[e]=h(e)}return{position:u,intensity:d,returnNumber:p,numberOfReturns:f,classification:m,pointSourceID:g,color:A,scanAngle:y,origin:v}}set lazPerf(t){this._wasmPath=t,this._wasmPromise=null}async parseFile(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new Uint8Array(t),i=await di.Las.PointData.decompressFile(r,this._initDecoder()),n=di.Las.Header.parse(r),s=e.colorDepth??(1===n.majorVersion&&n.minorVersion<=2?8:16),o=async(t,e)=>r.slice(t,e),a=await di.Las.Vlr.walk(o,n),l=di.Las.Vlr.find(a,"LASF_Spec",4),c=l&&di.Las.ExtraBytes.parse(await di.Las.Vlr.fetch(o,l)),h=di.Las.View.create(i,n,c);return{header:n,attributes:this._parseView(h,{colorDepth:s})}}},fi={enableLazPerf(t){if(!t)throw new Error("Path to laz-perf is mandatory");pi.lazPerf=t},parse(t){var e,r;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=n.out)&&void 0!==e&&e.skip&&console.warn("Warning: options 'skip' not supported anymore"),pi.parseFile(t,{colorDepth:null===(r=n.in)||void 0===r?void 0:r.colorDepth}).then((t=>{const e=new i.BufferGeometry,r=t.attributes;e.userData=t.header;const n=new i.BufferAttribute(r.position,3);e.setAttribute("position",n);const s=new i.BufferAttribute(r.intensity,1);e.setAttribute("intensity",s);const o=new i.BufferAttribute(r.returnNumber,1);e.setAttribute("returnNumber",o);const a=new i.BufferAttribute(r.numberOfReturns,1);e.setAttribute("numberOfReturns",a);const l=new i.BufferAttribute(r.classification,1);e.setAttribute("classification",l);const c=new i.BufferAttribute(r.pointSourceID,1);if(e.setAttribute("pointSourceID",c),r.color){const t=new i.BufferAttribute(r.color,4,!0);e.setAttribute("color",t)}const h=new i.BufferAttribute(r.scanAngle,1);return e.setAttribute("scanAngle",h),e.computeBoundingBox(),e.userData.origin=(new i.Vector3).fromArray(r.origin),e}))}};class mi extends Cr.Z{constructor(t){super(t),this.isEntwinePointTileSource=!0,this.colorDepth=t.colorDepth,this.url=this.url.replace("/ept.json",""),this.whenReady=d.Z.json(`${this.url}/ept.json`,this.networkOptions).then((t=>(this.parse="laszip"===t.dataType?fi.parse:ri.parse,this.extension="laszip"===t.dataType?"laz":"bin",t.srs&&t.srs.authority&&t.srs.horizontal&&(this.crs=`${t.srs.authority}:${t.srs.horizontal}`,n.default.defs(this.crs)||n.default.defs(this.crs,t.srs.wkt),t.srs.vertical&&t.srs.vertical!==t.srs.horizontal&&console.warn("EntwinePointTileSource: Vertical coordinates system code is not yet supported.")),this.spacing=(Math.abs(t.boundsConforming[3]-t.boundsConforming[0])+Math.abs(t.boundsConforming[4]-t.boundsConforming[1]))/(2*t.span),this.boundsConforming=t.boundsConforming,this.span=t.span,this))),this.fetcher=d.Z.arrayBuffer}}const gi=mi;var Ai=r(50810),yi=r(56178),vi=r(79003);const xi={parse(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=(0,ht._F)(r),t.zip?e=vi.parseZip(t.zip):t.shp&&t.shx&&t.dbf&&(e=Promise.all([vi.parseShp(t.shp,t.prj),vi.parseDbf(t.dbf)]).then(vi.combine)),r.in=r.in||{},r.in.crs=t.prj?(0,n.default)(t.prj).oProj.datumName:r.in.crs,Promise.resolve(e).then((t=>sr.Z.parse(t,r)))}};var bi=r(4090),_i=r(84612),wi=r(15344),Ei=r(25542),Mi=r(84607),Si=r(47274),Ci=r(27245),Ti=r(5626),Ii=r(83214),Ri=r(39865);const Bi=class{constructor(t){this.classes=t.classes,this.inverseHierarchy={},this.instancesIdxs=[];const e={};let r=0,i=t.parentCounts;void 0===i&&(i=new Array(t.instancesLength),i.fill(1));for(let n=0;n{"use strict";r.d(e,{S:()=>a,Z:()=>l});var i=r(99477),n=r(2362),s=r(71440),o=r(15344);function a(t,e){const r=t[t.indexOf(t.find((t=>t.includes(e))))].split(" ").filter((t=>""!==t));return parseFloat(r[r.length-1])}const l={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.split("\n"),l=r.indexOf(r.find((t=>t.includes("end_of_head"))))+1,c=r.slice(0,l),h={minX:a(c,"longlimit_west"),maxX:a(c,"longlimit_east"),minY:a(c,"latlimit_south"),maxY:a(c,"latlimit_north"),stepX:a(c,"gridstep"),stepY:a(c,"gridstep"),nRows:a(c,"latitude_parallels"),nColumns:a(c,"longitude_parallels")},u=new DataView(new ArrayBuffer(o.h8*h.nRows*h.nColumns));let d=0;for(let t of r.slice(l,r.length))t=t.split(" ").filter((t=>""!==t)),t.length&&(u.setFloat64(d*o.h8,parseFloat(t[2])),d++);const p=new s.ZP(e.in.crs||"EPSG:4326",h.minX,h.maxX,h.minY,h.maxY),f=new i.Vector2(h.stepX,h.stepY);return Promise.resolve(new n.Z(p,f,((t,e)=>u.getFloat64((h.nColumns*(h.nRows-t-1)+e)*o.h8))))}}},25542:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>Mt,qw:()=>wt,hu:()=>Et,zL:()=>bt,mp:()=>_t});var i=r(99477);function n(t,e){if(e===i.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===i.TriangleFanDrawMode||e===i.TriangleStripDrawMode){let r=t.getIndex();if(null===r){const e=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t=2.0 are supported.")));const h=new Z(n,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let t=0;t=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}h.setExtensions(s),h.setPlugins(o),h.parse(r,i)}parseAsync(t,e){const r=this;return new Promise((function(i,n){r.parse(t,e,i,n)}))}}function o(){let t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const a={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class l{constructor(t){this.parser=t,this.name=a.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let r=0,i=e.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,n.source,s)}}class b{constructor(t){this.parser=t,this.name=a.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,r=this.parser,i=r.json,n=i.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=i.images[s.source];let a=r.textureLoader;if(o.uri){const t=r.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(t,s.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class _{constructor(t){this.parser=t,this.name=a.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,r=this.parser,i=r.json,n=i.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=i.images[s.source];let a=r.textureLoader;if(o.uri){const t=r.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(t,s.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class w{constructor(t){this.name=a.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,r=e.bufferViews[t];if(r.extensions&&r.extensions[this.name]){const t=r.extensions[this.name],i=this.parser.getDependency("buffer",t.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then((function(e){const r=t.byteOffset||0,i=t.byteLength||0,s=t.count,o=t.byteStride,a=new Uint8Array(e,r,i);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(s,o,a,t.mode,t.filter).then((function(t){return t.buffer})):n.ready.then((function(){const e=new ArrayBuffer(s*o);return n.decodeGltfBuffer(new Uint8Array(e),s,o,a,t.mode,t.filter),e}))}))}return null}}class E{constructor(t){this.name=a.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,r=e.nodes[t];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const n=e.meshes[r.mesh];for(const t of n.primitives)if(t.mode!==P.TRIANGLES&&t.mode!==P.TRIANGLE_STRIP&&t.mode!==P.TRIANGLE_FAN&&void 0!==t.mode)return null;const s=r.extensions[this.name].attributes,o=[],a={};for(const t in s)o.push(this.parser.getDependency("accessor",s[t]).then((e=>(a[t]=e,a[t]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(t)),Promise.all(o).then((t=>{const e=t.pop(),r=e.isGroup?e.children:[e],n=t[0].count,s=[];for(const t of r){const e=new i.Matrix4,r=new i.Vector3,o=new i.Quaternion,l=new i.Vector3(1,1,1),c=new i.InstancedMesh(t.geometry,t.material,n);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new o,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,s=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=navigator.userAgent.indexOf("Firefox")>-1,s=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&s<98?this.textureLoader=new i.TextureLoader(this.options.manager):this.textureLoader=new i.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new i.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const r=this,i=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(t){return t._markDefs&&t._markDefs()})),Promise.all(this._invokeAll((function(t){return t.beforeRoot&&t.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(e){const s={scene:e[0][i.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:i.asset,parser:r,userData:{}};return G(n,s,i),Q(s,i),Promise.all(r._invokeAll((function(t){return t.afterRoot&&t.afterRoot(s)}))).then((function(){t(s)}))})).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[];for(let r=0,i=e.length;r{const r=this.associations.get(t);null!=r&&this.associations.set(e,r);for(const[r,i]of t.children.entries())n(i,e.children[r])};return n(r,i),i.name+="_instance_"+t.uses[e]++,i}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let r=0;r=2&&p.setY(e,u[t*o+1]),o>=3&&p.setZ(e,u[t*o+2]),o>=4&&p.setW(e,u[t*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(t){const e=this.json,r=this.options,i=e.textures[t].source,n=e.images[i];let s=this.textureLoader;if(n.uri){const t=r.manager.getHandler(n.uri);null!==t&&(s=t)}return this.loadTextureImage(t,i,s)}loadTextureImage(t,e,r){const n=this,s=this.json,o=s.textures[t],a=s.images[e],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(e,r).then((function(e){e.flipY=!1,e.name=o.name||a.name||"",""===e.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(e.name=a.uri);const r=(s.samplers||{})[o.sampler]||{};return e.magFilter=O[r.magFilter]||i.LinearFilter,e.minFilter=O[r.minFilter]||i.LinearMipmapLinearFilter,e.wrapS=k[r.wrapS]||i.RepeatWrapping,e.wrapT=k[r.wrapT]||i.RepeatWrapping,n.associations.set(e,{textures:t}),e})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(t,e){const r=this.json,n=this.options;if(void 0!==this.sourceCache[t])return this.sourceCache[t].then((t=>t.clone()));const s=r.images[t],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=this.getDependency("bufferView",s.bufferView).then((function(t){l=!0;const e=new Blob([t],{type:s.mimeType});return a=o.createObjectURL(e),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(t){return new Promise((function(r,s){let o=r;!0===e.isImageBitmapLoader&&(o=function(t){const e=new i.Texture(t);e.needsUpdate=!0,r(e)}),e.load(i.LoaderUtils.resolveURL(t,n.path),o,void 0,s)}))})).then((function(t){var e;return!0===l&&o.revokeObjectURL(a),t.userData.mimeType=s.mimeType||((e=s.uri).search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"),t})).catch((function(t){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),t}));return this.sourceCache[t]=c,c}assignTexture(t,e,r,i){const n=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),n.extensions[a.KHR_TEXTURE_TRANSFORM]){const t=void 0!==r.extensions?r.extensions[a.KHR_TEXTURE_TRANSFORM]:void 0;if(t){const e=n.associations.get(s);s=n.extensions[a.KHR_TEXTURE_TRANSFORM].extendTexture(s,t),n.associations.set(s,e)}}return void 0!==i&&(s.colorSpace=i),t[e]=s,s}))}assignFinalMaterial(t){const e=t.geometry;let r=t.material;const n=void 0===e.attributes.tangent,s=void 0!==e.attributes.color,o=void 0===e.attributes.normal;if(t.isPoints){const t="PointsMaterial:"+r.uuid;let e=this.cache.get(t);e||(e=new i.PointsMaterial,i.Material.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,e.sizeAttenuation=!1,this.cache.add(t,e)),r=e}else if(t.isLine){const t="LineBasicMaterial:"+r.uuid;let e=this.cache.get(t);e||(e=new i.LineBasicMaterial,i.Material.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,this.cache.add(t,e)),r=e}if(n||s||o){let t="ClonedMaterial:"+r.uuid+":";n&&(t+="derivative-tangents:"),s&&(t+="vertex-colors:"),o&&(t+="flat-shading:");let e=this.cache.get(t);e||(e=r.clone(),s&&(e.vertexColors=!0),o&&(e.flatShading=!0),n&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(t,e),this.associations.set(e,this.associations.get(r))),r=e}t.material=r}getMaterialType(){return i.MeshStandardMaterial}loadMaterial(t){const e=this,r=this.json,n=this.extensions,s=r.materials[t];let o;const l={},c=[];if((s.extensions||{})[a.KHR_MATERIALS_UNLIT]){const t=n[a.KHR_MATERIALS_UNLIT];o=t.getMaterialType(),c.push(t.extendParams(l,s,e))}else{const r=s.pbrMetallicRoughness||{};if(l.color=new i.Color(1,1,1),l.opacity=1,Array.isArray(r.baseColorFactor)){const t=r.baseColorFactor;l.color.setRGB(t[0],t[1],t[2],i.LinearSRGBColorSpace),l.opacity=t[3]}void 0!==r.baseColorTexture&&c.push(e.assignTexture(l,"map",r.baseColorTexture,i.SRGBColorSpace)),l.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,l.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(c.push(e.assignTexture(l,"metalnessMap",r.metallicRoughnessTexture)),c.push(e.assignTexture(l,"roughnessMap",r.metallicRoughnessTexture))),o=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),c.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,l)}))))}!0===s.doubleSided&&(l.side=i.DoubleSide);const h=s.alphaMode||"OPAQUE";if("BLEND"===h?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,"MASK"===h&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==i.MeshBasicMaterial&&(c.push(e.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new i.Vector2(1,1),void 0!==s.normalTexture.scale)){const t=s.normalTexture.scale;l.normalScale.set(t,t)}if(void 0!==s.occlusionTexture&&o!==i.MeshBasicMaterial&&(c.push(e.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==i.MeshBasicMaterial){const t=s.emissiveFactor;l.emissive=(new i.Color).setRGB(t[0],t[1],t[2],i.LinearSRGBColorSpace)}return void 0!==s.emissiveTexture&&o!==i.MeshBasicMaterial&&c.push(e.assignTexture(l,"emissiveMap",s.emissiveTexture,i.SRGBColorSpace)),Promise.all(c).then((function(){const r=new o(l);return s.name&&(r.name=s.name),Q(r,s),e.associations.set(r,{materials:t}),s.extensions&&G(n,r,s),r}))}createUniqueName(t){const e=i.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,r=this.extensions,n=this.primitiveCache;function s(t){return r[a.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(r){return Y(r,t,e)}))}const o=[];for(let r=0,l=t.length;r0&&j(p,o),p.name=e.createUniqueName(o.name||"mesh_"+t),Q(p,o),d.extensions&&G(s,p,d),e.assignFinalMaterial(p),h.push(p)}for(let r=0,i=h.length;r1?new i.Group:1===e.length?e[0]:new i.Object3D,a!==e[0])for(let t=0,r=e.length;t{const e=new Map;for(const[t,r]of n.associations)(t instanceof i.Material||t instanceof i.Texture)&&e.set(t,r);return t.traverse((t=>{const r=n.associations.get(t);null!=r&&e.set(t,r)})),e})(s),s}))}_createAnimationTracks(t,e,r,n,s){const o=[],a=t.name?t.name:t.uuid,l=[];let c;switch(F[s.path]===F.weights?t.traverse((function(t){t.morphTargetInfluences&&l.push(t.name?t.name:t.uuid)})):l.push(a),F[s.path]){case F.weights:c=i.NumberKeyframeTrack;break;case F.rotation:c=i.QuaternionKeyframeTrack;break;case F.position:case F.scale:c=i.VectorKeyframeTrack;break;default:c=1===r.itemSize?i.NumberKeyframeTrack:i.VectorKeyframeTrack}const h=void 0!==n.interpolation?z[n.interpolation]:i.InterpolateLinear,u=this._getArrayFromAccessor(r);for(let t=0,r=l.length;t{this.parse(t,e,n)}),r,n)}parse(t,e,r){this.decodeDracoFile(t,e,null,null,i.SRGBColorSpace).catch(r)}decodeDracoFile(t,e,r,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.LinearSRGBColorSpace;const o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:s};return this.decodeGeometry(t,o).then(e)}decodeGeometry(t,e){const r=JSON.stringify(e);if(X.has(t)){const e=X.get(t);if(e.key===r)return e.promise;if(0===t.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const n=this.workerNextTaskID++,s=t.byteLength,o=this._getWorker(n,s).then((r=>(i=r,new Promise(((r,s)=>{i._callbacks[n]={resolve:r,reject:s},i.postMessage({type:"decode",id:n,taskConfig:e,buffer:t},[t])}))))).then((t=>this._createGeometry(t.geometry)));return o.catch((()=>!0)).then((()=>{i&&n&&this._releaseTask(i,n)})),X.set(t,{key:r,promise:o}),o}_createGeometry(t){const e=new i.BufferGeometry;t.index&&e.setIndex(new i.BufferAttribute(t.index.array,1));for(let r=0;r{r.load(t,e,void 0,i)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then((e=>{const r=e[0];t||(this.decoderConfig.wasmBinary=e[1]);const i=K.toString(),n=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending}_getWorker(t,e){return this._initDecoder().then((()=>{if(this.workerPool.lengthe._taskLoad?-1:1}));const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[t]=e,r._taskLoad+=e,r}))}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map((t=>t._taskLoad)))}dispose(){for(let t=0;t{const e=t.draco,o=new e.Decoder;try{const t=function(t,e,i,n){const s=n.attributeIDs,o=n.attributeTypes;let a,l;const c=e.GetEncodedGeometryType(i);if(c===t.TRIANGULAR_MESH)a=new t.Mesh,l=e.DecodeArrayToMesh(i,i.byteLength,a);else{if(c!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new t.PointCloud,l=e.DecodeArrayToPointCloud(i,i.byteLength,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const i in s){const l=self[o[i]];let c,u;if(n.useUniqueIDs)u=s[i],c=e.GetAttributeByUniqueId(a,u);else{if(u=e.GetAttributeId(a,t[s[i]]),-1===u)continue;c=e.GetAttribute(a,u)}const d=r(t,e,a,i,l,c);"color"===i&&(d.vertexColorSpace=n.vertexColorSpace),h.attributes.push(d)}return c===t.TRIANGULAR_MESH&&(h.index=function(t,e,r){const i=3*r.num_faces(),n=4*i,s=t._malloc(n);e.GetTrianglesUInt32Array(r,n,s);const o=new Uint32Array(t.HEAPF32.buffer,s,i).slice();return t._free(s),{array:o,itemSize:1}}(t,e,a)),t.destroy(a),h}(e,o,new Int8Array(i),s),a=t.attributes.map((t=>t.array.buffer));t.index&&a.push(t.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:t},a)}catch(t){console.error(t),self.postMessage({type:"error",id:n.id,error:t.message})}finally{e.destroy(o)}}))}}}class ${constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(t){if(!this.workers[t]){const e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,t)),this.workers[t]=e}}_getIdleWorker(){for(let t=0;t{const i=this._getIdleWorker();-1!==i?(this._initWorker(i),this.workerStatus|=1<t.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class tt{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class et{constructor(t,e,r,i){this._dataView=new DataView(t.buffer,t.byteOffset+e,r),this._littleEndian=i,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_nextInt32(){const t=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,t}_skip(t){return this._offset+=t,this}_scan(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==e&&it.arrayBuffer())).then((t=>WebAssembly.instantiate(t,at))).then(this._init):WebAssembly.instantiate(Buffer.from(ct,"base64"),at).then(this._init),nt)}_init(t){st=t.instance,at.env.emscripten_notify_memory_growth(0)}decode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!st)throw new Error("ZSTDDecoder: Await .init() before decoding.");const r=t.byteLength,i=st.exports.malloc(r);ot.set(t,i),e=e||Number(st.exports.ZSTD_findDecompressedSize(i,r));const n=st.exports.malloc(e),s=st.exports.ZSTD_decompress(n,e,i,r),o=ot.slice(n,n+s);return st.exports.free(i),st.exports.free(n),o}}const ct="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",ht=new WeakMap;let ut,dt=0;class pt extends i.Loader{constructor(t){super(t),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new $,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(t){return this.transcoderPath=t,this}setWorkerLimit(t){return this.workerPool.setWorkerLimit(t),this}detectSupport(t){return!0===t.isWebGPURenderer?this.workerConfig={astcSupported:t.hasFeature("texture-compression-astc"),etc1Supported:!1,etc2Supported:t.hasFeature("texture-compression-etc2"),dxtSupported:t.hasFeature("texture-compression-bc"),bptcSupported:!1,pvrtcSupported:!1}:(this.workerConfig={astcSupported:t.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:t.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:t.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:t.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:t.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:t.extensions.has("WEBGL_compressed_texture_pvrtc")||t.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},t.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const t=new i.FileLoader(this.manager);t.setPath(this.transcoderPath),t.setWithCredentials(this.withCredentials);const e=t.loadAsync("basis_transcoder.js"),r=new i.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const n=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([e,n]).then((t=>{let[e,r]=t;const i=pt.BasisWorker.toString(),n=["/* constants */","let _EngineFormat = "+JSON.stringify(pt.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(pt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(pt.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n])),this.transcoderBinary=r,this.workerPool.setWorkerCreator((()=>{const t=new Worker(this.workerSourceURL),e=this.transcoderBinary.slice(0);return t.postMessage({type:"init",config:this.workerConfig,transcoderBinary:e},[e]),t}))})),dt>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),dt++}return this.transcoderPending}load(t,e,r,n){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new i.FileLoader(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(t,(t=>{if(ht.has(t))return ht.get(t).promise.then(e).catch(n);this._createTexture(t).then((t=>e?e(t):null)).catch(n)}),r,n)}_createTextureFrom(t,e){const{faces:r,width:n,height:s,format:o,type:a,error:l,dfdFlags:c}=t;if("error"===a)return Promise.reject(l);let h;if(6===e.faceCount)h=new i.CompressedCubeTexture(r,o,i.UnsignedByteType);else{const t=r[0].mipmaps;h=e.layerCount>1?new i.CompressedArrayTexture(t,n,s,e.layerCount,o,i.UnsignedByteType):new i.CompressedTexture(t,n,s,o,i.UnsignedByteType)}return h.minFilter=1===r[0].mipmaps.length?i.LinearFilter:i.LinearMipmapLinearFilter,h.magFilter=i.LinearFilter,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=At(e),h.premultiplyAlpha=!!(1&c),h}async _createTexture(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,rt.length);if(e[0]!==rt[0]||e[1]!==rt[1]||e[2]!==rt[2]||e[3]!==rt[3]||e[4]!==rt[4]||e[5]!==rt[5]||e[6]!==rt[6]||e[7]!==rt[7]||e[8]!==rt[8]||e[9]!==rt[9]||e[10]!==rt[10]||e[11]!==rt[11])throw new Error("Missing KTX 2.0 identifier.");const r=new tt,i=17*Uint32Array.BYTES_PER_ELEMENT,n=new et(t,rt.length,i,!0);r.vkFormat=n._nextUint32(),r.typeSize=n._nextUint32(),r.pixelWidth=n._nextUint32(),r.pixelHeight=n._nextUint32(),r.pixelDepth=n._nextUint32(),r.layerCount=n._nextUint32(),r.faceCount=n._nextUint32();const s=n._nextUint32();r.supercompressionScheme=n._nextUint32();const o=n._nextUint32(),a=n._nextUint32(),l=n._nextUint32(),c=n._nextUint32(),h=n._nextUint64(),u=n._nextUint64(),d=new et(t,rt.length+i,3*s*8,!0);for(let e=0;e{const e=new lt;await e.init(),t(e)}))),r=await ut);const n=[];for(let s=0;s>s),a=Math.max(1,t.pixelHeight>>s),l=t.pixelDepth?Math.max(1,t.pixelDepth>>s):0,c=t.levels[s];let h,u;if(0===t.supercompressionScheme)h=c.levelData;else{if(2!==t.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");h=r.decode(c.levelData,c.uncompressedByteLength)}u=gt[e]===i.FloatType?new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):gt[e]===i.HalfFloatType?new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):h,n.push({data:u,width:o,height:a,depth:l})}let s;if(ft.has(mt[e]))s=0===t.pixelDepth?new i.DataTexture(n[0].data,t.pixelWidth,t.pixelHeight):new i.Data3DTexture(n[0].data,t.pixelWidth,t.pixelHeight,t.pixelDepth);else{if(t.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new i.CompressedTexture(n,t.pixelWidth,t.pixelHeight)}return s.mipmaps=n,s.type=gt[e],s.format=mt[e],s.colorSpace=At(t),s.needsUpdate=!0,Promise.resolve(s)}(r);const n=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:t,taskConfig:e},[t]))).then((t=>this._createTextureFrom(t.data,r)));return ht.set(t,{promise:n}),n}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),dt--,this}}pt.BasisFormat={ETC1S:0,UASTC_4x4:1},pt.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},pt.EngineFormat={RGBAFormat:i.RGBAFormat,RGBA_ASTC_4x4_Format:i.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:i.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:i.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:i.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:i.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:i.RGB_ETC1_Format,RGB_ETC2_Format:i.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:i.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:i.RGB_S3TC_DXT1_Format},pt.BasisWorker=function(){let t,e,r;const i=_EngineFormat,n=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",(function(o){const u=o.data;switch(u.type){case"init":t=u.config,d=u.transcoderBinary,e=new Promise((t=>{r={wasmBinary:d,onRuntimeInitialized:t},BASIS(r)})).then((()=>{r.initializeBasis(),void 0===r.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":e.then((()=>{try{const{faces:e,buffers:o,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g}=function(e){const o=new r.KTX2File(new Uint8Array(e));function u(){o.close(),o.delete()}if(!o.isValid())throw u(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=o.isUASTC()?s.UASTC_4x4:s.ETC1S,p=o.getWidth(),f=o.getHeight(),m=o.getLayers()||1,g=o.getLevels(),A=o.getFaces(),y=o.getHasAlpha(),v=o.getDFDFlags(),{transcoderFormat:x,engineFormat:b}=function(e,r,o,h){let u,d;const p=e===s.ETC1S?a:l;for(let i=0;i1?(n=a.origWidth,s=a.origHeight):(n=a.width,s=a.height);const l=new Uint8Array(o.getImageTranscodedSizeInBytes(r,e,0,x));if(!o.transcodeImage(l,r,e,t,x,0,-1,-1))throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");i.push(l)}const a=h(i);e.push({data:a,width:n,height:s}),w.push(a.buffer)}_.push({mipmaps:e,width:p,height:f,format:b})}return u(),{faces:_,buffers:w,width:p,height:f,hasAlpha:y,format:b,dfdFlags:v}}(u.buffer);self.postMessage({type:"transcode",id:u.id,faces:e,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g},o)}catch(t){console.error(t),self.postMessage({type:"error",id:u.id,error:t.message})}}))}var d}));const o=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.BC1,n.BC3],engineFormat:[i.RGB_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.ETC1],engineFormat:[i.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],a=o.sort((function(t,e){return t.priorityETC1S-e.priorityETC1S})),l=o.sort((function(t,e){return t.priorityUASTC-e.priorityUASTC}));function c(t){return t<=2||0==(t&t-1)&&0!==t}function h(t){if(1===t.length)return t[0];let e=0;for(let r=0;r=0&&(c[n.KHR_MATERIALS_COMMON]=new s(h)),new C(h,c,{crossOrigin:this.crossOrigin,manager:this.manager,path:e||this.resourcePath||""}).parse((function(t,e,i,n){r({scene:t,scenes:e,cameras:i,animations:n})}))}}function e(){var t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}},update:function(e,r){for(var i in t){var n=t[i];n.update&&n.update(e,r)}}}}function r(t,e){var r={},n=t.material.uniforms;for(var s in n){var o=n[s];if(o.semantic){var a=o.node,l=t;a&&(l=e[a]),r[s]={semantic:o.semantic,sourceNode:l,targetNode:t,uniform:o}}}this.boundUniforms=r,this._m4=new i.Matrix4}t.Shaders={update:function(){console.warn("threeExamples.LegacyGLTFLoader.Shaders has been deprecated, and now updates automatically.")}},r.prototype.update=function(t,e){var r=this.boundUniforms;for(var i in r){var n=r[i];switch(n.semantic){case"MODELVIEW":n.uniform.value.multiplyMatrices(e.matrixWorldInverse,n.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var s=n.uniform.value;this._m4.multiplyMatrices(e.matrixWorldInverse,n.sourceNode.matrixWorld),s.getNormalMatrix(this._m4);break;case"PROJECTION":n.uniform.value.copy(e.projectionMatrix);break;case"JOINTMATRIX":for(var o=n.uniform.value,a=0;anew Promise(((r,i)=>{if(!t||!e)return void i(new Error("[GLTFParser]: Buffer and path are mandatory to parse a glTF."));const n=t=>{t.scene.applyMatrix4(xt),r(t)},s=t=>{i(new Error(`[GLTFParser]: Failed to parse gltf with error: ${t}`))};1===new DataView(t,0,20).getUint32(4,!0)?_t.parse(t,e,n,s):bt.parse(t,e,n,s)}))}},15344:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>a,h8:()=>o});var i=r(99477),n=r(2362),s=r(71440);const o=8,a={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=e.in.dataType||"float";if(!["float","double"].includes(r))throw new Error("`dataType` parameter is incorrect for GTXParser.parse method. This parameter must be either `double` or `float`.");const a=new DataView(t,0,40),l={minX:a.getFloat64(8),minY:a.getFloat64(0),stepX:a.getFloat64(24),stepY:a.getFloat64(16),nColumns:a.getInt32(36),nRows:a.getInt32(32)},c=new DataView(t,40),h=l.minX+l.stepX*(l.nColumns-1),u=l.minY+l.stepY*(l.nRows-1),d=new s.ZP(e.in.crs||"EPSG:4326",l.minX,h,l.minY,u),p=new i.Vector2(l.stepX,l.stepY);return Promise.resolve(new n.Z(d,p,((t,e)=>"float"===r?c.getFloat32(4*(l.nColumns*t+e)):"double"===r?c.getFloat64((l.nColumns*t+e)*o):void 0)))}}},12679:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(62310),n=r(5167),s=r(53175);const o=new i.Z("EPSG:4978",0,0,0),a=new i.Z("EPSG:4978",0,0,0),l=new i.Z("EPSG:4978",0,0,0),c=(t,e,r)=>(o.crs=r,o.setFromArray(e[0]),!t.isPointInside(o)),h={populateGeometry(t,e,r,i){r.startSubGeometry(e.length,i),o.crs=t;for(const t of e)o.setFromValues(t[0],t[1],t[2]),r.pushCoordinates(i,o);r.updateExtent()},populateGeometryWithCCW(t,e,r,i){r.startSubGeometry(e.length,i),o.crs=t;let n=0;l.setFromValues(e[0][0],e[0][1],e[0][2]),a.copy(l);for(let t=0;tvoid 0===t||Array.isArray(t)&&!isNaN(t[0])?t:d(t[0]);function p(t,e,r){var i,s;if(null===(i=e.geometry)||void 0===i||!i.type)return console.warn("No geometry provided"),null;const o=e.geometry.type.toLowerCase(),a=function(t){switch(t){case"point":case"multipoint":return n.tg.POINT;case"linestring":case"multilinestring":return n.tg.LINE;case"polygon":case"multipolygon":return n.tg.POLYGON;default:throw new Error(`Unhandled geometry type ${t}`)}}(o),l=r.requestFeatureByType(a),c="point"!=o?e.geometry.coordinates:[e.geometry.coordinates],p=e.properties||{};l.hasRawElevationData=3===(null===(s=d(c))||void 0===s?void 0:s.length);for(const t of Object.keys(e))u.includes(t.toLowerCase())||(p.geojson=p.geojson||{},p.geojson[t]=e[t]);return function(t,e,r,i,n,s){if(0!=i.length)switch(t){case"point":case"linestring":return h.default(e,r,i,n,s);case"multipoint":return h.multi("point",e,r,i,n,s);case"multilinestring":return h.multi("default",e,r,i,n,s);case"polygon":return h.polygon(e,r,i,n,s);case"multipolygon":return h.multi("polygon",e,r,i,n,s);default:throw new Error(`Unhandled geojson type ${e.type}`)}}(o,l,t,c,r,p),l}function f(t,e,r){const i=new n.t1(r),s=r.filter||(()=>!0);for(const r of e)s(r.properties,r.geometry)&&p(t,r,i);return i.removeEmptyFeature(),i.updateExtent(),i}const m={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=(0,s._F)(e),e.in=e.in||{};const r=e.out,i=e.in;switch("string"==typeof t&&(t=JSON.parse(t)),i.crs=i.crs||function(t){if(t.crs){if("epsg"==t.crs.type.toLowerCase())return`EPSG:${t.crs.properties.code}`;if("name"==t.crs.type.toLowerCase()){if(t.crs.properties.name.toLowerCase().includes("epsg:")){const e=t.crs.properties.name.lastIndexOf(":");if(e>0)return`EPSG:${t.crs.properties.name.substr(e+1)}`}throw new Error(`Unsupported CRS authority '${t.crs.properties.name}'`)}throw new Error(`Unsupported CRS type '${t.crs}'`)}return"EPSG:4326"}(t),r.filteringExtent&&("boolean"==typeof r.filteringExtent?r.filterExtent=e.extent.as(i.crs):r.filteringExtent.isExtent&&(r.filterExtent=r.filteringExtent)),t.type.toLowerCase()){case"featurecollection":return Promise.resolve(f(i.crs,t.features,r));case"feature":return Promise.resolve(f(i.crs,[t],r));default:throw new Error(`Unsupported GeoJSON type: '${t.type}`)}}}},50810:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(75153),n=r(12679),s=r(53175);const o={parse:(t,e)=>(e=(0,s._F)(e),n.Z.parse((0,i.ng)(t),e))}},4090:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477),n=r(2362),s=r(71440),o=r(84612),a=r(15344);const l={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.split("\n"),l=r.indexOf(r.find((t=>t.includes("end_of_head"))))+1,c=r.slice(0,l),h={minX:(0,o.S)(c,"lon min"),maxX:(0,o.S)(c,"lon max"),minY:(0,o.S)(c,"lat min"),maxY:(0,o.S)(c,"lat max"),stepX:(0,o.S)(c,"delta lon"),stepY:(0,o.S)(c,"delta lat"),nRows:(0,o.S)(c,"nrows"),nColumns:(0,o.S)(c,"ncols")},u=new DataView(new ArrayBuffer(a.h8*h.nRows*h.nColumns));let d=0;for(let t of r.slice(l,r.length))if(t=t.split(" ").filter((t=>""!==t)),t.length)for(const e of t)u.setFloat64(d*a.h8,parseFloat(e)),d++;const p=new s.ZP(e.in.crs||"EPSG:4326",h.minX+h.stepX/2,h.maxX-h.stepX/2,h.minY+h.stepY/2,h.maxY-h.stepY/2),f=new i.Vector2(h.stepX,h.stepY);return Promise.resolve(new n.Z(p,f,((t,e)=>u.getFloat64((h.nColumns*t+e)*a.h8))))}}},56178:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(75153),n=r(12679),s=r(53175);const o={parse:(t,e)=>(e=(0,s._F)(e),n.Z.parse((0,i.DS)(t),e))}},66014:(t,e,r)=>{"use strict";r.d(e,{SR:()=>m,SY:()=>d,Ti:()=>y,Y0:()=>v,y:()=>h});var i=r(99477),n=r(70991),s=r(39865),o=r(11707);function a(t,e,r,i,n,s){const a={view:t,requester:n,layer:r,priority:n?1/(n.distance+1):100,metadata:i,redraw:s};return r.dispatchEvent({type:o.y.ON_TILE_REQUESTED,metadata:i}),e.execute(a)}function l(t){return t.children.filter((e=>e.layer==t.layer&&e.tileId))}const c=new i.Matrix4;function h(t,e,r,i){return!(!r.viewerRequestVolume||!r.viewerRequestVolume.viewerRequestVolumeCulling(e,i))||!(!r.boundingVolume||!r.boundingVolume.boundingVolumeCulling(e,i))}function u(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=e.additiveRefinement||r>0;for(let s=0;sthis.cleanupDelay){this.root.cleanableSince=void 0;let e=0;for(;ethis.cleanupDelay))break;u(this,r)}this._cleanableTiles.splice(0,e)}return[this.root]}const p=new i.Box3,f=new i.Sphere;function m(t,e,r,i){return a(t,e,r,i,void 0,!0).then((t=>{r.object3d.add(t),t.updateMatrixWorld(),r.tileset.tiles[t.tileId].loaded=!0,r.root=t,r.onTileContentLoaded(t)}))}function g(t,e){t.content&&(t.content.visible=e)}function A(t,e){e.cleanableSince||(e.cleanableSince=Date.now(),t._cleanableTiles.push(e))}function y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return function(r,i,n){if(n.parent.pendingSubdivision&&!n.parent.additiveRefinement)return void(n.visible=!1);const s=!t||!t(i,r.camera,n,n.matrixWorld);if(n.visible=s,s){let s;if(n.cleanableSince&&(i._cleanableTiles.splice(i._cleanableTiles.indexOf(n),1),n.cleanableSince=void 0),n.pendingSubdivision||e(r,i,n))(function(t,e,r,i){r.additiveRefinement?function(t,e,r,i){for(const n of e.tileset.tiles[r.tileId].children){if(n.promise||n.loaded)continue;let s=r.matrixWorld;n.transform&&(s=c.multiplyMatrices(r.matrixWorld,n.transform)),(!i||!i(e,t.camera,n,s))&&(n.promise=a(t.view,t.scheduler,e,n,r,!0).then((i=>{r.add(i),i.updateMatrixWorld(),e.onTileContentLoaded(i),t.view.notifyChange(n),n.loaded=!0,delete n.promise})))}}(t,e,r,i):function(t,e,r){if(!r.pendingSubdivision&&0==l(r).length){const i=e.tileset.tiles[r.tileId].children;if(void 0===i||0===i.length)return;r.pendingSubdivision=!0;const n=[];for(let s=0;s{i[s].loaded=!0,r.add(n),n.updateMatrixWorld(),r.additiveRefinement&&t.view.notifyChange(r),e.tileset.tiles[n.tileId].loaded=!0,e.onTileContentLoaded(n)})));Promise.all(n).then((()=>{r.pendingSubdivision=!1,t.view.notifyChange(r)}))}}(t,e,r)})(r,i,n,t),g(n,n.pendingSubdivision||n.additiveRefinement),s=l(n);else{g(n,!0);for(const t of l(n))t.visible=!1,A(i,t)}return s}A(i,n)}}function v(t,e,r){if(void 0===e.tileset.tiles[r.tileId].children)return!1;if(e.tileset.tiles[r.tileId].isTileset)return!0;const i=function(t,e){if(e.distance=0,e.boundingVolume.initialVolumeType===s.D.box)p.copy(e.boundingVolume.volume),p.applyMatrix4(e.matrixWorld),e.distance=p.distanceToPoint(t.camera3D.position);else{if(e.boundingVolume.initialVolumeType!==s.D.sphere&&e.boundingVolume.initialVolumeType!==s.D.region)return 1/0;f.copy(e.boundingVolume.volume),f.applyMatrix4(e.matrixWorld),e.distance=Math.max(0,f.distanceToPoint(t.camera3D.position))}return 0===e.distance?1/0:t._preSSE*(e.geometricError/e.distance)}(t.camera,r);return i>e.sseThreshold}},81189:(t,e,r)=>{"use strict";r.d(e,{U8:()=>u,XP:()=>c,kE:()=>o,pN:()=>h});var i=r(60465),n=r(81590),s=r(79159);const o=131072**.5;function a(t){return!(t.requester.parent&&t.requester.material&&!(t.layer.isElevationLayer&&t.requester.material.getElevationLayer()&&t.targetLevel<=t.requester.material.getElevationLayer().level)&&t.requester.layerUpdateState[t.layer.id]&&t.layer.source._featuresCaches[t.layer.crs]&&t.requester.material.visible)}function l(t,e,r,i,n){return{view:t,layer:e,extentsSource:r,extentsDestination:i,requester:n,priority:(s=n.material,s.visible?100:10),earlyDropFunction:a};var s}function c(t,e,r,o){const a=r.material;if(!o||!a)return;const c=r.getExtentsByProjection(e.crs),h=c[0].zoom;if(h>e.zoom.max||h=e.source.zoom.min)return void t.view.notifyChange(r,!1)}if(!a.visible)return;if(!e.visible||!r.layerUpdateState[e.id].canTryUpdate())return;if(u.level>=c[0].zoom)return void r.layerUpdateState[e.id].noMoreUpdatePossible();if(e.frozen)return;const p=r.layerUpdateState[e.id].failureParams,f=c[0].zoom||r.level,m=(0,i.k5)(e.updateStrategy.type,r,f,u.level,e,p);if(!e.source.isVectorSource&&m<=u.level||m>f)return void(p.lowestLevelError!=1/0&&r.layerUpdateState[e.id].noMoreUpdatePossible());if(!e.source.extentInsideLimit(r.extent,m))return r.layerUpdateState[e.id].noData({targetLevel:m}),void t.view.notifyChange(r,!1);const g=c.map((t=>t.tiledExtentParent(m)));r.layerUpdateState[e.id].newTry();const A=l(t.view,e,g,c,r);return t.scheduler.execute(A).then((t=>{if(!r.layerUpdateState[e.id])return;const i=c.map(((e,r)=>e.offsetToParent(t[r].extent,u.offsetScales[r])));u.setTextures(t,i),r.layerUpdateState[e.id].success()}),(i=>(0,s.Z)(i,r,e,m,t.view)))}function h(t,e,r,o){const a=r.material;if(!o||!a)return;const c=r.getExtentsByProjection(e.crs),h=c[0].zoom;if(h>e.zoom.max||h=e.source.zoom.min)return void t.view.notifyChange(r,!1)}if(e.frozen||!a.visible||!r.layerUpdateState[e.id].canTryUpdate())return;const p=r.layerUpdateState[e.id].failureParams,f=(0,i.k5)(e.updateStrategy.type,r,c[0].zoom,u.level,e,p);if(f<=u.level||f>c[0].zoom)return void r.layerUpdateState[e.id].noMoreUpdatePossible();if(!e.source.extentInsideLimit(r.extent,f))return r.layerUpdateState[e.id].noData({targetLevel:f}),void t.view.notifyChange(r,!1);const m=c.map((t=>t.tiledExtentParent(f)));r.layerUpdateState[e.id].newTry();const g=l(t.view,e,m,c,r);return t.scheduler.execute(g).then((t=>{if(!r.layerUpdateState[e.id])return;if(f<=u.level)return void r.layerUpdateState[e.id].noMoreUpdatePossible();const i=c.map(((e,r)=>e.offsetToParent(t[r].extent,u.offsetScales[r])));u.setTextures(t,i),r.layerUpdateState[e.id].success()}),(i=>(0,s.Z)(i,r,e,f,t.view)))}function u(t){return function(e){var r;null!==(r=e.material)&&void 0!==r&&r.removeLayer&&(e.material.elevationLayerIds.indexOf(t)>-1&&e.setBBoxZ({min:0,max:0}),e.material.removeLayer(t)),e.layerUpdateState&&e.layerUpdateState[t]&&delete e.layerUpdateState[t]}}},70991:(t,e,r)=>{"use strict";function i(t){t.dispose();for(const e of Object.keys(t)){const r=t[e];r&&r.isTexture&&r.dispose()}}r.d(e,{Z:()=>n});const n={cleanup(t){if(t.layer=null,t.isScene||"function"!=typeof t.dispose){if(t.geometry&&t.geometry.dispose(),t.material)if(Array.isArray(t.material))for(const e of t.material)i(e);else i(t.material);t.dispatchEvent({type:"dispose"})}else t.dispose()},removeChildren(t,e){const r=e.children.filter((e=>(e.layer&&e.layer.id)===t.id));return e.remove(...r),r},removeChildrenAndCleanup(t,e){const r=e.children.filter((e=>(e.layer&&e.layer.id)===t.id));return e.remove(...r),e.layer===t&&this.cleanup(e),r},removeChildrenAndCleanupRecursively(t,e){let r=e.children.filter((e=>e.layer&&e.layer.id===t.id));const i=e.link&&e.link[t.id];null!=i&&i.children.length&&(r=r.concat(i.children),delete e.link[t.id]);for(const e of r)this.removeChildrenAndCleanupRecursively(t,e);return e.remove(...r),e.layer&&e.layer.id===t.id&&this.cleanup(e),r}}},79159:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=4;function n(t,e,r,n,s){if(e.layerUpdateState[r.id])if(t.isCancelledCommandException)e.layerUpdateState[r.id].success();else if(t instanceof SyntaxError)e.layerUpdateState[r.id].failure(0,!0);else{const t=e.layerUpdateState[r.id].errorCount>i;e.layerUpdateState[r.id].failure(Date.now(),t,{targetLevel:n}),t||window.setTimeout((()=>{s.notifyChange(e,!1)}),1e3*e.layerUpdateState[r.id].secondsUntilNextTry())}}},45340:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var i=r(99477);const n=new i.TextureLoader;function s(t){if(!t.ok){const e=new Error(`Error loading ${t.url}: status ${t.status}`);throw e.response=t,e}}const o=function(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.arrayBuffer())))},a={text(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.text())))},json(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.json())))},xml(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.text()))).then((t=>(new window.DOMParser).parseFromString(t,"text/xml")))},texture(t){let e,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.crossOrigin=i.crossOrigin;const s=new Promise(((t,i)=>{e=t,r=i}));return n.load(t,e,(()=>{}),r),s},arrayBuffer:o,textureFloat(t){return o(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>{const e=function(t){const e=new i.DataTexture(t,256,256,i.RedFormat,i.FloatType);return e.internalFormat="R32F",e.needsUpdate=!0,e}(new Float32Array(t));return e}))},multiple(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[];let n;for(const s in e){if(!this[s])throw new Error(`${s} is not a valid Fetcher method.`);for(const o of e[s])n=`${t}.${o}`,i.push(this[s](n,r).then((t=>({type:o,result:t}))))}return Promise.all(i).then((t=>{const e={};for(const r of t)e[r.type]=r.result;return Promise.resolve(e)}))},get(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[e,r]=t.split("/");switch(e){case"application":switch(r){case"geo+json":case"json":return this.json;case"kml":case"gpx":return this.xml;case"x-protobuf;type=mapbox-vector":case"gtx":return this.arrayBuffer;default:return this.text}case"image":return"x-bil;bits=32"===r?this.textureFloat:this.texture;default:return this.texture}}}},4380:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});const i=new(r(71440).ZP)("EPSG:4326",[0,0,0,0]);let n=0;function s(t){const e=/\$\{u:([\w-_.|]+)\}/.exec(t);if(!e)return t;const r=e[1].split("|");return t.replace(e[0],r[n++%r.length])}const o={subDomains:s,xyz:function(t,e){return s(e.url.replace(/(\$\{z\}|%TILEMATRIX)/,e.tileMatrixCallback(t.zoom)).replace(/(\$\{y\}|%ROW)/,t.row).replace(/(\$\{x\}|%COL)/,t.col))},bbox:function(t,e){let r="EPSG:4326"==e.crs?9:2;void 0!==e.bboxDigits&&(r=e.bboxDigits),t.as(e.crs,i);const n=i.west.toFixed(r),o=i.south.toFixed(r),a=i.east.toFixed(r),l=i.north.toFixed(r);let c=e.axisOrder||"wsen";return c=c.replace("w",`${n},`).replace("s",`${o},`).replace("e",`${a},`).replace("n",`${l},`).slice(0,-1),s(e.url.replace("%bbox",c))}}},232:(t,e,r)=>{"use strict";r.d(e,{P:()=>o,Z:()=>u});var i=r(99477),n=r(62310),s=r(86541);const o={PERSPECTIVE:0,ORTHOGRAPHIC:1},a={frustum:new i.Frustum,matrix:new i.Matrix4,box3:new i.Box3},l=new i.Box3(new i.Vector3(-1,-1,-1),new i.Vector3(1,1,1));function c(t,e,r){if(t.camera3D.isOrthographicCamera)t._preSSE=e;else{const n=i.MathUtils.degToRad(r);t._preSSE=e/(2*Math.tan(.5*n))}}const h=[new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3],u=class{#B=!0;#L=new i.Matrix4;constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(this.crs=t,n.isCamera)console.warn("options.camera parameter is deprecated. Use options.camera.cameraThree to place a custom camera as a parameter. See the documentation of Camera."),this.camera3D=n;else if(n.cameraThree)this.camera3D=n.cameraThree;else switch(n.type){case o.ORTHOGRAPHIC:this.camera3D=new i.OrthographicCamera;break;case o.PERSPECTIVE:default:this.camera3D=new i.PerspectiveCamera(30)}if(this.camera3D.aspect=this.camera3D.aspect??1,this.width=e,this.height=r,this.resize(e,r),this._preSSE=1/0,this.camera3D.isPerspectiveCamera){let t=this.camera3D.fov;Object.defineProperty(this.camera3D,"fov",{get:()=>t,set:e=>{t=e,c(this,this.height,t)}})}}resize(t,e){if(!t||t<=0||!e||e<=0)return void console.warn(`Trying to resize the Camera with invalid height (${e}) or width (${t}). Skipping resize.`);const r=t/e;if(this.camera3D.aspect!==r){if(this.camera3D.isOrthographicCamera){this.camera3D.zoom*=this.width/t;const e=this.camera3D.top*this.camera3D.aspect/r;this.camera3D.bottom=-e,this.camera3D.top=e}else this.camera3D.isPerspectiveCamera&&(this.camera3D.fov=2*i.MathUtils.radToDeg(Math.atan(e/this.height*Math.tan(i.MathUtils.degToRad(this.camera3D.fov)/2))));this.camera3D.aspect=r}this.width=t,this.height=e,c(this,this.height,this.camera3D.fov),this.camera3D.updateProjectionMatrix&&(this.camera3D.updateProjectionMatrix(),this.#B=!0)}update(){this.camera3D.updateMatrixWorld(),this.#B=!0}position(t){return new n.Z(this.crs,this.camera3D.position).as(t||this.crs)}setPosition(t){this.camera3D.position.copy(t.as(this.crs))}isBox3Visible(t,e){return this.box3SizeOnScreen(t,e).intersectsBox(l)}isSphereVisible(t,e){return this.#B&&(this.#L.multiplyMatrices(this.camera3D.projectionMatrix,this.camera3D.matrixWorldInverse),this.#B=!1),e?(a.matrix.multiplyMatrices(this.#L,e),a.frustum.setFromProjectionMatrix(a.matrix)):a.frustum.setFromProjectionMatrix(this.#L),a.frustum.intersectsSphere(t)}box3SizeOnScreen(t,e){const r=function(t,e,r){let i=t.camera3D.matrixWorldInverse;r&&(i=a.matrix.multiplyMatrices(t.camera3D.matrixWorldInverse,r)),h[0].set(e.min.x,e.min.y,e.min.z).applyMatrix4(i),h[1].set(e.min.x,e.min.y,e.max.z).applyMatrix4(i),h[2].set(e.min.x,e.max.y,e.min.z).applyMatrix4(i),h[3].set(e.min.x,e.max.y,e.max.z).applyMatrix4(i),h[4].set(e.max.x,e.min.y,e.min.z).applyMatrix4(i),h[5].set(e.max.x,e.min.y,e.max.z).applyMatrix4(i),h[6].set(e.max.x,e.max.y,e.min.z).applyMatrix4(i),h[7].set(e.max.x,e.max.y,e.max.z).applyMatrix4(i);let n=!1;for(let e=0;e<8;e++)h[e].z<=-t.camera3D.near?n=!0:h[e].z=-t.camera3D.near;return n?h:void 0}(this,t,e);if(!r)return a.box3.makeEmpty();for(let t=0;t<8;t++)r[t].applyMatrix4(this.camera3D.projectionMatrix);return a.box3.setFromPoints(r)}adjustAltitudeToAvoidCollisionWithLayer(t,e,r){const i=t.camera.position().as("EPSG:4326");if(void 0!==e){const n=s.Z.getElevationValueAt(e,i);void 0!==n&&i.altitude-(n+r)<0&&(i.altitude=n+r,t.camera3D.position.copy(i.as(t.referenceCrs)),t.notifyChange(this.camera3D))}}}},97112:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o,i:()=>s});var i=r(78025);function n(t,e){const r=i.M.getColorLayersIdOrderedBySequence(e),n=function(t){var e;null!==(e=t.material)&&void 0!==e&&e.setSequence&&t.material.setSequence(r)};for(const e of t.level0Nodes)e.traverse(n)}const s="layers-order-changed",o={moveLayerUp(t,e){const r=t.getLayers((t=>t.isColorLayer)),o=t.getLayerById(e);if(!o)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(r);i.M.moveLayerUp(o,r),n(t.tileLayer,r),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(t.tileLayer)}},moveLayerDown(t,e){const r=t.getLayers((t=>t.isColorLayer)),o=t.getLayerById(e);if(!o)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(r);i.M.moveLayerDown(o,r),n(t.tileLayer,r),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(t.tileLayer)}},moveLayerToIndex(t,e,r){const o=t.getLayers((t=>t.isColorLayer)),a=t.getLayerById(e);if(!a)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(o);i.M.moveLayerToIndex(a,r,o),n(t.tileLayer,o),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(o)}}),t.notifyChange(t.tileLayer)}}}},3725:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});var i=r(99477);const n={setDefineMapping(t,e,r){Object.keys(r).forEach((i=>{t.defines[`${e}_${i}`]=r[i]}))},setDefineProperty(t,e,r,i){t.defines[r]=i,Object.defineProperty(t,e,{get:()=>t.defines[r],set:e=>{t.defines[r]!=e&&(t.defines[r]=e,t.needsUpdate=!0)}})},setUniformProperty(t,e,r){t.uniforms[e]=new i.Uniform(r),Object.defineProperty(t,e,{get:()=>t.uniforms[e].value,set:r=>{t.uniforms[e].value!=r&&(t.uniforms[e].value=r)}})}}},49652:(t,e,r)=>{"use strict";r.d(e,{R:()=>o,Z:()=>l});var i=r(99477),n=r(49401);const s=new i.Frustum;class o{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=t,this.y=e,this.grid=[],this.visible=[],this.resize(),this.reset(),this.width=r,this.height=i}reset(){for(let t=0;t0&&this.grid[s][e].some((e=>{return r=e.boundaries,i=t.boundaries,!(r.left>i.right||r.righti.bottom||r.bottomt.isLabelLayer&&t.visible));0!=r.length&&(this.grid.reset(),s.setFromProjectionMatrix(e.projectionMatrix),r.forEach((t=>{t.submittedLabelNodes.forEach((t=>{t.labels.forEach((r=>{t.updatePosition(r),this.culling(r,e)})),t.domElements.labels.show(),t.needsUpdate=!1}))})),this.grid.visible.sort(((t,e)=>{const r=e.order-t.order;return 0==r?!t.visible&&e.visible?1:-1:r})),this.grid.visible.forEach((t=>{this.grid.insert(t)?(t.visible=!0,t.updateCSSPosition()):t.visible=!1})),r.forEach((t=>{t.toHide.children.forEach((t=>{var e;return null===(e=t.domElements)||void 0===e?void 0:e.labels.hide()})),t.toHide.clear()})))}culling(t,e){t.getWorldPosition(a),!s.containsPoint(a.applyMatrix4(e.matrixWorldInverse))||t.horizonCullingPoint&&n.Z.horizonCulling(t.horizonCullingPoint)||this.grid.visible.some((e=>{const r=t.content.textContent;return""!==r&&e.content.textContent.toLowerCase()==r.toLowerCase()}))?t.visible=!1:(a.applyMatrix4(e.projectionMatrix),t.updateProjectedPosition(a.x*this.halfWidth+this.halfWidth,-a.y*this.halfHeight+this.halfHeight),this.grid.visible.push(t))}removeLabelDOM(t){this.garbage.appendChild(t.content),this.garbage.innerHTML=""}}},5199:(t,e,r)=>{"use strict";r.d(e,{On:()=>d,ZP:()=>w,dn:()=>m,pO:()=>g,zQ:()=>v});var i=r(99477),n=r(43195),s=r(28448),o=r(14625),a=r(3725);const l=new i.Vector4(0,0,1,1),c=new i.Texture,h=255/256,u=new i.Vector4(5.9371814131736755e-8,h/65536,.0038909912109375,h);function d(t,e){return e?u.dot(t)*e:u.dot(t)}const p=15,f=1;function m(){const t=s.Z.getMaxTextureUnitsCount();return Math.min(t-f,p)}const g={noEffect:0,removeLightColor:1,removeWhiteColor:2,customEffect:3},A={bias:0,noDataValue:-99999,zmin:0,zmax:0,scale:0,mode:0,textureOffset:0,opacity:0,crs:0,effect_parameter:0,effect_type:g.noEffect,transparent:!1};function y(t,e,r){const i=t.layers.value,n=t.textures.value,s=t.offsetScales.value,o=t.textureCount;let a=0;for(const t of e){t.textureOffset=a;for(let e=0,o=t.textures.length;er&&console.warn(`LayeredMaterial: Not enough texture units (${r} < ${a}), excess textures have been discarded.`),o.value=a;for(let t=a;t1?arguments[1]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),x=x||[f,m()],this.defines.NUM_VS_TEXTURES=x[0],this.defines.NUM_FS_TEXTURES=x[1],this.defines.USE_FOG=1,this.defines.NUM_CRS=t,a.Z.setDefineMapping(this,"ELEVATION",v),a.Z.setDefineMapping(this,"MODE",o.Z.MODES),a.Z.setDefineProperty(this,"mode","MODE",o.Z.MODES.FINAL),this.vertexShader="#include \n#include \n#include \n#include \n#if NUM_CRS > 1\nattribute float uv_1;\n#endif\n\nuniform bool lightingEnabled;\nvarying vec2 vHighPrecisionZW;\n\n#if MODE == MODE_FINAL\n#include \nvarying vec3 vUv;\nvarying vec3 vNormal;\n#endif\nvoid main() {\n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n#if MODE == MODE_FINAL\n #include \n #if NUM_CRS > 1\n vUv = vec3(uv, (uv_1 > 0.) ? uv_1 : uv.y); // set uv_1 = uv if uv_1 is undefined\n #else\n vUv = vec3(uv, 0.0);\n #endif\n vNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\n#endif\n}\n",b[t]=b[t]||n.Z.unrollLoops("#include \n#include \n#include \n#include \n#if MODE == MODE_FINAL\n#include \n#include \n#include \n#endif\n#include \n\nuniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vUv; // uv.x/uv_1.x, uv.y, uv_1.y\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n #include \n\n#if MODE == MODE_ID\n\n #include \n\n#elif MODE == MODE_DEPTH\n\n #include \n\n#else\n\n gl_FragColor = vec4(diffuse, opacity);\n\n uvs[0] = vec3(vUv.xy, 0.);\n\n#if NUM_CRS > 1\n uvs[1] = vec3(vUv.x, fract(vUv.z), floor(vUv.z));\n#endif\n\n vec4 color;\n #pragma unroll_loop\n for ( int i = 0; i < NUM_FS_TEXTURES; i ++ ) {\n color = getLayerColor( i , colorTextures[ i ], colorOffsetScales[ i ], colorLayers[ i ]);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n\n #if defined(DEBUG)\n if (showOutline) {\n #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++) {\n color = getOutlineColor( outlineColors[ i ], uvs[ i ].xy);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n }\n #endif\n\n #include \n #include \n #include \n\n#endif\n}\n",this.defines),this.fragmentShader=b[t],a.Z.setUniformProperty(this,"diffuse",new i.Color(.04,.23,.35)),a.Z.setUniformProperty(this,"opacity",this.opacity),a.Z.setUniformProperty(this,"lightingEnabled",!1),a.Z.setUniformProperty(this,"lightPosition",new i.Vector3(-.5,0,1)),a.Z.setUniformProperty(this,"fogDistance",1e9),a.Z.setUniformProperty(this,"fogColor",new i.Color(.76,.85,1)),a.Z.setUniformProperty(this,"overlayAlpha",0),a.Z.setUniformProperty(this,"overlayColor",new i.Color(1,.3,0)),a.Z.setUniformProperty(this,"objectId",0),a.Z.setUniformProperty(this,"geoidHeight",0),a.Z.setUniformProperty(this,"minBorderDistance",-.01),this.layers=[],this.elevationLayerIds=[],this.colorLayerIds=[],this.uniforms.elevationLayers=new i.Uniform(new Array(x[0]).fill(A)),this.uniforms.elevationTextures=new i.Uniform(new Array(x[0]).fill(c)),this.uniforms.elevationOffsetScales=new i.Uniform(new Array(x[0]).fill(l)),this.uniforms.elevationTextureCount=new i.Uniform(0),this.uniforms.colorLayers=new i.Uniform(new Array(x[1]).fill(A)),this.uniforms.colorTextures=new i.Uniform(new Array(x[1]).fill(c)),this.uniforms.colorOffsetScales=new i.Uniform(new Array(x[1]).fill(l)),this.uniforms.colorTextureCount=new i.Uniform(0),Object.defineProperty(this,"visible",{get(){return this.#P},set(t){this.#P!=t&&(this.#P=t,this.dispatchEvent({type:t?"shown":"hidden"}))}})}getUniformByType(t){return{layers:this.uniforms[`${t}Layers`],textures:this.uniforms[`${t}Textures`],offsetScales:this.uniforms[`${t}OffsetScales`],textureCount:this.uniforms[`${t}TextureCount`]}}updateLayersUniforms(){const t=this.layers.filter((t=>this.colorLayerIds.includes(t.id)&&t.visible&&t.opacity>0));if(t.sort(((t,e)=>this.colorLayerIds.indexOf(t.id)-this.colorLayerIds.indexOf(e.id))),y(this.getUniformByType("color"),t,this.defines.NUM_FS_TEXTURES),this.elevationLayerIds.some((t=>this.getLayer(t)))||this.uniforms.elevationTextureCount.value&&!this.elevationLayerIds.length){const t=this.getElevationLayer()?[this.getElevationLayer()]:[];y(this.getUniformByType("elevation"),t,this.defines.NUM_VS_TEXTURES)}this.layersNeedUpdate=!1}dispose(){this.dispatchEvent({type:"dispose"}),this.layers.forEach((t=>t.dispose(!0))),this.layers.length=0,this.layersNeedUpdate=!0}setSequence(t){this.colorLayerIds=t,this.layersNeedUpdate=!0}setSequenceElevation(t){this.elevationLayerIds[0]=t,this.layersNeedUpdate=!0}removeLayer(t){const e=this.layers.findIndex((e=>e.id===t));if(e>-1){this.layers[e].dispose(),this.layers.splice(e,1);const r=this.colorLayerIds.indexOf(t);r>-1?this.colorLayerIds.splice(r,1):this.elevationLayerIds=[]}}addLayer(t){t.layer.id in this.layers&&console.warn('The "{layer.id}" layer was already present in the material, overwritting.'),this.layers.push(t)}getLayer(t){return this.layers.find((e=>e.id===t))}getLayers(t){return this.layers.filter((e=>t.includes(e.id)))}getElevationLayer(){return this.layers.find((t=>t.id===this.elevationLayerIds[0]))}setElevationScale(t){this.elevationLayerIds.length&&(this.getElevationLayer().scale=t)}}const w=_},67490:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(99477),n=r(42423),s=r(51969),o=r(62310),a=r(79323);const l=new s.Z({crs:"EPSG:4978",uvCount:1}),c=new i.Vector3,h=new i.Vector2,u=new i.Vector3,d=new o.Z("EPSG:4326",0,0,0);let p;class f extends i.Object3D{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector3(1/0,1/0,1/0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3(-1/0,-1/0,-1/0);super(),this.box3D=new i.Box3(t.clone(),e.clone()),this.natBox=this.box3D.clone(),this.z={min:0,max:0,scale:1}}clone(){return(new f).copy(this)}copy(t){return super.copy(t),this.box3D.copy(t.box3D),this.natBox.copy(t.natBox),this.z.min=t.z.min,this.z.max=t.z.max,this.z.scale=t.z.scale,this}updateZ(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.z.min=t.min??this.z.min,this.z.max=t.max??this.z.max,this.z.scale=t.scale>0?t.scale:this.z.scale,this.z.delta=Math.abs(this.z.max-this.z.min)*this.z.scale;const e=t.geoidHeight||0;this.box3D.min.z=this.natBox.min.z+this.z.min*this.z.scale+e,this.box3D.max.z=this.natBox.max.z+this.z.max*this.z.scale+e}isSphereAboveXYBox(t){const e=this.worldToLocal(t.center),r=Math.max(this.box3D.min.x,Math.min(e.x,this.box3D.max.x)),i=Math.max(this.box3D.min.y,Math.min(e.y,this.box3D.max.y));return Math.sqrt((r-e.x)*(r-e.x)+(i-e.y)*(i-e.y))1&&void 0!==arguments[1]?arguments[1]:t.min||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.max||0;if("EPSG:4326"==t.crs){const{sharableExtent:i,quaternion:s,position:o}=l.computeSharableExtent(t),a=Math.max(Math.floor(i.planarDimensions(h).x/90+1),2),c=new n.Z({extent:i,level:0,segments:a,disableSkirt:!0,builder:l});p.box3D.copy(c.boundingBox),p.natBox.copy(c.boundingBox),this.copy(p),this.updateZ({min:e,max:r}),this.position.copy(o),this.quaternion.copy(s),this.updateMatrixWorld(!0)}else{if(a.Z.isTms(t.crs)||!a.Z.isMetricUnit(t.crs))throw new Error("Unsupported extent crs");t.center(d).toVector3(this.position),t.planarDimensions(h),c.set(h.x,h.y,Math.abs(r-e)),this.box3D.setFromCenterAndSize(u,c),this.updateMatrixWorld(!0)}return this}}p=new f;const m=f},25033:(t,e,r)=>{"use strict";r.d(e,{wy:()=>d,vj:()=>l,Uz:()=>c,E7:()=>h,ZP:()=>g});var i=r(99477),n=r(43195),s=r(3725);const o={SPECTRAL:[[0,new i.Color(.3686,.3098,.6353)],[.1,new i.Color(.1961,.5333,.7412)],[.2,new i.Color(.4,.7608,.6471)],[.3,new i.Color(.6706,.8667,.6431)],[.4,new i.Color(.902,.9608,.5961)],[.5,new i.Color(1,1,.749)],[.6,new i.Color(.9961,.8784,.5451)],[.7,new i.Color(.9922,.6824,.3804)],[.8,new i.Color(.9569,.4275,.2627)],[.9,new i.Color(.8353,.2431,.3098)],[1,new i.Color(.6196,.0039,.2588)]],PLASMA:[[0,new i.Color(.241,.015,.61)],[.1,new i.Color(.387,.001,.654)],[.2,new i.Color(.524,.025,.653)],[.3,new i.Color(.651,.125,.596)],[.4,new i.Color(.752,.227,.513)],[.5,new i.Color(.837,.329,.431)],[.6,new i.Color(.907,.435,.353)],[.7,new i.Color(.963,.554,.272)],[.8,new i.Color(.992,.681,.195)],[.9,new i.Color(.987,.822,.144)],[1,new i.Color(.94,.975,.131)]],YELLOW_GREEN:[[0,new i.Color(.1647,.2824,.3451)],[.1,new i.Color(.1338,.3555,.4227)],[.2,new i.Color(.061,.4319,.4864)],[.3,new i.Color(0,.5099,.5319)],[.4,new i.Color(0,.5881,.5569)],[.5,new i.Color(.137,.665,.5614)],[.6,new i.Color(.2906,.7395,.5477)],[.7,new i.Color(.4453,.8099,.5201)],[.8,new i.Color(.6102,.8748,.485)],[.9,new i.Color(.7883,.9323,.4514)],[1,new i.Color(.9804,.9804,.4314)]],VIRIDIS:[[0,new i.Color(.267,.005,.329)],[.1,new i.Color(.283,.141,.458)],[.2,new i.Color(.254,.265,.53)],[.3,new i.Color(.207,.372,.553)],[.4,new i.Color(.164,.471,.558)],[.5,new i.Color(.128,.567,.551)],[.6,new i.Color(.135,.659,.518)],[.7,new i.Color(.267,.749,.441)],[.8,new i.Color(.478,.821,.318)],[.9,new i.Color(.741,.873,.15)],[1,new i.Color(.993,.906,.144)]],INFERNO:[[0,new i.Color(.077,.042,.206)],[.1,new i.Color(.225,.036,.388)],[.2,new i.Color(.373,.074,.432)],[.3,new i.Color(.522,.128,.42)],[.4,new i.Color(.665,.182,.37)],[.5,new i.Color(.797,.255,.287)],[.6,new i.Color(.902,.364,.184)],[.7,new i.Color(.969,.516,.063)],[.8,new i.Color(.988,.683,.072)],[.9,new i.Color(.961,.859,.298)],[1,new i.Color(.988,.998,.645)]],GRAYSCALE:[[0,new i.Color(0,0,0)],[1,new i.Color(1,1,1)]],TURBO:[[0,new i.Color(.18995,.07176,.23217)],[.07,new i.Color(.25107,.25237,.63374)],[.13,new i.Color(.27628,.42118,.89123)],[.2,new i.Color(.25862,.57958,.99876)],[.27,new i.Color(.15844,.73551,.92305)],[.33,new i.Color(.09267,.86554,.7623)],[.4,new i.Color(.19659,.94901,.59466)],[.47,new i.Color(.42778,.99419,.38575)],[.53,new i.Color(.64362,.98999,.23356)],[.6,new i.Color(.80473,.92452,.20459)],[.67,new i.Color(.93301,.81236,.22667)],[.73,new i.Color(.99314,.67408,.20348)],[.8,new i.Color(.9836,.49291,.12849)],[.87,new i.Color(.92105,.31489,.05475)],[.93,new i.Color(.81608,.18462,.01809)],[1,new i.Color(.66449,.08436,.00424)]],RAINBOW:[[0,new i.Color(.278,0,.714)],[1/6,new i.Color(0,0,1)],[2/6,new i.Color(0,1,1)],[.5,new i.Color(0,1,0)],[4/6,new i.Color(1,1,0)],[5/6,new i.Color(1,.64,0)],[1,new i.Color(1,0,0)]],CONTOUR:[[0,new i.Color(0,0,0)],[.03,new i.Color(0,0,0)],[.04,new i.Color(1,1,1)],[1,new i.Color(1,1,1)]]},a="#include \n#include \n#if defined(USE_TEXTURES_PROJECTIVE)\n#include \n#endif\n\nvarying vec4 vColor;\nuniform bool picking;\nuniform int shape;\n\nvoid main() {\n #include \n //square shape does not require any change.\n if (shape == PNTS_SHAPE_CIRCLE) {\n //circular rendering in glsl\n if ((length(gl_PointCoord - 0.5) > 0.5) || (vColor.a == 0.0)) {\n discard;\n }\n }\n\n#if defined(USE_TEXTURES_PROJECTIVE)\n vec4 color = vColor;\n if (!picking) {\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n } else {\n gl_FragColor = color;\n }\n#else\n gl_FragColor = vColor;\n#endif\n}\n",l={COLOR:0,INTENSITY:1,CLASSIFICATION:2,ELEVATION:3,RETURN_NUMBER:4,RETURN_TYPE:5,RETURN_COUNT:6,POINT_SOURCE_ID:7,SCAN_ANGLE:8,NORMAL:9},c={CIRCLE:0,SQUARE:1},h={VALUE:0,ATTENUATED:1},u=new i.Color(1,1,1),d={DEFAULT:{0:{visible:!0,name:"never classified",color:new i.Color(.5,.5,.5),opacity:1},1:{visible:!0,name:"unclassified",color:new i.Color(.5,.5,.5),opacity:1},2:{visible:!0,name:"ground",color:new i.Color(.63,.32,.18),opacity:1},3:{visible:!0,name:"low vegetation",color:new i.Color(0,1,0),opacity:1},4:{visible:!0,name:"medium vegetation",color:new i.Color(0,.8,0),opacity:1},5:{visible:!0,name:"high vegetation",color:new i.Color(0,.6,0),opacity:1},6:{visible:!0,name:"building",color:new i.Color(1,.66,0),opacity:1},7:{visible:!0,name:"low point(noise)",color:new i.Color(1,0,1),opacity:1},8:{visible:!0,name:"key-point",color:new i.Color(1,0,0),opacity:1},9:{visible:!0,name:"water",color:new i.Color(0,0,1),opacity:1},10:{visible:!0,name:"rail",color:new i.Color(.8,.8,1),opacity:1},11:{visible:!0,name:"road Surface",color:new i.Color(.4,.4,.7),opacity:1},12:{visible:!0,name:"overlap",color:new i.Color(1,1,0),opacity:1},DEFAULT:{visible:!0,name:"default",color:new i.Color(.3,.6,.6),opacity:.5}}},p={DEFAULT:{0:{visible:!0,name:"0",color:new i.Color("rgb(67, 99, 216)"),opacity:1},1:{visible:!0,name:"1",color:new i.Color("rgb(60, 180, 75);"),opacity:1},2:{visible:!0,name:"2",color:new i.Color("rgb(255, 255, 25)"),opacity:1},3:{visible:!0,name:"3",color:new i.Color("rgb(145, 30, 180)"),opacity:1},4:{visible:!0,name:"4",color:new i.Color("rgb(245, 130, 49)"),opacity:1},5:{visible:!0,name:"5",color:new i.Color("rgb(230, 25, 75)"),opacity:1},6:{visible:!0,name:"6",color:new i.Color("rgb(66, 212, 244)"),opacity:1},7:{visible:!0,name:"7",color:new i.Color("rgb(240, 50, 230)"),opacity:1},DEFAULT:{visible:!0,name:"default",color:u,opacity:.5}}};function f(t,e,r){const i=e.image.data,n=e.image.width;r||(r=Object.keys(t).length);for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{};const e=t.intensityRange||new i.Vector2(1,65536),r=t.elevationRange||new i.Vector2(0,1e3),u=t.angleRange||new i.Vector2(-90,90),f=t.orientedImageMaterial,m=t.classification||d.DEFAULT,g=t.discreteScheme||p.DEFAULT,A=null!=t.applyOpacityClassication&&t.applyOpacityClassication,y=t.size||0,v=t.mode||l.COLOR,x=t.shape||c.CIRCLE,b=0===y?h.ATTENUATED:t.sizeMode||h.VALUE,_=t.minAttenuatedSize||3,w=t.maxAttenuatedSize||10;let E=o;t.gradient&&(E={...t.gradient,...o}),delete t.intensityRange,delete t.elevationRange,delete t.angleRange,delete t.orientedImageMaterial,delete t.classificationScheme,delete t.discreteScheme,delete t.applyOpacityClassication,delete t.size,delete t.mode,delete t.shape,delete t.sizeMode,delete t.minAttenuatedSize,delete t.maxAttenuatedSize,delete t.gradient,super(t),this.gradients=E,this.gradientTexture=new i.CanvasTexture,this.vertexShader="#include \n#if defined(USE_TEXTURES_PROJECTIVE)\n#include \n#endif\n#include \n#include \n\n#define NB_CLASS 8.\n\nuniform float size;\nuniform float scale;\n\nuniform bool picking;\nuniform int mode;\nuniform float opacity;\nuniform vec4 overlayColor;\n\nuniform vec2 elevationRange;\nuniform vec2 intensityRange;\nuniform vec2 angleRange;\n\nuniform bool applyOpacityClassication;\n\nuniform sampler2D classificationTexture;\nuniform sampler2D discreteTexture;\nuniform sampler2D gradientTexture;\nuniform int sizeMode;\nuniform float minAttenuatedSize;\nuniform float maxAttenuatedSize;\n\nattribute vec3 color;\nattribute vec2 range;\nattribute vec4 unique_id;\nattribute float intensity;\nattribute float classification;\nattribute float pointSourceID;\n\nattribute float returnNumber;\nattribute float numberOfReturns;\nattribute float scanAngle;\n\n#if defined(NORMAL_OCT16)\nattribute vec2 oct16Normal;\n#elif defined(NORMAL_SPHEREMAPPED)\nattribute vec2 sphereMappedNormal;\n#endif\n\nvarying vec4 vColor;\n\n// see https://web.archive.org/web/20150303053317/http://lgdv.cs.fau.de/get/1602\n// and implementation in PotreeConverter (BINPointReader.cpp) and potree (BinaryDecoderWorker.js)\n#if defined(NORMAL_OCT16)\nvec3 decodeOct16Normal(vec2 encodedNormal) {\n vec2 nNorm = 2. * (encodedNormal / 255.) - 1.;\n vec3 n;\n n.z = 1. - abs(nNorm.x) - abs(nNorm.y);\n if (n.z >= 0.) {\n n.x = nNorm.x;\n n.y = nNorm.y;\n } else {\n n.x = sign(nNorm.x) - sign(nNorm.x) * sign(nNorm.y) * nNorm.y;\n n.y = sign(nNorm.y) - sign(nNorm.y) * sign(nNorm.x) * nNorm.x;\n }\n return normalize(n);\n}\n#elif defined(NORMAL_SPHEREMAPPED)\n// see http://aras-p.info/texts/CompactNormalStorage.html method #4\n// or see potree's implementation in BINPointReader.cpp\nvec3 decodeSphereMappedNormal(vec2 encodedNormal) {\n vec2 fenc = 2. * encodedNormal / 255. - 1.;\n float f = dot(fenc,fenc);\n float g = 2. * sqrt(1. - f);\n vec3 n;\n n.xy = fenc * g;\n n.z = 1. - 2. * f;\n return n;\n}\n#endif\n\nvoid main() {\n\n#if defined(NORMAL_OCT16)\n vec3 normal = decodeOct16Normal(oct16Normal);\n#elif defined(NORMAL_SPHEREMAPPED)\n vec3 normal = decodeSphereMappedNormal(sphereMappedNormal);\n#elif defined(NORMAL)\n // nothing to do\n#else\n // default to color\n vec3 normal = color;\n#endif\n\n if (picking) {\n vColor = unique_id;\n } else {\n vColor.a = opacity;\n if (applyOpacityClassication || mode == PNTS_MODE_CLASSIFICATION) {\n vec2 uv = vec2(classification/255., 0.5);\n vColor = texture2D(classificationTexture, uv);\n vColor.a *= opacity;\n }\n\n if (mode == PNTS_MODE_NORMAL) {\n vColor.rgb = abs(normal);\n } else if (mode == PNTS_MODE_COLOR) {\n // default to color mode\n vColor.rgb = mix(color, overlayColor.rgb, overlayColor.a);\n } else if (mode == PNTS_MODE_RETURN_NUMBER) {\n vec2 uv = vec2(returnNumber/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_TYPE) {\n float returnType;\n if (returnNumber > numberOfReturns) {\n returnType = 4.;\n } else if (returnNumber == 1.) {\n if (numberOfReturns == 1.) {\n // single\n returnType = 0.;\n } else {\n // first\n returnType = 1.;\n }\n } else {\n if (returnNumber == numberOfReturns) {\n // last\n returnType = 3.;\n } else {\n // intermediate\n returnType = 2.;\n }\n }\n vec2 uv = vec2(returnType/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_COUNT) {\n vec2 uv = vec2(numberOfReturns/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_POINT_SOURCE_ID) {\n vec2 uv = vec2(mod(pointSourceID, NB_CLASS)/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_SCAN_ANGLE) {\n float i = (scanAngle - angleRange.x) / (angleRange.y - angleRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_INTENSITY) {\n float i = (intensity - intensityRange.x) / (intensityRange.y - intensityRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_ELEVATION) {\n float i = (position.z - elevationRange.x) / (elevationRange.y - elevationRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n }\n }\n\n #include \n #include \n\n gl_PointSize = size;\n\n if (sizeMode == PNTS_SIZE_MODE_ATTENUATED) {\n bool isPerspective = isPerspectiveMatrix(projectionMatrix);\n\n if (isPerspective) {\n gl_PointSize *= scale / -mvPosition.z;\n gl_PointSize = clamp(gl_PointSize, minAttenuatedSize, maxAttenuatedSize);\n }\n }\n\n#if defined(USE_TEXTURES_PROJECTIVE)\n #include \n#endif\n #include \n}\n";const M=t.scale||.025/Math.tan(.5);s.Z.setDefineMapping(this,"PNTS_MODE",l),s.Z.setDefineMapping(this,"PNTS_SHAPE",c),s.Z.setDefineMapping(this,"PNTS_SIZE_MODE",h),s.Z.setUniformProperty(this,"size",y),s.Z.setUniformProperty(this,"mode",v),s.Z.setUniformProperty(this,"shape",x),s.Z.setUniformProperty(this,"picking",!1),s.Z.setUniformProperty(this,"opacity",this.opacity),s.Z.setUniformProperty(this,"overlayColor",t.overlayColor||new i.Vector4(0,0,0,0)),s.Z.setUniformProperty(this,"intensityRange",e),s.Z.setUniformProperty(this,"elevationRange",r),s.Z.setUniformProperty(this,"angleRange",u),s.Z.setUniformProperty(this,"applyOpacityClassication",A),s.Z.setUniformProperty(this,"sizeMode",b),s.Z.setUniformProperty(this,"scale",M),s.Z.setUniformProperty(this,"minAttenuatedSize",_),s.Z.setUniformProperty(this,"maxAttenuatedSize",w);const S=new Uint8Array(1024),C=new i.DataTexture(S,256,1,i.RGBAFormat);C.needsUpdate=!0,C.magFilter=i.NearestFilter,s.Z.setUniformProperty(this,"classificationTexture",C);const T=new Uint8Array(1024),I=new i.DataTexture(T,256,1,i.RGBAFormat);I.needsUpdate=!0,I.magFilter=i.NearestFilter,s.Z.setUniformProperty(this,"discreteTexture",I),this.classificationScheme=m,this.discreteScheme=g,this.recomputeClassification(),this.recomputeDiscreteTexture(),this.gradient=Object.values(E)[0],s.Z.setUniformProperty(this,"gradientTexture",this.gradientTexture),f?(this.uniforms.projectiveTextureAlphaBorder=f.uniforms.projectiveTextureAlphaBorder,this.uniforms.projectiveTextureDistortion=f.uniforms.projectiveTextureDistortion,this.uniforms.projectiveTextureMatrix=f.uniforms.projectiveTextureMatrix,this.uniforms.projectiveTexture=f.uniforms.projectiveTexture,this.uniforms.mask=f.uniforms.mask,this.uniforms.boostLight=f.uniforms.boostLight,this.defines.ORIENTED_IMAGES_COUNT=f.defines.ORIENTED_IMAGES_COUNT,this.defines.USE_DISTORTION=f.defines.USE_DISTORTION,this.defines.DEBUG_ALPHA_BORDER=f.defines.DEBUG_ALPHA_BORDER,this.defines.USE_TEXTURES_PROJECTIVE=!0,this.defines.USE_BASE_MATERIAL=!0,this.fragmentShader=n.Z.unrollLoops(a,this.defines)):this.fragmentShader=a}recomputeClassification(){f(this.classificationScheme,this.classificationTexture,32),this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}recomputeDiscreteTexture(){f(this.discreteScheme,this.discreteTexture),this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}copy(t){return super.copy(t),t.uniforms.projectiveTextureAlphaBorder&&(this.uniforms.projectiveTextureAlphaBorder=t.uniforms.projectiveTextureAlphaBorder,this.uniforms.projectiveTextureDistortion=t.uniforms.projectiveTextureDistortion,this.uniforms.projectiveTextureMatrix=t.uniforms.projectiveTextureMatrix,this.uniforms.projectiveTexture=t.uniforms.projectiveTexture,this.uniforms.mask=t.uniforms.mask,this.uniforms.boostLight=t.uniforms.boostLight),this}enablePicking(t){this.picking=t,this.blending=t?i.NoBlending:i.NormalBlending}update(t){return this.visible=t.visible,this.opacity=t.opacity,this.transparent=t.transparent,this.size=t.size,this.mode=t.mode,this.shape=t.shape,this.sizeMode=t.sizeMode,this.minAttenuatedSize=t.minAttenuatedSize,this.maxAttenuatedSize=t.maxAttenuatedSize,this.picking=t.picking,this.scale=t.scale,this.overlayColor.copy(t.overlayColor),this.intensityRange.copy(t.intensityRange),this.elevationRange.copy(t.elevationRange),this.angleRange.copy(t.angleRange),Object.assign(this.defines,t.defines),this}set gradient(t){this.gradientTexture=function(t){const e=64,r=document.createElement("canvas");r.width=e,r.height=e;const n=r.getContext("2d");n.rect(0,0,e,e);const s=n.createLinearGradient(0,0,e,e);for(let e=0;e{"use strict";r.d(e,{pL:()=>a,AN:()=>h,NO:()=>u});var i=r(99477),n=r(5199),s=r(86541);var o=r(79323);const a=-1,l=new i.Vector4;class c extends i.EventDispatcher{constructor(t,e){super(),this.layer=e,this.crs=e.parent.tileMatrixSets.indexOf(o.Z.formatToTms(e.crs)),-1==this.crs&&console.error("Unknown crs:",e.crs),this.textures=[],this.offsetScales=[],this.level=a,this.material=t,this._handlerCBEvent=()=>{this.material.layersNeedUpdate=!0},e.addEventListener("visible-property-changed",this._handlerCBEvent),e.addEventListener("opacity-property-changed",this._handlerCBEvent)}get id(){return this.layer.id}get opacity(){return this.layer.opacity}get visible(){return this.layer.visible}initFromParent(t,e){if(t&&t.level>this.level){let r=0;for(const i of e)for(const e of t.textures)if(i.isInside(e.extent)){this.setTexture(r++,e,i.offsetToParent(e.extent));break}}}dispose(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.layer.removeEventListener("visible-property-changed",this._handlerCBEvent),this.layer.removeEventListener("opacity-property-changed",this._handlerCBEvent),this._listeners={});for(const t of this.textures)t.isTexture&&t.dispose();this.level=a,this.textures=[],this.offsetScales=[],this.material.layersNeedUpdate=!0}setTexture(t,e,r){this.level=e&&e.extent&&0==t?e.extent.zoom:this.level,this.textures[t]=e||null,this.offsetScales[t]=r,this.material.layersNeedUpdate=!0}setTextures(t,e){this.dispose(!1);for(let r=0,i=t.length;rnull!=t));return a.length?{min:Math.min(...a),max:Math.max(...a)}:{min:1/0,max:-1/0}}(t,e,r);const c=Math.floor(e.z*i);if(c>2){const t=Math.floor(e.z*n),s=Math.floor(e.x*i),h=Math.floor(e.y*n),u=Math.max(Math.floor(c/32),2);for(let e=h;ea&&(a=r.zmin),r.zmaxe&&t[r-1]>e&&t[Math.sqrt(r)-1]>e&&t[r-Math.sqrt(r)]>e}(n,e)&&function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0,r=arguments.length>2?arguments[2]:void 0;for(let i=0,n=t.length;ir[function(t,e,r){const i=Math.floor(t/r)/r,n=e.x+t%r/r*e.z,s=e.y+i*e.w;return Math.floor(s*r)*r+Math.floor(n*r)}(t,i,256)]}(t,r,i,l),e)}}},14625:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i={FINAL:0,DEPTH:1,ID:2},n={MODES:i,push:function(t,e){const r=t.mode??i.FINAL;if(r==e)return()=>{};const n=t=>e=>{const r=e.material;r&&(r.mode=t)};return t.traverse(n(e)),()=>{t.traverse(n(r))}}}},43195:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});const i=new RegExp("gl_Position.*(?![^]*gl_Position)"),n=new RegExp("[^\\w]*main[^\\w]*(void)?[^\\w]*{"),s={patchMaterialForLogDepthSupport(t){if(t.vertexShader.includes("USE_LOGDEPTHBUF")||t.vertexShader.includes("logdepthbuf_pars_vertex"))return;t.vertexShader=`#include \n#define EPSILON 1e-6\n${t.vertexShader}`;let e=i.exec(t.vertexShader),r=e[0].length+e.index;t.vertexShader=`${t.vertexShader.slice(0,r)}\n#include \n${t.vertexShader.slice(r)}`,t.fragmentShader=`#include \n${t.fragmentShader}`,e=n.exec(t.fragmentShader),r=e[0].length+e.index,t.fragmentShader=`${t.fragmentShader.slice(0,r)}\n#include \n${t.fragmentShader.slice(r)}`,t.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}},unrollLoops:(t,e)=>t.replace(/#pragma unroll_loop\s+for\s*\(\s*int\s+i\s*=\s*([\w\d]+);\s*i\s+<\s+([\w\d]+);\s*i\s*\+\+\s*\)\s*\{\n([^}]*)\}/g,(function(t,r,i,n){let s="";r=r in e?e[r]:parseInt(r,10),i=i in e?e[i]:parseInt(i,10);for(let t=r;t{"use strict";r.d(e,{Z:()=>R});var i=r(71440),n=r(12679),s=r(56178),o=r(84612),a=r(50810),l=r(15344),c=r(4090),h=r(99477),u=r(3614),d=r(38929),p=r(5167),f=r(53175),m=r(62310);const g=i.Mh.get("EPSG:3857").planarDimensions(),A=new h.Vector3(g.x,g.y,1),y=new h.Vector2,v=new h.Vector2;function x(t,e,r,i){const n=i*2**r.z,s=i*r.x,o=i*r.y;return new m.Z("EPSG:4326",360*(t+s)/n-180,360/Math.PI*Math.atan(Math.exp((180-360*(e+o)/n)*Math.PI/180))-90)}function b(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.bindNewGeometry();const n=e.type===p.tg.POLYGON;r=r&&n,i.properties=t.properties;const s=t._pbf;s.pos=t._geometry;const o=s.readVarint()+s.pos;let a=1,l=0,c=0,h=0,u=0,d=0;for(;s.pos>3}if(l--,1===a||2===a){c+=s.readSVarint(),h+=s.readSVarint(),1===a&&(u&&(r&&d>0&&i.indices.length>0&&(e.updateExtent(i),i=e.bindNewGeometry(),i.properties=t.properties),i.closeSubGeometry(u,e),i.getLastSubGeometry().ccw=d<0),u=0,d=0),u++;const o=x(c,h,t.tileNumbers,t.extent);i.pushCoordinatesValues(e,{x:c,y:h},o),1==u?(v.set(c,h),v.coordProj=o,y.set(c,h)):n&&u>1&&(d+=(y.x-c)*(y.y+h),y.set(c,h))}else{if(7!==a)throw new Error(`unknown command ${a}`);u&&(u++,i.pushCoordinatesValues(e,{x:v.x,y:v.y},v.coordProj),n&&(d+=(y.x-v.x)*(y.y+v.y)))}}u&&(r&&d>0&&i.indices.length>0&&(e.updateExtent(i),i=e.bindNewGeometry(),i.properties=t.properties),i.closeSubGeometry(u,e),i.getLastSubGeometry().ccw=d<0),e.updateExtent(i)}const _={parse:(t,e)=>(e=(0,f._F)(e),Promise.resolve(function(t,e){e.out=e.out||{};const r=new d.VectorTile(new u(t)),i=Object.keys(r.layers);if(i.length<1)return;const n=e.extent.col,s=e.extent.zoom,o=e.in.isInverted?e.extent.row:(1<{if(!e.in.layers[t])return;const i=r.layers[t];for(let r=i.length-1;r>=0;r--){const o=i.feature(r);o.tileNumbers={x:n,y:e.extent.row,z:s};const l=e.in.layers[t].filter((t=>t.filterExpression.filter({zoom:s},o)&&s>=t.zoom.min&&se.id===t.id))||(c=a.newFeatureByReference(c),c.id=t.id,c.order=t.order,c.style=e.in.styles[c.id]):(c=a.requestFeatureById(t.id,o.type-1),c.id=t.id,c.order=t.order,c.style=e.in.styles[c.id],b(o,c))}})),a.removeEmptyFeature(),a.features.sort(((t,e)=>t.order-e.order)),a.updateExtent(),a.extent=e.extent,a.isInverted=e.in.isInverted,Promise.resolve(a)}(t,e)))};var w=r(45340),E=r(55086),M=r(79323);const S=new Map([["application/geo+json",n.Z.parse],["application/json",n.Z.parse],["application/kml",s.Z.parse],["application/gpx",a.Z.parse],["application/x-protobuf;type=mapbox-vector",_.parse],["application/gtx",l.ZP.parse],["application/isg",c.Z.parse],["application/gdf",o.Z.parse]]),C={getByArray:()=>{},setByArray:t=>t,clear:()=>{}};class T{constructor(t){t.projection&&(console.warn("Source projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),t.crs&&M.Z.isValid(t.crs),this.crs=t.crs}}let I=0;const R=class extends T{constructor(t){if(super(t),this.isSource=!0,!t.url)throw new Error("New Source: url is required");this.uid=I++,this.url=t.url,this.format=t.format,this.fetcher=t.fetcher||w.Z.get(t.format),this.parser=t.parser||S.get(t.format)||((t,e)=>(t.extent=e.extent,t)),this.isVectorSource=null!=(t.parser||S.get(t.format)),this.networkOptions=t.networkOptions||{crossOrigin:"anonymous"},this.attribution=t.attribution,this.whenReady=Promise.resolve(),this._featuresCaches={},t.extent&&!t.extent.isExtent?this.extent=new i.ZP(this.crs,t.extent):this.extent=t.extent}handlingError(t){throw new Error(t)}urlFromExtent(){throw new Error("In extended Source, you have to implement the method urlFromExtent!")}requestToKey(t){return[t.zoom,t.row,t.col]}loadData(t,e){const r=this._featuresCaches[e.crs],i=this.requestToKey(t);let n=r.getByArray(i);return n||(n=r.setByArray(this.fetcher(this.urlFromExtent(t),this.networkOptions).then((r=>this.parser(r,{out:e,in:this,extent:t}))).catch((t=>this.handlingError(t))),i),this.onParsedFile&&n.then((t=>(this.onParsedFile(t),console.warn("Source.onParsedFile was deprecated"),t)))),n}onLayerAdded(t){this._featuresCaches[t.out.crs]||(this._featuresCaches[t.out.crs]=this.isVectorSource?new E.Z:C)}onLayerRemoved(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._featuresCaches[t.unusedCrs];e&&(e.clear(),delete this._featuresCaches[t.unusedCrs])}extentInsideLimit(){throw new Error("In extented Source, you have to implement the method extentInsideLimit!")}}},32533:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>b});var i=r(99477),n=r(36194),s=r(86541),o=r(99617),a=r(62310),l=r(2359),c=r(67490),h=r(73502);i.Object3D.DEFAULT_UP.set(0,0,1);const u=new i.Vector3,d=new a.Z("EPSG:4326",0,0,0),p=new l.Z,f=[],m=new c.Z,g=new i.Vector3;function A(t){return t-360*Math.floor((t+180)/360)}function y(t){return t.getLayers((t=>t.isTiledGeometryLayer))[0]}class v extends i.Object3D{constructor(){super(),this.seaLevel=new i.Object3D,this.target=new i.Object3D,this.target.rotation.order="ZXY",this.camera=new i.Camera,this.add(this.seaLevel),this.seaLevel.add(this.target),this.target.add(this.camera),this.coord=new a.Z("EPSG:4978",0,0),this.targetWorldPosition=new i.Vector3,this.removeAll=()=>{},this._onChangeCallback=null}applyTransformToCamera(t,e){this.proxy?(e.quaternion._onChange(this._onChangeCallback),this.camera.matrixWorld.decompose(this.proxy.position,e.quaternion,e.scale),e.quaternion._onChange((()=>this.removeProxy(t,e)))):this.camera.matrixWorld.decompose(e.position,e.quaternion,e.scale),t.dispatchEvent({type:h.b.CAMERA_MOVED,coord:this.coord,range:this.range,heading:this.heading,tilt:this.tilt})}setProxy(t,e){!this.proxy&&t&&e&&(this.proxy={position:new i.Vector3},Object.keys(e.position).forEach((r=>function(t,e,r,i){r.proxy.position[i]=e.position[i],Object.defineProperty(e.position,i,{get:()=>r.proxy.position[i],set:n=>{r.removeProxy(t,e),e.position[i]=n}})}(t,e,this,r))),this._onChangeCallback=e.quaternion._onChangeCallback,e.quaternion._onChange((()=>this.removeProxy(t,e))))}removeProxy(t,e){this.stop(t),this.proxy&&t&&e&&(Object.keys(e.position).forEach((t=>Object.defineProperty(e.position,t,{value:this.proxy.position[t],writable:!0}))),e.quaternion._onChange(this._onChangeCallback),this.proxy=null)}setTargetFromCoordinate(t,e){e.as(y(t).extent.crs,this.coord);const r=Math.max(0,s.Z.getElevationValueAt(y(t),this.coord,s.Z.PRECISE_READ_Z)||this.coord.z);this.coord.z=r,this.coord.as(t.referenceCrs).toVector3(u),"EPSG:4978"==t.referenceCrs?(this.lookAt(u),this.seaLevel.position.set(0,0,u.length()-r)):(this.position.set(u.x,u.y,0),this.seaLevel.position.set(0,0,0)),this.target.position.set(0,0,r)}setFromPositions(t,e){this.setTargetFromCoordinate(t,new a.Z(t.referenceCrs,u)),this.target.rotation.set(0,0,0),this.updateMatrixWorld(!0),this.camera.position.copy(e),this.target.worldToLocal(this.camera.position);const r=this.camera.position.length();this.target.rotation.x=Math.asin(this.camera.position.z/r);const n=i.MathUtils.clamp(this.camera.position.y/(Math.cos(this.target.rotation.x)*r),-1,1);this.target.rotation.z=Math.sign(-this.camera.position.x||1)*Math.acos(n),this.camera.position.set(0,r,0)}applyParams(t,e){e.coord&&this.setTargetFromCoordinate(t,e.coord),null!=e.tilt&&(this.target.rotation.x=i.MathUtils.degToRad(e.tilt)),null!=e.heading&&(this.target.rotation.z=i.MathUtils.degToRad(-A(e.heading+180))),e.range&&this.camera.position.set(0,e.range,0),this.camera.rotation.set(.5*-Math.PI,0,Math.PI),this.updateMatrixWorld(!0),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld)}getParams(){return{coord:this.coord.clone(),tilt:this.tilt,heading:this.heading,range:this.range,targetWorldPosition:this.targetWorldPosition}}setfromCamera(t,e,r){e.updateMatrixWorld(!0),null==r&&(r=t.getPickingPositionFromDepth()||function(t,e){const r=new i.Vector3(0,0,.5);if(r.unproject(e),r.sub(e.position).normalize(),"EPSG:4978"==t.referenceCrs)return p.intersection({direction:r,origin:e.position});{const t=e.position.z/r.z;return r.multiplyScalar(t).add(e.position)}}(t,e));const n=r&&!isNaN(r.x)?e.position.distanceTo(r):100;e.localToWorld(u.set(0,0,-n)),this.setFromPositions(t,e.position)}copyObject3D(t){return this.copy(t,!1),this.seaLevel.copy(t.seaLevel,!1),this.target.copy(t.target,!1),this.camera.copy(t.camera),this}animateCameraToLookAtTarget(t,e,r){r.easing=r.easing||n.ZP.Easing.Quartic.InOut,this.setfromCamera(t,e);const s=new n.ZP.Group;this.start=(this.start||new v).copyObject3D(this),this.end=(this.end||new v).copyObject3D(this);const a=r.time||2500,l={t:0},c=[],h=(()=>{let t,e;return{promise:new Promise(((r,i)=>{t=r,e=i})),resolve:t,reject:e}})();this.addPlaceTargetOnGround(t,e,r.coord,l),this.end.applyParams(t,r);const u=this.end.target.rotation.z-this.start.target.rotation.z;return Math.abs(u)>Math.PI&&(this.end.target.rotation.z=this.start.target.rotation.z+u-2*Math.sign(u)*Math.PI),c.push(new n.ZP.Tween(l,s).to({t:1},a).easing(r.easing).onUpdate((e=>{"EPSG:4978"==t.referenceCrs&&this.quaternion.slerpQuaternions(this.start.quaternion,this.end.quaternion,e.t),this.camera.quaternion.slerpQuaternions(this.start.camera.quaternion,this.end.camera.quaternion,e.t),this.target.rotation.set(0,0,0),this.target.rotateZ(i.MathUtils.lerp(this.start.target.rotation.z,this.end.target.rotation.z,e.t)),this.target.rotateX(i.MathUtils.lerp(this.start.target.rotation.x,this.end.target.rotation.x,e.t))}))),"EPSG:4978"!=t.referenceCrs&&c.push(new n.ZP.Tween(this.position,s).to(this.end.position,a).easing(r.easing)),c.push(new n.ZP.Tween(this.seaLevel.position,s).to(this.end.seaLevel.position,a).easing(r.easing)),c.push(new n.ZP.Tween(this.camera.position,s).to(this.end.camera.position,a).easing(r.easing)),this.animationFrameRequester=()=>{s.update(),this.updateMatrixWorld(!0),this.applyTransformToCamera(t,e),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld),r.callback&&r.callback(this),d.crs=t.referenceCrs,d.setFromVector3(this.targetWorldPosition).as(y(t).extent.crs,this.coord),t.notifyChange(e)},this.removeAll=function(e){this.removeAll=()=>{},s.removeAll(),this.animationFrameRequester&&t.removeFrameRequester(o.Ao.BEFORE_RENDER,this.animationFrameRequester),h.resolve(void 0!==e),this.animationFrameRequester=null},c[c.length-1].onComplete(this.removeAll),c.forEach((t=>t.start())),t.addFrameRequester(o.Ao.BEFORE_RENDER,this.animationFrameRequester),t.notifyChange(e),h}stop(t){this.removePlaceTargetOnGround(t),this.removeAll()}addPlaceTargetOnGround(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{t:1};if(this.removePlaceTargetOnGround(t),t&&e){const n=this.target.position.z;this.placeTargetOnGround=()=>{const o=Math.max(0,s.Z.getElevationValueAt(y(t),r||this.coord,s.Z.PRECISE_READ_Z)||0);this.target.position.z=n*(1-i.t)+o*i.t,this.target.updateMatrixWorld(!0),this.applyTransformToCamera(t,e)},this.placeTargetOnGround(),t.addFrameRequester(o.Ao.BEFORE_RENDER,this.placeTargetOnGround)}}removePlaceTargetOnGround(t){t&&this.placeTargetOnGround&&(t.removeFrameRequester(o.Ao.BEFORE_RENDER,this.placeTargetOnGround),this.placeTargetOnGround=null)}get tilt(){return i.MathUtils.radToDeg(this.target.rotation.x)}get heading(){return-A(i.MathUtils.radToDeg(this.target.rotation.z)+180)}get range(){return this.camera.position.y}}function x(t){return f[t.uuid]=f[t.uuid]||new v,f[t.uuid]}const b={defaultStopPlaceOnGroundAtEnd:!1,Easing:n.ZP.Easing,stop(t,e){x(e).stop(t)},getTransformCameraLookingAtTarget(t,e,r){const i=x(e);return i.setfromCamera(t,e,r),i.getParams()},transformCameraToLookAtTarget(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.isExtent&&(r=this.getCameraTransformOptionsFromExtent(t,e,r)),r.proxy=void 0===r.proxy||r.proxy;const i=x(e);return i.stop(t),i.setfromCamera(t,e),r.proxy&&i.setProxy(t,e),i.applyParams(t,r),i.addPlaceTargetOnGround(t,e,r.coord),i.applyTransformToCamera(t,e),t.notifyChange(e),Promise.resolve(i.getParams())},getCameraTransformOptionsFromExtent(t,e,r){const n={coord:new a.Z(r.crs,0,0,0),heading:0,tilt:t.isPlanarView?90:89.9};let s;if(t.isGlobeView?(r=r.as("EPSG:4326"),m.setFromExtent(r),m.box3D.getSize(g),s={x:g.y,y:g.x}):s=(r=r.as(t.referenceCrs)).planarDimensions(),r.center(n.coord),e.isOrthographicCamera)s.x/s.y>e.aspect?e.zoom=(e.right-e.left)/s.x:e.zoom=(e.top-e.bottom)/s.y,e.updateProjectionMatrix(),n.range=1e3;else if(e.isPerspectiveCamera){const r=i.MathUtils.degToRad(e.fov);if(s.x/s.y>e.aspect){const e=.5*t.domElement.clientHeight/Math.tan(.5*r),i=2*Math.atan(.5*t.domElement.clientWidth/e);n.range=s.x/(2*Math.tan(.5*i))}else n.range=s.y/(2*Math.tan(.5*r))}return n},animateCameraToLookAtTarget(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.proxy=void 0===r.proxy||r.proxy;const i=x(e);return i.stop(t),r.proxy&&i.setProxy(t,e),i.animateCameraToLookAtTarget(t,e,r).promise.then((e=>{const n=void 0===r.stopPlaceOnGroundAtEnd?this.defaultStopPlaceOnGroundAtEnd:r.stopPlaceOnGroundAtEnd,s=i.getParams();return n&&i.stop(t),s.finished=e,s}))},sequenceAnimationsToLookAtTarget(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{}]).map((r=>()=>this.animateCameraToLookAtTarget(t,e,r))).reduce(((t,e)=>t.then((t=>!t.length||t[t.length-1].finished?e().then(Array.prototype.concat.bind(t)):Promise.resolve([{finished:!1}])))),Promise.resolve([]))},getDiffParams(t,e){if(!t||!e)return;let r;return Math.abs(t.range-e.range)/t.range>.001&&(r=r||{},r.range={previous:t.range,new:e.range}),Math.abs(t.tilt-e.tilt)>.1&&(r=r||{},r.tilt={previous:t.tilt,new:e.tilt}),Math.abs(t.heading-e.heading)>.1&&(r=r||{},r.heading={previous:t.heading,new:e.heading}),(Math.abs(t.coord.x-e.coord.x)>1e-6||Math.abs(t.coord.y-e.coord.y)>1e-6)&&(r=r||{},r.coord={previous:t.coord,new:e.coord}),r}}},86541:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a,P:()=>p});var i=r(99477),n=r(62310);const s={v:new i.Vector3,coord1:new n.Z("EPSG:4978"),coord2:new n.Z("EPSG:4978"),offset:new i.Vector2};function o(t,e,r,i,o,l){let c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},h=arguments.length>8?arguments[8]:void 0;const u=(arguments.length>7?arguments[7]:void 0)||new n.Z(i);c.worldFromLocal?u.setFromVector3(s.v.copy(o).applyMatrix4(c.worldFromLocal)):u.setFromVector3(o);const d=a.getTerrainObjectAt(t,u,e,r,h);if(d)return d.coord.z+=l,d.coord.as(i,s.coord2).toVector3(o),c.localFromWorld&&o.applyMatrix4(c.localFromWorld),{id:d.texture.id,version:d.texture.version,tile:d.tile}}const a={getElevationValueAt(t,e){const r=A(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e,(arguments.length>3?arguments[3]:void 0)||t.level0Nodes);if(r)return r.coord.z},getTerrainObjectAt(t,e){let r=arguments.length>4?arguments[4]:void 0;return A(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e,(arguments.length>3?arguments[3]:void 0)||t.level0Nodes,r)},FAST_READ_Z:0,PRECISE_READ_Z:1,placeObjectOnGround:function(t,e,r){let s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0;if(console.warn("placeObjectOnGround has been deprecated because it needs review and test"),s=c?c.concat(t.level0Nodes):t.level0Nodes,l.modifyGeometry){const c={worldFromLocal:r.matrixWorld,localFromWorld:(new i.Matrix4).copy(r.matrixWorld).invert()},h=r.geometry;if(h.vertices){l.cache&&(l.cache.length=h.vertices.length);let r=!0;const i=new n.Z(e);for(let n=0;n=0?e:void 0}}let c;function h(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s2&&void 0!==arguments[2]?arguments[2]:new i.Vector2;if(t.crs!=e.crs)throw new Error(`Unsupported mix: ${t.crs} and ${e.crs}`);e.planarDimensions(g);const n=(t.x-e.west)/g.x,s=(e.north-t.y)/g.y;r.set(n,s)}(a,c.extent,m.offset),a.z=1==e?function(t,e,r,n,s){const o=n.x/s.x/16;let a=Math.floor(r.x/o)*o,l=Math.floor(r.y/o)*o;1==a&&(a-=o),1==l&&(l-=o);const c=a,h=a+o,u=l,d=l+o,m=(r.x-a)/o,g=(r.y-l)/o,A=new i.Triangle(new i.Vector3(c,d),new i.Vector3(h,u),1==g||m/(1-g)>=1?new i.Vector3(h,d):new i.Vector3(c,u));A.getBarycoord(new i.Vector3(r.x,r.y),f);const y=t.attachedLayers.filter((t=>t.isElevationLayer))[0],v=p(y,e,A.a.x,A.a.y),x=p(y,e,A.b.x,A.b.y),b=p(y,e,A.c.x,A.c.y);return v*f.x+x*f.y+b*f.z}(t,y,m.offset,d.extent.planarDimensions(),c.extent.planarDimensions()):function(t,e,r){return function(t,e,r,i){const n=u(e,r,i);return h(t,e,n.wu<=0?n.u1:n.u2,n.wv<=0?n.v1:n.v2)}(t.attachedLayers.filter((t=>t.isElevationLayer))[0],e,r.x,r.y)}(t,y,m.offset),null!=a.z?{coord:a,texture:y,tile:d}:void 0}},29372:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(5167);function n(t,e,r,i,n,s){const o=t.x,a=t.y;for(let t=i+s,l=i;t=-r&&p<=d+r&&Math.abs(u*o-h*a+s*n-c*i)/d<=r)return!0}return!1}function s(t,e,r,s,o,a,l){if(e==i.tg.LINE&&n(t,r,s,o,a,l))return!0;if(e==i.tg.POLYGON&&function(t,e,r,i,s,o){const a=t.x,l=t.y;let c=!1;for(let h=i,u=i+s-o;hl!=d>l&&a<(o-i)*(l-s)/(d-s)+i&&(c=!c)}return c}(t,r,s,o,a,l))return!0;if(e==i.tg.POINT){const e=function(t,e,r,i,n,s){const o=t.x,a=t.y;let l,c=r*r;for(let t=i;t2&&void 0!==arguments[2]?arguments[2]:.1;const i=[];if(t.as(e.crs,a),a.applyMatrix4(e.matrixWorldInverse),e.extent.isPointInside(a,r))if(e.isFeatureCollection){r*=Math.sqrt(e.scale.x**2+e.scale.y**2);for(const t of e.features)t.extent&&!t.extent.isPointInside(a,r)||o(a,t,r,i)}else e.geometries&&o(a,e,r,i);return i}}},59099:(t,e,r)=>{"use strict";function i(t){const e=function(t){const e=[];return t.alphaMap&&e.push(t.map),t.aoMap&&e.push(t.map),t.bumpMap&&e.push(t.bumpMap),t.displacementMap&&e.push(t.bumpMap),t.emissiveMap&&e.push(t.emissiveMap),t.envMap&&e.push(t.envMap),t.lightMap&&e.push(t.envMap),t.map&&e.push(t.map),t.metalnessMap&&e.push(t.map),t.normalMap&&e.push(t.map),t.roughnessMap&&e.push(t.map),t.specularMap&&e.push(t.specularMap),e}(t);if(Array.isArray(t))for(const e of t)e.dispose();else t.dispose();for(let t=0;t-1*(t.start-e.start)));const e=t.geometry.groups.length-1;let r=t.geometry.groups[e].materialIndex;const i=[r];for(let n=e-1;n>=0;n--){const e=t.geometry.groups[n];e.materialIndex===r?(t.geometry.groups[n+1].count+=e.count,t.geometry.groups.splice(n,1)):(r=e.materialIndex,i.push(r))}for(let e=t.material.length-1;e>=0;e--)i.includes(e)||(t.geometry.groups.forEach((t=>{t.materialIndex>e&&(t.materialIndex-=1)})),t.material.splice(e,1))}r.d(e,{O:()=>n,Z:()=>i})},99477:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ACESFilmicToneMapping:()=>st,AddEquation:()=>E,AddOperation:()=>tt,AdditiveAnimationBlendMode:()=>Ne,AdditiveBlending:()=>x,AlphaFormat:()=>Ft,AlwaysCompare:()=>Sr,AlwaysDepth:()=>H,AlwaysStencilFunc:()=>yr,AmbientLight:()=>op,AnimationAction:()=>Yp,AnimationClip:()=>Rd,AnimationLoader:()=>Fd,AnimationMixer:()=>Jp,AnimationObjectGroup:()=>Zp,AnimationUtils:()=>Ad,ArcCurve:()=>kh,ArrayCamera:()=>jl,ArrowHelper:()=>jf,AttachedBindMode:()=>at,Audio:()=>Pp,AudioAnalyser:()=>Fp,AudioContext:()=>xp,AudioListener:()=>Lp,AudioLoader:()=>bp,AxesHelper:()=>Vf,BackSide:()=>m,BasicDepthPacking:()=>Ve,BasicShadowMap:()=>h,BatchedMesh:()=>ch,Bone:()=>Pc,BooleanKeyframeTrack:()=>wd,Box2:()=>hf,Box3:()=>Ui,Box3Helper:()=>Nf,BoxGeometry:()=>Ys,BoxHelper:()=>Uf,BufferAttribute:()=>us,BufferGeometry:()=>Is,BufferGeometryLoader:()=>pp,ByteType:()=>It,Cache:()=>Ld,Camera:()=>eo,CameraHelper:()=>Df,CanvasTexture:()=>Ph,CapsuleGeometry:()=>iu,CatmullRomCurve3:()=>Qh,CineonToneMapping:()=>nt,CircleGeometry:()=>nu,ClampToEdgeWrapping:()=>gt,Clock:()=>Sp,Color:()=>$n,ColorKeyframeTrack:()=>Ed,ColorManagement:()=>mi,CompressedArrayTexture:()=>Bh,CompressedCubeTexture:()=>Lh,CompressedTexture:()=>Rh,CompressedTextureLoader:()=>zd,ConeGeometry:()=>ou,ConstantAlphaFactor:()=>Q,ConstantColorFactor:()=>z,CubeCamera:()=>no,CubeReflectionMapping:()=>ht,CubeRefractionMapping:()=>ut,CubeTexture:()=>so,CubeTextureLoader:()=>Qd,CubeUVReflectionMapping:()=>ft,CubicBezierCurve:()=>Wh,CubicBezierCurve3:()=>qh,CubicInterpolant:()=>vd,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>o,Curve:()=>Dh,CurvePath:()=>tu,CustomBlending:()=>w,CustomToneMapping:()=>ot,CylinderGeometry:()=>su,Cylindrical:()=>lf,Data3DTexture:()=>Ri,DataArrayTexture:()=>Ti,DataTexture:()=>Dc,DataTextureLoader:()=>jd,DataUtils:()=>ls,DecrementStencilOp:()=>ar,DecrementWrapStencilOp:()=>cr,DefaultLoadingManager:()=>Dd,DepthFormat:()=>jt,DepthStencilFormat:()=>Vt,DepthTexture:()=>Ko,DetachedBindMode:()=>lt,DirectionalLight:()=>sp,DirectionalLightHelper:()=>Bf,DiscreteInterpolant:()=>bd,DisplayP3ColorSpace:()=>Je,DodecahedronGeometry:()=>lu,DoubleSide:()=>g,DstAlphaFactor:()=>O,DstColorFactor:()=>U,DynamicCopyUsage:()=>Dr,DynamicDrawUsage:()=>Tr,DynamicReadUsage:()=>Br,EdgesGeometry:()=>pu,EllipseCurve:()=>Oh,EqualCompare:()=>br,EqualDepth:()=>Z,EqualStencilFunc:()=>pr,EquirectangularReflectionMapping:()=>dt,EquirectangularRefractionMapping:()=>pt,Euler:()=>bn,EventDispatcher:()=>Gr,ExtrudeGeometry:()=>Qu,FileLoader:()=>Nd,Float16BufferAttribute:()=>vs,Float32BufferAttribute:()=>xs,Float64BufferAttribute:()=>bs,FloatType:()=>Dt,Fog:()=>$l,FogExp2:()=>Kl,FramebufferTexture:()=>Ih,FrontSide:()=>f,Frustum:()=>fo,GLBufferAttribute:()=>rf,GLSL1:()=>kr,GLSL3:()=>Ur,GreaterCompare:()=>wr,GreaterDepth:()=>X,GreaterEqualCompare:()=>Mr,GreaterEqualDepth:()=>Y,GreaterEqualStencilFunc:()=>Ar,GreaterStencilFunc:()=>mr,GridHelper:()=>Sf,Group:()=>Vl,HalfFloatType:()=>Ot,HemisphereLight:()=>Wd,HemisphereLightHelper:()=>Mf,IcosahedronGeometry:()=>Vu,ImageBitmapLoader:()=>yp,ImageLoader:()=>Gd,ImageUtils:()=>vi,IncrementStencilOp:()=>or,IncrementWrapStencilOp:()=>lr,InstancedBufferAttribute:()=>Nc,InstancedBufferGeometry:()=>dp,InstancedInterleavedBuffer:()=>ef,InstancedMesh:()=>Wc,Int16BufferAttribute:()=>ms,Int32BufferAttribute:()=>As,Int8BufferAttribute:()=>ds,IntType:()=>Lt,InterleavedBuffer:()=>ec,InterleavedBufferAttribute:()=>ic,Interpolant:()=>yd,InterpolateDiscrete:()=>Be,InterpolateLinear:()=>Le,InterpolateSmooth:()=>Pe,InvertStencilOp:()=>hr,KeepStencilOp:()=>nr,KeyframeTrack:()=>_d,LOD:()=>_c,LatheGeometry:()=>ru,Layers:()=>_n,LessCompare:()=>xr,LessDepth:()=>W,LessEqualCompare:()=>_r,LessEqualDepth:()=>q,LessEqualStencilFunc:()=>fr,LessStencilFunc:()=>dr,Light:()=>Hd,LightProbe:()=>cp,Line:()=>gh,Line3:()=>pf,LineBasicMaterial:()=>hh,LineCurve:()=>Zh,LineCurve3:()=>Yh,LineDashedMaterial:()=>ud,LineLoop:()=>xh,LineSegments:()=>vh,LinearDisplayP3ColorSpace:()=>Ke,LinearEncoding:()=>Qe,LinearFilter:()=>wt,LinearInterpolant:()=>xd,LinearMipMapLinearFilter:()=>Ct,LinearMipMapNearestFilter:()=>Mt,LinearMipmapLinearFilter:()=>St,LinearMipmapNearestFilter:()=>Et,LinearSRGBColorSpace:()=>Xe,LinearToneMapping:()=>rt,LinearTransfer:()=>$e,Loader:()=>Od,LoaderUtils:()=>up,LoadingManager:()=>Pd,LoopOnce:()=>Te,LoopPingPong:()=>Re,LoopRepeat:()=>Ie,LuminanceAlphaFormat:()=>Qt,LuminanceFormat:()=>Gt,MOUSE:()=>n,Material:()=>rs,MaterialLoader:()=>hp,MathUtils:()=>ti,Matrix3:()=>ri,Matrix4:()=>un,MaxEquation:()=>T,Mesh:()=>qs,MeshBasicMaterial:()=>is,MeshDepthMaterial:()=>Ul,MeshDistanceMaterial:()=>Nl,MeshLambertMaterial:()=>cd,MeshMatcapMaterial:()=>hd,MeshNormalMaterial:()=>ld,MeshPhongMaterial:()=>od,MeshPhysicalMaterial:()=>sd,MeshStandardMaterial:()=>nd,MeshToonMaterial:()=>ad,MinEquation:()=>C,MirroredRepeatWrapping:()=>At,MixOperation:()=>$,MultiplyBlending:()=>_,MultiplyOperation:()=>K,NearestFilter:()=>yt,NearestMipMapLinearFilter:()=>_t,NearestMipMapNearestFilter:()=>xt,NearestMipmapLinearFilter:()=>bt,NearestMipmapNearestFilter:()=>vt,NeverCompare:()=>vr,NeverDepth:()=>V,NeverStencilFunc:()=>ur,NoBlending:()=>y,NoColorSpace:()=>Ze,NoToneMapping:()=>et,NormalAnimationBlendMode:()=>Ue,NormalBlending:()=>v,NotEqualCompare:()=>Er,NotEqualDepth:()=>J,NotEqualStencilFunc:()=>gr,NumberKeyframeTrack:()=>Md,Object3D:()=>kn,ObjectLoader:()=>fp,ObjectSpaceNormalMap:()=>qe,OctahedronGeometry:()=>Hu,OneFactor:()=>R,OneMinusConstantAlphaFactor:()=>j,OneMinusConstantColorFactor:()=>G,OneMinusDstAlphaFactor:()=>k,OneMinusDstColorFactor:()=>N,OneMinusSrcAlphaFactor:()=>D,OneMinusSrcColorFactor:()=>L,OrthographicCamera:()=>To,P3Primaries:()=>rr,PCFShadowMap:()=>u,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>No,Path:()=>eu,PerspectiveCamera:()=>ro,Plane:()=>ho,PlaneGeometry:()=>Ao,PlaneHelper:()=>Ff,PointLight:()=>ip,PointLightHelper:()=>bf,Points:()=>Sh,PointsMaterial:()=>bh,PolarGridHelper:()=>Cf,PolyhedronGeometry:()=>au,PositionalAudio:()=>Np,PropertyBinding:()=>qp,PropertyMixer:()=>zp,QuadraticBezierCurve:()=>Xh,QuadraticBezierCurve3:()=>Jh,Quaternion:()=>Pi,QuaternionKeyframeTrack:()=>Cd,QuaternionLinearInterpolant:()=>Sd,RED_GREEN_RGTC2_Format:()=>Se,RED_RGTC1_Format:()=>Ee,REVISION:()=>i,RGBADepthPacking:()=>He,RGBAFormat:()=>zt,RGBAIntegerFormat:()=>Yt,RGBA_ASTC_10x10_Format:()=>ye,RGBA_ASTC_10x5_Format:()=>me,RGBA_ASTC_10x6_Format:()=>ge,RGBA_ASTC_10x8_Format:()=>Ae,RGBA_ASTC_12x10_Format:()=>ve,RGBA_ASTC_12x12_Format:()=>xe,RGBA_ASTC_4x4_Format:()=>ae,RGBA_ASTC_5x4_Format:()=>le,RGBA_ASTC_5x5_Format:()=>ce,RGBA_ASTC_6x5_Format:()=>he,RGBA_ASTC_6x6_Format:()=>ue,RGBA_ASTC_8x5_Format:()=>de,RGBA_ASTC_8x6_Format:()=>pe,RGBA_ASTC_8x8_Format:()=>fe,RGBA_BPTC_Format:()=>be,RGBA_ETC2_EAC_Format:()=>oe,RGBA_PVRTC_2BPPV1_Format:()=>ie,RGBA_PVRTC_4BPPV1_Format:()=>re,RGBA_S3TC_DXT1_Format:()=>Jt,RGBA_S3TC_DXT3_Format:()=>Kt,RGBA_S3TC_DXT5_Format:()=>$t,RGB_BPTC_SIGNED_Format:()=>_e,RGB_BPTC_UNSIGNED_Format:()=>we,RGB_ETC1_Format:()=>ne,RGB_ETC2_Format:()=>se,RGB_PVRTC_2BPPV1_Format:()=>ee,RGB_PVRTC_4BPPV1_Format:()=>te,RGB_S3TC_DXT1_Format:()=>Xt,RGFormat:()=>qt,RGIntegerFormat:()=>Zt,RawShaderMaterial:()=>id,Ray:()=>hn,Raycaster:()=>nf,Rec709Primaries:()=>er,RectAreaLight:()=>ap,RedFormat:()=>Ht,RedIntegerFormat:()=>Wt,ReinhardToneMapping:()=>it,RenderTarget:()=>Si,RepeatWrapping:()=>mt,ReplaceStencilOp:()=>sr,ReverseSubtractEquation:()=>S,RingGeometry:()=>Wu,SIGNED_RED_GREEN_RGTC2_Format:()=>Ce,SIGNED_RED_RGTC1_Format:()=>Me,SRGBColorSpace:()=>Ye,SRGBTransfer:()=>tr,Scene:()=>tc,ShaderChunk:()=>yo,ShaderLib:()=>xo,ShaderMaterial:()=>to,ShadowMaterial:()=>rd,Shape:()=>fu,ShapeGeometry:()=>qu,ShapePath:()=>Hf,ShapeUtils:()=>Fu,ShortType:()=>Rt,Skeleton:()=>Uc,SkeletonHelper:()=>vf,SkinnedMesh:()=>Lc,Source:()=>bi,Sphere:()=>en,SphereGeometry:()=>Zu,Spherical:()=>af,SphericalHarmonics3:()=>lp,SplineCurve:()=>Kh,SpotLight:()=>Kd,SpotLightHelper:()=>mf,Sprite:()=>yc,SpriteMaterial:()=>nc,SrcAlphaFactor:()=>P,SrcAlphaSaturateFactor:()=>F,SrcColorFactor:()=>B,StaticCopyUsage:()=>Pr,StaticDrawUsage:()=>Cr,StaticReadUsage:()=>Rr,StereoCamera:()=>Mp,StreamCopyUsage:()=>Or,StreamDrawUsage:()=>Ir,StreamReadUsage:()=>Lr,StringKeyframeTrack:()=>Td,SubtractEquation:()=>M,SubtractiveBlending:()=>b,TOUCH:()=>s,TangentSpaceNormalMap:()=>We,TetrahedronGeometry:()=>Yu,Texture:()=>Ei,TextureLoader:()=>Vd,TorusGeometry:()=>Xu,TorusKnotGeometry:()=>Ju,Triangle:()=>Zn,TriangleFanDrawMode:()=>Ge,TriangleStripDrawMode:()=>ze,TrianglesDrawMode:()=>Fe,TubeGeometry:()=>Ku,TwoPassDoubleSide:()=>A,UVMapping:()=>ct,Uint16BufferAttribute:()=>gs,Uint32BufferAttribute:()=>ys,Uint8BufferAttribute:()=>ps,Uint8ClampedBufferAttribute:()=>fs,Uniform:()=>Kp,UniformsGroup:()=>tf,UniformsLib:()=>vo,UniformsUtils:()=>$s,UnsignedByteType:()=>Tt,UnsignedInt248Type:()=>Nt,UnsignedIntType:()=>Pt,UnsignedShort4444Type:()=>kt,UnsignedShort5551Type:()=>Ut,UnsignedShortType:()=>Bt,VSMShadowMap:()=>p,Vector2:()=>ei,Vector3:()=>Di,Vector4:()=>Mi,VectorKeyframeTrack:()=>Id,VideoTexture:()=>Th,WebGL1Renderer:()=>Jl,WebGL3DRenderTarget:()=>Bi,WebGLArrayRenderTarget:()=>Ii,WebGLCoordinateSystem:()=>Fr,WebGLCubeRenderTarget:()=>oo,WebGLMultipleRenderTargets:()=>Li,WebGLRenderTarget:()=>Ci,WebGLRenderer:()=>Xl,WebGLUtils:()=>Ql,WebGPUCoordinateSystem:()=>zr,WireframeGeometry:()=>$u,WrapAroundEnding:()=>ke,ZeroCurvatureEnding:()=>De,ZeroFactor:()=>I,ZeroSlopeEnding:()=>Oe,ZeroStencilOp:()=>ir,_SRGBAFormat:()=>Nr,createCanvasElement:()=>li,sRGBEncoding:()=>je});const i="159",n={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,l=2,c=3,h=0,u=1,d=2,p=3,f=0,m=1,g=2,A=2,y=0,v=1,x=2,b=3,_=4,w=5,E=100,M=101,S=102,C=103,T=104,I=200,R=201,B=202,L=203,P=204,D=205,O=206,k=207,U=208,N=209,F=210,z=211,G=212,Q=213,j=214,V=0,H=1,W=2,q=3,Z=4,Y=5,X=6,J=7,K=0,$=1,tt=2,et=0,rt=1,it=2,nt=3,st=4,ot=5,at="attached",lt="detached",ct=300,ht=301,ut=302,dt=303,pt=304,ft=306,mt=1e3,gt=1001,At=1002,yt=1003,vt=1004,xt=1004,bt=1005,_t=1005,wt=1006,Et=1007,Mt=1007,St=1008,Ct=1008,Tt=1009,It=1010,Rt=1011,Bt=1012,Lt=1013,Pt=1014,Dt=1015,Ot=1016,kt=1017,Ut=1018,Nt=1020,Ft=1021,zt=1023,Gt=1024,Qt=1025,jt=1026,Vt=1027,Ht=1028,Wt=1029,qt=1030,Zt=1031,Yt=1033,Xt=33776,Jt=33777,Kt=33778,$t=33779,te=35840,ee=35841,re=35842,ie=35843,ne=36196,se=37492,oe=37496,ae=37808,le=37809,ce=37810,he=37811,ue=37812,de=37813,pe=37814,fe=37815,me=37816,ge=37817,Ae=37818,ye=37819,ve=37820,xe=37821,be=36492,_e=36494,we=36495,Ee=36283,Me=36284,Se=36285,Ce=36286,Te=2200,Ie=2201,Re=2202,Be=2300,Le=2301,Pe=2302,De=2400,Oe=2401,ke=2402,Ue=2500,Ne=2501,Fe=0,ze=1,Ge=2,Qe=3e3,je=3001,Ve=3200,He=3201,We=0,qe=1,Ze="",Ye="srgb",Xe="srgb-linear",Je="display-p3",Ke="display-p3-linear",$e="linear",tr="srgb",er="rec709",rr="p3",ir=0,nr=7680,sr=7681,or=7682,ar=7683,lr=34055,cr=34056,hr=5386,ur=512,dr=513,pr=514,fr=515,mr=516,gr=517,Ar=518,yr=519,vr=512,xr=513,br=514,_r=515,wr=516,Er=517,Mr=518,Sr=519,Cr=35044,Tr=35048,Ir=35040,Rr=35045,Br=35049,Lr=35041,Pr=35046,Dr=35050,Or=35042,kr="100",Ur="300 es",Nr=1035,Fr=2e3,zr=2001;class Gr{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>8&255]+Qr[t>>16&255]+Qr[t>>24&255]+"-"+Qr[255&e]+Qr[e>>8&255]+"-"+Qr[e>>16&15|64]+Qr[e>>24&255]+"-"+Qr[63&r|128]+Qr[r>>8&255]+"-"+Qr[r>>16&255]+Qr[r>>24&255]+Qr[255&i]+Qr[i>>8&255]+Qr[i>>16&255]+Qr[i>>24&255]).toLowerCase()}function qr(t,e,r){return Math.max(e,Math.min(r,t))}function Zr(t,e){return(t%e+e)%e}function Yr(t,e,r){return(1-r)*t+r*e}function Xr(t){return 0==(t&t-1)&&0!==t}function Jr(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Kr(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function $r(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const ti={DEG2RAD:Vr,RAD2DEG:Hr,generateUUID:Wr,clamp:qr,euclideanModulo:Zr,mapLinear:function(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)},inverseLerp:function(t,e,r){return t!==e?(r-t)/(e-t):0},lerp:Yr,damp:function(t,e,r,i){return Yr(t,e,1-Math.exp(-r*i))},pingpong:function(t,e=1){return e-Math.abs(Zr(t,2*e)-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(jr=t);let e=jr+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*Vr},radToDeg:function(t){return t*Hr},isPowerOfTwo:Xr,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Jr,setQuaternionFromProperEuler:function(t,e,r,i,n){const s=Math.cos,o=Math.sin,a=s(r/2),l=o(r/2),c=s((e+i)/2),h=o((e+i)/2),u=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,l*u,l*d,a*c);break;case"YZY":t.set(l*d,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*d,a*h,a*c);break;case"XZX":t.set(a*h,l*f,l*p,a*c);break;case"YXY":t.set(l*p,a*h,l*f,a*c);break;case"ZYZ":t.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}},normalize:$r,denormalize:Kr};class ei{constructor(t=0,e=0){ei.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}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(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(qr(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}}class ri{constructor(t,e,r,i,n,s,o,a,l){ri.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,l)}set(t,e,r,i,n,s,o,a,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=o,c[3]=e,c[4]=n,c[5]=a,c[6]=r,c[7]=s,c[8]=l,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],l=r[1],c=r[4],h=r[7],u=r[2],d=r[5],p=r[8],f=i[0],m=i[3],g=i[6],A=i[1],y=i[4],v=i[7],x=i[2],b=i[5],_=i[8];return n[0]=s*f+o*A+a*x,n[3]=s*m+o*y+a*b,n[6]=s*g+o*v+a*_,n[1]=l*f+c*A+h*x,n[4]=l*m+c*y+h*b,n[7]=l*g+c*v+h*_,n[2]=u*f+d*A+p*x,n[5]=u*m+d*y+p*b,n[8]=u*g+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],l=t[7],c=t[8];return e*s*c-e*o*l-r*n*c+r*o*a+i*n*l-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],l=t[7],c=t[8],h=c*s-o*l,u=o*a-c*n,d=l*n-s*a,p=e*h+r*u+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*l-c*r)*f,t[2]=(o*r-i*s)*f,t[3]=u*f,t[4]=(c*e-i*a)*f,t[5]=(i*n-o*e)*f,t[6]=d*f,t[7]=(r*a-l*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),l=Math.sin(n);return this.set(r*a,r*l,-r*(a*s+l*o)+s+t,-i*l,i*a,-i*(-l*s+a*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(ii.makeScale(t,e)),this}rotate(t){return this.premultiply(ii.makeRotation(-t)),this}translate(t,e){return this.premultiply(ii.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):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 ii=new ri;function ni(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const si={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oi(t,e){return new si[t](e)}function ai(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function li(){const t=ai("canvas");return t.style.display="block",t}const ci={};function hi(t){t in ci||(ci[t]=!0,console.warn(t))}const ui=(new ri).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),di=(new ri).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),pi={[Xe]:{transfer:$e,primaries:er,toReference:t=>t,fromReference:t=>t},[Ye]:{transfer:tr,primaries:er,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Ke]:{transfer:$e,primaries:rr,toReference:t=>t.applyMatrix3(di),fromReference:t=>t.applyMatrix3(ui)},[Je]:{transfer:tr,primaries:rr,toReference:t=>t.convertSRGBToLinear().applyMatrix3(di),fromReference:t=>t.applyMatrix3(ui).convertLinearToSRGB()}},fi=new Set([Xe,Ke]),mi={enabled:!0,_workingColorSpace:Xe,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 this._workingColorSpace},set workingColorSpace(t){if(!fi.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,r){if(!1===this.enabled||e===r||!e||!r)return t;const i=pi[e].toReference;return(0,pi[r].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return pi[t].primaries},getTransfer:function(t){return t===Ze?$e:pi[t].transfer}};function gi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ai(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let yi;class vi{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===yi&&(yi=ai("canvas")),yi.width=t.width,yi.height=t.height;const r=yi.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),e=yi}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=ai("canvas");e.width=t.width,e.height=t.height;const r=e.getContext("2d");r.drawImage(t,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height),n=i.data;for(let t=0;t0&&(r.userData=this.userData),e||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==ct)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case mt:t.x=t.x-Math.floor(t.x);break;case gt:t.x=t.x<0?0:1;break;case At: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 mt:t.y=t.y-Math.floor(t.y);break;case gt:t.y=t.y<0?0:1;break;case At: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 hi("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Ye?je:Qe}set encoding(t){hi("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===je?Ye:Ze}}Ei.DEFAULT_IMAGE=null,Ei.DEFAULT_MAPPING=ct,Ei.DEFAULT_ANISOTROPY=1;class Mi{constructor(t=0,e=0,r=0,i=1){Mi.prototype.isVector4=!0,this.x=t,this.y=e,this.z=r,this.w=i}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,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)a&&t>A?tA?a=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+u*n,l=l*t+d*n,c=c*t+p*n,h=h*t+f*n,t===1-o){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,r,i,n,s){const o=r[i],a=r[i+1],l=r[i+2],c=r[i+3],h=n[s],u=n[s+1],d=n[s+2],p=n[s+3];return t[e]=o*p+c*h+a*d-l*u,t[e+1]=a*p+c*u+l*h-o*d,t[e+2]=l*p+c*d+o*u-a*h,t[e+3]=c*p-o*h-a*u-l*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,l=o(r/2),c=o(i/2),h=o(n/2),u=a(r/2),d=a(i/2),p=a(n/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*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],l=e[2],c=e[6],h=e[10],u=r+o+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=(s-i)*t}else if(r>o&&r>h){const t=2*Math.sqrt(1+r-o-h);this._w=(c-a)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(n+l)/t}else if(o>h){const t=2*Math.sqrt(1+o-r-h);this._w=(n-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-r-o);this._w=(s-i)/t,this._x=(n+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let r=t.dot(e)+1;return rMath.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(qr(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()}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 r=t._x,i=t._y,n=t._z,s=t._w,o=e._x,a=e._y,l=e._z,c=e._w;return this._x=r*c+s*o+i*l-n*a,this._y=i*c+s*a+n*o-r*l,this._z=n*c+s*l+r*a-i*o,this._w=s*c-r*o-i*a-n*l,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 l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=r*h+this._x*u,this._y=i*h+this._y*u,this._z=n*h+this._z*u,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}}class Di{constructor(t=0,e=0,r=0){Di.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(ki.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ki.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,l=2*(s*i-o*r),c=2*(o*e-n*i),h=2*(n*r-s*e);return this.x=e+a*l+s*h-o*c,this.y=r+a*c+o*l-n*h,this.z=i+a*h+n*c-s*l,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(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 Oi.copy(this).projectOnVector(t),this.sub(Oi)}reflect(t){return this.sub(Oi.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(qr(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 Oi=new Di,ki=new Pi;class Ui{constructor(t=new Di(1/0,1/0,1/0),e=new Di(-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;ethis.max.x||t.ythis.max.y||t.zthis.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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Fi),Fi.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(qi),Zi.subVectors(this.max,qi),Gi.subVectors(t.a,qi),Qi.subVectors(t.b,qi),ji.subVectors(t.c,qi),Vi.subVectors(Qi,Gi),Hi.subVectors(ji,Qi),Wi.subVectors(Gi,ji);let e=[0,-Vi.z,Vi.y,0,-Hi.z,Hi.y,0,-Wi.z,Wi.y,Vi.z,0,-Vi.x,Hi.z,0,-Hi.x,Wi.z,0,-Wi.x,-Vi.y,Vi.x,0,-Hi.y,Hi.x,0,-Wi.y,Wi.x,0];return!!Ji(e,Gi,Qi,ji,Zi)&&(e=[1,0,0,0,1,0,0,0,1],!!Ji(e,Gi,Qi,ji,Zi)&&(Yi.crossVectors(Vi,Hi),e=[Yi.x,Yi.y,Yi.z],Ji(e,Gi,Qi,ji,Zi)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Fi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Fi).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()||(Ni[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ni[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ni[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ni[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ni[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ni[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ni[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ni[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ni)),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 Ni=[new Di,new Di,new Di,new Di,new Di,new Di,new Di,new Di],Fi=new Di,zi=new Ui,Gi=new Di,Qi=new Di,ji=new Di,Vi=new Di,Hi=new Di,Wi=new Di,qi=new Di,Zi=new Di,Yi=new Di,Xi=new Di;function Ji(t,e,r,i,n){for(let s=0,o=t.length-3;s<=o;s+=3){Xi.fromArray(t,s);const o=n.x*Math.abs(Xi.x)+n.y*Math.abs(Xi.y)+n.z*Math.abs(Xi.z),a=e.dot(Xi),l=r.dot(Xi),c=i.dot(Xi);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const Ki=new Ui,$i=new Di,tn=new Di;class en{constructor(t=new Di,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):Ki.setFromPoints(t).getCenter(r);let i=0;for(let e=0,n=t.length;ethis.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;$i.subVectors(t,this.center);const e=$i.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),r=.5*(t-this.radius);this.center.addScaledVector($i,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):(tn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint($i.copy(t.center).add(tn)),this.expandByPoint($i.copy(t.center).sub(tn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const rn=new Di,nn=new Di,sn=new Di,on=new Di,an=new Di,ln=new Di,cn=new Di;class hn{constructor(t=new Di,e=new Di(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,rn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const r=e.dot(this.direction);return r<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=rn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(rn.copy(this.origin).addScaledVector(this.direction,e),rn.distanceToSquared(t))}distanceSqToSegment(t,e,r,i){nn.copy(t).add(e).multiplyScalar(.5),sn.copy(e).sub(t).normalize(),on.copy(this.origin).sub(nn);const n=.5*t.distanceTo(e),s=-this.direction.dot(sn),o=on.dot(this.direction),a=-on.dot(sn),l=on.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*a-o,u=s*o-a,p=n*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-s*n+o)),u=h>0?-n:Math.min(Math.max(-n,-a),n),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-n,-a),n),d=u*(u+2*a)+l):(h=Math.max(0,-(s*n+o)),u=h>0?n:Math.min(Math.max(-n,-a),n),d=-h*h+u*(u+2*a)+l);else u=s>0?-n:n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(nn).addScaledVector(sn,u),d}intersectSphere(t,e){rn.subVectors(t.center,this.origin);const r=rn.dot(this.direction),i=rn.dot(rn)-r*r,n=t.radius*t.radius;if(i>n)return null;const s=Math.sqrt(n-i),o=r-s,a=r+s;return a<0?null:o<0?this.at(a,e):this.at(o,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 r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null}intersectPlane(t,e){const r=this.distanceToPlane(t);return null===r?null:this.at(r,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let r,i,n,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(r=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(r=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(n=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(n=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),r>s||n>i?null:((n>r||isNaN(r))&&(r=n),(s=0?(o=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(o=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),r>a||o>i?null:((o>r||r!=r)&&(r=o),(a=0?r:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,rn)}intersectTriangle(t,e,r,i,n){an.subVectors(e,t),ln.subVectors(r,t),cn.crossVectors(an,ln);let s,o=this.direction.dot(cn);if(o>0){if(i)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}on.subVectors(this.origin,t);const a=s*this.direction.dot(ln.crossVectors(on,ln));if(a<0)return null;const l=s*this.direction.dot(an.cross(on));if(l<0)return null;if(a+l>o)return null;const c=-s*on.dot(cn);return c<0?null:this.at(c/o,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)}}class un{constructor(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m){un.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m)}set(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=r,g[12]=i,g[1]=n,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new un).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/dn.setFromMatrixColumn(t,0).length(),n=1/dn.setFromMatrixColumn(t,1).length(),s=1/dn.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]*s,e[9]=r[9]*s,e[10]=r[10]*s,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),l=Math.sin(i),c=Math.cos(n),h=Math.sin(n);if("XYZ"===t.order){const t=s*c,r=s*h,i=o*c,n=o*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=r+i*l,e[5]=t-n*l,e[9]=-o*a,e[2]=n-t*l,e[6]=i+r*l,e[10]=s*a}else if("YXZ"===t.order){const t=a*c,r=a*h,i=l*c,n=l*h;e[0]=t+n*o,e[4]=i*o-r,e[8]=s*l,e[1]=s*h,e[5]=s*c,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*c,r=a*h,i=l*c,n=l*h;e[0]=t-n*o,e[4]=-s*h,e[8]=i+r*o,e[1]=r+i*o,e[5]=s*c,e[9]=n-t*o,e[2]=-s*l,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*c,r=s*h,i=o*c,n=o*h;e[0]=a*c,e[4]=i*l-r,e[8]=t*l+n,e[1]=a*h,e[5]=n*l+t,e[9]=r*l-i,e[2]=-l,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,r=s*l,i=o*a,n=o*l;e[0]=a*c,e[4]=n-t*h,e[8]=i*h+r,e[1]=h,e[5]=s*c,e[9]=-o*c,e[2]=-l*c,e[6]=r*h+i,e[10]=t-n*h}else if("XZY"===t.order){const t=s*a,r=s*l,i=o*a,n=o*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+n,e[5]=s*c,e[9]=r*h-i,e[2]=i*h-r,e[6]=o*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(fn,t,mn)}lookAt(t,e,r){const i=this.elements;return yn.subVectors(t,e),0===yn.lengthSq()&&(yn.z=1),yn.normalize(),gn.crossVectors(r,yn),0===gn.lengthSq()&&(1===Math.abs(r.z)?yn.x+=1e-4:yn.z+=1e-4,yn.normalize(),gn.crossVectors(r,yn)),gn.normalize(),An.crossVectors(yn,gn),i[0]=gn.x,i[4]=An.x,i[8]=yn.x,i[1]=gn.y,i[5]=An.y,i[9]=yn.y,i[2]=gn.z,i[6]=An.z,i[10]=yn.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],l=r[12],c=r[1],h=r[5],u=r[9],d=r[13],p=r[2],f=r[6],m=r[10],g=r[14],A=r[3],y=r[7],v=r[11],x=r[15],b=i[0],_=i[4],w=i[8],E=i[12],M=i[1],S=i[5],C=i[9],T=i[13],I=i[2],R=i[6],B=i[10],L=i[14],P=i[3],D=i[7],O=i[11],k=i[15];return n[0]=s*b+o*M+a*I+l*P,n[4]=s*_+o*S+a*R+l*D,n[8]=s*w+o*C+a*B+l*O,n[12]=s*E+o*T+a*L+l*k,n[1]=c*b+h*M+u*I+d*P,n[5]=c*_+h*S+u*R+d*D,n[9]=c*w+h*C+u*B+d*O,n[13]=c*E+h*T+u*L+d*k,n[2]=p*b+f*M+m*I+g*P,n[6]=p*_+f*S+m*R+g*D,n[10]=p*w+f*C+m*B+g*O,n[14]=p*E+f*T+m*L+g*k,n[3]=A*b+y*M+v*I+x*P,n[7]=A*_+y*S+v*R+x*D,n[11]=A*w+y*C+v*B+x*O,n[15]=A*E+y*T+v*L+x*k,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],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+n*a*h-i*l*h-n*o*u+r*l*u+i*o*d-r*a*d)+t[7]*(+e*a*d-e*l*u+n*s*u-i*s*d+i*l*c-n*a*c)+t[11]*(+e*l*h-e*o*d-n*s*h+r*s*d+n*o*c-r*l*c)+t[15]*(-i*o*c-e*a*h+e*o*u+i*s*h-r*s*u+r*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,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],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],A=h*m*l-f*u*l+f*a*d-o*m*d-h*a*g+o*u*g,y=p*u*l-c*m*l-p*a*d+s*m*d+c*a*g-s*u*g,v=c*f*l-p*h*l+p*o*d-s*f*d-c*o*g+s*h*g,x=p*h*a-c*f*a-p*o*u+s*f*u+c*o*m-s*h*m,b=e*A+r*y+i*v+n*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/b;return t[0]=A*_,t[1]=(f*u*n-h*m*n-f*i*d+r*m*d+h*i*g-r*u*g)*_,t[2]=(o*m*n-f*a*n+f*i*l-r*m*l-o*i*g+r*a*g)*_,t[3]=(h*a*n-o*u*n-h*i*l+r*u*l+o*i*d-r*a*d)*_,t[4]=y*_,t[5]=(c*m*n-p*u*n+p*i*d-e*m*d-c*i*g+e*u*g)*_,t[6]=(p*a*n-s*m*n-p*i*l+e*m*l+s*i*g-e*a*g)*_,t[7]=(s*u*n-c*a*n+c*i*l-e*u*l-s*i*d+e*a*d)*_,t[8]=v*_,t[9]=(p*h*n-c*f*n-p*r*d+e*f*d+c*r*g-e*h*g)*_,t[10]=(s*f*n-p*o*n+p*r*l-e*f*l-s*r*g+e*o*g)*_,t[11]=(c*o*n-s*h*n-c*r*l+e*h*l+s*r*d-e*o*d)*_,t[12]=x*_,t[13]=(c*f*i-p*h*i+p*r*u-e*f*u-c*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-c*o*i+c*r*a-e*h*a-s*r*u+e*o*u)*_,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 t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):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,l=n*s,c=n*o;return this.set(l*s+r,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+r,c*a-i*s,0,l*a-i*o,c*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,l=n+n,c=s+s,h=o+o,u=n*l,d=n*c,p=n*h,f=s*c,m=s*h,g=o*h,A=a*l,y=a*c,v=a*h,x=r.x,b=r.y,_=r.z;return i[0]=(1-(f+g))*x,i[1]=(d+v)*x,i[2]=(p-y)*x,i[3]=0,i[4]=(d-v)*b,i[5]=(1-(u+g))*b,i[6]=(m+A)*b,i[7]=0,i[8]=(p+y)*_,i[9]=(m-A)*_,i[10]=(1-(u+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=dn.set(i[0],i[1],i[2]).length();const s=dn.set(i[4],i[5],i[6]).length(),o=dn.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],pn.copy(this);const a=1/n,l=1/s,c=1/o;return pn.elements[0]*=a,pn.elements[1]*=a,pn.elements[2]*=a,pn.elements[4]*=l,pn.elements[5]*=l,pn.elements[6]*=l,pn.elements[8]*=c,pn.elements[9]*=c,pn.elements[10]*=c,e.setFromRotationMatrix(pn),r.x=n,r.y=s,r.z=o,this}makePerspective(t,e,r,i,n,s,o=Fr){const a=this.elements,l=2*n/(e-t),c=2*n/(r-i),h=(e+t)/(e-t),u=(r+i)/(r-i);let d,p;if(o===Fr)d=-(s+n)/(s-n),p=-2*s*n/(s-n);else{if(o!==zr)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);d=-s/(s-n),p=-s*n/(s-n)}return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,r,i,n,s,o=Fr){const a=this.elements,l=1/(e-t),c=1/(r-i),h=1/(s-n),u=(e+t)*l,d=(r+i)*c;let p,f;if(o===Fr)p=(s+n)*h,f=-2*h;else{if(o!==zr)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);p=n*h,f=-1*h}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=f,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[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 dn=new Di,pn=new un,fn=new Di(0,0,0),mn=new Di(1,1,1),gn=new Di,An=new Di,yn=new Di,vn=new un,xn=new Pi;class bn{constructor(t=0,e=0,r=0,i=bn.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],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(qr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,n)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-qr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-h,n),this._z=0);break;case"ZXY":this._x=Math.asin(qr(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-qr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(qr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,n)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-qr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-c,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 vn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(vn,e,r)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return xn.setFromEuler(this),this.setFromQuaternion(xn,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}}bn.DEFAULT_ORDER="XYZ";class _n{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(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.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),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;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(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),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),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.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,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.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(t,e,r,i,n){Un.subVectors(i,e),Nn.subVectors(r,e),Fn.subVectors(t,e);const s=Un.dot(Un),o=Un.dot(Nn),a=Un.dot(Fn),l=Nn.dot(Nn),c=Nn.dot(Fn),h=s*l-o*o;if(0===h)return n.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,p=(s*c-o*a)*u;return n.set(1-d-p,p,d)}static containsPoint(t,e,r,i){return this.getBarycoord(t,e,r,i,zn),zn.x>=0&&zn.y>=0&&zn.x+zn.y<=1}static getUV(t,e,r,i,n,s,o,a){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),this.getInterpolation(t,e,r,i,n,s,o,a)}static getInterpolation(t,e,r,i,n,s,o,a){return this.getBarycoord(t,e,r,i,zn),a.setScalar(0),a.addScaledVector(n,zn.x),a.addScaledVector(s,zn.y),a.addScaledVector(o,zn.z),a}static isFrontFacing(t,e,r,i){return Un.subVectors(r,e),Nn.subVectors(t,e),Un.cross(Nn).dot(i)<0}set(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this}setFromPointsAndIndices(t,e,r,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,r,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,i),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 Un.subVectors(this.c,this.b),Nn.subVectors(this.a,this.b),.5*Un.cross(Nn).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Zn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Zn.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,r,i,n){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),Zn.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}getInterpolation(t,e,r,i,n){return Zn.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}containsPoint(t){return Zn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Zn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const r=this.a,i=this.b,n=this.c;let s,o;Gn.subVectors(i,r),Qn.subVectors(n,r),Vn.subVectors(t,r);const a=Gn.dot(Vn),l=Qn.dot(Vn);if(a<=0&&l<=0)return e.copy(r);Hn.subVectors(t,i);const c=Gn.dot(Hn),h=Qn.dot(Hn);if(c>=0&&h<=c)return e.copy(i);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),e.copy(r).addScaledVector(Gn,s);Wn.subVectors(t,n);const d=Gn.dot(Wn),p=Qn.dot(Wn);if(p>=0&&d<=p)return e.copy(n);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(r).addScaledVector(Qn,o);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return jn.subVectors(n,i),o=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(jn,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(r).addScaledVector(Gn,s).addScaledVector(Qn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Yn={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},Xn={h:0,s:0,l:0},Jn={h:0,s:0,l:0};function Kn(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 $n{constructor(t,e,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,r)}set(t,e,r){if(void 0===e&&void 0===r){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,r);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ye){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,mi.toWorkingColorSpace(this,e),this}setRGB(t,e,r,i=mi.workingColorSpace){return this.r=t,this.g=e,this.b=r,mi.toWorkingColorSpace(this,i),this}setHSL(t,e,r,i=mi.workingColorSpace){if(t=Zr(t,1),e=qr(e,0,1),r=qr(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=Kn(n,i,t+1/3),this.g=Kn(n,i,t),this.b=Kn(n,i,t-1/3)}return mi.toWorkingColorSpace(this,i),this}setStyle(t,e=Ye){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=Ye){const r=Yn[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=gi(t.r),this.g=gi(t.g),this.b=gi(t.b),this}copyLinearToSRGB(t){return this.r=Ai(t.r),this.g=Ai(t.g),this.b=Ai(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ye){return mi.fromWorkingColorSpace(ts.copy(this),t),65536*Math.round(qr(255*ts.r,0,255))+256*Math.round(qr(255*ts.g,0,255))+Math.round(qr(255*ts.b,0,255))}getHexString(t=Ye){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=mi.workingColorSpace){mi.fromWorkingColorSpace(ts.copy(this),e);const r=ts.r,i=ts.g,n=ts.b,s=Math.max(r,i,n),o=Math.min(r,i,n);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const t=s-o;switch(l=c<=.5?t/(s+o):t/(2-s-o),s){case r:a=(i-n)/t+(i0!=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 r=t[e];if(void 0===r){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[e]=r: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 r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const r in t){const i=t[r];delete i.metadata,e.push(i)}return e}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==v&&(r.blending=this.blending),this.side!==f&&(r.side=this.side),!0===this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=!0),this.blendSrc!==P&&(r.blendSrc=this.blendSrc),this.blendDst!==D&&(r.blendDst=this.blendDst),this.blendEquation!==E&&(r.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(r.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(r.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==q&&(r.depthFunc=this.depthFunc),!1===this.depthTest&&(r.depthTest=this.depthTest),!1===this.depthWrite&&(r.depthWrite=this.depthWrite),!1===this.colorWrite&&(r.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yr&&(r.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(r.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==nr&&(r.stencilFail=this.stencilFail),this.stencilZFail!==nr&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==nr&&(r.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(r.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaHash&&(r.alphaHash=!0),!0===this.alphaToCoverage&&(r.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=!0),!0===this.forceSinglePass&&(r.forceSinglePass=!0),!0===this.wireframe&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),e){const e=i(t.textures),n=i(t.images);e.length>0&&(r.textures=e),n.length>0&&(r.images=n)}return r}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.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,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 r=null;if(null!==e){const t=e.length;r=new Array(t);for(let i=0;i!==t;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,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.alphaHash=t.alphaHash,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++}}class is extends rs{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new $n(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=K,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}}const ns=ss();function ss(){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(;0==(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;++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:r,baseTable:i,shiftTable:n,mantissaTable:s,exponentTable:o,offsetTable:a}}function os(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=qr(t,-65504,65504),ns.floatView[0]=t;const e=ns.uint32View[0],r=e>>23&511;return ns.baseTable[r]+((8388607&e)>>ns.shiftTable[r])}function as(t){const e=t>>10;return ns.uint32View[0]=ns.mantissaTable[ns.offsetTable[e]+(1023&t)]+ns.exponentTable[e],ns.floatView[0]}const ls={toHalfFloat:os,fromHalfFloat:as},cs=new Di,hs=new ei;class us{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=Cr,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Dt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=t.gpuType,this}copyAt(t,e,r){t*=this.itemSize,r*=e.itemSize;for(let i=0,n=this.itemSize;i0&&(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;e0&&(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;t0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t(t.far-t.near)**2)return}Rs.copy(n).invert(),Bs.copy(t.ray).applyMatrix4(Rs),null!==r.boundingBox&&!1===Bs.intersectsBox(r.boundingBox)||this._computeIntersections(t,e,Bs)}}_computeIntersections(t,e,r){let i;const n=this.geometry,s=this.material,o=n.index,a=n.attributes.position,l=n.attributes.uv,c=n.attributes.uv1,h=n.attributes.normal,u=n.groups,d=n.drawRange;if(null!==o)if(Array.isArray(s))for(let n=0,a=u.length;nr.far?null:{distance:c,point:Ws.clone(),object:t}}(t,e,r,i,Ds,Os,ks,Hs);if(h){n&&(Fs.fromBufferAttribute(n,a),zs.fromBufferAttribute(n,l),Gs.fromBufferAttribute(n,c),h.uv=Zn.getInterpolation(Hs,Ds,Os,ks,Fs,zs,Gs,new ei)),s&&(Fs.fromBufferAttribute(s,a),zs.fromBufferAttribute(s,l),Gs.fromBufferAttribute(s,c),h.uv1=Zn.getInterpolation(Hs,Ds,Os,ks,Fs,zs,Gs,new ei),h.uv2=h.uv1),o&&(Qs.fromBufferAttribute(o,a),js.fromBufferAttribute(o,l),Vs.fromBufferAttribute(o,c),h.normal=Zn.getInterpolation(Hs,Ds,Os,ks,Qs,js,Vs,new Di),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const t={a,b:l,c,normal:new Di,materialIndex:0};Zn.getNormal(Ds,Os,ks,t.normal),h.face=t}return h}class Ys extends Is{constructor(t=1,e=1,r=1,i=1,n=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:s};const o=this;i=Math.floor(i),n=Math.floor(n),s=Math.floor(s);const a=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,r,i,n,s,p,f,m,g,A){const y=s/m,v=p/g,x=s/2,b=p/2,_=f/2,w=m+1,E=g+1;let M=0,S=0;const C=new Di;for(let s=0;s0?1:-1,c.push(C.x,C.y,C.z),h.push(a/m),h.push(1-s/g),M+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const r={};for(const t in this.extensions)!0===this.extensions[t]&&(r[t]=!0);return Object.keys(r).length>0&&(e.extensions=r),e}}class eo extends kn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new un,this.projectionMatrix=new un,this.projectionMatrixInverse=new un,this.coordinateSystem=Fr}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}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)}}class ro extends eo{constructor(t=50,e=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=i,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*Hr*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Vr*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Hr*Math.atan(Math.tan(.5*Vr*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,r,i,n,s){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=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Vr*this.fov)/this.zoom,r=2*e,i=this.aspect*r,n=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;n+=s.offsetX*i/t,e-=s.offsetY*r/o,i*=s.width/t,r*=s.height/o}const o=this.filmOffset;0!==o&&(n+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,e,e-r,t,this.far,this.coordinateSystem),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}}const io=-90;class no extends kn{constructor(t,e,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ro(io,1,t,e);i.layers=this.layers,this.add(i);const n=new ro(io,1,t,e);n.layers=this.layers,this.add(n);const s=new ro(io,1,t,e);s.layers=this.layers,this.add(s);const o=new ro(io,1,t,e);o.layers=this.layers,this.add(o);const a=new ro(io,1,t,e);a.layers=this.layers,this.add(a);const l=new ro(io,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[r,i,n,s,o,a]=e;for(const t of e)this.remove(t);if(t===Fr)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(t!==zr)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[n,s,o,a,l,c]=this.children,h=t.getRenderTarget(),u=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;const f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0,i),t.render(e,n),t.setRenderTarget(r,1,i),t.render(e,s),t.setRenderTarget(r,2,i),t.render(e,o),t.setRenderTarget(r,3,i),t.render(e,a),t.setRenderTarget(r,4,i),t.render(e,l),r.texture.generateMipmaps=f,t.setRenderTarget(r,5,i),t.render(e,c),t.setRenderTarget(h,u,d),t.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class so extends Ei{constructor(t,e,r,i,n,s,o,a,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:ht,r,i,n,s,o,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class oo extends Ci{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const r={width:t,height:t,depth:1},i=[r,r,r,r,r,r];void 0!==e.encoding&&(hi("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===je?Ye:Ze),this.texture=new so(i,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:wt}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 r={tEquirect:{value:null}},i="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",n="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new Ys(5,5,5),o=new to({name:"CubemapFromEquirect",uniforms:Xs(r),vertexShader:i,fragmentShader:n,side:m,blending:y});o.uniforms.tEquirect.value=e;const a=new qs(s,o),l=e.minFilter;return e.minFilter===St&&(e.minFilter=wt),new no(1,10,this).update(t,a),e.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,r,i){const n=t.getRenderTarget();for(let n=0;n<6;n++)t.setRenderTarget(this,n),t.clear(e,r,i);t.setRenderTarget(n)}}const ao=new Di,lo=new Di,co=new ri;class ho{constructor(t=new Di(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,r,i){return this.normal.set(t,e,r),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,r){const i=ao.subVectors(r,e).cross(lo.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 r=t.delta(ao),i=this.normal.dot(r);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const n=-(t.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:e.copy(t.start).addScaledVector(r,n)}intersectsLine(t){const e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<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 r=e||co.getNormalMatrix(t),i=this.coplanarPoint(ao).applyMatrix4(t),n=this.normal.applyMatrix3(r).normalize();return this.constant=-i.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)}}const uo=new en,po=new Di;class fo{constructor(t=new ho,e=new ho,r=new ho,i=new ho,n=new ho,s=new ho){this.planes=[t,e,r,i,n,s]}set(t,e,r,i,n,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(r),o[3].copy(i),o[4].copy(n),o[5].copy(s),this}copy(t){const e=this.planes;for(let r=0;r<6;r++)e[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t,e=Fr){const r=this.planes,i=t.elements,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],A=i[13],y=i[14],v=i[15];if(r[0].setComponents(a-n,u-l,m-d,v-g).normalize(),r[1].setComponents(a+n,u+l,m+d,v+g).normalize(),r[2].setComponents(a+s,u+c,m+p,v+A).normalize(),r[3].setComponents(a-s,u-c,m-p,v-A).normalize(),r[4].setComponents(a-o,u-h,m-f,v-y).normalize(),e===Fr)r[5].setComponents(a+o,u+h,m+f,v+y).normalize();else{if(e!==zr)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);r[5].setComponents(o,h,f,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),uo.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),uo.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(uo)}intersectsSprite(t){return uo.center.set(0,0,0),uo.radius=.7071067811865476,uo.applyMatrix4(t.matrixWorld),this.intersectsSphere(uo)}intersectsSphere(t){const e=this.planes,r=t.center,i=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(r)0?t.max.x:t.min.x,po.y=i.normal.y>0?t.max.y:t.min.y,po.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(po)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function mo(){let t=null,e=!1,r=null,i=null;function n(e,s){r(e,s),i=t.requestAnimationFrame(n)}return{start:function(){!0!==e&&null!==r&&(i=t.requestAnimationFrame(n),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){r=t},setContext:function(e){t=e}}}function go(t,e){const r=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const r=i.get(e);r&&(t.deleteBuffer(r.buffer),i.delete(e))},update:function(e,n){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\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 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\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\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\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\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_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\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\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\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\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 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\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\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\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\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\t\t#undef SPOT_LIGHT_MAP_INDEX\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\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\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\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\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\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\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\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\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = 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\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\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\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\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\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\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\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\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\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},vo={common:{diffuse:{value:new $n(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ri},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ri}},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 ri}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ri}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ri},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ri},normalScale:{value:new ei(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ri},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ri}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ri}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ri}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new $n(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 $n(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0},uvTransform:{value:new ri}},sprite:{diffuse:{value:new $n(16777215)},opacity:{value:1},center:{value:new ei(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ri},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0}}},xo={basic:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.fog]),vertexShader:yo.meshbasic_vert,fragmentShader:yo.meshbasic_frag},lambert:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new $n(0)}}]),vertexShader:yo.meshlambert_vert,fragmentShader:yo.meshlambert_frag},phong:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new $n(0)},specular:{value:new $n(1118481)},shininess:{value:30}}]),vertexShader:yo.meshphong_vert,fragmentShader:yo.meshphong_frag},standard:{uniforms:Js([vo.common,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.roughnessmap,vo.metalnessmap,vo.fog,vo.lights,{emissive:{value:new $n(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yo.meshphysical_vert,fragmentShader:yo.meshphysical_frag},toon:{uniforms:Js([vo.common,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.gradientmap,vo.fog,vo.lights,{emissive:{value:new $n(0)}}]),vertexShader:yo.meshtoon_vert,fragmentShader:yo.meshtoon_frag},matcap:{uniforms:Js([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,{matcap:{value:null}}]),vertexShader:yo.meshmatcap_vert,fragmentShader:yo.meshmatcap_frag},points:{uniforms:Js([vo.points,vo.fog]),vertexShader:yo.points_vert,fragmentShader:yo.points_frag},dashed:{uniforms:Js([vo.common,vo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yo.linedashed_vert,fragmentShader:yo.linedashed_frag},depth:{uniforms:Js([vo.common,vo.displacementmap]),vertexShader:yo.depth_vert,fragmentShader:yo.depth_frag},normal:{uniforms:Js([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,{opacity:{value:1}}]),vertexShader:yo.meshnormal_vert,fragmentShader:yo.meshnormal_frag},sprite:{uniforms:Js([vo.sprite,vo.fog]),vertexShader:yo.sprite_vert,fragmentShader:yo.sprite_frag},background:{uniforms:{uvTransform:{value:new ri},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yo.background_vert,fragmentShader:yo.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:yo.backgroundCube_vert,fragmentShader:yo.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yo.cube_vert,fragmentShader:yo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yo.equirect_vert,fragmentShader:yo.equirect_frag},distanceRGBA:{uniforms:Js([vo.common,vo.displacementmap,{referencePosition:{value:new Di},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yo.distanceRGBA_vert,fragmentShader:yo.distanceRGBA_frag},shadow:{uniforms:Js([vo.lights,vo.fog,{color:{value:new $n(0)},opacity:{value:1}}]),vertexShader:yo.shadow_vert,fragmentShader:yo.shadow_frag}};xo.physical={uniforms:Js([xo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ri},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ri},clearcoatNormalScale:{value:new ei(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ri},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ri},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ri},sheen:{value:0},sheenColor:{value:new $n(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ri},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ri},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ri},transmissionSamplerSize:{value:new ei},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ri},attenuationDistance:{value:0},attenuationColor:{value:new $n(0)},specularColor:{value:new $n(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ri},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ri},anisotropyVector:{value:new ei},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ri}}]),vertexShader:yo.meshphysical_vert,fragmentShader:yo.meshphysical_frag};const bo={r:0,b:0,g:0};function _o(t,e,r,i,n,s,o){const a=new $n(0);let l,c,h=!0===s?0:1,u=null,d=0,p=null;function g(e,r){e.getRGB(bo,Ks(t)),i.buffers.color.setClear(bo.r,bo.g,bo.b,r,o)}return{getClearColor:function(){return a},setClearColor:function(t,e=1){a.set(t),h=e,g(a,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,g(a,h)},render:function(s,A){let y=!1,v=!0===A.isScene?A.background:null;v&&v.isTexture&&(v=(A.backgroundBlurriness>0?r:e).get(v)),null===v?g(a,h):v&&v.isColor&&(g(v,1),y=!0);const x=t.xr.getEnvironmentBlendMode();"additive"===x?i.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===x&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||y)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.mapping===ft)?(void 0===c&&(c=new qs(new Ys(1,1,1),new to({name:"BackgroundCubeMaterial",uniforms:Xs(xo.backgroundCube.uniforms),vertexShader:xo.backgroundCube.vertexShader,fragmentShader:xo.backgroundCube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,c.material.toneMapped=mi.getTransfer(v.colorSpace)!==tr,u===v&&d===v.version&&p===t.toneMapping||(c.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(void 0===l&&(l=new qs(new Ao(2,2),new to({name:"BackgroundMaterial",uniforms:Xs(xo.background.uniforms),vertexShader:xo.background.vertexShader,fragmentShader:xo.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=v,l.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,l.material.toneMapped=mi.getTransfer(v.colorSpace)!==tr,!0===v.matrixAutoUpdate&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),u===v&&d===v.version&&p===t.toneMapping||(l.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),l.layers.enableAll(),s.unshift(l,l.geometry,l.material,0,0,null))}}}function wo(t,e,r,i){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||null!==s,a={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],r=[],i=[];for(let t=0;t=0){const r=n[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===r)return!0;if(r.attribute!==i)return!0;if(i&&r.data!==i.data)return!0;o++}return c.attributesNum!==o||c.index!==i}(n,v,d,x),b&&function(t,e,r,i){const n={},s=e.attributes;let o=0;const a=r.getAttributes();for(const e in a)if(a[e].location>=0){let r=s[e];void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor));const i={};i.attribute=r,r&&r.data&&(i.data=r.data),n[e]=i,o++}c.attributes=n,c.attributesNum=o,c.index=i}(n,v,d,x)}else{const t=!0===l.wireframe;c.geometry===v.id&&c.program===d.id&&c.wireframe===t||(c.geometry=v.id,c.program=d.id,c.wireframe=t,b=!0)}null!==x&&r.update(x,t.ELEMENT_ARRAY_BUFFER),(b||h)&&(h=!1,function(n,s,o,a){if(!1===i.isWebGL2&&(n.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const l=a.attributes,c=o.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.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,l=o.itemSize,c=r.get(o);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||o.gpuType===Lt);if(o.isInterleavedBufferAttribute){const r=o.data,i=r.stride,c=o.offset;if(r.isInstancedInterleavedBuffer){for(let t=0;t0&&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 s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let o=void 0!==r.precision?r.precision:"highp";const a=n(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||e.has("WEBGL_draw_buffers"),c=!0===r.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),m=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),A=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),y=u>0,v=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const r=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:n,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:A,vertexTextures:y,floatFragmentTextures:v,floatVertexTextures:y&&v,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function So(t){const e=this;let r=null,i=0,n=!1,s=!1;const o=new ho,a=new ri,l={value:null,needsUpdate:!1};function c(t,r,i,n){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==n||null===c){const e=i+4*s,n=r.matrixWorldInverse;a.getNormalMatrix(n),(null===c||c.length0),e.numPlanes=i,e.numIntersection=0);else{const t=s?0:i,e=4*t;let n=f.clippingState||null;l.value=n,n=c(u,a,e,h);for(let t=0;t!==e;++t)n[t]=r[t];f.clippingState=n,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function Co(t){let e=new WeakMap;function r(t,e){return e===dt?t.mapping=ht:e===pt&&(t.mapping=ut),t}function i(t){const r=t.target;r.removeEventListener("dispose",i);const n=e.get(r);void 0!==n&&(e.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping;if(s===dt||s===pt){if(e.has(n))return r(e.get(n).texture,n.mapping);{const s=n.image;if(s&&s.height>0){const o=new oo(s.height/2);return o.fromEquirectangularTexture(t,n),e.set(n,o),n.addEventListener("dispose",i),r(o.texture,n.mapping)}return null}}}return n},dispose:function(){e=new WeakMap}}}class To extends eo{constructor(t=-1,e=1,r=1,i=-1,n=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=n,this.far=s,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,r,i,n,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,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),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let n=r-t,s=r+t,o=i+e,a=i-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,s=n+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(n,s,o,a,this.near,this.far,this.coordinateSystem),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}}const Io=[.125,.215,.35,.446,.526,.582],Ro=new To,Bo=new $n;let Lo=null,Po=0,Do=0;const Oo=(1+Math.sqrt(5))/2,ko=1/Oo,Uo=[new Di(1,1,1),new Di(-1,1,1),new Di(1,1,-1),new Di(-1,1,-1),new Di(0,Oo,ko),new Di(0,Oo,-ko),new Di(ko,0,Oo),new Di(-ko,0,Oo),new Di(Oo,ko,0),new Di(-Oo,ko,0)];class No{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,r=.1,i=100){Lo=this._renderer.getRenderTarget(),Po=this._renderer.getActiveCubeFace(),Do=this._renderer.getActiveMipmapLevel(),this._setSize(256);const n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(t,r,i,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=Qo(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Go(),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;tt-4?a=Io[o-t+4-1]:0===o&&(a=0),i.push(a);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,A=new Float32Array(f*p*d),y=new Float32Array(m*p*d),v=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,r,0,e+2/3,r,0,e+2/3,r+1,0,e,r,0,e+2/3,r+1,0,e,r+1,0];A.set(i,f*p*t),y.set(u,m*p*t);const n=[t,t,t,t,t,t];v.set(n,g*p*t)}const x=new Is;x.setAttribute("position",new us(A,f)),x.setAttribute("uv",new us(y,m)),x.setAttribute("faceIndex",new us(v,g)),e.push(x),n>4&&n--}return{lodPlanes:e,sizeLods:r,sigmas:i}}(i)),this._blurMaterial=function(t,e,r){const i=new Float32Array(20),n=new Di(0,1,0);return new to({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},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 \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:y,depthTest:!1,depthWrite:!1})}(i,t,e)}return i}_compileMaterial(t){const e=new qs(this._lodPlanes[0],t);this._renderer.compile(e,Ro)}_sceneToCubeUV(t,e,r,i){const n=new ro(90,1,e,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(Bo),a.toneMapping=et,a.autoClear=!1;const h=new is({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),u=new qs(new Ys,h);let d=!1;const p=t.background;p?p.isColor&&(h.color.copy(p),t.background=null,d=!0):(h.color.copy(Bo),d=!0);for(let e=0;e<6;e++){const r=e%3;0===r?(n.up.set(0,s[e],0),n.lookAt(o[e],0,0)):1===r?(n.up.set(0,0,s[e]),n.lookAt(0,o[e],0)):(n.up.set(0,s[e],0),n.lookAt(0,0,o[e]));const l=this._cubeSize;zo(i,r*l,e>2?l:0,l,l),a.setRenderTarget(i),d&&a.render(u,n),a.render(t,n)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=c,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const r=this._renderer,i=t.mapping===ht||t.mapping===ut;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Qo()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Go());const n=i?this._cubemapMaterial:this._equirectMaterial,s=new qs(this._lodPlanes[0],n);n.uniforms.envMap.value=t;const o=this._cubeSize;zo(e,0,0,3*o,2*o),r.setRenderTarget(e),r.render(s,Ro)}_applyPMREM(t){const e=this._renderer,r=e.autoClear;e.autoClear=!1;for(let e=1;e20&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,r=Math.exp(-e*e/2);m.push(r),0===t?g+=r:tA-4?i-A+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(e),a.render(c,Ro)}}function Fo(t,e,r){const i=new Ci(t,e,r);return i.texture.mapping=ft,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function zo(t,e,r,i,n){t.viewport.set(e,r,i,n),t.scissor.set(e,r,i,n)}function Go(){return new to({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 \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:y,depthTest:!1,depthWrite:!1})}function Qo(){return new to({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:y,depthTest:!1,depthWrite:!1})}function jo(t){let e=new WeakMap,r=null;function i(t){const r=t.target;r.removeEventListener("dispose",i);const n=e.get(r);void 0!==n&&(e.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping,o=s===dt||s===pt,a=s===ht||s===ut;if(o||a){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let i=e.get(n);return null===r&&(r=new No(t)),i=o?r.fromEquirectangular(n,i):r.fromCubemap(n,i),e.set(n,i),i.texture}if(e.has(n))return e.get(n).texture;{const s=n.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;for(let r=0;r<6;r++)void 0!==t[r]&&e++;return 6===e}(s)){null===r&&(r=new No(t));const s=o?r.fromEquirectangular(n):r.fromCubemap(n);return e.set(n,s),n.addEventListener("dispose",i),s.texture}return null}}}return n},dispose:function(){e=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function Vo(t){const e={};function r(r){if(void 0!==e[r])return e[r];let i;switch(r){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(r)}return e[r]=i,i}return{has:function(t){return null!==r(t)},init:function(t){t.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture")},get:function(t){const e=r(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Ho(t,e,r,i){const n={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);for(const t in a.morphAttributes){const r=a.morphAttributes[t];for(let t=0,i=r.length;te.maxTextureSize&&(M=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const S=new Float32Array(E*M*4*p),C=new Ti(S,E,M,p);C.type=Dt,C.needsUpdate=!0;const T=4*w;for(let R=0;R0)return t;const n=e*r;let s=na[n];if(void 0===s&&(s=new Float32Array(n),na[n]=s),0!==e){i.toArray(s,0);for(let i=1,n=0;i!==e;++i)n+=r,t[i].toArray(s,n)}return s}function ha(t,e){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r":" "} ${n}: ${r[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return n}function ll(t,e){const r=function(t){const e=mi.getPrimaries(mi.workingColorSpace),r=mi.getPrimaries(t);let i;switch(e===r?i="":e===rr&&r===er?i="LinearDisplayP3ToLinearSRGB":e===er&&r===rr&&(i="LinearSRGBToLinearDisplayP3"),t){case Xe:case Ke:return[i,"LinearTransferOETF"];case Ye:case Je:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${r[0]}( ${r[1]}( value ) ); }`}function cl(t,e){let r;switch(e){case rt:r="Linear";break;case it:r="Reinhard";break;case nt:r="OptimizedCineon";break;case st:r="ACESFilmic";break;case ot:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),r="Linear"}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function hl(t){return""!==t}function ul(t,e){const r=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,r).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 dl(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const pl=/^[ \t]*#include +<([\w\d./]+)>/gm;function fl(t){return t.replace(pl,gl)}const ml=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function gl(t,e){let r=yo[e];if(void 0===r){const t=ml.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");r=yo[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return fl(r)}const Al=/#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 yl(t){return t.replace(Al,vl)}function vl(t,e,r,i){let n="";for(let t=parseInt(e);t0&&(v+="\n"),x=[g,"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A].filter(hl).join("\n"),x.length>0&&(x+="\n")):(v=[xl(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.batching?"#define USE_BATCHING":"",r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.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(hl).join("\n"),x=[g,xl(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+h:"",r.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==et?"#define TONE_MAPPING":"",r.toneMapping!==et?yo.tonemapping_pars_fragment:"",r.toneMapping!==et?cl("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",yo.colorspace_pars_fragment,ll("linearToOutputTexel",r.outputColorSpace),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(hl).join("\n")),o=fl(o),o=ul(o,r),o=dl(o,r),a=fl(a),a=ul(a,r),a=dl(a,r),o=yl(o),a=yl(a),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(b="#version 300 es\n",v=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,x=["precision mediump sampler2DArray;","#define varying in",r.glslVersion===Ur?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===Ur?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const _=b+v+o,w=b+x+a,E=nl(n,n.VERTEX_SHADER,_),M=nl(n,n.FRAGMENT_SHADER,w);function S(e){if(t.debug.checkShaderErrors){const r=n.getProgramInfoLog(y).trim(),i=n.getShaderInfoLog(E).trim(),s=n.getShaderInfoLog(M).trim();let o=!0,a=!0;if(!1===n.getProgramParameter(y,n.LINK_STATUS))if(o=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(n,y,E,M);else{const t=al(n,E,"vertex"),e=al(n,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(y,n.VALIDATE_STATUS)+"\n\nProgram Info Log: "+r+"\n"+t+"\n"+e)}else""!==r?console.warn("THREE.WebGLProgram: Program Info Log:",r):""!==i&&""!==s||(a=!1);a&&(e.diagnostics={runnable:o,programLog:r,vertexShader:{log:i,prefix:v},fragmentShader:{log:s,prefix:x}})}n.deleteShader(E),n.deleteShader(M),C=new il(n,y),T=function(t,e){const r={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let n=0;n0,Y=s.clearcoat>0,X=s.iridescence>0,J=s.sheen>0,K=s.transmission>0,$=Z&&!!s.anisotropyMap,tt=Y&&!!s.clearcoatMap,rt=Y&&!!s.clearcoatNormalMap,it=Y&&!!s.clearcoatRoughnessMap,nt=X&&!!s.iridescenceMap,st=X&&!!s.iridescenceThicknessMap,ot=J&&!!s.sheenColorMap,at=J&&!!s.sheenRoughnessMap,lt=!!s.specularMap,ct=!!s.specularColorMap,ht=!!s.specularIntensityMap,ut=K&&!!s.transmissionMap,dt=K&&!!s.thicknessMap,pt=!!s.gradientMap,mt=!!s.alphaMap,gt=s.alphaTest>0,At=!!s.alphaHash,yt=!!s.extensions,vt=!!_.attributes.uv1,xt=!!_.attributes.uv2,bt=!!_.attributes.uv3;let _t=et;return s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(_t=t.toneMapping)),{isWebGL2:h,shaderID:S,shaderType:s.type,shaderName:s.name,vertexShader:I,fragmentShader:R,defines:s.defines,customVertexShaderID:B,customFragmentShaderID:L,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,batching:k,instancing:O,instancingColor:O&&null!==x.instanceColor,supportsVertexTextures:d,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Xe,map:U,matcap:N,envMap:F,envMapMode:F&&E.mapping,envMapCubeUVHeight:M,aoMap:z,lightMap:G,bumpMap:Q,normalMap:j,displacementMap:d&&V,emissiveMap:H,normalMapObjectSpace:j&&s.normalMapType===qe,normalMapTangentSpace:j&&s.normalMapType===We,metalnessMap:W,roughnessMap:q,anisotropy:Z,anisotropyMap:$,clearcoat:Y,clearcoatMap:tt,clearcoatNormalMap:rt,clearcoatRoughnessMap:it,iridescence:X,iridescenceMap:nt,iridescenceThicknessMap:st,sheen:J,sheenColorMap:ot,sheenRoughnessMap:at,specularMap:lt,specularColorMap:ct,specularIntensityMap:ht,transmission:K,transmissionMap:ut,thicknessMap:dt,gradientMap:pt,opaque:!1===s.transparent&&s.blending===v,alphaMap:mt,alphaTest:gt,alphaHash:At,combine:s.combine,mapUv:U&&A(s.map.channel),aoMapUv:z&&A(s.aoMap.channel),lightMapUv:G&&A(s.lightMap.channel),bumpMapUv:Q&&A(s.bumpMap.channel),normalMapUv:j&&A(s.normalMap.channel),displacementMapUv:V&&A(s.displacementMap.channel),emissiveMapUv:H&&A(s.emissiveMap.channel),metalnessMapUv:W&&A(s.metalnessMap.channel),roughnessMapUv:q&&A(s.roughnessMap.channel),anisotropyMapUv:$&&A(s.anisotropyMap.channel),clearcoatMapUv:tt&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:rt&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:it&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:st&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:ot&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:at&&A(s.sheenRoughnessMap.channel),specularMapUv:lt&&A(s.specularMap.channel),specularColorMapUv:ct&&A(s.specularColorMap.channel),specularIntensityMapUv:ht&&A(s.specularIntensityMap.channel),transmissionMapUv:ut&&A(s.transmissionMap.channel),thicknessMapUv:dt&&A(s.thicknessMap.channel),alphaMapUv:mt&&A(s.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(j||Z),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,vertexUv1s:vt,vertexUv2s:xt,vertexUv3s:bt,pointsUvs:!0===x.isPoints&&!!_.attributes.uv&&(U||mt),fog:!!b,useFog:!0===s.fog,fogExp2:b&&b.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:T,morphTextureStride:P,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:_t,useLegacyLights:t._useLegacyLights,decodeVideoTexture:U&&!0===s.map.isVideoTexture&&mi.getTransfer(s.map.colorSpace)===tr,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===m,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:yt&&!0===s.extensions.derivatives,extensionFragDepth:yt&&!0===s.extensions.fragDepth,extensionDrawBuffers:yt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:yt&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const r=[];if(e.shaderID?r.push(e.shaderID):(r.push(e.customVertexShaderID),r.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)r.push(t),r.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(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.anisotropyMapUv),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.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(r,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0),e.supportsVertexTextures&&a.enable(1),e.instancing&&a.enable(2),e.instancingColor&&a.enable(3),e.matcap&&a.enable(4),e.envMap&&a.enable(5),e.normalMapObjectSpace&&a.enable(6),e.normalMapTangentSpace&&a.enable(7),e.clearcoat&&a.enable(8),e.iridescence&&a.enable(9),e.alphaTest&&a.enable(10),e.vertexColors&&a.enable(11),e.vertexAlphas&&a.enable(12),e.vertexUv1s&&a.enable(13),e.vertexUv2s&&a.enable(14),e.vertexUv3s&&a.enable(15),e.vertexTangents&&a.enable(16),e.anisotropy&&a.enable(17),e.alphaHash&&a.enable(18),e.batching&&a.enable(19),t.push(a.mask),a.disableAll(),e.fog&&a.enable(0),e.useFog&&a.enable(1),e.flatShading&&a.enable(2),e.logarithmicDepthBuffer&&a.enable(3),e.skinning&&a.enable(4),e.morphTargets&&a.enable(5),e.morphNormals&&a.enable(6),e.morphColors&&a.enable(7),e.premultipliedAlpha&&a.enable(8),e.shadowMapEnabled&&a.enable(9),e.useLegacyLights&&a.enable(10),e.doubleSided&&a.enable(11),e.flipSided&&a.enable(12),e.useDepthPacking&&a.enable(13),e.dithering&&a.enable(14),e.transmission&&a.enable(15),e.sheen&&a.enable(16),e.opaque&&a.enable(17),e.pointsUvs&&a.enable(18),e.decodeVideoTexture&&a.enable(19),t.push(a.mask)}(r,e),r.push(t.outputColorSpace)),r.push(e.customProgramCacheKey),r.join()},getUniforms:function(t){const e=f[t.type];let r;if(e){const t=xo[e];r=$s.clone(t.uniforms)}else r=t.uniforms;return r},acquireProgram:function(e,r){let i;for(let t=0,e=c.length;t0?i.push(h):!0===o.transparent?n.push(h):r.push(h)},unshift:function(t,e,o,a,l,c){const h=s(t,e,o,a,l,c);o.transmission>0?i.unshift(h):!0===o.transparent?n.unshift(h):r.unshift(h)},finish:function(){for(let r=e,i=t.length;r1&&r.sort(t||Cl),i.length>1&&i.sort(e||Tl),n.length>1&&n.sort(e||Tl)}}}function Rl(){let t=new WeakMap;return{get:function(e,r){const i=t.get(e);let n;return void 0===i?(n=new Il,t.set(e,[n])):r>=i.length?(n=new Il,i.push(n)):n=i[r],n},dispose:function(){t=new WeakMap}}}function Bl(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let r;switch(e.type){case"DirectionalLight":r={direction:new Di,color:new $n};break;case"SpotLight":r={position:new Di,direction:new Di,color:new $n,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new Di,color:new $n,distance:0,decay:0};break;case"HemisphereLight":r={direction:new Di,skyColor:new $n,groundColor:new $n};break;case"RectAreaLight":r={color:new $n,position:new Di,halfWidth:new Di,halfHeight:new Di}}return t[e.id]=r,r}}}let Ll=0;function Pl(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Dl(t,e){const r=new Bl,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let r;switch(e.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ei};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ei,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=r,r}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-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,numLightProbes:0};for(let t=0;t<9;t++)n.probe.push(new Di);const s=new Di,o=new un,a=new un;return{setup:function(s,o){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,d=0,p=0,f=0,m=0,g=0,A=0,y=0,v=0,x=0;s.sort(Pl);const b=!0===o?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(n.rectAreaLTC1=vo.LTC_FLOAT_1,n.rectAreaLTC2=vo.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(n.rectAreaLTC1=vo.LTC_HALF_1,n.rectAreaLTC2=vo.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 _=n.hash;_.directionalLength===h&&_.pointLength===u&&_.spotLength===d&&_.rectAreaLength===p&&_.hemiLength===f&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===A&&_.numSpotMaps===y&&_.numLightProbes===x||(n.directional.length=h,n.spot.length=d,n.rectArea.length=p,n.point.length=u,n.hemi.length=f,n.directionalShadow.length=m,n.directionalShadowMap.length=m,n.pointShadow.length=g,n.pointShadowMap.length=g,n.spotShadow.length=A,n.spotShadowMap.length=A,n.directionalShadowMatrix.length=m,n.pointShadowMatrix.length=g,n.spotLightMatrix.length=A+y-v,n.spotLightMap.length=y,n.numSpotLightShadowsWithMaps=v,n.numLightProbes=x,_.directionalLength=h,_.pointLength=u,_.spotLength=d,_.rectAreaLength=p,_.hemiLength=f,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=A,_.numSpotMaps=y,_.numLightProbes=x,n.version=Ll++)},setupView:function(t,e){let r=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(o=new Ol(t,e),s.push(o)):o=s[n],o},dispose:function(){r=new WeakMap}}}class Ul extends rs{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ve,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}}class Nl extends rs{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 Fl(t,e,r){let i=new fo;const n=new ei,s=new ei,o=new Mi,a=new Ul({depthPacking:He}),l=new Nl,c={},h=r.maxTextureSize,d={[f]:m,[m]:f,[g]:g},A=new to({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ei},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=A.clone();v.defines.HORIZONTAL_PASS=1;const x=new Is;x.setAttribute("position",new us(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new qs(x,A),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=u;let w=this.type;function E(r,i){const s=e.update(b);A.defines.VSM_SAMPLES!==r.blurSamples&&(A.defines.VSM_SAMPLES=r.blurSamples,v.defines.VSM_SAMPLES=r.blurSamples,A.needsUpdate=!0,v.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new Ci(n.x,n.y)),A.uniforms.shadow_pass.value=r.map.texture,A.uniforms.resolution.value=r.mapSize,A.uniforms.radius.value=r.radius,t.setRenderTarget(r.mapPass),t.clear(),t.renderBufferDirect(i,null,s,A,b,null),v.uniforms.shadow_pass.value=r.mapPass.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,t.setRenderTarget(r.map),t.clear(),t.renderBufferDirect(i,null,s,v,b,null)}function M(e,r,i,n){let s=null;const o=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)s=o;else if(s=!0===i.isPointLight?l:a,t.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0){const t=s.uuid,e=r.uuid;let i=c[t];void 0===i&&(i={},c[t]=i);let n=i[e];void 0===n&&(n=s.clone(),i[e]=n),s=n}return s.visible=r.visible,s.wireframe=r.wireframe,s.side=n===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:d[r.side],s.alphaMap=r.alphaMap,s.alphaTest=r.alphaTest,s.map=r.map,s.clipShadows=r.clipShadows,s.clippingPlanes=r.clippingPlanes,s.clipIntersection=r.clipIntersection,s.displacementMap=r.displacementMap,s.displacementScale=r.displacementScale,s.displacementBias=r.displacementBias,s.wireframeLinewidth=r.wireframeLinewidth,s.linewidth=r.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial&&(t.properties.get(s).light=i),s}function S(r,n,s,o,a){if(!1===r.visible)return;if(r.layers.test(n.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&a===p)&&(!r.frustumCulled||i.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);const i=e.update(r),l=r.material;if(Array.isArray(l)){const e=i.groups;for(let c=0,h=e.length;ch||n.y>h)&&(n.x>h&&(s.x=Math.floor(h/g.x),n.x=s.x*g.x,u.mapSize.x=s.x),n.y>h&&(s.y=Math.floor(h/g.y),n.y=s.y*g.y,u.mapSize.y=s.y)),null===u.map||!0===f||!0===m){const t=this.type!==p?{minFilter:yt,magFilter:yt}:{};null!==u.map&&u.map.dispose(),u.map=new Ci(n.x,n.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const A=u.getViewportCount();for(let t=0;t=1):-1!==yt.indexOf("OpenGL ES")&&(At=parseFloat(/^OpenGL ES (\d)/.exec(yt)[1]),gt=At>=2);let vt=null,xt={};const bt=t.getParameter(t.SCISSOR_BOX),_t=t.getParameter(t.VIEWPORT),wt=(new Mi).fromArray(bt),Et=(new Mi).fromArray(_t);function Mt(e,r,n,s){const o=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;ai||t.height>i)&&(n=i/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 i=e?Jr:Math.floor,s=i(n*t.width),o=i(n*t.height);void 0===m&&(m=y(s,o));const a=r?y(s,o):m;return a.width=s,a.height=o,a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),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 Xr(t.width)&&Xr(t.height)}function b(t,e){return t.generateMipmaps&&e&&t.minFilter!==yt&&t.minFilter!==wt}function _(e){t.generateMipmap(e)}function w(r,i,n,s,o=!1){if(!1===a)return i;if(null!==r){if(void 0!==t[r])return t[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let l=i;if(i===t.RED&&(n===t.FLOAT&&(l=t.R32F),n===t.HALF_FLOAT&&(l=t.R16F),n===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RED_INTEGER&&(n===t.UNSIGNED_BYTE&&(l=t.R8UI),n===t.UNSIGNED_SHORT&&(l=t.R16UI),n===t.UNSIGNED_INT&&(l=t.R32UI),n===t.BYTE&&(l=t.R8I),n===t.SHORT&&(l=t.R16I),n===t.INT&&(l=t.R32I)),i===t.RG&&(n===t.FLOAT&&(l=t.RG32F),n===t.HALF_FLOAT&&(l=t.RG16F),n===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA){const e=o?$e:mi.getTransfer(s);n===t.FLOAT&&(l=t.RGBA32F),n===t.HALF_FLOAT&&(l=t.RGBA16F),n===t.UNSIGNED_BYTE&&(l=e===tr?t.SRGB8_ALPHA8:t.RGBA8),n===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),n===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)}return l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function E(t,e,r){return!0===b(t,r)||t.isFramebufferTexture&&t.minFilter!==yt&&t.minFilter!==wt?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===yt||e===vt||e===bt?t.NEAREST:t.LINEAR}function S(t){const e=t.target;e.removeEventListener("dispose",S),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const r=t.source,n=g.get(r);if(n){const i=n[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&T(t),0===Object.keys(n).length&&g.delete(r)}i.remove(t)}(e),e.isVideoTexture&&f.delete(e)}function C(e){const r=e.target;r.removeEventListener("dispose",C),function(e){const r=e.texture,n=i.get(e),s=i.get(r);if(void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let r=0;r0&&s.__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 k(s,e,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+n)}const B={[mt]:t.REPEAT,[gt]:t.CLAMP_TO_EDGE,[At]:t.MIRRORED_REPEAT},L={[yt]:t.NEAREST,[vt]:t.NEAREST_MIPMAP_NEAREST,[bt]:t.NEAREST_MIPMAP_LINEAR,[wt]:t.LINEAR,[Et]:t.LINEAR_MIPMAP_NEAREST,[St]:t.LINEAR_MIPMAP_LINEAR},P={[vr]:t.NEVER,[Sr]:t.ALWAYS,[xr]:t.LESS,[_r]:t.LEQUAL,[br]:t.EQUAL,[Mr]:t.GEQUAL,[wr]:t.GREATER,[Er]:t.NOTEQUAL};function D(r,s,o){if(o?(t.texParameteri(r,t.TEXTURE_WRAP_S,B[s.wrapS]),t.texParameteri(r,t.TEXTURE_WRAP_T,B[s.wrapT]),r!==t.TEXTURE_3D&&r!==t.TEXTURE_2D_ARRAY||t.texParameteri(r,t.TEXTURE_WRAP_R,B[s.wrapR]),t.texParameteri(r,t.TEXTURE_MAG_FILTER,L[s.magFilter]),t.texParameteri(r,t.TEXTURE_MIN_FILTER,L[s.minFilter])):(t.texParameteri(r,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(r,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r!==t.TEXTURE_3D&&r!==t.TEXTURE_2D_ARRAY||t.texParameteri(r,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===gt&&s.wrapT===gt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(r,t.TEXTURE_MAG_FILTER,M(s.magFilter)),t.texParameteri(r,t.TEXTURE_MIN_FILTER,M(s.minFilter)),s.minFilter!==yt&&s.minFilter!==wt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(r,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(r,t.TEXTURE_COMPARE_FUNC,P[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const o=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===yt)return;if(s.minFilter!==bt&&s.minFilter!==St)return;if(s.type===Dt&&!1===e.has("OES_texture_float_linear"))return;if(!1===a&&s.type===Ot&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(r,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,n.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function O(e,r){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",S));const n=r.source;let s=g.get(n);void 0===s&&(s={},g.set(n,s));const a=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()}(r);if(a!==e.__cacheKey){void 0===s[a]&&(s[a]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,i=!0),s[a].usedTimes++;const n=s[e.__cacheKey];void 0!==n&&(s[e.__cacheKey].usedTimes--,0===n.usedTimes&&T(r)),e.__cacheKey=a,e.__webglTexture=s[a].texture}return i}function k(e,n,o){let l=t.TEXTURE_2D;(n.isDataArrayTexture||n.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),n.isData3DTexture&&(l=t.TEXTURE_3D);const c=O(e,n),u=n.source;r.bindTexture(l,e.__webglTexture,t.TEXTURE0+o);const d=i.get(u);if(u.version!==d.__version||!0===c){r.activeTexture(t.TEXTURE0+o);const e=mi.getPrimaries(mi.workingColorSpace),i=n.colorSpace===Ze?null:mi.getPrimaries(n.colorSpace),p=n.colorSpace===Ze||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const f=function(t){return!a&&(t.wrapS!==gt||t.wrapT!==gt||t.minFilter!==yt&&t.minFilter!==wt)}(n)&&!1===x(n.image);let m=v(n.image,f,!1,h);m=Q(n,m);const g=x(m)||a,A=s.convert(n.format,n.colorSpace);let y,M=s.convert(n.type),S=w(n.internalFormat,A,M,n.colorSpace,n.isVideoTexture);D(l,n,g);const C=n.mipmaps,T=a&&!0!==n.isVideoTexture&&S!==ne,I=void 0===d.__version||!0===c,R=E(n,m,g);if(n.isDepthTexture)S=t.DEPTH_COMPONENT,a?S=n.type===Dt?t.DEPTH_COMPONENT32F:n.type===Pt?t.DEPTH_COMPONENT24:n.type===Nt?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:n.type===Dt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===jt&&S===t.DEPTH_COMPONENT&&n.type!==Bt&&n.type!==Pt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Pt,M=s.convert(n.type)),n.format===Vt&&S===t.DEPTH_COMPONENT&&(S=t.DEPTH_STENCIL,n.type!==Nt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Nt,M=s.convert(n.type))),I&&(T?r.texStorage2D(t.TEXTURE_2D,1,S,m.width,m.height):r.texImage2D(t.TEXTURE_2D,0,S,m.width,m.height,0,A,M,null));else if(n.isDataTexture)if(C.length>0&&g){T&&I&&r.texStorage2D(t.TEXTURE_2D,R,S,C[0].width,C[0].height);for(let e=0,i=C.length;e>=1,i>>=1}}else if(C.length>0&&g){T&&I&&r.texStorage2D(t.TEXTURE_2D,R,S,C[0].width,C[0].height);for(let e=0,i=C.length;e>c),i=Math.max(1,n.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?r.texImage3D(l,c,p,e,i,n.depth,0,h,u,null):r.texImage2D(l,c,p,e,i,0,h,u,null)}r.bindFramebuffer(t.FRAMEBUFFER,e),G(n)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,a,l,i.get(o).__webglTexture,0,z(n)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,a,l,i.get(o).__webglTexture,c),r.bindFramebuffer(t.FRAMEBUFFER,null)}function N(e,r,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),r.depthBuffer&&!r.stencilBuffer){let n=!0===a?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(i||G(r)){const e=r.depthTexture;e&&e.isDepthTexture&&(e.type===Dt?n=t.DEPTH_COMPONENT32F:e.type===Pt&&(n=t.DEPTH_COMPONENT24));const i=z(r);G(r)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,n,r.width,r.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,n,r.width,r.height)}else t.renderbufferStorage(t.RENDERBUFFER,n,r.width,r.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(r.depthBuffer&&r.stencilBuffer){const n=z(r);i&&!1===G(r)?t.renderbufferStorageMultisample(t.RENDERBUFFER,n,t.DEPTH24_STENCIL8,r.width,r.height):G(r)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,n,t.DEPTH24_STENCIL8,r.width,r.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,r.width,r.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===r.isWebGLMultipleRenderTargets?r.texture:[r.texture];for(let n=0;n0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function Q(t,r){const i=t.colorSpace,n=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Nr||i!==Xe&&i!==Ze&&(mi.getTransfer(i)===tr?!1===a?!0===e.has("EXT_sRGB")&&n===zt?(t.format=Nr,t.minFilter=wt,t.generateMipmaps=!1):r=vi.sRGBToLinear(r):n===zt&&s===Tt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),r}this.allocateTextureUnit=function(){const t=I;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),I+=1,t},this.resetTextureUnits=function(){I=0},this.setTexture2D=R,this.setTexture2DArray=function(e,n){const s=i.get(e);e.version>0&&s.__version!==e.version?k(s,e,n):r.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+n)},this.setTexture3D=function(e,n){const s=i.get(e);e.version>0&&s.__version!==e.version?k(s,e,n):r.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+n)},this.setTextureCube=function(e,n){const o=i.get(e);e.version>0&&o.__version!==e.version?function(e,n,o){if(6!==n.image.length)return;const l=O(e,n),h=n.source;r.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+o);const u=i.get(h);if(h.version!==u.__version||!0===l){r.activeTexture(t.TEXTURE0+o);const e=mi.getPrimaries(mi.workingColorSpace),i=n.colorSpace===Ze?null:mi.getPrimaries(n.colorSpace),d=n.colorSpace===Ze||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const p=n.isCompressedTexture||n.image[0].isCompressedTexture,f=n.image[0]&&n.image[0].isDataTexture,m=[];for(let t=0;t<6;t++)m[t]=p||f?f?n.image[t].image:n.image[t]:v(n.image[t],!1,!0,c),m[t]=Q(n,m[t]);const g=m[0],A=x(g)||a,y=s.convert(n.format,n.colorSpace),M=s.convert(n.type),S=w(n.internalFormat,y,M,n.colorSpace),C=a&&!0!==n.isVideoTexture,T=void 0===u.__version||!0===l;let I,R=E(n,g,A);if(D(t.TEXTURE_CUBE_MAP,n,A),p){C&&T&&r.texStorage2D(t.TEXTURE_CUBE_MAP,R,S,g.width,g.height);for(let e=0;e<6;e++){I=m[e].mipmaps;for(let i=0;i0&&R++,r.texStorage2D(t.TEXTURE_CUBE_MAP,R,S,m[0].width,m[0].height));for(let e=0;e<6;e++)if(f){C?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,m[e].width,m[e].height,y,M,m[e].data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,m[e].width,m[e].height,0,y,M,m[e].data);for(let i=0;i0){c.__webglFramebuffer[e]=[];for(let r=0;r0){c.__webglFramebuffer=[];for(let e=0;e0&&!1===G(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],r.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let r=0;r0)for(let i=0;i0)for(let r=0;r0&&!1===G(e)){const n=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,o=e.height;let a=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;ea+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&o<=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,r),null!==n&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,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!==o&&(i=e.getPose(t.targetRaySpace,r),null===i&&null!==n&&(i=n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Hl)))}return null!==o&&(o.visible=null!==i),null!==a&&(a.visible=null!==n),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const r=new Vl;r.matrixAutoUpdate=!1,r.visible=!1,t.joints[e.jointName]=r,t.add(r)}return t.joints[e.jointName]}}class ql extends Gr{constructor(t,e){super();const r=this;let i=null,n=1,s=null,o="local-floor",a=1,l=null,c=null,h=null,u=null,d=null,p=null;const f=e.getContextAttributes();let m=null,g=null;const A=[],y=[],v=new ei;let x=null;const b=new ro;b.layers.enable(1),b.viewport=new Mi;const _=new ro;_.layers.enable(2),_.viewport=new Mi;const w=[b,_],E=new jl;E.layers.enable(1),E.layers.enable(2);let M=null,S=null;function C(t){const e=y.indexOf(t.inputSource);if(-1===e)return;const r=A[e];void 0!==r&&(r.update(t.inputSource,t.frame,l||s),r.dispatchEvent({type:t.type,data:t.inputSource}))}function T(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",T),i.removeEventListener("inputsourceschange",I);for(let t=0;t=0&&(y[i]=null,A[i].disconnect(r))}for(let e=0;e=y.length){y.push(r),i=t;break}if(null===y[t]){y[t]=r,i=t;break}}if(-1===i)break}const n=A[i];n&&n.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getGripSpace()},this.getHand=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){n=t,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(m=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",T),i.addEventListener("inputsourceschange",I),!0!==f.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(v),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const r={antialias:void 0!==i.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:n};d=new XRWebGLLayer(i,e,r),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),g=new Ci(d.framebufferWidth,d.framebufferHeight,{format:zt,type:Tt,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil})}else{let r=null,s=null,o=null;f.depth&&(o=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,r=f.stencil?Vt:jt,s=f.stencil?Nt:Pt);const a={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:n};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(a),i.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),g=new Ci(u.textureWidth,u.textureHeight,{format:zt,type:Tt,depthTexture:new Ko(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0}),t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(a),l=null,s=await i.requestReferenceSpace(o),D.setContext(i),D.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const R=new Di,B=new Di;function L(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===i)return;E.near=_.near=b.near=t.near,E.far=_.far=b.far=t.far,M===E.near&&S===E.far||(i.updateRenderState({depthNear:E.near,depthFar:E.far}),M=E.near,S=E.far);const e=t.parent,r=E.cameras;L(E,e);for(let t=0;t0&&(i.alphaTest.value=n.alphaTest);const s=e.get(n).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*e,r(n.lightMap,i.lightMapTransform)}n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity,r(n.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,r){r.color.getRGB(e.fogColor.value,Ks(t)),r.isFog?(e.fogNear.value=r.near,e.fogFar.value=r.far):r.isFogExp2&&(e.fogDensity.value=r.density)},refreshMaterialUniforms:function(t,n,s,o,a){n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(t,n):n.isMeshToonMaterial?(i(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,n)):n.isMeshPhongMaterial?(i(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,n)):n.isMeshStandardMaterial?(i(t,n),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,r(i.metalnessMap,t.metalnessMapTransform)),t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,r(i.roughnessMap,t.roughnessMapTransform));e.get(i).envMap&&(t.envMapIntensity.value=i.envMapIntensity)}(t,n),n.isMeshPhysicalMaterial&&function(t,e,i){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,r(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,r(e.sheenRoughnessMap,t.sheenRoughnessMapTransform))),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,r(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,r(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,r(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===m&&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,r(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,r(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform))),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,r(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,r(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,r(e.anisotropyMap,t.anisotropyMapTransform))),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,r(e.specularColorMap,t.specularColorMapTransform)),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,r(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,n,a)):n.isMeshMatcapMaterial?(i(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,n)):n.isMeshDepthMaterial?i(t,n):n.isMeshDistanceMaterial?(i(t,n),function(t,r){const i=e.get(r).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,n)):n.isMeshNormalMaterial?i(t,n):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,r(e.map,t.mapTransform))}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map,r(e.map,t.uvTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap,r(e.alphaMap,t.alphaMapTransform)),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,n,s,o):n.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,r(e.map,t.mapTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap,r(e.alphaMap,t.alphaMapTransform)),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Yl(t,e,r,i){let n={},s={},o=[];const a=r.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,r){const i=t.value;if(void 0===r[e]){if("number"==typeof i)r[e]=i;else{const t=Array.isArray(i)?i:[i],n=[];for(let e=0;e0&&(i=r%16,0!==i&&16-i-s.boundary<0&&(r+=16-i,n.__offset=r)),r+=s.storage}i=r%16,i>0&&(r+=16-i),t.__size=r,t.__cache={}}(r),d=function(e){const r=function(){for(let t=0;t0),u=!!r.morphAttributes.position,d=!!r.morphAttributes.normal,p=!!r.morphAttributes.color;let f=et;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=_.toneMapping));const m=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,g=void 0!==m?m.length:0,A=rt.get(i),y=v.state.lights;if(!0===j&&(!0===V||t!==T)){const e=t===T&&i.id===C;pt.setState(i,t,e)}let x=!1;i.version===A.__version?A.needsLights&&A.lightsStateVersion!==y.state.version||A.outputColorSpace!==a||n.isBatchedMesh&&!1===A.batching?x=!0:n.isBatchedMesh||!0!==A.batching?n.isInstancedMesh&&!1===A.instancing?x=!0:n.isInstancedMesh||!0!==A.instancing?n.isSkinnedMesh&&!1===A.skinning?x=!0:n.isSkinnedMesh||!0!==A.skinning?n.isInstancedMesh&&!0===A.instancingColor&&null===n.instanceColor||n.isInstancedMesh&&!1===A.instancingColor&&null!==n.instanceColor||A.envMap!==l||!0===i.fog&&A.fog!==s?x=!0:void 0===A.numClippingPlanes||A.numClippingPlanes===pt.numPlanes&&A.numIntersection===pt.numIntersection?(A.vertexAlphas!==c||A.vertexTangents!==h||A.morphTargets!==u||A.morphNormals!==d||A.morphColors!==p||A.toneMapping!==f||!0===K.isWebGL2&&A.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,A.__version=i.version);let b=A.currentProgram;!0===x&&(b=Kt(i,e,n));let w=!1,E=!1,M=!1;const I=b.getUniforms(),R=A.uniforms;if($.useProgram(b.program)&&(w=!0,E=!0,M=!0),i.id!==C&&(C=i.id,E=!0),w||T!==t){I.setValue(_t,"projectionMatrix",t.projectionMatrix),I.setValue(_t,"viewMatrix",t.matrixWorldInverse);const e=I.map.cameraPosition;void 0!==e&&e.setValue(_t,Z.setFromMatrixPosition(t.matrixWorld)),K.logarithmicDepthBuffer&&I.setValue(_t,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&I.setValue(_t,"isOrthographic",!0===t.isOrthographicCamera),T!==t&&(T=t,E=!0,M=!0)}if(n.isSkinnedMesh){I.setOptional(_t,n,"bindMatrix"),I.setOptional(_t,n,"bindMatrixInverse");const t=n.skeleton;t&&(K.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),I.setValue(_t,"boneTexture",t.boneTexture,it)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}n.isBatchedMesh&&(I.setOptional(_t,n,"batchingTexture"),I.setValue(_t,"batchingTexture",n._matricesTexture,it));const B=r.morphAttributes;var L,P;if((void 0!==B.position||void 0!==B.normal||void 0!==B.color&&!0===K.isWebGL2)&>.update(n,r,b),(E||A.receiveShadow!==n.receiveShadow)&&(A.receiveShadow=n.receiveShadow,I.setValue(_t,"receiveShadow",n.receiveShadow)),i.isMeshGouraudMaterial&&null!==i.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),E&&(I.setValue(_t,"toneMappingExposure",_.toneMappingExposure),A.needsLights&&(P=M,(L=R).ambientLightColor.needsUpdate=P,L.lightProbe.needsUpdate=P,L.directionalLights.needsUpdate=P,L.directionalLightShadows.needsUpdate=P,L.pointLights.needsUpdate=P,L.pointLightShadows.needsUpdate=P,L.spotLights.needsUpdate=P,L.spotLightShadows.needsUpdate=P,L.rectAreaLights.needsUpdate=P,L.hemisphereLights.needsUpdate=P),s&&!0===i.fog&&ht.refreshFogUniforms(R,s),ht.refreshMaterialUniforms(R,i,k,O,H),il.upload(_t,$t(A),R,it)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(il.upload(_t,$t(A),R,it),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&I.setValue(_t,"center",n.center),I.setValue(_t,"modelViewMatrix",n.modelViewMatrix),I.setValue(_t,"normalMatrix",n.normalMatrix),I.setValue(_t,"modelMatrix",n.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,r=t.length;e{function r(){i.forEach((function(t){rt.get(t).currentProgram.isReady()&&i.delete(t)})),0!==i.size?setTimeout(r,10):e(t)}null!==J.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)}))};let Gt=null;function Qt(){Vt.stop()}function jt(){Vt.start()}const Vt=new mo;function Ht(t,e,r,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)r=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Q.intersectsSprite(t)){i&&Z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(W);const e=lt.update(t),n=t.material;n.visible&&y.push(t,e,n,r,Z.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Q.intersectsObject(t))){const e=lt.update(t),n=t.material;if(i&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),Z.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),Z.copy(e.boundingSphere.center)),Z.applyMatrix4(t.matrixWorld).applyMatrix4(W)),Array.isArray(n)){const i=e.groups;for(let s=0,o=i.length;s0&&function(t,e,r,i){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;const n=K.isWebGL2;null===H&&(H=new Ci(1,1,{generateMipmaps:!0,type:J.has("EXT_color_buffer_half_float")?Ot:Tt,minFilter:St,samples:n?4:0})),_.getDrawingBufferSize(q),n?H.setSize(q.x,q.y):H.setSize(Jr(q.x),Jr(q.y));const s=_.getRenderTarget();_.setRenderTarget(H),_.getClearColor(L),P=_.getClearAlpha(),P<1&&_.setClearColor(16777215,.5),_.clear();const o=_.toneMapping;_.toneMapping=et,Xt(t,r,i),it.updateMultisampleRenderTarget(H),it.updateRenderTargetMipmap(H);let a=!1;for(let t=0,n=e.length;t0&&Xt(n,e,r),s.length>0&&Xt(s,e,r),o.length>0&&Xt(o,e,r),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function Xt(t,e,r){const i=!0===e.isScene?e.overrideMaterial:null;for(let n=0,s=t.length;n0?b[b.length-1]:null,x.pop(),y=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,r){rt.get(t.texture).__webglTexture=e,rt.get(t.depthTexture).__webglTexture=r;const i=rt.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===r,i.__autoAllocateDepthBuffer||!0===J.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const r=rt.get(t);r.__webglFramebuffer=e,r.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,r=0){S=t,E=e,M=r;let i=!0,n=null,s=!1,o=!1;if(t){const a=rt.get(t);void 0!==a.__useDefaultFramebuffer?($.bindFramebuffer(_t.FRAMEBUFFER,null),i=!1):void 0===a.__webglFramebuffer?it.setupRenderTarget(t):a.__hasExternalTextures&&it.rebindTextures(t,rt.get(t.texture).__webglTexture,rt.get(t.depthTexture).__webglTexture);const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=rt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=Array.isArray(c[e])?c[e][r]:c[e],s=!0):n=K.isWebGL2&&t.samples>0&&!1===it.useMultisampledRTT(t)?rt.get(t).__webglMultisampledFramebuffer:Array.isArray(c)?c[r]:c,I.copy(t.viewport),R.copy(t.scissor),B=t.scissorTest}else I.copy(F).multiplyScalar(k).floor(),R.copy(z).multiplyScalar(k).floor(),B=G;if($.bindFramebuffer(_t.FRAMEBUFFER,n)&&K.drawBuffers&&i&&$.drawBuffers(t,n),$.viewport(I),$.scissor(R),$.setScissorTest(B),s){const i=rt.get(t.texture);_t.framebufferTexture2D(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,_t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,r)}else if(o){const i=rt.get(t.texture),n=e||0;_t.framebufferTextureLayer(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,i.__webglTexture,r||0,n)}C=-1},this.readRenderTargetPixels=function(t,e,r,i,n,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=rt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){$.bindFramebuffer(_t.FRAMEBUFFER,a);try{const o=t.texture,a=o.format,l=o.type;if(a!==zt&&vt.convert(a)!==_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Ot&&(J.has("EXT_color_buffer_half_float")||K.isWebGL2&&J.has("EXT_color_buffer_float"));if(!(l===Tt||vt.convert(l)===_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_TYPE)||l===Dt&&(K.isWebGL2||J.has("OES_texture_float")||J.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&r>=0&&r<=t.height-n&&_t.readPixels(e,r,i,n,vt.convert(a),vt.convert(l),s)}finally{const t=null!==S?rt.get(S).__webglFramebuffer:null;$.bindFramebuffer(_t.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,r=0){const i=Math.pow(2,-r),n=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);it.setTexture2D(e,0),_t.copyTexSubImage2D(_t.TEXTURE_2D,r,0,0,t.x,t.y,n,s),$.unbindTexture()},this.copyTextureToTexture=function(t,e,r,i=0){const n=e.image.width,s=e.image.height,o=vt.convert(r.format),a=vt.convert(r.type);it.setTexture2D(r,0),_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,r.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,r.unpackAlignment),e.isDataTexture?_t.texSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,n,s,o,a,e.image.data):e.isCompressedTexture?_t.compressedTexSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):_t.texSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,o,a,e.image),0===i&&r.generateMipmaps&&_t.generateMipmap(_t.TEXTURE_2D),$.unbindTexture()},this.copyTextureToTexture3D=function(t,e,r,i,n=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=vt.convert(i.format),c=vt.convert(i.type);let h;if(i.isData3DTexture)it.setTexture3D(i,0),h=_t.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");it.setTexture2DArray(i,0),h=_t.TEXTURE_2D_ARRAY}_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,i.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,i.unpackAlignment);const u=_t.getParameter(_t.UNPACK_ROW_LENGTH),d=_t.getParameter(_t.UNPACK_IMAGE_HEIGHT),p=_t.getParameter(_t.UNPACK_SKIP_PIXELS),f=_t.getParameter(_t.UNPACK_SKIP_ROWS),m=_t.getParameter(_t.UNPACK_SKIP_IMAGES),g=r.isCompressedTexture?r.mipmaps[0]:r.image;_t.pixelStorei(_t.UNPACK_ROW_LENGTH,g.width),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,g.height),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,t.min.x),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,t.min.y),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,t.min.z),r.isDataTexture||r.isData3DTexture?_t.texSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,c,g.data):r.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),_t.compressedTexSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,g.data)):_t.texSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,c,g),_t.pixelStorei(_t.UNPACK_ROW_LENGTH,u),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,d),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,p),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,f),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,m),0===n&&i.generateMipmaps&&_t.generateMipmap(h),$.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?it.setTextureCube(t,0):t.isData3DTexture?it.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?it.setTexture2DArray(t,0):it.setTexture2D(t,0),$.unbindTexture()},this.resetState=function(){E=0,M=0,S=null,$.reset(),xt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Fr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===Je?"display-p3":"srgb",e.unpackColorSpace=mi.workingColorSpace===Ke?"display-p3":"srgb"}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===Ye?je:Qe}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===je?Ye:Xe}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class Jl extends Xl{}Jl.prototype.isWebGL1Renderer=!0;class Kl{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new $n(t),this.density=e}clone(){return new Kl(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class $l{constructor(t,e=1,r=1e3){this.isFog=!0,this.name="",this.color=new $n(t),this.near=e,this.far=r}clone(){return new $l(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class tc extends kn{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}}class ec{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Cr,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Wr()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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;it.far||e.push({distance:a,point:oc.clone(),uv:Zn.getInterpolation(oc,dc,pc,fc,mc,gc,Ac,new ei),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function vc(t,e,r,i,n,s){cc.subVectors(t,r).addScalar(.5).multiply(i),void 0!==n?(hc.x=s*cc.x-n*cc.y,hc.y=n*cc.x+s*cc.y):hc.copy(cc),t.copy(e),t.x+=hc.x,t.y+=hc.y,t.applyMatrix4(uc)}const xc=new Di,bc=new Di;class _c extends kn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,r=e.length;t0){let r,i;for(r=1,i=e.length;r0){xc.setFromMatrixPosition(this.matrixWorld);const r=t.ray.origin.distanceTo(xc);this.getObjectForDistance(r).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){xc.setFromMatrixPosition(t.matrixWorld),bc.setFromMatrixPosition(this.matrixWorld);const r=xc.distanceTo(bc)/t.zoom;let i,n;for(e[0].object.visible=!0,i=1,n=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;i=r.length&&r.push({start:-1,count:-1,z:-1});const n=r[this.index];i.push(n),this.index++,n.start=t.start,n.count=t.count,n.z=e}reset(){this.list.length=0,this.index=0}}const Xc="batchId",Jc=new un,Kc=new un,$c=new un,th=new un,eh=new fo,rh=new Ui,ih=new en,nh=new Di,sh=new Yc,oh=new qs,ah=[];function lh(t,e,r=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const n=t.count;for(let s=0;s65536?new Uint32Array(n):new Uint16Array(n);e.setIndex(new us(t,1))}const s=i>65536?new Uint32Array(r):new Uint16Array(r);e.setAttribute(Xc,new us(s,1)),this._geometryInitialized=!0}}_validateGeometry(t){if(t.getAttribute(Xc))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Xc}"`);const e=this.geometry;if(Boolean(t.getIndex())!==Boolean(e.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in e.attributes){if(r===Xc)continue;if(!t.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=t.getAttribute(r),n=e.getAttribute(r);if(i.itemSize!==n.itemSize||i.normalized!==n.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ui);const t=this._geometryCount,e=this.boundingBox,r=this._active;e.makeEmpty();for(let i=0;i=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let n=null;const s=this._reservedRanges,o=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(n=s[s.length-1]),i.vertexCount=-1===e?t.getAttribute("position").count:e,i.vertexStart=null===n?0:n.vertexStart+n.vertexCount;const l=t.getIndex(),c=null!==l;if(c&&(i.indexCount=-1===r?l.count:r,i.indexStart=null===n?0:n.indexStart+n.indexCount),-1!==i.indexStart&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,u=this._active,d=this._matricesTexture,p=this._matricesTexture.image.data;h.push(!0),u.push(!0);const f=this._geometryCount;this._geometryCount++,$c.toArray(p,16*f),d.needsUpdate=!0,s.push(i),o.push({start:c?i.indexStart:i.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Ui,sphereInitialized:!1,sphere:new en});const m=this.geometry.getAttribute(Xc);for(let t=0;t=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const r=this.geometry,i=null!==r.getIndex(),n=r.getIndex(),s=e.getIndex(),o=this._reservedRanges[t];if(i&&s.count>o.indexCount||e.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=o.vertexStart,l=o.vertexCount;for(const t in r.attributes){if(t===Xc)continue;const i=e.getAttribute(t),n=r.getAttribute(t);lh(i,n,a);const s=i.itemSize;for(let t=i.count,e=l;t=e.length||!1===e[t]||(e[t]=!1,this._visibilityChanged=!0),this}getBoundingBoxAt(t,e){if(!1===this._active[t])return this;const r=this._bounds[t],i=r.box,n=this.geometry;if(!1===r.boxInitialized){i.makeEmpty();const e=n.index,s=n.attributes.position,o=this._drawRanges[t];for(let t=o.start,r=o.start+o.count;t=this._geometryCount||!1===r[t]||(e.toArray(n,16*t),i.needsUpdate=!0),this}getMatrixAt(t,e){const r=this._active,i=this._matricesTexture.image.data;return t>=this._geometryCount||!1===r[t]?null:e.fromArray(i,16*t)}setVisibleAt(t,e){const r=this._visibility,i=this._active;return t>=this._geometryCount||!1===i[t]||r[t]===e||(r[t]=e,this._visibilityChanged=!0),this}getVisibleAt(t){const e=this._visibility,r=this._active;return!(t>=this._geometryCount||!1===r[t])&&e[t]}raycast(t,e){const r=this._visibility,i=this._active,n=this._drawRanges,s=this._geometryCount,o=this.matrixWorld,a=this.geometry;oh.material=this.material,oh.geometry.index=a.index,oh.geometry.attributes=a.attributes,null===oh.geometry.boundingBox&&(oh.geometry.boundingBox=new Ui),null===oh.geometry.boundingSphere&&(oh.geometry.boundingSphere=new en);for(let a=0;a({...t}))),this._reservedRanges=t._reservedRanges.map((t=>({...t}))),this._visibility=t._visibility.slice(),this._active=t._active.slice(),this._bounds=t._bounds.map((t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()}))),this._maxGeometryCount=t._maxGeometryCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(t,e,r,i,n){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),o=null===s?1:s.array.BYTES_PER_ELEMENT,a=this._visibility,l=this._multiDrawStarts,c=this._multiDrawCounts,h=this._drawRanges,u=this.perObjectFrustumCulled;u&&(th.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),eh.setFromProjectionMatrix(th,t.isWebGPURenderer?zr:Fr));let d=0;if(this.sortObjects){Kc.copy(this.matrixWorld).invert(),nh.setFromMatrixPosition(r.matrixWorld).applyMatrix4(Kc);for(let t=0,e=a.length;ta)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}else for(let r=Math.max(0,s.start),i=Math.min(f.count,s.start+s.count)-1;ra)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;tn.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:r,index:e,face:null,object:o})}}class Th extends Ei{constructor(t,e,r,i,n,s,o,a,l){super(t,e,r,i,n,s,o,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:wt,this.magFilter=void 0!==n?n:wt,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Ih extends Ei{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=yt,this.minFilter=yt,this.generateMipmaps=!1,this.needsUpdate=!0}}class Rh extends Ei{constructor(t,e,r,i,n,s,o,a,l,c,h,u){super(null,s,o,a,l,c,i,n,h,u),this.isCompressedTexture=!0,this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Bh extends Rh{constructor(t,e,r,i,n,s){super(t,e,r,n,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=gt}}class Lh extends Rh{constructor(t,e,r){super(void 0,t[0].width,t[0].height,e,r,ht),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class Ph extends Ei{constructor(t,e,r,i,n,s,o,a,l){super(t,e,r,i,n,s,o,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Dh{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const r=this.getUtoTmapping(t);return this.getPoint(r,e)}getPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return e}getSpacedPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPointAt(r/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 r,i=this.getPoint(0),n=0;e.push(0);for(let s=1;s<=t;s++)r=this.getPoint(s/t),n+=r.distanceTo(i),e.push(n),i=r;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const r=this.getLengths();let i=0;const n=r.length;let s;s=e||t*r[n-1];let o,a=0,l=n-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),o=r[i]-s,o<0)a=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(i=l,r[i]===s)return i/(n-1);const c=r[i];return(i+(s-c)/(r[i+1]-c))/(n-1)}getTangent(t,e){const r=1e-4;let i=t-r,n=t+r;i<0&&(i=0),n>1&&(n=1);const s=this.getPoint(i),o=this.getPoint(n),a=e||(s.isVector2?new ei:new Di);return a.copy(o).sub(s).normalize(),a}getTangentAt(t,e){const r=this.getUtoTmapping(t);return this.getTangent(r,e)}computeFrenetFrames(t,e){const r=new Di,i=[],n=[],s=[],o=new Di,a=new un;for(let e=0;e<=t;e++){const r=e/t;i[e]=this.getTangentAt(r,new Di)}n[0]=new Di,s[0]=new Di;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,r.set(1,0,0)),h<=l&&(l=h,r.set(0,1,0)),u<=l&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),n[0].crossVectors(i[0],o),s[0].crossVectors(i[0],n[0]);for(let e=1;e<=t;e++){if(n[e]=n[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(i[e-1],i[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(qr(i[e-1].dot(i[e]),-1,1));n[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(i[e],n[e])}if(!0===e){let e=Math.acos(qr(n[0].dot(n[t]),-1,1));e/=t,i[0].dot(o.crossVectors(n[0],n[t]))>0&&(e=-e);for(let r=1;r<=t;r++)n[r].applyMatrix4(a.makeRotationAxis(i[r],e*r)),s[r].crossVectors(i[r],n[r])}return{tangents:i,normals:n,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Oh extends Dh{constructor(t=0,e=0,r=1,i=1,n=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const r=e||new ei,i=2*Math.PI;let n=this.aEndAngle-this.aStartAngle;const s=Math.abs(n)i;)n-=i;n0?0:(Math.floor(Math.abs(l)/n)+1)*n:0===c&&l===n-1&&(l=n-2,c=1),this.closed||l>0?o=i[(l-1)%n]:(Nh.subVectors(i[0],i[1]).add(i[0]),o=Nh);const h=i[l%n],u=i[(l+1)%n];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return r.set(jh(o,a.x,l.x,c.x,h.x),jh(o,a.y,l.y,c.y,h.y)),r}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e=r){const t=i[n]-r,s=this.curves[n],o=s.getLength(),a=0===o?0:1-t/o;return s.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 r=0,i=this.curves.length;r1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,r=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),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}}class ru extends Is{constructor(t=[new ei(0,-.5),new ei(.5,0),new ei(0,.5)],e=12,r=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=Math.floor(e),i=qr(i,0,2*Math.PI);const n=[],s=[],o=[],a=[],l=[],c=1/e,h=new Di,u=new ei,d=new Di,p=new Di,f=new Di;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case t.length-1:a.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let n=0;n<=e;n++){const d=r+n*c*i,p=Math.sin(d),f=Math.cos(d);for(let r=0;r<=t.length-1;r++){h.x=t[r].x*p,h.y=t[r].y,h.z=t[r].x*f,s.push(h.x,h.y,h.z),u.x=n/e,u.y=r/(t.length-1),o.push(u.x,u.y);const i=a[3*r+0]*p,c=a[3*r+1],d=a[3*r+0]*f;l.push(i,c,d)}}for(let r=0;r0&&A(!0),e>0&&A(!1)),this.setIndex(c),this.setAttribute("position",new xs(h,3)),this.setAttribute("normal",new xs(u,3)),this.setAttribute("uv",new xs(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new su(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ou extends su{constructor(t=1,e=1,r=32,i=1,n=!1,s=0,o=2*Math.PI){super(0,t,e,r,i,n,s,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:i,openEnded:n,thetaStart:s,thetaLength:o}}static fromJSON(t){return new ou(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class au extends Is{constructor(t=[],e=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i};const n=[],s=[];function o(t,e,r,i){const n=i+1,s=[];for(let i=0;i<=n;i++){s[i]=[];const o=t.clone().lerp(r,i/n),a=e.clone().lerp(r,i/n),l=n-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===n?o:o.clone().lerp(a,t/l)}for(let t=0;t.9&&o<.1&&(e<.2&&(s[t+0]+=1),r<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new xs(n,3)),this.setAttribute("normal",new xs(n.slice(),3)),this.setAttribute("uv",new xs(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new au(t.vertices,t.indices,t.radius,t.details)}}class lu extends au{constructor(t=1,e=0){const r=(1+Math.sqrt(5))/2,i=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new lu(t.radius,t.detail)}}const cu=new Di,hu=new Di,uu=new Di,du=new Zn;class pu extends Is{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const r=4,i=Math.pow(10,r),n=Math.cos(Vr*e),s=t.getIndex(),o=t.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t0)for(s=e;s=e;s-=i)o=ku(s,t[s],t[s+1],o);return o&&Ru(o,o.next)&&(Uu(o),o=o.next),o}function gu(t,e){if(!t)return t;e||(e=t);let r,i=t;do{if(r=!1,i.steiner||!Ru(i,i.next)&&0!==Iu(i.prev,i,i.next))i=i.next;else{if(Uu(i),i=e=i.prev,i===i.next)break;r=!0}}while(r||i!==e);return e}function Au(t,e,r,i,n,s,o){if(!t)return;!o&&s&&function(t,e,r,i){let n=t;do{0===n.z&&(n.z=Mu(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,l,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(o>1)}(n)}(t,i,n,s);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,s?vu(t,i,n,s):yu(t))e.push(a.i/r|0),e.push(t.i/r|0),e.push(l.i/r|0),Uu(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?Au(t=xu(gu(t),e,r),e,r,i,n,s,2):2===o&&bu(t,e,r,i,n,s):Au(gu(t),e,r,i,n,s,1);break}}function yu(t){const e=t.prev,r=t,i=t.next;if(Iu(e,r,i)>=0)return!1;const n=e.x,s=r.x,o=i.x,a=e.y,l=r.y,c=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=i.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Cu(n,a,s,l,o,c,f.x,f.y)&&Iu(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function vu(t,e,r,i){const n=t.prev,s=t,o=t.next;if(Iu(n,s,o)>=0)return!1;const a=n.x,l=s.x,c=o.x,h=n.y,u=s.y,d=o.y,p=al?a>c?a:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,A=Mu(p,f,e,r,i),y=Mu(m,g,e,r,i);let v=t.prevZ,x=t.nextZ;for(;v&&v.z>=A&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==o&&Cu(a,h,l,u,c,d,v.x,v.y)&&Iu(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==o&&Cu(a,h,l,u,c,d,x.x,x.y)&&Iu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==o&&Cu(a,h,l,u,c,d,v.x,v.y)&&Iu(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==o&&Cu(a,h,l,u,c,d,x.x,x.y)&&Iu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xu(t,e,r){let i=t;do{const n=i.prev,s=i.next.next;!Ru(n,s)&&Bu(n,i,i.next,s)&&Du(n,s)&&Du(s,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),Uu(i),Uu(i.next),i=t=s),i=i.next}while(i!==t);return gu(i)}function bu(t,e,r,i,n,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&Tu(o,t)){let a=Ou(o,t);return o=gu(o,o.next),a=gu(a,a.next),Au(o,e,r,i,n,s,0),void Au(a,e,r,i,n,s,0)}t=t.next}o=o.next}while(o!==t)}function _u(t,e){return t.x-e.x}function wu(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.x&&i.x>=l&&s!==i.x&&Cu(or.x||i.x===r.x&&Eu(r,i)))&&(r=i,u=h)),i=i.next}while(i!==a);return r}(t,e);if(!r)return e;const i=Ou(r,t);return gu(i,i.next),gu(r,r.next)}function Eu(t,e){return Iu(t.prev,t,e.prev)<0&&Iu(e.next,t,t.next)<0}function Mu(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 Su(t){let e=t,r=t;do{(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function Tu(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&&Bu(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Du(t,e)&&Du(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)&&(Iu(t.prev,t,e.prev)||Iu(t,e.prev,e))||Ru(t,e)&&Iu(t.prev,t,t.next)>0&&Iu(e.prev,e,e.next)>0)}function Iu(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ru(t,e){return t.x===e.x&&t.y===e.y}function Bu(t,e,r,i){const n=Pu(Iu(t,e,r)),s=Pu(Iu(t,e,i)),o=Pu(Iu(r,i,t)),a=Pu(Iu(r,i,e));return n!==s&&o!==a||!(0!==n||!Lu(t,r,e))||!(0!==s||!Lu(t,i,e))||!(0!==o||!Lu(r,t,i))||!(0!==a||!Lu(r,e,i))}function Lu(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 Pu(t){return t>0?1:t<0?-1:0}function Du(t,e){return Iu(t.prev,t,t.next)<0?Iu(t,e,t.next)>=0&&Iu(t,t.prev,e)>=0:Iu(t,e,t.prev)<0||Iu(t,t.next,e)<0}function Ou(t,e){const r=new Nu(t.i,t.x,t.y),i=new Nu(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 ku(t,e,r,i){const n=new Nu(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 Uu(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 Nu(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}class Fu{static area(t){const e=t.length;let r=0;for(let i=e-1,n=0;n80*r){a=c=t[0],l=h=t[1];for(let e=r;ec&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return Au(s,o,r,a,l,p,0),o}(r,i);for(let t=0;t2&&t[e-1].equals(t[0])&&t.pop()}function Gu(t,e){for(let r=0;rNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/u,f=e.y+o/u,m=((r.x-c/d-p)*c-(r.y+l/d-f)*l)/(o*c-a*l);i=p+o*m-t.x,n=f+a*m-t.y;const g=i*i+n*n;if(g<=2)return new ei(i,n);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?l>Number.EPSILON&&(t=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(i=-a,n=o,s=Math.sqrt(h)):(i=o,n=a,s=Math.sqrt(h/2))}return new ei(i/s,n/s)}const B=[];for(let t=0,e=S.length,r=e-1,i=t+1;t=0;t--){const e=t/p,r=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=S.length;t=0;){const i=r;let n=r-1;n<0&&(n=t.length-1);for(let t=0,r=a+2*p;t0)&&d.push(e,n,l),(t!==r-1||a0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class od extends rs{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new $n(16777215),this.specular=new $n(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K,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}}class ad extends rs{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new $n(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,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.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class ld extends rs{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),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.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class cd extends rs{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new $n(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K,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.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}}class hd extends rs{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new $n(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,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.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class ud extends hh{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}}function dd(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function pd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function fd(t){const e=t.length,r=new Array(e);for(let t=0;t!==e;++t)r[t]=t;return r.sort((function(e,r){return t[e]-t[r]})),r}function md(t,e,r){const i=t.length,n=new t.constructor(i);for(let s=0,o=0;o!==i;++s){const i=r[s]*e;for(let r=0;r!==e;++r)n[o++]=t[i+r]}return n}function gd(t,e,r,i){let n=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[n++];if(void 0===s)return;let o=s[i];if(void 0!==o)if(Array.isArray(o))do{o=s[i],void 0!==o&&(e.push(s.time),r.push.apply(r,o)),s=t[n++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[i],void 0!==o&&(e.push(s.time),o.toArray(r,r.length)),s=t[n++]}while(void 0!==s);else do{o=s[i],void 0!==o&&(e.push(s.time),r.push(o)),s=t[n++]}while(void 0!==s)}const Ad={convertArray:dd,isTypedArray:pd,getKeyframeOrder:fd,sortedArray:md,flattenJSON:gd,subclip:function(t,e,r,i,n=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t=i)){l.push(e.times[t]);for(let r=0;rs.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+a,e=t+l-a;d=i.values.slice(t,e)}else{const t=i.createInterpolant(),e=a,r=l-a;t.evaluate(s),d=t.resultBuffer.slice(e,r)}"quaternion"===n&&(new Pi).fromArray(d).normalize().conjugate().toArray(d);const p=o.times.length;for(let t=0;t=n)break t;{const o=e[1];t=n)break e}s=r,r=0}}for(;r>>1;te;)--s;if(++s,0!==n||s!==i){n>=s&&(s=Math.max(s,1),n=s-1);const t=this.getValueSize();this.times=r.slice(n,s),this.values=this.values.slice(n*t,s*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 r=this.times,i=this.values,n=r.length;0===n&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==n;e++){const i=r[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&pd(i))for(let e=0,r=i.length;e!==r;++e){const r=i[e];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,r),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Pe,n=t.length-1;let s=1;for(let o=1;o0){t[s]=t[n];for(let t=n*r,i=s*r,o=0;o!==r;++o)e[i+o]=e[t+o];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=e.slice(0,s*r)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),r=new(0,this.constructor)(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}_d.prototype.TimeBufferType=Float32Array,_d.prototype.ValueBufferType=Float32Array,_d.prototype.DefaultInterpolation=Le;class wd extends _d{}wd.prototype.ValueTypeName="bool",wd.prototype.ValueBufferType=Array,wd.prototype.DefaultInterpolation=Be,wd.prototype.InterpolantFactoryMethodLinear=void 0,wd.prototype.InterpolantFactoryMethodSmooth=void 0;class Ed extends _d{}Ed.prototype.ValueTypeName="color";class Md extends _d{}Md.prototype.ValueTypeName="number";class Sd extends yd{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){const n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(r-e)/(i-e);let l=t*o;for(let t=l+o;l!==t;l+=4)Pi.slerpFlat(n,0,s,l-o,s,l,a);return n}}class Cd extends _d{InterpolantFactoryMethodLinear(t){return new Sd(this.times,this.values,this.getValueSize(),t)}}Cd.prototype.ValueTypeName="quaternion",Cd.prototype.DefaultInterpolation=Le,Cd.prototype.InterpolantFactoryMethodSmooth=void 0;class Td extends _d{}Td.prototype.ValueTypeName="string",Td.prototype.ValueBufferType=Array,Td.prototype.DefaultInterpolation=Be,Td.prototype.InterpolantFactoryMethodLinear=void 0,Td.prototype.InterpolantFactoryMethodSmooth=void 0;class Id extends _d{}Id.prototype.ValueTypeName="vector";class Rd{constructor(t,e=-1,r,i=Ue){this.name=t,this.tracks=r,this.duration=e,this.blendMode=i,this.uuid=Wr(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],r=t.tracks,i=1/(t.fps||1);for(let t=0,n=r.length;t!==n;++t)e.push(Bd(r[t]).scale(i));const n=new this(t.name,t.duration,e,t.blendMode);return n.uuid=t.uuid,n}static toJSON(t){const e=[],r=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=r.length;t!==i;++t)e.push(_d.toJSON(r[t]));return i}static CreateFromMorphTargetSequence(t,e,r,i){const n=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(r)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,r));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(t,e,r,i,n){if(0!==r.length){const s=[],o=[];gd(r,s,o,i),0!==s.length&&n.push(new t(e,s,o))}},i=[],n=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(n),this.manager.itemEnd(t)}),0),n;if(void 0!==kd[t])return void kd[t].push({onLoad:e,onProgress:r,onError:i});kd[t]=[],kd[t].push({onLoad:e,onProgress:r,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const r=kd[t],i=e.body.getReader(),n=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=n?parseInt(n):0,o=0!==s;let a=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:n})=>{if(i)t.close();else{a+=n.byteLength;const i=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=r.length;t{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,o)));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),r=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(r);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{Ld.add(t,e);const r=kd[t];delete kd[t];for(let t=0,i=r.length;t{const r=kd[t];if(void 0===r)throw this.manager.itemError(t),e;delete kd[t];for(let t=0,i=r.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Fd extends Od{constructor(t){super(t)}load(t,e,r,i){const n=this,s=new Nd(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(r){try{e(n.parse(JSON.parse(r)))}catch(e){i?i(e):console.error(e),n.manager.itemError(t)}}),r,i)}parse(t){const e=[];for(let r=0;r0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const n=t.uniforms[e];switch(i.uniforms[e]={},n.type){case"t":i.uniforms[e].value=r(n.value);break;case"c":i.uniforms[e].value=(new $n).setHex(n.value);break;case"v2":i.uniforms[e].value=(new ei).fromArray(n.value);break;case"v3":i.uniforms[e].value=(new Di).fromArray(n.value);break;case"v4":i.uniforms[e].value=(new Mi).fromArray(n.value);break;case"m3":i.uniforms[e].value=(new ri).fromArray(n.value);break;case"m4":i.uniforms[e].value=(new un).fromArray(n.value);break;default:i.uniforms[e].value=n.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=r(t.map)),void 0!==t.matcap&&(i.matcap=r(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=r(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=r(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=r(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new ei).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=r(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=r(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=r(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=r(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=r(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=r(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=r(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=r(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=r(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=r(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=r(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=r(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=r(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=r(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new ei).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=r(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=r(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=r(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=r(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=r(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=r(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=r(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:rd,SpriteMaterial:nc,RawShaderMaterial:id,ShaderMaterial:to,PointsMaterial:bh,MeshPhysicalMaterial:sd,MeshStandardMaterial:nd,MeshPhongMaterial:od,MeshToonMaterial:ad,MeshNormalMaterial:ld,MeshLambertMaterial:cd,MeshDepthMaterial:Ul,MeshDistanceMaterial:Nl,MeshBasicMaterial:is,MeshMatcapMaterial:hd,LineDashedMaterial:ud,LineBasicMaterial:hh,Material:rs}[t]}}class up{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let r=0,i=t.length;r0){const r=new Pd(e);n=new Gd(r),n.setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e0){i=new Gd(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e{const e=new Ui;e.min.fromArray(t.boxMin),e.max.fromArray(t.boxMax);const r=new en;return r.radius=t.sphereRadius,r.center.fromArray(t.sphereCenter),{boxInitialized:t.boxInitialized,box:e,sphereInitialized:t.sphereInitialized,sphere:r}})),s._maxGeometryCount=t.maxGeometryCount,s._maxVertexCount=t.maxVertexCount,s._maxIndexCount=t.maxIndexCount,s._geometryInitialized=t.geometryInitialized,s._geometryCount=t.geometryCount,s._matricesTexture=h(t.matricesTexture.uuid);break;case"LOD":s=new _c;break;case"Line":s=new gh(l(t.geometry),c(t.material));break;case"LineLoop":s=new xh(l(t.geometry),c(t.material));break;case"LineSegments":s=new vh(l(t.geometry),c(t.material));break;case"PointCloud":case"Points":s=new Sh(l(t.geometry),c(t.material));break;case"Sprite":s=new yc(c(t.material));break;case"Group":s=new Vl;break;case"Bone":s=new Pc;break;default:s=new kn}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(s.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.quaternion&&s.quaternion.fromArray(t.quaternion),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.up&&s.up.fromArray(t.up),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(s.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(s.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(s.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&s.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(s.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.frustumCulled&&(s.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(s.renderOrder=t.renderOrder),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.layers&&(s.layers.mask=t.layers),void 0!==t.children){const o=t.children;for(let t=0;t0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(r,i,this._addIndex*e,1,e);for(let t=e,n=e+e;t!==n;++t)if(r[t]!==r[t+e]){o.setValue(r,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,r=this.valueSize,i=r*this._origIndex;t.getValue(e,i);for(let t=r,n=i;t!==n;++t)e[t]=e[i+t%r];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 r=t;r=.5)for(let i=0;i!==n;++i)t[e+i]=t[r+i]}_slerp(t,e,r,i){Pi.slerpFlat(t,e,t,e,t,r,i)}_slerpAdditive(t,e,r,i,n){const s=this._workIndex*n;Pi.multiplyQuaternionsFlat(t,s,t,e,t,r),Pi.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,r,i,n){const s=1-i;for(let o=0;o!==n;++o){const n=e+o;t[n]=t[n]*s+t[r+o]*i}}_lerpAdditive(t,e,r,i,n){for(let s=0;s!==n;++s){const n=e+s;t[n]=t[n]+t[r+s]*i}}}const Gp="\\[\\]\\.:\\/",Qp=new RegExp("["+Gp+"]","g"),jp="[^"+Gp+"]",Vp="[^"+Gp.replace("\\.","")+"]",Hp=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",jp)+/(WCOD+)?/.source.replace("WCOD",Vp)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",jp)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",jp)+"$"),Wp=["material","materials","bones","map"];class qp{constructor(t,e,r){this.path=e,this.parsedPath=r||qp.parseTrackName(e),this.node=qp.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,r){return t&&t.isAnimationObjectGroup?new qp.Composite(t,e,r):new qp(t,e,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Qp,"")}static parseTrackName(t){const e=Hp.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const r={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=r.nodeName.substring(i+1);-1!==Wp.indexOf(t)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=t)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const r=t.skeleton.getBoneByName(e);if(void 0!==r)return r}if(t.children){const r=function(t){for(let i=0;i=n){const s=n++,c=t[s];e[c.uuid]=l,t[l]=c,e[a]=s,t[s]=o;for(let t=0,e=i;t!==e;++t){const e=r[t],i=e[s],n=e[l];e[l]=i,e[s]=n}}}this.nCachedObjects_=n}uncache(){const t=this._objects,e=this._indicesByUUID,r=this._bindings,i=r.length;let n=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=e[a];if(void 0!==l)if(delete e[a],l0&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0,e=i;t!==e;++t){const e=r[t];e[l]=e[n],e.pop()}}}this.nCachedObjects_=n}subscribe_(t,e){const r=this._bindingsIndicesByPath;let i=r[t];const n=this._bindings;if(void 0!==i)return n[i];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);i=n.length,r[t]=i,s.push(t),o.push(e),n.push(h);for(let r=c,i=a.length;r!==i;++r){const i=a[r];h[r]=new qp(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){const i=this._paths,n=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=r,s[r]=a,s.pop(),n[r]=n[o],n.pop(),i[r]=i[o],i.pop()}}}class Yp{constructor(t,e,r=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=r,this.blendMode=i;const n=e.tracks,s=n.length,o=new Array(s),a={endingStart:De,endingEnd:De};for(let t=0;t!==s;++t){const e=n[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ie,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,r){if(t.fadeOut(e),this.fadeIn(e),r){const r=this._clip.duration,i=t._clip.duration,n=i/r,s=r/i;t.warp(1,n,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,r){return t.crossFadeFrom(this,e,r)}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,r){const i=this._mixer,n=i.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=n,a[1]=n+r,l[0]=t/s,l[1]=e/s,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,r,i){if(!this.enabled)return void this._updateWeight(t);const n=this._startTime;if(null!==n){const i=(t-n)*r;i<0||0===r?e=0:(this._startTime=null,e=r*i)}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===Ne)for(let r=0,i=t.length;r!==i;++r)t[r].evaluate(s),e[r].accumulateAdditive(o);else for(let r=0,n=t.length;r!==n;++r)t[r].evaluate(s),e[r].accumulate(i,o)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const r=this._weightInterpolant;if(null!==r){const i=r.evaluate(t)[0];e*=i,t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,r=this.loop;let i=this.time+t,n=this._loopCount;const s=r===Re;if(0===t)return-1===n?i:s&&1==(1&n)?e-i:i;if(r===Te){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===n&&(t>=0?(n=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const r=Math.floor(i/e);i-=e*r,n+=Math.abs(r);const o=this.repetitions-n;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=n,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=i;if(s&&1==(1&n))return e-i}return i}_setEndings(t,e,r){const i=this._interpolantSettings;r?(i.endingStart=Oe,i.endingEnd=Oe):(i.endingStart=t?this.zeroSlopeAtStart?Oe:De:ke,i.endingEnd=e?this.zeroSlopeAtEnd?Oe:De:ke)}_scheduleFading(t,e,r){const i=this._mixer,n=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=n,a[0]=e,o[1]=n+t,a[1]=r,this}}const Xp=new Float32Array(1);class Jp extends Gr{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,s=t._propertyBindings,o=t._interpolants,a=r.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==n;++t){const n=i[t],l=n.name;let h=c[l];if(void 0!==h)++h.referenceCount,s[t]=h;else{if(h=s[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;h=new zp(qp.create(r,l,i),n.ValueTypeName,n.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[t]=h}o[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,r=t._clip.uuid,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}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=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==r;++o)e[o]._update(i,t,n,s);const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.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.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,cf).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)}}const uf=new Di,df=new Di;class pf{constructor(t=new Di,e=new Di){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){uf.subVectors(t,this.start),df.subVectors(this.end,this.start);const r=df.dot(df);let i=df.dot(uf)/r;return e&&(i=qr(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)}}const ff=new Di;class mf extends kn{constructor(t,e){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const r=new Is,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,r=32;t1)for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{zf.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(zf,e)}}setLength(t,e=.2*t,r=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Vf extends vh{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],r=new Is;r.setAttribute("position",new xs(e,3)),r.setAttribute("color",new xs([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(r,new hh({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,r){const i=new $n,n=this.geometry.attributes.color.array;return i.set(t),i.toArray(n,0),i.toArray(n,3),i.set(e),i.toArray(n,6),i.toArray(n,9),i.set(r),i.toArray(n,12),i.toArray(n,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Hf{constructor(){this.type="ShapePath",this.color=new $n,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new eu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const r=e.length;let i=!1;for(let n=r-1,s=0;sNumber.EPSILON){if(l<0&&(r=e[s],a=-a,o=e[n],l=-l),t.yo.y)continue;if(t.y===r.y){if(t.x===r.x)return!0}else{const e=l*(t.x-r.x)-a*(t.y-r.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==r.y)continue;if(o.x<=t.x&&t.x<=r.x||r.x<=t.x&&t.x<=o.x)return!0}}return i}const r=Fu.isClockWise,i=this.subPaths;if(0===i.length)return[];let n,s,o;const a=[];if(1===i.length)return s=i[0],o=new fu,o.curves=s.curves,a.push(o),a;let l=!r(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let e=0,o=i.length;e1){let t=!1,r=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t{if(!r){var o=1/0;for(h=0;h=s)&&Object.keys(i.O).every((t=>i.O[t](r[l])))?r.splice(l--,1):(a=!1,s0&&t[h-1][2]>s;h--)t[h]=t[h-1];t[h]=[r,n,s]},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={764:0};i.O.j=e=>0===t[e];var e=(e,r)=>{var n,s,[o,a,l]=r,c=0;if(o.some((e=>0!==t[e]))){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(l)var h=l(i)}for(e&&e(r);c(self.webpackChunkitowns=self.webpackChunkitowns||[]).push([[711],{70473:(t,e,i)=>{i.r(e),i.d(e,{Debug:()=>Pn,GeometryDebug:()=>Fn,PotreeDebug:()=>En,create3dTilesDebugUI:()=>Hn,createTileDebugUI:()=>Bn});var s=i(99477),n=i(60145),o=i(49469),a=i(44996);function r(t){return t+.5|0}const h=(t,e,i)=>Math.max(Math.min(t,i),e);function l(t){return h(r(2.55*t),0,255)}function c(t){return h(r(255*t),0,255)}function d(t){return h(r(t/2.55)/100,0,1)}function u(t){return h(r(100*t),0,100)}const f={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},p=[..."0123456789ABCDEF"],g=t=>p[15&t],m=t=>p[(240&t)>>4]+p[15&t],b=t=>(240&t)>>4==(15&t);const x=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function _(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function y(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function v(t,e,i){const s=_(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function w(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,h,l;return n!==o&&(l=n-o,h=a>.5?l/(2-n-o):l/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(et<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,T=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function L(t,e,i){if(t){let s=w(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=k(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function z(t,e){return t?Object.assign(e||{},t):t}function I(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=c(t[3]))):(e=z(t,{r:0,g:0,b:0,a:1})).a=c(e.a),e}function R(t){return"r"===t.charAt(0)?function(t){const e=O.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?l(t):h(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?l(i):h(i,0,255)),s=255&(e[4]?l(s):h(s,0,255)),n=255&(e[6]?l(n):h(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):function(t){const e=x.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?l(+e[5]):c(+e[5]));const n=S(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return M(v,t,e,i)}(n,o,a):"hsv"===e[1]?function(t,e,i){return M(y,t,e,i)}(n,o,a):k(n,o,a),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class A{constructor(t){if(t instanceof A)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=I(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*f[s[1]],g:255&17*f[s[2]],b:255&17*f[s[3]],a:5===o?17*f[s[4]]:255}:7!==o&&9!==o||(n={r:f[s[1]]<<4|f[s[2]],g:f[s[3]]<<4|f[s[4]],b:f[s[5]]<<4|f[s[6]],a:9===o?f[s[7]]<<4|f[s[8]]:255})),i=n||function(t){P||(P=function(){const t={},e=Object.keys(C),i=Object.keys(D);let s,n,o,a,r;for(s=0;s>16&255,o>>8&255,255&o]}return t}(),P.transparent=[0,0,0,0]);const e=P[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||R(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=z(this._rgb);return t&&(t.a=d(t.a)),t}set rgb(t){this._rgb=I(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${d(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>b(t.r)&&b(t.g)&&b(t.b)&&b(t.a))(t)?g:m,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=w(t),i=e[0],s=u(e[1]),n=u(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${d(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,h=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;n=1-h,i.r=255&h*i.r+n*s.r+.5,i.g=255&h*i.g+n*s.g+.5,i.b=255&h*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=T(d(t.r)),n=T(d(t.g)),o=T(d(t.b));return{r:c(E(s+i*(T(d(e.r))-s))),g:c(E(n+i*(T(d(e.g))-n))),b:c(E(o+i*(T(d(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new A(this.rgb)}alpha(t){return this._rgb.a=c(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=r(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return L(this._rgb,2,t),this}darken(t){return L(this._rgb,2,-t),this}saturate(t){return L(this._rgb,1,t),this}desaturate(t){return L(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=w(t);i[0]=S(i[0]+e),i=k(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}const F=(()=>{let t=0;return()=>t++})();function V(t){return null==t}function j(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function B(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function W(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function N(t,e){return W(t)?t:e}function $(t,e){return void 0===t?e:t}function H(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function U(t,e,i,s){let n,o,a;if(j(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;nt,x:t=>t.x,y:t=>t.y};function tt(t,e){const i=J[e]||(J[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function et(t){return t.charAt(0).toUpperCase()+t.slice(1)}const it=t=>void 0!==t,st=t=>"function"==typeof t,nt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},ot=Math.PI,at=2*ot,rt=at+ot,ht=Number.POSITIVE_INFINITY,lt=ot/180,ct=ot/2,dt=ot/4,ut=2*ot/3,ft=Math.log10,pt=Math.sign;function gt(t,e,i){return Math.abs(t-e)h&&l=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function Dt(t,e,i){i=i||(i=>t[i]1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const Ct=(t,e,i,s)=>Dt(t,i,s?s=>{const n=t[s][e];return nt[s][e]Dt(t,i,(s=>t[s][e]>=i)),Ot=["push","pop","shift","splice","unshift"];function Et(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(Ot.forEach((e=>{delete t[e]})),delete t._chartjs)}const Tt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Lt(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,Tt.call(window,(()=>{s=!1,t.apply(e,i)})))}}const zt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;const It=t=>0===t||1===t,Rt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*at/i),At=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*at/i)+1,Ft={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*ct),easeOutSine:t=>Math.sin(t*ct),easeInOutSine:t=>-.5*(Math.cos(ot*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>It(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>It(t)?t:Rt(t,.075,.3),easeOutElastic:t=>It(t)?t:At(t,.075,.3),easeInOutElastic(t){const e=.1125;return It(t)?t:t<.5?.5*Rt(2*t,e,.45):.5+.5*At(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Ft.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Ft.easeInBounce(2*t):.5*Ft.easeOutBounce(2*t-1)+.5};function Vt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function jt(t){return Vt(t)?t:new A(t)}function Bt(t){return Vt(t)?t:new A(t).saturate(.5).darken(.1).hexString()}const Wt=["x","y","borderWidth","radius","tension"],Nt=["color","borderColor","backgroundColor"],$t=new Map;function Ht(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=$t.get(i);return s||(s=new Intl.NumberFormat(t,e),$t.set(i,s)),s}(e,i).format(t)}const Ut={values:t=>j(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const a=ft(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),h={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(h,this.options.ticks.format),Ht(t,s,h)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(ft(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?Ut.numeric.call(this,t,e,i):""}};var Yt={formatters:Ut};const qt=Object.create(null),Xt=Object.create(null);function Zt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Bt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Bt(e.borderColor),this.hoverColor=(t,e)=>Bt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Gt(this,t,e)}get(t){return Zt(this,t)}describe(t,e){return Gt(Xt,t,e)}override(t,e){return Gt(qt,t,e)}route(t,e,i,s){const n=Zt(this,t),o=Zt(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return B(t)?Object.assign({},e,t):$(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach((t=>t(this)))}}var Qt=new Kt({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Nt},numbers:{type:"number",properties:Wt}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Yt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Jt(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function te(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function ee(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ie(t,e,i,s){!function(t,e,i,s,n){let o,a,r,h,l,c,d,u;const f=e.pointStyle,p=e.rotation,g=e.radius;let m=(p||0)*lt;if(f&&"object"==typeof f&&(o=f.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,s,n/2,g,0,0,at):t.arc(i,s,g,0,at),t.closePath();break;case"triangle":c=n?n/2:g,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=ut,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),m+=ut,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*g),t.closePath();break;case"rectRounded":l=.516*g,h=g-l,a=Math.cos(m+dt)*h,d=Math.cos(m+dt)*(n?n/2-l:h),r=Math.sin(m+dt)*h,u=Math.sin(m+dt)*(n?n/2-l:h),t.arc(i-d,s-r,l,m-ot,m-ct),t.arc(i+u,s-a,l,m-ct,m),t.arc(i+d,s+r,l,m,m+ct),t.arc(i-u,s+a,l,m+ct,m+ot),t.closePath();break;case"rect":if(!p){h=Math.SQRT1_2*g,c=n?n/2:h,t.rect(i-c,s-h,2*c,2*h);break}m+=dt;case"rectRot":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+u,s-a),t.lineTo(i+d,s+r),t.lineTo(i-u,s+a),t.closePath();break;case"crossRot":m+=dt;case"cross":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a),m+=dt,d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*g,r=Math.sin(m)*g,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}(t,e,i,s,null)}function se(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let h,l;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),V(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),h=0;h+t||0;function me(t,e){const i={},s=B(e),n=s?Object.keys(e):e,o=B(t)?s?i=>$(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=ge(o(t));return i}function be(t){return me(t,{top:"y",right:"x",bottom:"y",left:"x"})}function xe(t){const e=be(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function _e(t,e){t=t||{},e=e||Qt.font;let i=$(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=$(t.style,e.style);s&&!(""+s).match(fe)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:$(t.family,e.family),lineHeight:pe($(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:$(t.weight,e.weight),string:""};return n.string=function(t){return!t||V(t.size)||V(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function ye(t,e,i,s){let n,o,a,r=!0;for(n=0,o=t.length;nt[0])){const o=i||t;void 0===s&&(s=ze("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>we([i,...t],e,o,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Ce(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=ze(Se(o,t),i),void 0!==n)return De(t,n)?Te(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Ie(t).includes(e),ownKeys:t=>Ie(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function Me(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,s),setContext:e=>Me(t,e,i,s),override:n=>Me(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ce(t,e,(()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let r=s[e];return st(r)&&a.isScriptable(e)&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let h=e(o,a||s);return r.delete(t),De(t,h)&&(h=Te(n._scopes,n,t,h)),h}(e,r,t,i)),j(r)&&r.length&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(B(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const h of i){const i=Te(s,n,t,h);e.push(Me(i,o,a&&a[t],r))}}return e}(e,r,t,a.isIndexable)),De(e,r)&&(r=Me(r,n,o&&o[e],a)),r}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:st(i)?i:()=>i,isIndexable:st(s)?s:()=>s}}const Se=(t,e)=>t?t+et(e):e,De=(t,e)=>B(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ce(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function Pe(t,e,i){return st(t)?t(e,i):t}const Oe=(t,e)=>!0===t?e:"string"==typeof t?tt(e,t):void 0;function Ee(t,e,i,s,n){for(const o of e){const e=Oe(i,o);if(e){t.add(e);const o=Pe(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Te(t,e,i,s){const n=e._rootScopes,o=Pe(e._fallback,i,s),a=[...t,...n],r=new Set;r.add(s);let h=Le(r,a,i,o||i,s);return null!==h&&(void 0===o||o===i||(h=Le(r,a,o,h,s),null!==h))&&we(Array.from(r),[""],n,o,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return j(n)&&B(i)?i:n||{}}(e,i,s)))}function Le(t,e,i,s,n){for(;i;)i=Ee(t,e,i,s,n);return i}function ze(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Ie(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const Re=Number.EPSILON||1e-14,Ae=(t,e)=>e"x"===t?"y":"x";function Ve(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=yt(o,n),h=yt(a,o);let l=r/(r+h),c=h/(r+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const d=s*l,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function je(t,e,i){return Math.max(Math.min(t,i),e)}function Be(t,e,i,s,n){let o,a,r,h;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Fe(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,h,l=Ae(t,0);for(a=0;at.ownerDocument.defaultView.getComputedStyle(t,null),Ue=["top","right","bottom","left"];function Ye(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=Ue[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const qe=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function Xe(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=He(i),o="border-box"===n.boxSizing,a=Ye(n,"padding"),r=Ye(n,"border","width"),{x:h,y:l,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,h=!1;if(qe(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,h=!0}return{x:a,y:r,box:h}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:p}=e;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((h-d)/f*i.width/s),y:Math.round((l-u)/p*i.height/s)}}const Ze=t=>Math.round(10*t)/10;function Ge(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};We()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Qe(t,e){const i=function(t,e){return He(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Je(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=Je(t,n,i),r=Je(n,o,i),h=Je(o,e,i),l=Je(a,r,i),c=Je(r,h,i);return Je(l,c,i)}function ii(t){return"angle"===t?{between:Mt,compare:vt,normalize:wt}:{between:St,compare:(t,e)=>t-e,normalize:t=>t}}function si({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function ni(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:h,normalize:l}=ii(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=ii(s),h=e.length;let l,c,{start:d,end:u,loop:f}=t;if(f){for(d+=h,u+=h,l=0,c=h;ls({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=Tt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var hi=new ri;const li="transparent",ci={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=jt(t||li),n=s.valid&&jt(e||li);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class di{constructor(t,e,i,s){const n=e[i];s=ye([t.to,s,n,t.from]);const o=ye([t.from,n,s]);this._active=!0,this._fn=t.fn||ci[t.type||typeof o],this._easing=Ft[t.easing]||Ft.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=ye([t.to,e,s,t.from]),this._from=ye([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const n=t[s];if(!B(n))return;const o={};for(const t of e)o[t]=n[t];(j(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const h=o[r];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const l=e[h];let c=n[h];const d=i.get(h);if(c){if(d&&c.active()){c.update(d,l,a);continue}c.cancel()}d&&d.duration?(n[h]=c=new di(d,t,h,l),s.push(c)):t[h]=l}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(hi.add(this._chart,i),!0):void 0}}function fi(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function pi(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n0||!i&&e<0)return n.index}return null}function _i(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;ti[t].axis===e)).shift()}function vi(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const wi=t=>"reset"===t||"none"===t,Mi=(t,e)=>e?t:Object.assign({},t);class ki{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=mi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&vi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=$(i.xAxisID,yi(t,"x")),o=e.yAxisID=$(i.yAxisID,yi(t,"y")),a=e.rAxisID=$(i.rAxisID,yi(t,"r")),r=e.indexAxis,h=e.iAxisID=s(r,n,o,a),l=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Et(this._data,this),t._stacked&&vi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(B(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,n,o;for(s=0,n=e.length;s{const e="_onData"+et(t),i=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=i.apply(this,t);return s._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),n}})})))),this._syncList=[],this._data=e}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=mi(e.vScale,e),e.stack!==i.stack&&(s=!0,vi(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&_i(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,h,l,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,l=s;else{l=j(s[t])?this.parseArrayData(i,s,t,e):B(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===h[a]||d&&h[a]t&&!e.hidden&&e._stacked&&{keys:pi(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:l,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(a);let d,u;function f(){u=s[d];const e=u[a.axis];return!W(u[t.axis])||l>e||c=0;--d)if(!f()){this.updateRangeFromParsed(h,t,u,r);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s=0&&tthis.getContext(i,s,e)),c);return f.$shared&&(f.$shared=r,n[o]=Object.freeze(Mi(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const h=new ui(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||wi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){wi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!wi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;at-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const h=()=>{32767!==o&&-32768!==o&&(it(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;sMath.abs(r)&&(h=r,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function Ci(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,h=[];let l,c,d,u;for(l=i,c=i+s;lt.x,i="left",s="right"):(e=t.base{t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:h}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var Vi={evaluateInteractionItems:Ii,modes:{index(t,e,i,s){const n=Xe(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?Ri(t,n,o,s,a):Ai(t,n,o,!1,s,a),h=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})})),h):[]},dataset(t,e,i,s){const n=Xe(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?Ri(t,n,o,s,a):Ai(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tRi(t,Xe(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=Xe(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return Ai(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>Fi(t,Xe(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Fi(t,Xe(e,t),"y",i.intersect,s)}};const ji=["left","top","right","bottom"];function Bi(t,e){return t.filter((t=>t.pos===e))}function Wi(t,e){return t.filter((t=>-1===ji.indexOf(t.pos)&&t.box.axis===e))}function Ni(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function $i(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Hi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ui(t,e,i,s){const{pos:n,box:o}=i,a=t.maxPadding;if(!B(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&Hi(a,o.getPadding());const r=Math.max(0,e.outerWidth-$i(a,t,"left","right")),h=Math.max(0,e.outerHeight-$i(a,t,"top","bottom")),l=r!==t.w,c=h!==t.h;return t.w=r,t.h=h,i.horizontal?{same:l,other:c}:{same:c,other:l}}function Yi(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}(t?["left","right"]:["top","bottom"])}function qi(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;ot.box.fullSize)),!0),s=Ni(Bi(e,"left"),!0),n=Ni(Bi(e,"right")),o=Ni(Bi(e,"top"),!0),a=Ni(Bi(e,"bottom")),r=Wi(e,"x"),h=Wi(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:Bi(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}(t.boxes),h=r.vertical,l=r.horizontal;U(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=h.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);Hi(u,xe(s));const f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),p=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!ji.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Ki{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Qi extends Ki{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ji="$chartjs",ts={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},es=t=>null===t||""===t,is=!!Ke&&{passive:!0};function ss(t,e,i){t.canvas.removeEventListener(e,i,is)}function ns(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function os(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ns(i.addedNodes,s),e=e&&!ns(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function as(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ns(i.removedNodes,s),e=e&&!ns(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const rs=new Map;let hs=0;function ls(){const t=window.devicePixelRatio;t!==hs&&(hs=t,rs.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function cs(t,e,i){const s=t.canvas,n=s&&Ne(s);if(!n)return;const o=Lt(((t,e)=>{const s=n.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return a.observe(n),function(t,e){rs.size||window.addEventListener("resize",ls),rs.set(t,e)}(t,o),a}function ds(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){rs.delete(t),rs.size||window.removeEventListener("resize",ls)}(t)}function us(t,e,i){const s=t.canvas,n=Lt((e=>{null!==t.ctx&&i(function(t,e){const i=ts[t.type]||t.type,{x:s,y:n}=Xe(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t);return function(t,e,i){t.addEventListener(e,i,is)}(s,e,n),n}class fs extends Ki{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[Ji]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",es(n)){const e=Qe(t,"width");void 0!==e&&(t.width=e)}if(es(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Qe(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ji])return!1;const i=e[Ji].initial;["height","width"].forEach((t=>{const s=i[t];V(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[Ji],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:os,detach:as,resize:cs}[e]||us;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:ds,detach:ds,resize:ds}[e]||ss)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){const n=He(t),o=Ye(n,"margin"),a=$e(n.maxWidth,t,"clientWidth")||ht,r=$e(n.maxHeight,t,"clientHeight")||ht,h=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=Ne(t);if(o){const t=o.getBoundingClientRect(),a=He(o),r=Ye(a,"border","width"),h=Ye(a,"padding");e=t.width-h.width-r.width,i=t.height-h.height-r.height,s=$e(a.maxWidth,o,"clientWidth"),n=$e(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||ht,maxHeight:n||ht}}(t,e,i);let{width:l,height:c}=h;if("content-box"===n.boxSizing){const t=Ye(n,"border","width"),e=Ye(n,"padding");l-=e.width+t.width,c-=e.height+t.height}return l=Math.max(0,l-o.width),c=Math.max(0,s?l/s:c-o.height),l=Ze(Math.min(l,a,h.maxWidth)),c=Ze(Math.min(c,r,h.maxHeight)),l&&!c&&(c=Ze(l/2)),(void 0!==e||void 0!==i)&&s&&h.height&&c>h.height&&(c=h.height,l=Ze(Math.floor(c*s))),{width:l,height:c}}(t,e,i,s)}isAttached(t){const e=Ne(t);return!(!e||!e.isConnected)}}class ps{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return bt(this.x)&&bt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function gs(t,e,i,s,n){const o=$(s,0),a=Math.min($(n,t.length),t.length);let r,h,l,c=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),l=o;l<0;)c++,l=Math.round(o+c*i);for(h=Math.max(o,0);h"top"===e||"left"===e?t[e]+i:t[e]-i,bs=(t,e)=>Math.min(e||t,t);function xs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return l}function ys(t){return t.drawTicks?t.tickLength:0}function vs(t,e){if(!t.display)return 0;const i=_e(t.font,e),s=xe(t.padding);return(j(t.text)?t.text.length:1)*i.lineHeight+s.height}function ws(t,e,i){let s=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Ms extends ps{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=N(t,Number.POSITIVE_INFINITY),e=N(e,Number.NEGATIVE_INFINITY),i=N(i,Number.POSITIVE_INFINITY),s=N(s,Number.NEGATIVE_INFINITY),{min:N(t,i),max:N(e,s),minDefined:W(t),maxDefined:W(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,h=a.length;rs?s:i,s=n&&i>s?i:s,{min:N(i,N(s,i)),max:N(s,N(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:s,max:n}=t,o=(h=(n-s)/2,"string"==typeof(r=e)&&r.endsWith("%")?parseFloat(r)/100*h:+r),a=(t,e)=>i&&0===t?0:t+e;var r,h;return{min:a(s,-Math.abs(o)),max:a(n,o)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=an)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;nt-e)).pop(),e}(s);for(let t=0,e=o.length-1;tn)return e}return Math.max(n,1)}(o,e,n);if(a>0){let t,i;const s=a>1?Math.round((h-r)/(a-1)):null;for(gs(e,l,c,V(s)?0:r-s,r),t=0,i=a-1;t=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const l=this._getLabelSizes(),c=l.widest.width,d=l.highest.height,u=kt(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-ys(t.grid)-e.padding-vs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),h=Math.min(Math.asin(kt((l.highest.height+6)/o,-1,1)),Math.asin(kt(a/r,-1,1))-Math.asin(kt(d/r,-1,1)))*(180/ot),h=Math.max(s,Math.min(n,h))),this.labelRotation=h}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=vs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=ys(n)+o):(t.height=this.maxHeight,t.width=ys(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,h=xt(this.labelRotation),l=Math.cos(h),c=Math.sin(h);if(a){const e=i.mirror?0:c*n.width+l*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:l*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,l)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){H(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n({width:o[t]||0,height:a[t]||0});return{first:M(0),last:M(e-1),widest:M(v),highest:M(w),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return kt(this._alignToPixels?te(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:r/s:r*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:a}=s,r=n.offset,h=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=ys(n),d=[],u=a.setContext(this.getContext()),f=u.display?u.width:0,p=f/2,g=function(t){return te(i,t,f)};let m,b,x,_,y,v,w,M,k,S,D,C;if("top"===o)m=g(this.bottom),v=this.bottom-c,M=m-p,S=g(t.top)+p,C=t.bottom;else if("bottom"===o)m=g(this.top),S=t.top,C=g(t.bottom)-p,v=m+p,M=this.top+c;else if("left"===o)m=g(this.right),y=this.right-c,w=m-p,k=g(t.left)+p,D=t.right;else if("right"===o)m=g(this.left),k=t.left,D=g(t.right)-p,y=m+p,w=this.left+c;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(B(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}S=t.top,C=t.bottom,v=m+p,M=v+c}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(B(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}y=m-p,w=y-c,k=t.left,D=t.right}const P=$(s.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/P));for(b=0;b0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}g.push({label:_,font:k,textOffset:C,options:{rotation:p,color:i,strokeColor:r,strokeWidth:l,textAlign:u,textBaseline:P,translation:[y,v],backdrop:d}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,h;return"left"===e?s?(h=this.right+n,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h+=a)):(h=this.right-o,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h=this.left)):"right"===e?s?(h=this.left+n,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h-=a)):(h=this.left+o,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h=this.right)):r="right",{textAlign:r,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),h=a.join(".");Qt.route(o,n,h,r)}))}(e,t.defaultRoutes),t.descriptors&&Qt.describe(e,t.descriptors)}(t,o,i),this.override&&Qt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Qt[s]&&(delete Qt[s][i],this.override&&delete qt[i])}}class Ss{constructor(){this.controllers=new ks(ki,"datasets",!0),this.elements=new ks(ps,"elements"),this.plugins=new ks(Object,"plugins"),this.scales=new ks(Ms,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):U(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=et(t);H(i["before"+s],[],i),e[t](i),H(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Ps(t,e){return e||!1!==t?!0===t?{}:t:null}function Os(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Es(t,e){const i=Qt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ts(t){if("x"===t||"y"===t||"r"===t)return t}function Ls(t,...e){if(Ts(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&Ts(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function zs(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Is(t){const e=t.options||(t.options={});e.plugins=$(e.plugins,{}),e.scales=function(t,e){const i=qt[t.type]||{scales:{}},s=e.scales||{},n=Es(t.type,e),o=Object.create(null);return Object.keys(s).forEach((e=>{const a=s[e];if(!B(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const r=Ls(e,a,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return zs(t,"x",i[0])||zs(t,"y",i[0])}return{}}(e,t),Qt.scales[a.type]),h=function(t,e){return t===e?"_index_":"_value_"}(r,n),l=i.scales||{};o[e]=K(Object.create(null),[{axis:r},a,l[r],l[h]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,a=i.indexAxis||Es(n,e),r=(qt[n]||{}).scales||{};Object.keys(r).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),K(o[n],[{axis:e},s[n],r[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];K(e,[Qt.scales[e.type],Qt.scale])})),o}(t,e)}function Rs(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const As=new Map,Fs=new Set;function Vs(t,e){let i=As.get(t);return i||(i=e(),As.set(t,i),Fs.add(i)),i}const js=(t,e,i)=>{const s=tt(e,i);void 0!==s&&t.add(s)};class Bs{constructor(t){this._config=function(t){return(t=t||{}).data=Rs(t.data),Is(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Rs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Is(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Vs(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Vs(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Vs(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Vs(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>js(r,t,e)))),e.forEach((t=>js(r,s,t))),e.forEach((t=>js(r,qt[n]||{},t))),e.forEach((t=>js(r,Qt,t))),e.forEach((t=>js(r,Xt,t)))}));const h=Array.from(r);return 0===h.length&&h.push(Object.create(null)),Fs.has(e)&&o.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,qt[e]||{},Qt.datasets[e]||{},{type:e},Qt,Xt]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=Ws(this._resolverCache,t,s);let r=o;(function(t,e){const{isScriptable:i,isIndexable:s}=ke(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(st(a)||Ns(a))||o&&j(a))return!0}return!1})(o,e)&&(n.$shared=!1,r=Me(o,i=st(i)?i():i,this.createResolver(t,i,a)));for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=Ws(this._resolverCache,t,i);return B(e)?Me(n,e,void 0,s):n}}function Ws(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);return o||(o={resolver:we(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)),o}const Ns=t=>B(t)&&Object.getOwnPropertyNames(t).some((e=>st(t[e]))),$s=["top","bottom","left","right","chartArea"];function Hs(t,e){return"top"===t||"bottom"===t||-1===$s.indexOf(t)&&"x"===e}function Us(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Ys(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),H(i&&i.onComplete,[t],e)}function qs(t){const e=t.chart,i=e.options.animation;H(i&&i.onProgress,[t],e)}function Xs(t){return We()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Zs={},Gs=t=>{const e=Xs(t);return Object.values(Zs).filter((t=>t.canvas===e)).pop()};function Ks(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}function Qs(t,e,i){return t.options.clip?t[i]:e[i]}class Js{static defaults=Qt;static instances=Zs;static overrides=qt;static registry=Ds;static version="4.4.1";static getChart=Gs;static register(...t){Ds.add(...t),tn()}static unregister(...t){Ds.remove(...t),tn()}constructor(t,e){const i=this.config=new Bs(e),s=Xs(t),n=Gs(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!We()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Qi:fs}(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),r=a&&a.canvas,h=r&&r.height,l=r&&r.width;this.id=F(),this.ctx=a,this.canvas=r,this.width=l,this.height=h,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Cs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],Zs[this.id]=this,a&&r?(hi.listen(this,"complete",Ys),hi.listen(this,"progress",qs),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return V(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ds}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ge(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ee(this.canvas,this.ctx),this}stop(){return hi.stop(this),this}resize(t,e){hi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ge(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),H(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){U(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=Ls(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),U(n,(e=>{const n=e.options,o=n.id,a=Ls(o,n),r=$(n.type,e.dtype);void 0!==n.position&&Hs(n.position,a)===Hs(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;o in i&&i[o].type===r?h=i[o]:(h=new(Ds.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[h.id]=h),h.init(n,t)})),U(s,((t,e)=>{t||delete i[e]})),U(i,(t=>{Gi.configure(this,t,t.options),Gi.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Us("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){U(this.scales,(t=>{Gi.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);nt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)Ks(t,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Gi.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],U(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:Qs(i,e,"left"),right:Qs(i,e,"right"),top:Qs(s,e,"top"),bottom:Qs(s,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&ne(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&oe(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return se(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Vi.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=ve(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);it(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),hi.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};U(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){U(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},U(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!Y(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),h=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,H(n.onHover,[t,a,this],this),r&&H(n.onClick,[t,a,this],this));const l=!Y(a,s);return(l||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=h,l}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function tn(){return U(Js.instances,(t=>t._plugins.invalidate()))}function en(t,e,i=e){t.lineCap=$(i.borderCapStyle,e.borderCapStyle),t.setLineDash($(i.borderDash,e.borderDash)),t.lineDashOffset=$(i.borderDashOffset,e.borderDashOffset),t.lineJoin=$(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=$(i.borderWidth,e.borderWidth),t.strokeStyle=$(i.borderColor,e.borderColor)}function sn(t,e,i){t.lineTo(i.x,i.y)}function nn(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,h=Math.max(n,a),l=Math.min(o,r),c=nr&&o>r;return{count:s,start:h,loop:e.loop,ilen:l(a+(l?r-t:t))%o,_=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(h&&(d=n[x(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[x(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(ip&&(p=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),u=s,b=0,f=p=i),g=i}_()}function rn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?on:an}const hn="function"==typeof Path2D;function ln(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)=0&&ts=e?s:t,a=t=>n=i?n:t;if(t){const t=pt(s),e=pt(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:n,min:o,max:a,precision:r,count:h,maxTicks:l,maxDigits:c,includeBounds:d}=t,u=n||1,f=l-1,{min:p,max:g}=e,m=!V(o),b=!V(a),x=!V(h),_=(g-p)/(c+1);let y,v,w,M,k=mt((g-p)/f/u)*u;if(k<1e-14&&!m&&!b)return[{value:p},{value:g}];M=Math.ceil(g/k)-Math.floor(p/k),M>f&&(k=mt(M*k/f/u)*u),V(r)||(y=Math.pow(10,r),k=Math.ceil(k*y)/y),"ticks"===s?(v=Math.floor(p/k)*k,w=Math.ceil(g/k)*k):(v=p,w=g),m&&b&&n&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((a-o)/n,k/1e3)?(M=Math.round(Math.min((a-o)/k,l)),k=(a-o)/M,v=o,w=a):x?(v=m?o:v,w=b?a:w,M=h-1,k=(w-v)/M):(M=(w-v)/k,M=gt(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(_t(k),_t(v));y=Math.pow(10,V(r)?S:r),v=Math.round(v*y)/y,w=Math.round(w*y)/y;let D=0;for(m&&(d&&v!==o?(i.push({value:o}),va)break;i.push({value:t})}return b&&d&&w!==a?i.length&>(i[i.length-1].value,a,bn(a,_,t))?i[i.length-1].value=a:i.push({value:a}):b&&w!==a||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,e,i){let s,n,o;for(s=0,n=t.length;s{const h=Math.floor((Date.now()-s)/1e3),l=`${h}s`;i>0&&a[i]==l?a.push(""):(a.push(l),i=a.length-1),a.length>60&&(a.shift(),i--);const c=e.info.memory;n.data.push({x:h,y:c.textures}),o.data.push({x:h,y:c.geometries}),n.data.length>60&&(n.data.shift(),o.data.shift()),t&&r.update()},this.resize=()=>{r.resize()}}Js.register(class extends ki{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:a,count:r}=function(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,h=a.axis,{min:l,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=kt(Math.min(Ct(r,h,l).lo,i?s:Ct(e,h,a.getPixelForValue(l)).lo),0,s-1)),o=u?kt(Math.max(Ct(r,a.axis,c,!0).hi+1,i?0:Ct(e,h,a.getPixelForValue(c),!0).hi+1),n,s)-n:s-n}return{start:n,count:o}}(e,s,o);this._drawStart=a,this._drawCount=r,function(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:h},t),this.updateElements(s,a,r,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a,_stacked:r,_dataset:h}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),d=o.axis,u=a.axis,{spanGaps:f,segment:p}=this.options,g=bt(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||n||"none"===s,b=e+i,x=t.length;let _=e>0&&this.getParsed(e-1);for(let i=0;i=b){x.skip=!0;continue}const y=this.getParsed(i),v=V(y[u]),w=x[d]=o.getPixelForValue(y[d],i),M=x[u]=n||v?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,y,r):y[u],i);x.skip=isNaN(w)||isNaN(M)||v,x.stop=i>0&&Math.abs(y[d]-_[d])>g,p&&(x.parsed=y,x.raw=h.data[i]),c&&(x.options=l||this.resolveDataElementOptions(i,f.active?"active":s)),m||this.updateElement(f,i,x,s),_=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},class extends ps{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Be(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;nn&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return function(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=oi(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,h=i.length,l=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=h;i[t%h].skip;)t-=o;for(;i[e%h].skip;)e+=o;t%h!=e%h&&(l.push({start:t%h,end:e%h,loop:s,style:n}),c=n,d=e%h)}}for(const t of e){d=r?d:t.start;let e,o=i[d%h];for(u=d+1;u<=t.end;u++){const r=i[u%h];e=oi(s.setContext(ve(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%h,p1DataIndex:u%h,datasetIndex:a}))),ai(e,c)&&f(d,u-1,t.loop,c),o=r,c=e}dnull===t?null:kt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,$(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return mn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},class extends ps{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=un(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?de:pn;var r;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,gn(o,e,n)),t.clip(),a(t,gn(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,gn(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return fn(this,t,e,i)}inXRange(t,e){return fn(this,t,null,e)}inYRange(t,e){return fn(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},class extends ki{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return Ci(t,e,i,s)}parseArrayData(t,e,i,s){return Ci(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,h="x"===n.axis?a:r,l="x"===o.axis?a:r,c=[];let d,u,f,p;for(d=i,u=i+s;dt.controller.options.grouped)),n=i.options.stacked,o=[],a=t=>{const i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if(V(s)||isNaN(s))return!0};for(const i of s)if((void 0===e||!a(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n=i?1:-1)}(d,e,a)*o,u===a&&(m-=d/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),h=Math.min(t,n),f=Math.max(t,n);m=Math.max(Math.min(m,f),h),c=m+d,i&&!l&&(r._stacks[e.axis]._visualValues[s]=e.getValueForPixel(c)-e.getValueForPixel(m))}if(m===e.getPixelForValue(a)){const t=pt(d)*e.getLineWidthForValue(a)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,o=$(s.maxBarThickness,1/0);let a,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,h="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t0&&void 0!==arguments[0]&&arguments[0];this.obb.box3D.isEmpty()||(this.quaternion.copy(this.obb.quaternion),this.obb.box3D.getCenter(this.position).applyQuaternion(this.quaternion).add(this.obb.position),this.obb.box3D.getSize(this.scale),this.scale.multiplyScalar(.5),this.updateMatrix(),s.Object3D.prototype.updateMatrixWorld.call(this,t))}}const Dn=Sn;function Cn(t,e,i){i||((i=document.createElement("div")).id="chart-div",i.style.cssText=`z-index: 10; position: absolute; bottom: 0; left: 0; width: 100vw; height: 30%; background-color: ${Mn}; display: none`,document.body.appendChild(i)),this.chartDivContainer=i;const r=this.createChartContainer("three-info").getContext("2d");this.charts=[],this.charts.push(new kn(r,t.mainLoop.gfxEngine.renderer));const h=this.charts,l=t.tileLayer,c=new n.Z(t.referenceCrs,0,0,0),d=new n.Z("EPSG:4326",0,0,0),u=e.addFolder("Debug Tools"),f={displayCharts:!1,eventsDebug:!1,debugCameraWindow:!1,freeze:!1};let p;const g=()=>{p=Date.now()},m=()=>{!function(t){const e="none"!=i.style.display;h.forEach((i=>i.update(e,t)))}(Date.now()-p)};let b,x,_,y;u.add(f,"displayCharts").name("Display charts").onChange((e=>{e?(t.addFrameRequester(o.Ao.UPDATE_START,g),t.addFrameRequester(o.Ao.UPDATE_END,m),i.style.display="flex"):(t.removeFrameRequester(o.Ao.UPDATE_START,g),t.removeFrameRequester(o.Ao.UPDATE_END,m),i.style.display="none"),this.updateChartDivSize(),t.notifyChange()})),u.add(f,"debugCameraWindow").name("debug Camera").onChange((e=>{e?t.addFrameRequester(o.Ao.AFTER_RENDER,A):t.removeFrameRequester(o.Ao.AFTER_RENDER,A),t.notifyChange()})),u.add(f,"freeze").name("freeze update").onChange((e=>{l.frozen=e,t.notifyChange()}));const v=t.controls;c.crs=t.referenceCrs;const w=new s.Vector3,M=v&&v.getCameraTargetPosition?v.getCameraTargetPosition:()=>t.camera3D.position,k=e=>{t.getPickingPositionFromDepth(t.eventToViewCoords(e),w)?(c.setFromVector3(w).as("EPSG:4326",d),f.latitude=`${d.y.toFixed(6)}`,f.longitude=`${d.x.toFixed(6)}`,f.altitude=`${d.z.toFixed(2)}`):(f.latitude="---------",f.longitude="---------",f.altitude="---------"),b.updateDisplay(),x.updateDisplay(),_.updateDisplay()};u.add(f,"eventsDebug").name("Debug event").onChange((e=>{e?(y=u.addFolder("Events"),y.open(),c.setFromVector3(M()).as("EPSG:4326",d),f.latitude=`${d.y.toFixed(6)}`,f.longitude=`${d.x.toFixed(6)}`,f.altitude=`${d.z.toFixed(2)}`,b=y.add(f,"latitude"),x=y.add(f,"longitude"),_=y.add(f,"altitude"),t.domElement.addEventListener("mousemove",k)):(t.domElement.removeEventListener("mousemove",k),u.removeFolder("Events"))}));const S=new s.CameraHelper(t.camera3D),D=t.camera3D.clone();D.fov*=1.5,D.updateProjectionMatrix();const C=t.mainLoop.gfxEngine,P=C.renderer;let O=1e11;const E=t.getLayerById("atmosphere");E&&(O=E.fog.distance),S.visible=!1,t.scene.add(S);const T=new a.Z,L=new Dn(T,"",new s.Color(wn));function z(t){t.material&&O&&(t.material.fogDistance=O)}L.visible=!1,t.scene.add(T),t.scene.add(L);const I=new s.Color,R=new s.Vector3;function A(){if(f.debugCameraWindow&&D){const e=.25,s={x:C.width*e,y:C.height*e};D.aspect=s.x/s.y;const o=t.camera3D,a=new n.Z(t.referenceCrs,o.position).as(l.extent.crs),r=t.tileLayer.info.displayed.extent;T.setFromExtent(r),L.visible=!0,L.updateMatrixWorld(!0);const h=1.5*a.z;if(a.z=h,a.as(t.referenceCrs).toVector3(D.position),o.worldToLocal(D.position),D.position.z+=h,o.localToWorld(D.position),R.copy(t.camera3D.position),o.worldToLocal(R),R.z-=1.5*h,o.localToWorld(R),D.lookAt(R),S.update(),D.updateProjectionMatrix(),E){E.object3d.visible=!1,O=1e11;for(const t of l.level0Nodes)t.traverseVisible(z)}const c=f.displayCharts?Math.round(parseFloat(i.style.height.replace("%",""))*C.height/100)+3:0;if(S.visible=!0,S.updateMatrixWorld(!0),P.getClearColor(I),P.setViewport(C.width-s.x,c,s.x,s.y),P.setScissor(C.width-s.x,c,s.x,s.y),P.setScissorTest(!0),P.setClearColor(Mn),P.clear(),P.render(t.scene,D),P.setScissorTest(!1),P.setClearColor(I),P.setViewport(0,0,C.width,C.height),S.visible=!1,L.visible=!1,E&&(E.object3d.visible=!0),E){O=E.fog.distance;for(const t of l.level0Nodes)t.traverseVisible(z)}}}}Cn.prototype.createChartContainer=function(t){const e=document.createElement("div");e.style.cssText=`background-color: ${Mn}; flex: auto;`,this.chartDivContainer.appendChild(e);const i=document.createElement("canvas");return i.height="20rem",i.id=t,e.appendChild(i),i},Cn.prototype.updateChartDivSize=function(){let t=0;for(const e of this.chartDivContainer.getElementsByTagName("div"))"none"!==e.style.display&&t++;const e=Math.floor(100/t);for(const t of this.chartDivContainer.getElementsByTagName("div"))"none"!==t.style.display&&(t.style.width=`${e}%`);this.charts.forEach((t=>{t.resize(),t.update()}))};const Pn=Cn;var On=i(32204);const En={initTools(t,e,i){const s=()=>t.notifyChange(e,!0);e.debugUI=i.addFolder(`${e.id}`),e.debugUI.add(e,"visible").name("Visible").onChange(s),e.debugUI.add(e,"sseThreshold").name("SSE threshold").onChange(s),e.debugUI.add(e,"octreeDepthLimit",-1,20).name("Depth limit").onChange(s),e.debugUI.add(e,"pointBudget",1,15e6).name("Max point count").onChange(s),e.debugUI.add(e.object3d.position,"z",-50,50).name("Z translation").onChange((()=>{e.object3d.updateMatrixWorld(),t.notifyChange(e)})),e.dbgStickyNode="",e.dbgDisplaySticky=!1,e.dbgDisplayChildren=!0,e.dbgDisplayParents=!0;const n=e.debugUI.addFolder("Styling");null!=e.material.mode&&(n.add(e.material,"mode",On.vj).name("Display mode").onChange(s),n.add(e,"maxIntensityRange",0,1).name("Intensity max").onChange(s)),null!=e.material.shape&&n.add(e.material,"shape",On.Uz).name("Shape mode").onChange(s),n.add(e,"opacity",0,1).name("Layer Opacity").onChange(s),n.add(e,"pointSize",0,15).name("Point Size").onChange(s),null!=e.material.sizeMode&&n.add(e.material,"sizeMode",On.E7).name("Point size mode").onChange((()=>{s()})),n.add(e.material,"minAttenuatedSize",0,15).name("Min attenuated size").onChange(s),n.add(e.material,"maxAttenuatedSize",0,15).name("Max attenuated size").onChange(s),null!=e.material.picking&&n.add(e.material,"picking").name("Display picking id").onChange(s);const o=e.debugUI.addFolder("Debug");o.add(e.bboxes,"visible").name("Display Bounding Boxes").onChange(s),o.add(e,"dbgStickyNode").name("Sticky node name").onChange(s),o.add(e,"dbgDisplaySticky").name("Display sticky node").onChange(s),o.add(e,"dbgDisplayChildren").name("Display children of sticky node").onChange(s),o.add(e,"dbgDisplayParents").name("Display parents of sticky node").onChange(s),t.addFrameRequester("before_layer_update",(()=>{if(e.dbgStickyNode.length){e.displayedCount=0;const t=e.dbgStickyNode.split(",");for(const i of e.group.children)i.visible=t.some((t=>{return s=t,n=i.owner.name,e.dbgDisplaySticky&&s===n||e.dbgDisplayParents&&s.startsWith(n)||e.dbgDisplayChildren&&n.startsWith(s);var s,n})),i.boxHelper&&(i.boxHelper.visible=i.visible),i.visible&&(e.displayedCount+=i.geometry.attributes.position.count)}}))}};var Tn=i(36194),Ln=i(20193),zn=i(1857);function In(t,e){let i=0;const s=Date.now(),n={label:"Update 1st level",data:[{x:0,y:0}],borderColor:vn,borderWidth:1.5,pointRadius:1},o={label:"Update duration (ms)",data:[{x:0,y:0}],borderColor:wn,borderWidth:1.5,pointRadius:1},a=["0s"],r=new Js(t,{type:"line",data:{labels:a,datasets:[n,o]},options:{animation:{duration:10},scales:yn}});this.update=(t,h)=>{const l=`${Math.floor((Date.now()-s)/1e3)}s`;i>0&&a[i]==l?a.push(""):(a.push(l),i=a.length-1),a.length>60&&(a.shift(),i--),n.data.push({x:0,y:e._latestUpdateStartingLevel}),o.data.push({x:0,y:h}),n.data.length>60&&(n.data.shift(),o.data.shift()),t&&r.update()},this.resize=()=>{r.resize()}}function Rn(t,e){const i=[],s=[],n=[],o=new Js(t,{type:"bar",data:{labels:i,datasets:[{label:"Visible node per level",data:s,backgroundColor:vn},{label:"Diplayed node per level",data:n,backgroundColor:wn}]},options:{scales:yn}});this.update=t=>{const a={};!function t(i,s){if(i&&i.visible&&(i.level>=0&&i.layer===e&&(s[i.level]?s[i.level][0]+=1:s[i.level]=[1,0],i.material.visible&&(s[i.level][1]+=1)),i.children))for(const e of i.children)t(e,s)}(e.object3d,a),i.length=0,s.length=0;for(const t in a)({}).hasOwnProperty.call(a,t)&&(i[t]=`${t}`,s[t]=a[t][0],n[t]=a[t][1]);t&&o.update()},this.resize=()=>{o.resize()}}function An(t,e,i){t.defineLayerProperty(e,i,(()=>{(t.parent?t.parent.object3d:t.object3d).traverse((i=>{i.layer==t&&i.material?i.material[e]=t[e]:i.content&&i.content.layer==t&&i.content.traverse((i=>{i.material&&(i.material[e]=t[e])}))}))}))}const Fn={addWireFrameCheckbox(t,e,i){t.add(i,"wireframe").name("Wireframe").onChange((()=>e.notifyChange(i)))},addMaterialSize(t,e,i,s,n){An(i,"size",1),t.add(i,"size",s,n).name("Size").onChange((()=>e.notifyChange(i)))},addMaterialLineWidth(t,e,i,s,n){An(i,"linewidth",1),t.add(i,"linewidth",s,n).name("Line Width").onChange((()=>e.notifyChange(i)))},createGeometryDebugUI(t,e,i){const s=t.addFolder(`Layer ${i.id}`);return s.add(i,"visible").name("Visible").onChange((()=>e.notifyChange(i))),s.add(i,"opacity",0,1).name("Opacity").onChange((()=>e.notifyChange(i))),s}};let Vn;function jn(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Vn&&(Vn.material.overlayAlpha=0,Vn.material.showOutline=t.tileLayer.showOutline,t.notifyChange(Vn));const s=t.tileLayer.pickObjectsAt(t,e);return Vn=s.length?s[0].object:void 0,Vn&&(i&&console.info(Vn),Vn.material.overlayAlpha=.5,Vn.material.showOutline=!0,t.notifyChange(Vn)),Vn}function Bn(t,e,i,n){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e.isDebugMode&&!a)return;n=n||new Pn(e,t),i=i||e.tileLayer;const r=Fn.createGeometryDebugUI(t,e,i),h=`${i.id}-nb-objects`,l=n.createChartContainer(h),c=`${i.id}-nb-visible`,d=n.createChartContainer(c);n.charts.push(new In(l.getContext("2d"),i)),n.charts.push(new Rn(d.getContext("2d"),i)),i.showOutline=!1,i.wireframe=!1;const u={objectChart:!0,visibilityChart:!0,sseHelper:!1};r.add(i,"showOutline").name("Show tiles").onChange((t=>{i.showOutline=t,function(e,i,s,n){i.traverse((e=>{e.material&&e.layer===s&&(e.material.showOutline=t)})),e.notifyChange()}(e,i.object3d,i)})),r.add(i,"wireframe").name("Wireframe").onChange((()=>{e.notifyChange(i)})),r.add(u,"objectChart").name("Object chart").onChange((t=>{document.getElementById(h).parentNode.style.display=t?"block":"none",n.updateChartDivSize(),n.charts.forEach((t=>t.update()))})),r.add(u,"visibilityChart").name("Visibility chart").onChange((t=>{document.getElementById(c).parentNode.style.display=t?"block":"none",n.updateChartDivSize(),n.charts.forEach((t=>t.update()))}));const f=`${i.id}_obb_debug`,p=`${i.id}_sb_debug`,g=new s.SphereGeometry(1,16,16);function m(t,e,i){if(!i.parent||!e.visible)return void zn.Z.removeChildrenAndCleanupRecursively(e,i);let n=i.link[e.id];if(i.visible&&i.material&&i.material.visible){if(!n){if(n=new s.Group,n.layer=e,i.matrixWorld.decompose(n.position,n.quaternion,n.scale),e.id==f){const t=new Dn(i.obb);t.layer=e,n.add(t)}else if(e.id==p){const t=new s.Color(Math.random(),Math.random(),Math.random()),o=new s.MeshBasicMaterial({color:t.getHex(),wireframe:!0}),a=new s.Mesh(g,o);a.position.copy(i.boundingSphere.center),a.scale.multiplyScalar(i.boundingSphere.radius),a.scale.set(1,1,1).multiplyScalar(i.boundingSphere.radius),a.layer=e,n.add(a)}i.link[e.id]=n}e.object3d.add(n),n.updateMatrixWorld(!0)}else n&&e.object3d.remove(n)}class b extends Ln.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.update=m,super(t,e.object3d||new s.Group,e),this.isDebugLayer=!0}preUpdate(t,e){e.has(this.parent)&&this.object3d.clear()}}const x=new b(f,{visible:!1,cacheLifeTime:1/0,source:!1});e.addLayer(x).then((t=>{r.add(t,"visible").name("Bounding boxes").onChange((()=>{e.notifyChange(t)}))}));const _=new b(p,{visible:!1,cacheLifeTime:1/0,source:!1});e.addLayer(_).then((t=>{r.add(t,"visible").name("Bounding Spheres").onChange((()=>{e.notifyChange(t)}))}));const y=document.getElementById("viewerDiv"),v=document.createElement("span");v.className="circleBase",y.appendChild(v);const w=new s.Vector3;let M;const k=()=>{Tn.ZP.update(),e.notifyChange()},S=()=>{Tn.ZP.removeAll(),e._frameRequesters[o.Ao.BEFORE_RENDER].includes(k)&&e.removeFrameRequester(o.Ao.BEFORE_RENDER,k)};function D(t){const i=jn(e,t,!1);if(i){v.style.display="table-cell",w.copy(i.boundingSphere.center).applyMatrix4(i.matrixWorld);const t=w.project(e.camera3D),s=e.normalizedToViewCoords(t),n=i.screenSize;if(M!=i){const t=Number(v.style.width.replace("px",""));M=i,S(),new Tn.ZP.Tween({size:t}).to({size:n},500).easing(Tn.ZP.Easing.Sinusoidal.In).easing(Tn.ZP.Easing.Exponential.Out).onUpdate((t=>{v.style["line-height"]=`${t.size}px`,v.style.width=`${t.size}px`,v.style.height=`${t.size}px`,v.innerHTML=`${Math.floor(t.size)} px`,v.style.left=s.x-.5*t.size+"px",v.style.top=s.y-.5*t.size+"px"})).onComplete(S).start(),e.addFrameRequester(o.Ao.BEFORE_RENDER,k)}}else v.style.display="none"}r.add(u,"sseHelper").name("Sse helper").onChange((t=>{t?window.addEventListener("mousemove",D,!1):(v.style.display="none",S(),window.removeEventListener("mousemove",D))}));let C=null;window.addEventListener("mousedown",(t=>{83==C&&jn(e,t)})),window.addEventListener("keydown",(t=>{C=t.which})),window.addEventListener("keyup",(()=>{C=null}))}var Wn=i(36873),Nn=i(24147);const $n=new s.Mesh;function Hn(t,e,i){const n=Fn.createGeometryDebugUI(t,e,i);Fn.addWireFrameCheckbox(n,e,i);const o=`${i.id}_bounding_volume_debug`,a=new Ln.Z(o,new s.Object3D,{update:function(t,e,n){const o=n.userData.metadata;let a=n.userData.boundingVolumeHelper;if(a)a.visible=!(!e.visible||!n.visible);else if(e.visible&&n.visible&&o.boundingVolume){if(o.boundingVolume.initialVolumeType===Nn.D.box){var r,h;if($n.geometry.boundingBox=o.boundingVolume.volume,a=new s.BoxHelper($n),a.material.linewidth=2,null!==(r=o.content)&&void 0!==r&&r.uri&&null!==(h=o.content)&&void 0!==h&&h.uri.endsWith("b3dm")){const t=i.tileset.asset.gltfUpAxis;void 0===t||"Y"===t?a.rotation.x=.5*-Math.PI:"X"===t&&(a.rotation.z=.5*-Math.PI),a.updateMatrix()}}else{if(o.boundingVolume.initialVolumeType!==Nn.D.sphere&&o.boundingVolume.initialVolumeType!==Nn.D.region)return void console.warn(`[3D Tiles Debug]: Unknown bounding volume: ${o.boundingVolume}`);{const t=new s.SphereGeometry(o.boundingVolume.volume.radius,32,32),e=new s.MeshBasicMaterial({wireframe:!0,color:16777215*Math.random()});a=new s.Mesh(t,e)}}n.userData.boundingVolumeHelper=a,n.parent.add(a),a.updateMatrixWorld(!0)}},visible:!1,cacheLifeTime:1/0,source:!1});Wn.Z.prototype.addLayer.call(e,a,i).then((t=>{n.add(t,"visible").name("Bounding boxes").onChange((()=>{e.notifyChange(e.camera3D)}))})),n.add(i,"sseThreshold",0,100).name("sseThreshold").onChange((()=>{e.notifyChange(e.camera3D)})),n.add({frozen:i.frozen},"frozen").onChange((t=>{i.frozen=t,e.notifyChange(i)})),n.add(i,"pntsShape",On.Uz).name("Points Shape").onChange((()=>{e.notifyChange(e.camera.camera3D)})),n.add(i,"pntsSizeMode",On.E7).name("Pnts size mode").onChange((()=>{e.notifyChange(e.camera.camera3D)})),n.add(i,"pntsMinAttenuatedSize",0,15).name("Min attenuated size").onChange((()=>{e.notifyChange(e.camera.camera3D)})),n.add(i,"pntsMaxAttenuatedSize",0,15).name("Max attenuated size").onChange((()=>{e.notifyChange(e.camera.camera3D)}))}}},t=>(70473,t(t.s=70473))]))); +"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("debug",[],e):"object"==typeof exports?exports.debug=e():t.debug=e()}(self,(()=>(self.webpackChunkitowns=self.webpackChunkitowns||[]).push([[711],{31258:(t,e,i)=>{i.r(e),i.d(e,{Debug:()=>Pn,GeometryDebug:()=>Bn,PotreeDebug:()=>An,create3dTilesDebugUI:()=>Xn,createTileDebugUI:()=>Hn});var s=i(99477),n=i(62310),o=i(99617),a=i(67490);function r(t){return t+.5|0}const h=(t,e,i)=>Math.max(Math.min(t,i),e);function l(t){return h(r(2.55*t),0,255)}function c(t){return h(r(255*t),0,255)}function d(t){return h(r(t/2.55)/100,0,1)}function u(t){return h(r(100*t),0,100)}const g={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},f=[..."0123456789ABCDEF"],p=t=>f[15&t],m=t=>f[(240&t)>>4]+f[15&t],b=t=>(240&t)>>4==(15&t);const x=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function y(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function _(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function v(t,e,i){const s=y(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function w(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,h,l;return n!==o&&(l=n-o,h=a>.5?l/(2-n-o):l/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(et<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,R=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function I(t,e,i){if(t){let s=w(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=k(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function T(t,e){return t?Object.assign(e||{},t):t}function A(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=c(t[3]))):(e=T(t,{r:0,g:0,b:0,a:1})).a=c(e.a),e}function L(t){return"r"===t.charAt(0)?function(t){const e=O.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?l(t):h(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?l(i):h(i,0,255)),s=255&(e[4]?l(s):h(s,0,255)),n=255&(e[6]?l(n):h(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):function(t){const e=x.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?l(+e[5]):c(+e[5]));const n=S(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return M(v,t,e,i)}(n,o,a):"hsv"===e[1]?function(t,e,i){return M(_,t,e,i)}(n,o,a):k(n,o,a),{r:i[0],g:i[1],b:i[2],a:s}}(t)}class z{constructor(t){if(t instanceof z)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=A(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*g[s[1]],g:255&17*g[s[2]],b:255&17*g[s[3]],a:5===o?17*g[s[4]]:255}:7!==o&&9!==o||(n={r:g[s[1]]<<4|g[s[2]],g:g[s[3]]<<4|g[s[4]],b:g[s[5]]<<4|g[s[6]],a:9===o?g[s[7]]<<4|g[s[8]]:255})),i=n||function(t){P||(P=function(){const t={},e=Object.keys(D),i=Object.keys(C);let s,n,o,a,r;for(s=0;s>16&255,o>>8&255,255&o]}return t}(),P.transparent=[0,0,0,0]);const e=P[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||L(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=T(this._rgb);return t&&(t.a=d(t.a)),t}set rgb(t){this._rgb=A(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${d(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?(t=this._rgb,e=(t=>b(t.r)&&b(t.g)&&b(t.b)&&b(t.a))(t)?p:m,t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0):void 0;var t,e}hslString(){return this._valid?function(t){if(!t)return;const e=w(t),i=e[0],s=u(e[1]),n=u(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${d(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,h=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;n=1-h,i.r=255&h*i.r+n*s.r+.5,i.g=255&h*i.g+n*s.g+.5,i.b=255&h*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=R(d(t.r)),n=R(d(t.g)),o=R(d(t.b));return{r:c(E(s+i*(R(d(e.r))-s))),g:c(E(n+i*(R(d(e.g))-n))),b:c(E(o+i*(R(d(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new z(this.rgb)}alpha(t){return this._rgb.a=c(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=r(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return I(this._rgb,2,t),this}darken(t){return I(this._rgb,2,-t),this}saturate(t){return I(this._rgb,1,t),this}desaturate(t){return I(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=w(t);i[0]=S(i[0]+e),i=k(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}const F=(()=>{let t=0;return()=>t++})();function V(t){return null==t}function j(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function N(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function B(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function W(t,e){return B(t)?t:e}function $(t,e){return void 0===t?e:t}function H(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function U(t,e,i,s){let n,o,a;if(j(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;nt,x:t=>t.x,y:t=>t.y};function tt(t,e){const i=J[e]||(J[e]=function(t){const e=function(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function et(t){return t.charAt(0).toUpperCase()+t.slice(1)}const it=t=>void 0!==t,st=t=>"function"==typeof t,nt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},ot=Math.PI,at=2*ot,rt=at+ot,ht=Number.POSITIVE_INFINITY,lt=ot/180,ct=ot/2,dt=ot/4,ut=2*ot/3,gt=Math.log10,ft=Math.sign;function pt(t,e,i){return Math.abs(t-e)h&&l=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function Ct(t,e,i){i=i||(i=>t[i]1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const Dt=(t,e,i,s)=>Ct(t,i,s?s=>{const n=t[s][e];return nt[s][e]Ct(t,i,(s=>t[s][e]>=i)),Ot=["push","pop","shift","splice","unshift"];function Et(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(Ot.forEach((e=>{delete t[e]})),delete t._chartjs)}const Rt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function It(t,e){let i=[],s=!1;return function(...n){i=n,s||(s=!0,Rt.call(window,(()=>{s=!1,t.apply(e,i)})))}}const Tt=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;const At=t=>0===t||1===t,Lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*at/i),zt=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*at/i)+1,Ft={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*ct),easeOutSine:t=>Math.sin(t*ct),easeInOutSine:t=>-.5*(Math.cos(ot*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>At(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>At(t)?t:Lt(t,.075,.3),easeOutElastic:t=>At(t)?t:zt(t,.075,.3),easeInOutElastic(t){const e=.1125;return At(t)?t:t<.5?.5*Lt(2*t,e,.45):.5+.5*zt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Ft.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Ft.easeInBounce(2*t):.5*Ft.easeOutBounce(2*t-1)+.5};function Vt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function jt(t){return Vt(t)?t:new z(t)}function Nt(t){return Vt(t)?t:new z(t).saturate(.5).darken(.1).hexString()}const Bt=["x","y","borderWidth","radius","tension"],Wt=["color","borderColor","backgroundColor"],$t=new Map;function Ht(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=$t.get(i);return s||(s=new Intl.NumberFormat(t,e),$t.set(i,s)),s}(e,i).format(t)}const Ut={values:t=>j(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}const a=gt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),h={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(h,this.options.ticks.format),Ht(t,s,h)},logarithmic(t,e,i){if(0===t)return"0";const s=i[e].significand||t/Math.pow(10,Math.floor(gt(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?Ut.numeric.call(this,t,e,i):""}};var Yt={formatters:Ut};const qt=Object.create(null),Xt=Object.create(null);function Zt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Nt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Nt(e.borderColor),this.hoverColor=(t,e)=>Nt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Gt(this,t,e)}get(t){return Zt(this,t)}describe(t,e){return Gt(Xt,t,e)}override(t,e){return Gt(qt,t,e)}route(t,e,i,s){const n=Zt(this,t),o=Zt(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return N(t)?Object.assign({},e,t):$(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach((t=>t(this)))}}var Qt=new Kt({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:Wt},numbers:{type:"number",properties:Bt}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Yt.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function Jt(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function te(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function ee(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ie(t,e,i,s){!function(t,e,i,s,n){let o,a,r,h,l,c,d,u;const g=e.pointStyle,f=e.rotation,p=e.radius;let m=(f||0)*lt;if(g&&"object"==typeof g&&(o=g.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,s),t.rotate(m),t.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),g){default:n?t.ellipse(i,s,n/2,p,0,0,at):t.arc(i,s,p,0,at),t.closePath();break;case"triangle":c=n?n/2:p,t.moveTo(i+Math.sin(m)*c,s-Math.cos(m)*p),m+=ut,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*p),m+=ut,t.lineTo(i+Math.sin(m)*c,s-Math.cos(m)*p),t.closePath();break;case"rectRounded":l=.516*p,h=p-l,a=Math.cos(m+dt)*h,d=Math.cos(m+dt)*(n?n/2-l:h),r=Math.sin(m+dt)*h,u=Math.sin(m+dt)*(n?n/2-l:h),t.arc(i-d,s-r,l,m-ot,m-ct),t.arc(i+u,s-a,l,m-ct,m),t.arc(i+d,s+r,l,m,m+ct),t.arc(i-u,s+a,l,m+ct,m+ot),t.closePath();break;case"rect":if(!f){h=Math.SQRT1_2*p,c=n?n/2:h,t.rect(i-c,s-h,2*c,2*h);break}m+=dt;case"rectRot":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+u,s-a),t.lineTo(i+d,s+r),t.lineTo(i-u,s+a),t.closePath();break;case"crossRot":m+=dt;case"cross":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a),m+=dt,d=Math.cos(m)*(n?n/2:p),a=Math.cos(m)*p,r=Math.sin(m)*p,u=Math.sin(m)*(n?n/2:p),t.moveTo(i-d,s-r),t.lineTo(i+d,s+r),t.moveTo(i+u,s-a),t.lineTo(i-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*p,r=Math.sin(m)*p,t.moveTo(i-a,s-r),t.lineTo(i+a,s+r);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(n?n/2:p),s+Math.sin(m)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}(t,e,i,s,null)}function se(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let h,l;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),V(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),h=0;h+t||0;function me(t,e){const i={},s=N(e),n=s?Object.keys(e):e,o=N(t)?s?i=>$(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=pe(o(t));return i}function be(t){return me(t,{top:"y",right:"x",bottom:"y",left:"x"})}function xe(t){const e=be(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ye(t,e){t=t||{},e=e||Qt.font;let i=$(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=$(t.style,e.style);s&&!(""+s).match(ge)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:$(t.family,e.family),lineHeight:fe($(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:$(t.weight,e.weight),string:""};return n.string=function(t){return!t||V(t.size)||V(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n}function _e(t,e,i,s){let n,o,a,r=!0;for(n=0,o=t.length;nt[0])){const o=i||t;void 0===s&&(s=Te("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:s,_getTarget:n,override:i=>we([i,...t],e,o,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>De(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=Te(Se(o,t),i),void 0!==n)return Ce(t,n)?Re(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Ae(t).includes(e),ownKeys:t=>Ae(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function Me(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ke(t,s),setContext:e=>Me(t,e,i,s),override:n=>Me(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>De(t,e,(()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let r=s[e];return st(r)&&a.isScriptable(e)&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let h=e(o,a||s);return r.delete(t),Ce(t,h)&&(h=Re(n._scopes,n,t,h)),h}(e,r,t,i)),j(r)&&r.length&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(void 0!==o.index&&s(t))return e[o.index%e.length];if(N(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const h of i){const i=Re(s,n,t,h);e.push(Me(i,o,a&&a[t],r))}}return e}(e,r,t,a.isIndexable)),Ce(e,r)&&(r=Me(r,n,o&&o[e],a)),r}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function ke(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:st(i)?i:()=>i,isIndexable:st(s)?s:()=>s}}const Se=(t,e)=>t?t+et(e):e,Ce=(t,e)=>N(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function De(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function Pe(t,e,i){return st(t)?t(e,i):t}const Oe=(t,e)=>!0===t?e:"string"==typeof t?tt(e,t):void 0;function Ee(t,e,i,s,n){for(const o of e){const e=Oe(i,o);if(e){t.add(e);const o=Pe(e._fallback,i,n);if(void 0!==o&&o!==i&&o!==s)return o}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}function Re(t,e,i,s){const n=e._rootScopes,o=Pe(e._fallback,i,s),a=[...t,...n],r=new Set;r.add(s);let h=Ie(r,a,i,o||i,s);return null!==h&&(void 0===o||o===i||(h=Ie(r,a,o,h,s),null!==h))&&we(Array.from(r),[""],n,o,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return j(n)&&N(i)?i:n||{}}(e,i,s)))}function Ie(t,e,i,s,n){for(;i;)i=Ee(t,e,i,s,n);return i}function Te(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function Ae(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const Le=Number.EPSILON||1e-14,ze=(t,e)=>e"x"===t?"y":"x";function Ve(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=_t(o,n),h=_t(a,o);let l=r/(r+h),c=h/(r+h);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const d=s*l,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function je(t,e,i){return Math.max(Math.min(t,i),e)}function Ne(t,e,i,s,n){let o,a,r,h;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const i=Fe(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,h,l=ze(t,0);for(a=0;at.ownerDocument.defaultView.getComputedStyle(t,null),Ue=["top","right","bottom","left"];function Ye(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=Ue[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const qe=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function Xe(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=He(i),o="border-box"===n.boxSizing,a=Ye(n,"padding"),r=Ye(n,"border","width"),{x:h,y:l,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,h=!1;if(qe(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,h=!0}return{x:a,y:r,box:h}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:g,height:f}=e;return o&&(g-=a.width+r.width,f-=a.height+r.height),{x:Math.round((h-d)/g*i.width/s),y:Math.round((l-u)/f*i.height/s)}}const Ze=t=>Math.round(10*t)/10;function Ge(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Ke=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};Be()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Qe(t,e){const i=function(t,e){return He(t).getPropertyValue(e)}(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Je(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ti(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function ei(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=Je(t,n,i),r=Je(n,o,i),h=Je(o,e,i),l=Je(a,r,i),c=Je(r,h,i);return Je(l,c,i)}function ii(t){return"angle"===t?{between:Mt,compare:vt,normalize:wt}:{between:St,compare:(t,e)=>t-e,normalize:t=>t}}function si({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function ni(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:h,normalize:l}=ii(s),{start:c,end:d,loop:u,style:g}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=ii(s),h=e.length;let l,c,{start:d,end:u,loop:g}=t;if(g){for(d+=h,u+=h,l=0,c=h;ls({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=Rt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var hi=new ri;const li="transparent",ci={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=jt(t||li),n=s.valid&&jt(e||li);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class di{constructor(t,e,i,s){const n=e[i];s=_e([t.to,s,n,t.from]);const o=_e([t.from,n,s]);this._active=!0,this._fn=t.fn||ci[t.type||typeof o],this._easing=Ft[t.easing]||Ft.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=_e([t.to,e,s,t.from]),this._from=_e([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t{const n=t[s];if(!N(n))return;const o={};for(const t of e)o[t]=n[t];(j(n.properties)&&n.properties||[s]).forEach((t=>{t!==s&&i.has(t)||i.set(t,o)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const h=o[r];if("$"===h.charAt(0))continue;if("options"===h){s.push(...this._animateOptions(t,e));continue}const l=e[h];let c=n[h];const d=i.get(h);if(c){if(d&&c.active()){c.update(d,l,a);continue}c.cancel()}d&&d.duration?(n[h]=c=new di(d,t,h,l),s.push(c)):t[h]=l}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(hi.add(this._chart,i),!0):void 0}}function gi(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function fi(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n0||!i&&e<0)return n.index}return null}function yi(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,h=o.axis,l=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;ti[t].axis===e)).shift()}function vi(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i],void 0!==e[s]._visualValues&&void 0!==e[s]._visualValues[i]&&delete e[s]._visualValues[i]}}}const wi=t=>"reset"===t||"none"===t,Mi=(t,e)=>e?t:Object.assign({},t);class ki{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=mi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&vi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=$(i.xAxisID,_i(t,"x")),o=e.yAxisID=$(i.yAxisID,_i(t,"y")),a=e.rAxisID=$(i.rAxisID,_i(t,"r")),r=e.indexAxis,h=e.iAxisID=s(r,n,o,a),l=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Et(this._data,this),t._stacked&&vi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(N(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,n,o;for(s=0,n=e.length;s{const e="_onData"+et(t),i=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...t){const n=i.apply(this,t);return s._chartjs.listeners.forEach((i=>{"function"==typeof i[e]&&i[e](...t)})),n}})})))),this._syncList=[],this._data=e}var s}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=mi(e.vScale,e),e.stack!==i.stack&&(s=!0,vi(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&yi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,h,l,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,l=s;else{l=j(s[t])?this.parseArrayData(i,s,t,e):N(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===h[a]||d&&h[a]t&&!e.hidden&&e._stacked&&{keys:fi(i,!0),values:null})(e,i,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:l,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(a);let d,u;function g(){u=s[d];const e=u[a.axis];return!B(u[t.axis])||l>e||c=0;--d)if(!g()){this.updateRangeFromParsed(h,t,u,r);break}return h}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s=0&&tthis.getContext(i,s,e)),c);return g.$shared&&(g.$shared=r,n[o]=Object.freeze(Mi(g,r))),g}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const h=new ui(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||wi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,n=this.getSharedOptions(i),o=this.includeOptions(e,n)||n!==s;return this.updateSharedOptions(n,e,i),{sharedOptions:n,includeOptions:o}}updateElement(t,e,i,s){wi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!wi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;at-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const h=()=>{32767!==o&&-32768!==o&&(it(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;sMath.abs(r)&&(h=r,l=a),e[i.axis]=l,e._custom={barStart:h,barEnd:l,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function Di(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,h=[];let l,c,d,u;for(l=i,c=i+s;lt.x,i="left",s="right"):(e=t.base{t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:h}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var Vi={evaluateInteractionItems:Ai,modes:{index(t,e,i,s){const n=Xe(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?Li(t,n,o,s,a):zi(t,n,o,!1,s,a),h=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&h.push({element:i,datasetIndex:t.index,index:e})})),h):[]},dataset(t,e,i,s){const n=Xe(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?Li(t,n,o,s,a):zi(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;tLi(t,Xe(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=Xe(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return zi(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>Fi(t,Xe(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Fi(t,Xe(e,t),"y",i.intersect,s)}};const ji=["left","top","right","bottom"];function Ni(t,e){return t.filter((t=>t.pos===e))}function Bi(t,e){return t.filter((t=>-1===ji.indexOf(t.pos)&&t.box.axis===e))}function Wi(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function $i(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Hi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ui(t,e,i,s){const{pos:n,box:o}=i,a=t.maxPadding;if(!N(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&Hi(a,o.getPadding());const r=Math.max(0,e.outerWidth-$i(a,t,"left","right")),h=Math.max(0,e.outerHeight-$i(a,t,"top","bottom")),l=r!==t.w,c=h!==t.h;return t.w=r,t.h=h,i.horizontal?{same:l,other:c}:{same:c,other:l}}function Yi(t,e){const i=e.maxPadding;return function(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}(t?["left","right"]:["top","bottom"])}function qi(t,e,i,s){const n=[];let o,a,r,h,l,c;for(o=0,a=t.length,l=0;ot.box.fullSize)),!0),s=Wi(Ni(e,"left"),!0),n=Wi(Ni(e,"right")),o=Wi(Ni(e,"top"),!0),a=Wi(Ni(e,"bottom")),r=Bi(e,"x"),h=Bi(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(h).concat(a).concat(r),chartArea:Ni(e,"chartArea"),vertical:s.concat(n).concat(h),horizontal:o.concat(a).concat(r)}}(t.boxes),h=r.vertical,l=r.horizontal;U(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=h.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);Hi(u,xe(s));const g=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),f=function(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!ji.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o{const i=e.box;Object.assign(i,t.chartArea),i.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})}))}};class Ki{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Qi extends Ki{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ji="$chartjs",ts={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},es=t=>null===t||""===t,is=!!Ke&&{passive:!0};function ss(t,e,i){t.canvas.removeEventListener(e,i,is)}function ns(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function os(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ns(i.addedNodes,s),e=e&&!ns(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function as(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ns(i.removedNodes,s),e=e&&!ns(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const rs=new Map;let hs=0;function ls(){const t=window.devicePixelRatio;t!==hs&&(hs=t,rs.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function cs(t,e,i){const s=t.canvas,n=s&&We(s);if(!n)return;const o=It(((t,e)=>{const s=n.clientWidth;i(t,e),s{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)}));return a.observe(n),function(t,e){rs.size||window.addEventListener("resize",ls),rs.set(t,e)}(t,o),a}function ds(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){rs.delete(t),rs.size||window.removeEventListener("resize",ls)}(t)}function us(t,e,i){const s=t.canvas,n=It((e=>{null!==t.ctx&&i(function(t,e){const i=ts[t.type]||t.type,{x:s,y:n}=Xe(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t);return function(t,e,i){t.addEventListener(e,i,is)}(s,e,n),n}class gs extends Ki{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[Ji]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",es(n)){const e=Qe(t,"width");void 0!==e&&(t.width=e)}if(es(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Qe(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ji])return!1;const i=e[Ji].initial;["height","width"].forEach((t=>{const s=i[t];V(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e[Ji],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:os,detach:as,resize:cs}[e]||us;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:ds,detach:ds,resize:ds}[e]||ss)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){const n=He(t),o=Ye(n,"margin"),a=$e(n.maxWidth,t,"clientWidth")||ht,r=$e(n.maxHeight,t,"clientHeight")||ht,h=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=We(t);if(o){const t=o.getBoundingClientRect(),a=He(o),r=Ye(a,"border","width"),h=Ye(a,"padding");e=t.width-h.width-r.width,i=t.height-h.height-r.height,s=$e(a.maxWidth,o,"clientWidth"),n=$e(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||ht,maxHeight:n||ht}}(t,e,i);let{width:l,height:c}=h;if("content-box"===n.boxSizing){const t=Ye(n,"border","width"),e=Ye(n,"padding");l-=e.width+t.width,c-=e.height+t.height}return l=Math.max(0,l-o.width),c=Math.max(0,s?l/s:c-o.height),l=Ze(Math.min(l,a,h.maxWidth)),c=Ze(Math.min(c,r,h.maxHeight)),l&&!c&&(c=Ze(l/2)),(void 0!==e||void 0!==i)&&s&&h.height&&c>h.height&&(c=h.height,l=Ze(Math.floor(c*s))),{width:l,height:c}}(t,e,i,s)}isAttached(t){const e=We(t);return!(!e||!e.isConnected)}}class fs{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return bt(this.x)&&bt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}function ps(t,e,i,s,n){const o=$(s,0),a=Math.min($(n,t.length),t.length);let r,h,l,c=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),l=o;l<0;)c++,l=Math.round(o+c*i);for(h=Math.max(o,0);h"top"===e||"left"===e?t[e]+i:t[e]-i,bs=(t,e)=>Math.min(e||t,t);function xs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return l}function _s(t){return t.drawTicks?t.tickLength:0}function vs(t,e){if(!t.display)return 0;const i=ye(t.font,e),s=xe(t.padding);return(j(t.text)?t.text.length:1)*i.lineHeight+s.height}function ws(t,e,i){let s=(t=>"start"===t?"left":"end"===t?"right":"center")(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=(t=>"left"===t?"right":"right"===t?"left":t)(s)),s}class Ms extends fs{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=W(t,Number.POSITIVE_INFINITY),e=W(e,Number.NEGATIVE_INFINITY),i=W(i,Number.POSITIVE_INFINITY),s=W(s,Number.NEGATIVE_INFINITY),{min:W(t,i),max:W(e,s),minDefined:B(t),maxDefined:B(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,h=a.length;rs?s:i,s=n&&i>s?i:s,{min:W(i,W(s,i)),max:W(s,W(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:s,max:n}=t,o=(h=(n-s)/2,"string"==typeof(r=e)&&r.endsWith("%")?parseFloat(r)/100*h:+r),a=(t,e)=>i&&0===t?0:t+e;var r,h;return{min:a(s,-Math.abs(o)),max:a(n,o)}}(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=an)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;nt-e)).pop(),e}(s);for(let t=0,e=o.length-1;tn)return e}return Math.max(n,1)}(o,e,n);if(a>0){let t,i;const s=a>1?Math.round((h-r)/(a-1)):null;for(ps(e,l,c,V(s)?0:r-s,r),t=0,i=a-1;t=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const l=this._getLabelSizes(),c=l.widest.width,d=l.highest.height,u=kt(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-_s(t.grid)-e.padding-vs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),h=Math.min(Math.asin(kt((l.highest.height+6)/o,-1,1)),Math.asin(kt(a/r,-1,1))-Math.asin(kt(d/r,-1,1)))*(180/ot),h=Math.max(s,Math.min(n,h))),this.labelRotation=h}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=vs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=_s(n)+o):(t.height=this.maxHeight,t.width=_s(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,h=xt(this.labelRotation),l=Math.cos(h),c=Math.sin(h);if(a){const e=i.mirror?0:c*n.width+l*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:l*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,l)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,h="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?h?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-l+o)*this.width/(this.width-l),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){H(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n({width:o[t]||0,height:a[t]||0});return{first:M(0),last:M(e-1),widest:M(v),highest:M(w),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return kt(this._alignToPixels?te(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:r/s:r*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o,border:a}=s,r=n.offset,h=this.isHorizontal(),l=this.ticks.length+(r?1:0),c=_s(n),d=[],u=a.setContext(this.getContext()),g=u.display?u.width:0,f=g/2,p=function(t){return te(i,t,g)};let m,b,x,y,_,v,w,M,k,S,C,D;if("top"===o)m=p(this.bottom),v=this.bottom-c,M=m-f,S=p(t.top)+f,D=t.bottom;else if("bottom"===o)m=p(this.top),S=t.top,D=p(t.bottom)-f,v=m+f,M=this.top+c;else if("left"===o)m=p(this.right),_=this.right-c,w=m-f,k=p(t.left)+f,C=t.right;else if("right"===o)m=p(this.left),k=t.left,C=p(t.right)-f,_=m+f,w=this.left+c;else if("x"===e){if("center"===o)m=p((t.top+t.bottom)/2+.5);else if(N(o)){const t=Object.keys(o)[0],e=o[t];m=p(this.chart.scales[t].getPixelForValue(e))}S=t.top,D=t.bottom,v=m+f,M=v+c}else if("y"===e){if("center"===o)m=p((t.left+t.right)/2);else if(N(o)){const t=Object.keys(o)[0],e=o[t];m=p(this.chart.scales[t].getPixelForValue(e))}_=m-f,w=_-c,k=t.left,C=t.right}const P=$(s.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/P));for(b=0;b0&&(o-=s/2)}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}p.push({label:y,font:k,textOffset:D,options:{rotation:f,color:i,strokeColor:r,strokeWidth:l,textAlign:u,textBaseline:P,translation:[_,v],backdrop:d}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,h;return"left"===e?s?(h=this.right+n,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h+=a)):(h=this.right-o,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h=this.left)):"right"===e?s?(h=this.left+n,"near"===i?r="right":"center"===i?(r="center",h-=a/2):(r="left",h-=a)):(h=this.left+o,"near"===i?r="left":"center"===i?(r="center",h+=a/2):(r="right",h=this.right)):r="right",{textAlign:r,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),h=a.join(".");Qt.route(o,n,h,r)}))}(e,t.defaultRoutes),t.descriptors&&Qt.describe(e,t.descriptors)}(t,o,i),this.override&&Qt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Qt[s]&&(delete Qt[s][i],this.override&&delete qt[i])}}class Ss{constructor(){this.controllers=new ks(ki,"datasets",!0),this.elements=new ks(fs,"elements"),this.plugins=new ks(Object,"plugins"),this.scales=new ks(Ms,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):U(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=et(t);H(i["before"+s],[],i),e[t](i),H(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Ps(t,e){return e||!1!==t?!0===t?{}:t:null}function Os(t,{plugin:e,local:i},s,n){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(s,o);return i&&e.defaults&&a.push(e.defaults),t.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Es(t,e){const i=Qt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Rs(t){if("x"===t||"y"===t||"r"===t)return t}function Is(t,...e){if(Rs(t))return t;for(const s of e){const e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&Rs(t[0].toLowerCase());if(e)return e}var i;throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Ts(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function As(t){const e=t.options||(t.options={});e.plugins=$(e.plugins,{}),e.scales=function(t,e){const i=qt[t.type]||{scales:{}},s=e.scales||{},n=Es(t.type,e),o=Object.create(null);return Object.keys(s).forEach((e=>{const a=s[e];if(!N(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const r=Is(e,a,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter((e=>e.xAxisID===t||e.yAxisID===t));if(i.length)return Ts(t,"x",i[0])||Ts(t,"y",i[0])}return{}}(e,t),Qt.scales[a.type]),h=function(t,e){return t===e?"_index_":"_value_"}(r,n),l=i.scales||{};o[e]=K(Object.create(null),[{axis:r},a,l[r],l[h]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,a=i.indexAxis||Es(n,e),r=(qt[n]||{}).scales||{};Object.keys(r).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,a),n=i[e+"AxisID"]||e;o[n]=o[n]||Object.create(null),K(o[n],[{axis:e},s[n],r[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];K(e,[Qt.scales[e.type],Qt.scale])})),o}(t,e)}function Ls(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const zs=new Map,Fs=new Set;function Vs(t,e){let i=zs.get(t);return i||(i=e(),zs.set(t,i),Fs.add(i)),i}const js=(t,e,i)=>{const s=tt(e,i);void 0!==s&&t.add(s)};class Ns{constructor(t){this._config=function(t){return(t=t||{}).data=Ls(t.data),As(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ls(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),As(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Vs(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Vs(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Vs(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Vs(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>js(r,t,e)))),e.forEach((t=>js(r,s,t))),e.forEach((t=>js(r,qt[n]||{},t))),e.forEach((t=>js(r,Qt,t))),e.forEach((t=>js(r,Xt,t)))}));const h=Array.from(r);return 0===h.length&&h.push(Object.create(null)),Fs.has(e)&&o.set(e,h),h}chartOptionScopes(){const{options:t,type:e}=this;return[t,qt[e]||{},Qt.datasets[e]||{},{type:e},Qt,Xt]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=Bs(this._resolverCache,t,s);let r=o;(function(t,e){const{isScriptable:i,isIndexable:s}=ke(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(st(a)||Ws(a))||o&&j(a))return!0}return!1})(o,e)&&(n.$shared=!1,r=Me(o,i=st(i)?i():i,this.createResolver(t,i,a)));for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=Bs(this._resolverCache,t,i);return N(e)?Me(n,e,void 0,s):n}}function Bs(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);return o||(o={resolver:we(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)),o}const Ws=t=>N(t)&&Object.getOwnPropertyNames(t).some((e=>st(t[e]))),$s=["top","bottom","left","right","chartArea"];function Hs(t,e){return"top"===t||"bottom"===t||-1===$s.indexOf(t)&&"x"===e}function Us(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function Ys(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),H(i&&i.onComplete,[t],e)}function qs(t){const e=t.chart,i=e.options.animation;H(i&&i.onProgress,[t],e)}function Xs(t){return Be()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Zs={},Gs=t=>{const e=Xs(t);return Object.values(Zs).filter((t=>t.canvas===e)).pop()};function Ks(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}function Qs(t,e,i){return t.options.clip?t[i]:e[i]}class Js{static defaults=Qt;static instances=Zs;static overrides=qt;static registry=Cs;static version="4.4.1";static getChart=Gs;static register(...t){Cs.add(...t),tn()}static unregister(...t){Cs.remove(...t),tn()}constructor(t,e){const i=this.config=new Ns(e),s=Xs(t),n=Gs(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas with ID '"+n.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!Be()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Qi:gs}(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),r=a&&a.canvas,h=r&&r.height,l=r&&r.width;this.id=F(),this.ctx=a,this.canvas=r,this.width=l,this.height=h,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ds,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],Zs[this.id]=this,a&&r?(hi.listen(this,"complete",Ys),hi.listen(this,"progress",qs),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return V(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Cs}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ge(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ee(this.canvas,this.ctx),this}stop(){return hi.stop(this),this}resize(t,e){hi.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ge(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),H(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){U(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=Is(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),U(n,(e=>{const n=e.options,o=n.id,a=Is(o,n),r=$(n.type,e.dtype);void 0!==n.position&&Hs(n.position,a)===Hs(e.dposition)||(n.position=e.dposition),s[o]=!0;let h=null;o in i&&i[o].type===r?h=i[o]:(h=new(Cs.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[h.id]=h),h.init(n,t)})),U(s,((t,e)=>{t||delete i[e]})),U(i,(t=>{Gi.configure(this,t,t.options),Gi.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Us("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){U(this.scales,(t=>{Gi.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);nt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e)Ks(t,s,"_removeElements"===i?-n:n)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Gi.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],U(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=function(t,e){const{xScale:i,yScale:s}=t;return i&&s?{left:Qs(i,e,"left"),right:Qs(i,e,"right"),top:Qs(s,e,"top"),bottom:Qs(s,e,"bottom")}:e}(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&ne(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&oe(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return se(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Vi.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=ve(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);it(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),hi.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};U(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){U(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},U(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!Y(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter((e=>e.plugin.id===t)).length}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),h=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,H(n.onHover,[t,a,this],this),r&&H(n.onClick,[t,a,this],this));const l=!Y(a,s);return(l||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=h,l}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}function tn(){return U(Js.instances,(t=>t._plugins.invalidate()))}function en(t,e,i=e){t.lineCap=$(i.borderCapStyle,e.borderCapStyle),t.setLineDash($(i.borderDash,e.borderDash)),t.lineDashOffset=$(i.borderDashOffset,e.borderDashOffset),t.lineJoin=$(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=$(i.borderWidth,e.borderWidth),t.strokeStyle=$(i.borderColor,e.borderColor)}function sn(t,e,i){t.lineTo(i.x,i.y)}function nn(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,h=Math.max(n,a),l=Math.min(o,r),c=nr&&o>r;return{count:s,start:h,loop:e.loop,ilen:l(a+(l?r-t:t))%o,y=()=>{g!==f&&(t.lineTo(m,f),t.lineTo(m,g),t.lineTo(m,p))};for(h&&(d=n[x(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[x(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(if&&(f=i),m=(b*m+e)/++b):(y(),t.lineTo(e,i),u=s,b=0,g=f=i),p=i}y()}function rn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?on:an}const hn="function"==typeof Path2D;function ln(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)=0&&ts=e?s:t,a=t=>n=i?n:t;if(t){const t=ft(s),e=ft(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=0===n?1:Math.abs(.05*n);a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:n,min:o,max:a,precision:r,count:h,maxTicks:l,maxDigits:c,includeBounds:d}=t,u=n||1,g=l-1,{min:f,max:p}=e,m=!V(o),b=!V(a),x=!V(h),y=(p-f)/(c+1);let _,v,w,M,k=mt((p-f)/g/u)*u;if(k<1e-14&&!m&&!b)return[{value:f},{value:p}];M=Math.ceil(p/k)-Math.floor(f/k),M>g&&(k=mt(M*k/g/u)*u),V(r)||(_=Math.pow(10,r),k=Math.ceil(k*_)/_),"ticks"===s?(v=Math.floor(f/k)*k,w=Math.ceil(p/k)*k):(v=f,w=p),m&&b&&n&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((a-o)/n,k/1e3)?(M=Math.round(Math.min((a-o)/k,l)),k=(a-o)/M,v=o,w=a):x?(v=m?o:v,w=b?a:w,M=h-1,k=(w-v)/M):(M=(w-v)/k,M=pt(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(yt(k),yt(v));_=Math.pow(10,V(r)?S:r),v=Math.round(v*_)/_,w=Math.round(w*_)/_;let C=0;for(m&&(d&&v!==o?(i.push({value:o}),va)break;i.push({value:t})}return b&&d&&w!==a?i.length&&pt(i[i.length-1].value,a,bn(a,y,t))?i[i.length-1].value=a:i.push({value:a}):b&&w!==a||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&function(t,e,i){let s,n,o;for(s=0,n=t.length;s{const h=Math.floor((Date.now()-s)/1e3),l=`${h}s`;i>0&&a[i]==l?a.push(""):(a.push(l),i=a.length-1),a.length>60&&(a.shift(),i--);const c=e.info.memory;n.data.push({x:h,y:c.textures}),o.data.push({x:h,y:c.geometries}),n.data.length>60&&(n.data.shift(),o.data.shift()),t&&r.update()},this.resize=()=>{r.resize()}}Js.register(class extends ki{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:a,count:r}=function(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,h=a.axis,{min:l,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=kt(Math.min(Dt(r,h,l).lo,i?s:Dt(e,h,a.getPixelForValue(l)).lo),0,s-1)),o=u?kt(Math.max(Dt(r,a.axis,c,!0).hi+1,i?0:Dt(e,h,a.getPixelForValue(c),!0).hi+1),n,s)-n:s-n}return{start:n,count:o}}(e,s,o);this._drawStart=a,this._drawCount=r,function(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:h},t),this.updateElements(s,a,r,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a,_stacked:r,_dataset:h}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),d=o.axis,u=a.axis,{spanGaps:g,segment:f}=this.options,p=bt(g)?g:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||n||"none"===s,b=e+i,x=t.length;let y=e>0&&this.getParsed(e-1);for(let i=0;i=b){x.skip=!0;continue}const _=this.getParsed(i),v=V(_[u]),w=x[d]=o.getPixelForValue(_[d],i),M=x[u]=n||v?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,_,r):_[u],i);x.skip=isNaN(w)||isNaN(M)||v,x.stop=i>0&&Math.abs(_[d]-y[d])>p,f&&(x.parsed=_,x.raw=h.data[i]),c&&(x.options=l||this.resolveDataElementOptions(i,g.active?"active":s)),m||this.updateElement(g,i,x,s),y=_}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},class extends fs{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Ne(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;nn&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);return function(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=oi(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,h=i.length,l=[];let c=o,d=e[0].start,u=d;function g(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=h;i[t%h].skip;)t-=o;for(;i[e%h].skip;)e+=o;t%h!=e%h&&(l.push({start:t%h,end:e%h,loop:s,style:n}),c=n,d=e%h)}}for(const t of e){d=r?d:t.start;let e,o=i[d%h];for(u=d+1;u<=t.end;u++){const r=i[u%h];e=oi(s.setContext(ve(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%h,p1DataIndex:u%h,datasetIndex:a}))),ai(e,c)&&g(d,u-1,t.loop,c),o=r,c=e}dnull===t?null:kt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){const n=t.indexOf(e);return-1===n?((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s):n!==t.lastIndexOf(e)?i:n}(i,t,$(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return mn.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},class extends fs{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=un(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?de:fn;var r;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,pn(o,e,n)),t.clip(),a(t,pn(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,pn(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return gn(this,t,e,i)}inXRange(t,e){return gn(this,t,null,e)}inYRange(t,e){return gn(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},class extends ki{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return Di(t,e,i,s)}parseArrayData(t,e,i,s){return Di(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,h="x"===n.axis?a:r,l="x"===o.axis?a:r,c=[];let d,u,g,f;for(d=i,u=i+s;dt.controller.options.grouped)),n=i.options.stacked,o=[],a=t=>{const i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if(V(s)||isNaN(s))return!0};for(const i of s)if((void 0===e||!a(i))&&((!1===n||-1===o.indexOf(i.stack)||void 0===n&&void 0===i.stack)&&o.push(i.stack),i.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n=i?1:-1)}(d,e,a)*o,u===a&&(m-=d/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),h=Math.min(t,n),g=Math.max(t,n);m=Math.max(Math.min(m,g),h),c=m+d,i&&!l&&(r._stacks[e.axis]._visualValues[s]=e.getValueForPixel(c)-e.getValueForPixel(m))}if(m===e.getPixelForValue(a)){const t=ft(d)*e.getLineWidthForValue(a)/2;m+=t,d-=t}return{size:d,base:m,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,o=$(s.maxBarThickness,1/0);let a,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,h="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t0&&void 0!==arguments[0]&&arguments[0];this.obb.box3D.isEmpty()||(this.quaternion.copy(this.obb.quaternion),this.obb.box3D.getCenter(this.position).applyQuaternion(this.quaternion).add(this.obb.position),this.obb.box3D.getSize(this.scale),this.scale.multiplyScalar(.5),this.updateMatrix(),s.Object3D.prototype.updateMatrixWorld.call(this,t))}}const Cn=Sn;function Dn(t,e,i){i||((i=document.createElement("div")).id="chart-div",i.style.cssText=`z-index: 10; position: absolute; bottom: 0; left: 0; width: 100vw; height: 30%; background-color: ${Mn}; display: none`,document.body.appendChild(i)),this.chartDivContainer=i;const r=this.createChartContainer("three-info").getContext("2d");this.charts=[],this.charts.push(new kn(r,t.mainLoop.gfxEngine.renderer));const h=this.charts,l=t.tileLayer,c=new n.Z(t.referenceCrs,0,0,0),d=new n.Z("EPSG:4326",0,0,0),u=e.addFolder("Debug Tools"),g={displayCharts:!1,eventsDebug:!1,debugCameraWindow:!1,freeze:!1};let f;const p=()=>{f=Date.now()},m=()=>{!function(t){const e="none"!=i.style.display;h.forEach((i=>i.update(e,t)))}(Date.now()-f)};let b,x,y,_;u.add(g,"displayCharts").name("Display charts").onChange((e=>{e?(t.addFrameRequester(o.Ao.UPDATE_START,p),t.addFrameRequester(o.Ao.UPDATE_END,m),i.style.display="flex"):(t.removeFrameRequester(o.Ao.UPDATE_START,p),t.removeFrameRequester(o.Ao.UPDATE_END,m),i.style.display="none"),this.updateChartDivSize(),t.notifyChange()})),u.add(g,"debugCameraWindow").name("debug Camera").onChange((e=>{e?t.addFrameRequester(o.Ao.AFTER_RENDER,z):t.removeFrameRequester(o.Ao.AFTER_RENDER,z),t.notifyChange()})),u.add(g,"freeze").name("freeze update").onChange((e=>{l.frozen=e,t.notifyChange()}));const v=t.controls;c.crs=t.referenceCrs;const w=new s.Vector3,M=v&&v.getCameraTargetPosition?v.getCameraTargetPosition:()=>t.camera3D.position,k=e=>{t.getPickingPositionFromDepth(t.eventToViewCoords(e),w)?(c.setFromVector3(w).as("EPSG:4326",d),g.latitude=`${d.y.toFixed(6)}`,g.longitude=`${d.x.toFixed(6)}`,g.altitude=`${d.z.toFixed(2)}`):(g.latitude="---------",g.longitude="---------",g.altitude="---------"),b.updateDisplay(),x.updateDisplay(),y.updateDisplay()};u.add(g,"eventsDebug").name("Debug event").onChange((e=>{e?(_=u.addFolder("Events"),_.open(),c.setFromVector3(M()).as("EPSG:4326",d),g.latitude=`${d.y.toFixed(6)}`,g.longitude=`${d.x.toFixed(6)}`,g.altitude=`${d.z.toFixed(2)}`,b=_.add(g,"latitude"),x=_.add(g,"longitude"),y=_.add(g,"altitude"),t.domElement.addEventListener("mousemove",k)):(t.domElement.removeEventListener("mousemove",k),u.removeFolder("Events"))}));const S=new s.CameraHelper(t.camera3D),C=t.camera3D.clone();C.fov*=1.5,C.updateProjectionMatrix();const D=t.mainLoop.gfxEngine,P=D.renderer;let O=1e11;const E=t.getLayerById("atmosphere");E&&(O=E.fog.distance),S.visible=!1,t.scene.add(S);const R=new a.Z,I=new Cn(R,"",new s.Color(wn));function T(t){t.material&&O&&(t.material.fogDistance=O)}I.visible=!1,t.scene.add(R),t.scene.add(I);const A=new s.Color,L=new s.Vector3;function z(){if(g.debugCameraWindow&&C){const e=.25,s={x:D.width*e,y:D.height*e};C.aspect=s.x/s.y;const o=t.camera3D,a=new n.Z(t.referenceCrs,o.position).as(l.extent.crs),r=t.tileLayer.info.displayed.extent;R.setFromExtent(r),I.visible=!0,I.updateMatrixWorld(!0);const h=1.5*a.z;if(a.z=h,a.as(t.referenceCrs).toVector3(C.position),o.worldToLocal(C.position),C.position.z+=h,o.localToWorld(C.position),L.copy(t.camera3D.position),o.worldToLocal(L),L.z-=1.5*h,o.localToWorld(L),C.lookAt(L),S.update(),C.updateProjectionMatrix(),E){E.object3d.visible=!1,O=1e11;for(const t of l.level0Nodes)t.traverseVisible(T)}const c=g.displayCharts?Math.round(parseFloat(i.style.height.replace("%",""))*D.height/100)+3:0;if(S.visible=!0,S.updateMatrixWorld(!0),P.getClearColor(A),P.setViewport(D.width-s.x,c,s.x,s.y),P.setScissor(D.width-s.x,c,s.x,s.y),P.setScissorTest(!0),P.setClearColor(Mn),P.clear(),P.render(t.scene,C),P.setScissorTest(!1),P.setClearColor(A),P.setViewport(0,0,D.width,D.height),S.visible=!1,I.visible=!1,E&&(E.object3d.visible=!0),E){O=E.fog.distance;for(const t of l.level0Nodes)t.traverseVisible(T)}}}}Dn.prototype.createChartContainer=function(t){const e=document.createElement("div");e.style.cssText=`background-color: ${Mn}; flex: auto;`,this.chartDivContainer.appendChild(e);const i=document.createElement("canvas");return i.height="20rem",i.id=t,e.appendChild(i),i},Dn.prototype.updateChartDivSize=function(){let t=0;for(const e of this.chartDivContainer.getElementsByTagName("div"))"none"!==e.style.display&&t++;const e=Math.floor(100/t);for(const t of this.chartDivContainer.getElementsByTagName("div"))"none"!==t.style.display&&(t.style.width=`${e}%`);this.charts.forEach((t=>{t.resize(),t.update()}))};const Pn=Dn;var On=i(25033);function En(t,e){let i=null;const s=t.__folders.Styling.__controllers;for(let t=0;t{Tn(e.debugUI,e.material.mode),t.notifyChange(e,!0)};e.debugUI.add(e,"visible").name("Visible").onChange(s),e.debugUI.add(e,"sseThreshold").name("SSE threshold").onChange(s),e.debugUI.add(e,"octreeDepthLimit",-1,20).name("Depth limit").onChange(s),e.debugUI.add(e,"pointBudget",1,15e6).name("Max point count").onChange(s),e.debugUI.add(e.object3d.position,"z",-50,50).name("Z translation").onChange((()=>{e.object3d.updateMatrixWorld(),t.notifyChange(e)})),e.dbgStickyNode="",e.dbgDisplaySticky=!1,e.dbgDisplayChildren=!0,e.dbgDisplayParents=!0;const n=e.debugUI.addFolder("Styling");if(null!=e.material.mode){n.add(e.material,"mode",On.vj).name("Display mode").onChange(s);const i=Object.keys(e.material.gradients);n.add({gradient:i[0]},"gradient",i).name("gradient").onChange((i=>{e.material.gradient=e.material.gradients[i],Tn(e.debugUI,e.material.mode),t.notifyChange(e,!0)})),n.add(e,"minIntensityRange",e.minIntensityRange,e.maxIntensityRange-1).name("Intensity min").onChange((i=>{i>=e.maxIntensityRange&&(e.maxIntensityRange=i+1,En(e.debugUI,"maxIntensityRange").updateDisplay()),Tn(e.debugUI,e.material.mode),t.notifyChange(e,!0)})),n.add(e,"maxIntensityRange",e.minIntensityRange+1,e.maxIntensityRange).name("Intensity max").onChange((i=>{i<=e.minIntensityRange&&(e.minIntensityRange=i-1,En(e.debugUI,"minIntensityRange").updateDisplay()),Tn(e.debugUI,e.material.mode),t.notifyChange(e,!0)})),n.add(e,"minElevationRange",e.minElevationRange,e.maxElevationRange).name("Elevation min").onChange((i=>{i>=e.maxElevationRange&&(e.maxElevationRange=i+1,En(e.debugUI,"maxElevationRange").updateDisplay()),Tn(e.debugUI,e.material.mode),t.notifyChange(e,!0)})),n.add(e,"maxElevationRange",e.minElevationRange,e.maxElevationRange).name("Elevation max").onChange((i=>{i<=e.minElevationRange&&(e.minElevationRange=i-1,En(e.debugUI,"minElevationRange").updateDisplay()),Tn(e.debugUI,e.material.mode),t.notifyChange(e,!0)})),n.add(e,"minAngleRange",e.minAngleRange,e.maxAngleRange).name("Angle min").onChange((i=>{i>=e.maxAngleRange&&(e.maxAngleRange=i+1,En(e.debugUI,"maxAngleRange").updateDisplay()),Tn(e.debugUI,e.material.mode),t.notifyChange(e,!0)})),n.add(e,"maxAngleRange",e.minAngleRange,e.maxAngleRange).name("Angle max").onChange((i=>{i<=e.minAngleRange&&(e.minAngleRange=i-1,En(e.debugUI,"minAngleRange").updateDisplay()),Tn(e.debugUI,e.material.mode),t.notifyChange(e,!0)}))}null!=e.material.shape&&n.add(e.material,"shape",On.Uz).name("Shape mode").onChange(s),n.add(e,"opacity",0,1).name("Layer Opacity").onChange(s),n.add(e,"pointSize",0,15).name("Point Size").onChange(s),null!=e.material.sizeMode&&n.add(e.material,"sizeMode",On.E7).name("Point size mode").onChange((()=>{s()})),n.add(e.material,"minAttenuatedSize",0,15).name("Min attenuated size").onChange(s),n.add(e.material,"maxAttenuatedSize",0,15).name("Max attenuated size").onChange(s),null!=e.material.picking&&n.add(e.material,"picking").name("Display picking id").onChange(s);const o=e.debugUI.addFolder("Debug");o.add(e.bboxes,"visible").name("Display Bounding Boxes").onChange(s),o.add(e,"dbgStickyNode").name("Sticky node name").onChange(s),o.add(e,"dbgDisplaySticky").name("Display sticky node").onChange(s),o.add(e,"dbgDisplayChildren").name("Display children of sticky node").onChange(s),o.add(e,"dbgDisplayParents").name("Display parents of sticky node").onChange(s),Tn(e.debugUI,e.material.mode),t.addFrameRequester("before_layer_update",(()=>{if(e.dbgStickyNode.length){e.displayedCount=0;const t=e.dbgStickyNode.split(",");for(const i of e.group.children)i.visible=t.some((t=>{return s=t,n=i.owner.name,e.dbgDisplaySticky&&s===n||e.dbgDisplayParents&&s.startsWith(n)||e.dbgDisplayChildren&&n.startsWith(s);var s,n})),i.boxHelper&&(i.boxHelper.visible=i.visible),i.visible&&(e.displayedCount+=i.geometry.attributes.position.count)}}))}};var Ln=i(36194),zn=i(45222),Fn=i(70991);function Vn(t,e){let i=0;const s=Date.now(),n={label:"Update 1st level",data:[{x:0,y:0}],borderColor:vn,borderWidth:1.5,pointRadius:1},o={label:"Update duration (ms)",data:[{x:0,y:0}],borderColor:wn,borderWidth:1.5,pointRadius:1},a=["0s"],r=new Js(t,{type:"line",data:{labels:a,datasets:[n,o]},options:{animation:{duration:10},scales:_n}});this.update=(t,h)=>{const l=`${Math.floor((Date.now()-s)/1e3)}s`;i>0&&a[i]==l?a.push(""):(a.push(l),i=a.length-1),a.length>60&&(a.shift(),i--),n.data.push({x:0,y:e._latestUpdateStartingLevel}),o.data.push({x:0,y:h}),n.data.length>60&&(n.data.shift(),o.data.shift()),t&&r.update()},this.resize=()=>{r.resize()}}function jn(t,e){const i=[],s=[],n=[],o=new Js(t,{type:"bar",data:{labels:i,datasets:[{label:"Visible node per level",data:s,backgroundColor:vn},{label:"Diplayed node per level",data:n,backgroundColor:wn}]},options:{scales:_n}});this.update=t=>{const a={};!function t(i,s){if(i&&i.visible&&(i.level>=0&&i.layer===e&&(s[i.level]?s[i.level][0]+=1:s[i.level]=[1,0],i.material.visible&&(s[i.level][1]+=1)),i.children))for(const e of i.children)t(e,s)}(e.object3d,a),i.length=0,s.length=0;for(const t in a)({}).hasOwnProperty.call(a,t)&&(i[t]=`${t}`,s[t]=a[t][0],n[t]=a[t][1]);t&&o.update()},this.resize=()=>{o.resize()}}function Nn(t,e,i){t.defineLayerProperty(e,i,(()=>{(t.parent?t.parent.object3d:t.object3d).traverse((i=>{i.layer==t&&i.material?i.material[e]=t[e]:i.content&&i.content.layer==t&&i.content.traverse((i=>{i.material&&(i.material[e]=t[e])}))}))}))}const Bn={addWireFrameCheckbox(t,e,i){t.add(i,"wireframe").name("Wireframe").onChange((()=>e.notifyChange(i)))},addMaterialSize(t,e,i,s,n){Nn(i,"size",1),t.add(i,"size",s,n).name("Size").onChange((()=>e.notifyChange(i)))},addMaterialLineWidth(t,e,i,s,n){Nn(i,"linewidth",1),t.add(i,"linewidth",s,n).name("Line Width").onChange((()=>e.notifyChange(i)))},createGeometryDebugUI(t,e,i){const s=t.addFolder(`Layer ${i.id}`);return s.add(i,"visible").name("Visible").onChange((()=>e.notifyChange(i))),s.add(i,"opacity",0,1).name("Opacity").onChange((()=>e.notifyChange(i))),s}};let Wn;function $n(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Wn&&(Wn.material.overlayAlpha=0,Wn.material.showOutline=t.tileLayer.showOutline,t.notifyChange(Wn));const s=t.tileLayer.pickObjectsAt(t,e);return Wn=s.length?s[0].object:void 0,Wn&&(i&&console.info(Wn),Wn.material.overlayAlpha=.5,Wn.material.showOutline=!0,t.notifyChange(Wn)),Wn}function Hn(t,e,i,n){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e.isDebugMode&&!a)return;n=n||new Pn(e,t),i=i||e.tileLayer;const r=Bn.createGeometryDebugUI(t,e,i),h=`${i.id}-nb-objects`,l=n.createChartContainer(h),c=`${i.id}-nb-visible`,d=n.createChartContainer(c);n.charts.push(new Vn(l.getContext("2d"),i)),n.charts.push(new jn(d.getContext("2d"),i)),i.showOutline=!1,i.wireframe=!1;const u={objectChart:!0,visibilityChart:!0,sseHelper:!1};r.add(i,"showOutline").name("Show tiles").onChange((t=>{i.showOutline=t,function(e,i,s,n){i.traverse((e=>{e.material&&e.layer===s&&(e.material.showOutline=t)})),e.notifyChange()}(e,i.object3d,i)})),r.add(i,"wireframe").name("Wireframe").onChange((()=>{e.notifyChange(i)})),r.add(u,"objectChart").name("Object chart").onChange((t=>{document.getElementById(h).parentNode.style.display=t?"block":"none",n.updateChartDivSize(),n.charts.forEach((t=>t.update()))})),r.add(u,"visibilityChart").name("Visibility chart").onChange((t=>{document.getElementById(c).parentNode.style.display=t?"block":"none",n.updateChartDivSize(),n.charts.forEach((t=>t.update()))}));const g=`${i.id}_obb_debug`,f=`${i.id}_sb_debug`,p=new s.SphereGeometry(1,16,16);function m(t,e,i){if(!i.parent||!e.visible)return void Fn.Z.removeChildrenAndCleanupRecursively(e,i);let n=i.link[e.id];if(i.visible&&i.material&&i.material.visible){if(!n){if(n=new s.Group,n.layer=e,i.matrixWorld.decompose(n.position,n.quaternion,n.scale),e.id==g){const t=new Cn(i.obb);t.layer=e,n.add(t)}else if(e.id==f){const t=new s.Color(Math.random(),Math.random(),Math.random()),o=new s.MeshBasicMaterial({color:t.getHex(),wireframe:!0}),a=new s.Mesh(p,o);a.position.copy(i.boundingSphere.center),a.scale.multiplyScalar(i.boundingSphere.radius),a.scale.set(1,1,1).multiplyScalar(i.boundingSphere.radius),a.layer=e,n.add(a)}i.link[e.id]=n}e.object3d.add(n),n.updateMatrixWorld(!0)}else n&&e.object3d.remove(n)}class b extends zn.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.update=m,super(t,e.object3d||new s.Group,e),this.isDebugLayer=!0}preUpdate(t,e){e.has(this.parent)&&this.object3d.clear()}}const x=new b(g,{visible:!1,cacheLifeTime:1/0,source:!1});e.addLayer(x).then((t=>{r.add(t,"visible").name("Bounding boxes").onChange((()=>{e.notifyChange(t)}))}));const y=new b(f,{visible:!1,cacheLifeTime:1/0,source:!1});e.addLayer(y).then((t=>{r.add(t,"visible").name("Bounding Spheres").onChange((()=>{e.notifyChange(t)}))}));const _=document.getElementById("viewerDiv"),v=document.createElement("span");v.className="circleBase",_.appendChild(v);const w=new s.Vector3;let M;const k=()=>{Ln.ZP.update(),e.notifyChange()},S=()=>{Ln.ZP.removeAll(),e._frameRequesters[o.Ao.BEFORE_RENDER].includes(k)&&e.removeFrameRequester(o.Ao.BEFORE_RENDER,k)};function C(t){const i=$n(e,t,!1);if(i){v.style.display="table-cell",w.copy(i.boundingSphere.center).applyMatrix4(i.matrixWorld);const t=w.project(e.camera3D),s=e.normalizedToViewCoords(t),n=i.screenSize;if(M!=i){const t=Number(v.style.width.replace("px",""));M=i,S(),new Ln.ZP.Tween({size:t}).to({size:n},500).easing(Ln.ZP.Easing.Sinusoidal.In).easing(Ln.ZP.Easing.Exponential.Out).onUpdate((t=>{v.style["line-height"]=`${t.size}px`,v.style.width=`${t.size}px`,v.style.height=`${t.size}px`,v.innerHTML=`${Math.floor(t.size)} px`,v.style.left=s.x-.5*t.size+"px",v.style.top=s.y-.5*t.size+"px"})).onComplete(S).start(),e.addFrameRequester(o.Ao.BEFORE_RENDER,k)}}else v.style.display="none"}r.add(u,"sseHelper").name("Sse helper").onChange((t=>{t?window.addEventListener("mousemove",C,!1):(v.style.display="none",S(),window.removeEventListener("mousemove",C))}));let D=null;window.addEventListener("mousedown",(t=>{83==D&&$n(e,t)})),window.addEventListener("keydown",(t=>{D=t.which})),window.addEventListener("keyup",(()=>{D=null}))}var Un=i(73502),Yn=i(39865);const qn=new s.Mesh;function Xn(t,e,i){const n=Bn.createGeometryDebugUI(t,e,i);Bn.addWireFrameCheckbox(n,e,i);const o=`${i.id}_bounding_volume_debug`,a=new zn.Z(o,new s.Object3D,{update:function(t,e,n){const o=n.userData.metadata;let a=n.userData.boundingVolumeHelper;if(a)a.visible=!(!e.visible||!n.visible);else if(e.visible&&n.visible&&o.boundingVolume){if(o.boundingVolume.initialVolumeType===Yn.D.box){var r,h;if(qn.geometry.boundingBox=o.boundingVolume.volume,a=new s.BoxHelper(qn),a.material.linewidth=2,null!==(r=o.content)&&void 0!==r&&r.uri&&null!==(h=o.content)&&void 0!==h&&h.uri.endsWith("b3dm")){const t=i.tileset.asset.gltfUpAxis;void 0===t||"Y"===t?a.rotation.x=.5*-Math.PI:"X"===t&&(a.rotation.z=.5*-Math.PI),a.updateMatrix()}}else{if(o.boundingVolume.initialVolumeType!==Yn.D.sphere&&o.boundingVolume.initialVolumeType!==Yn.D.region)return void console.warn(`[3D Tiles Debug]: Unknown bounding volume: ${o.boundingVolume}`);{const t=new s.SphereGeometry(o.boundingVolume.volume.radius,32,32),e=new s.MeshBasicMaterial({wireframe:!0,color:16777215*Math.random()});a=new s.Mesh(t,e)}}n.userData.boundingVolumeHelper=a,n.parent.add(a),a.updateMatrixWorld(!0)}},visible:!1,cacheLifeTime:1/0,source:!1});Un.Z.prototype.addLayer.call(e,a,i).then((t=>{n.add(t,"visible").name("Bounding boxes").onChange((()=>{e.notifyChange(e.camera3D)}))})),n.add(i,"sseThreshold",0,100).name("sseThreshold").onChange((()=>{e.notifyChange(e.camera3D)})),n.add({frozen:i.frozen},"frozen").onChange((t=>{i.frozen=t,e.notifyChange(i)})),n.add(i,"pntsShape",On.Uz).name("Points Shape").onChange((()=>{e.notifyChange(e.camera.camera3D)})),n.add(i,"pntsSizeMode",On.E7).name("Pnts size mode").onChange((()=>{e.notifyChange(e.camera.camera3D)})),n.add(i,"pntsMinAttenuatedSize",0,15).name("Min attenuated size").onChange((()=>{e.notifyChange(e.camera.camera3D)})),n.add(i,"pntsMaxAttenuatedSize",0,15).name("Max attenuated size").onChange((()=>{e.notifyChange(e.camera.camera3D)}))}}},t=>(31258,t(t.s=31258))]))); //# sourceMappingURL=debug.js.map \ No newline at end of file diff --git a/itowns/dist/itowns.js b/itowns/dist/itowns.js index d106faac..cad17d5e 100644 --- a/itowns/dist/itowns.js +++ b/itowns/dist/itowns.js @@ -1,3 +1,3 @@ /*! For license information please see itowns.js.LICENSE.txt */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("itowns",[],e):"object"==typeof exports?exports.itowns=e():t.itowns=e()}(self,(()=>(()=>{var t,e={75550:t=>{"use strict";function e(t,e){this.x=t,this.y=e}t.exports=e,e.prototype={clone:function(){return new e(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),s=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t}},38929:(t,e,r)=>{t.exports.VectorTile=r(22779),r(66024),r(59701)},22779:(t,e,r)=>{"use strict";var i=r(59701);function n(t,e,r){if(3===t){var n=new i(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}t.exports=function(t,e){this.layers=t.readFields(n,{},e)}},66024:(t,e,r)=>{"use strict";var i=r(75550);function n(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(s,this,e)}function s(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos>3}if(s--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,s=0,o=1/0,a=-1/0,l=1/0,c=-1/0;t.pos>3}if(i--,1===r||2===r)(n+=t.readSVarint())a&&(a=n),(s+=t.readSVarint())c&&(c=s);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,a,c]},n.prototype.toGeoJSON=function(t,e,r){var i,s,a=this.extent*Math.pow(2,r),l=this.extent*t,c=this.extent*e,h=this.loadGeometry(),u=n.types[this.type];function d(t){for(var e=0;e{"use strict";var i=r(66024);function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(s,this,e),this.length=this._features.length}function s(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}t.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new i(this._pbf,e,this.extent,this._keys,this._values)}},36194:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>y});var i,n={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-n.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*n.Bounce.In(2*t):.5*n.Bounce.Out(2*t-1)+.5}}},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},o=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=s()),void 0===e&&(e=!1);var r=Object.keys(this._tweens);if(0===r.length)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i1?s(t[r],t[r-1],r-i):s(t[n],t[n+1>r?r:n+1],i-n)},Bezier:function(t,e){for(var r=0,i=t.length-1,n=Math.pow,s=a.Utils.Bernstein,o=0;o<=i;o++)r+=n(1-e,i-o)*n(e,o)*t[o]*s(i,o);return r},CatmullRom:function(t,e){var r=t.length-1,i=r*e,n=Math.floor(i),s=a.Utils.CatmullRom;return t[0]===t[r]?(e<0&&(n=Math.floor(i=r*(1+e))),s(t[(n-1+r)%r],t[n],t[(n+1)%r],t[(n+2)%r],i-n)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[r]-(s(t[r],t[r],t[r-1],t[r-1],i-r)-t[r]):s(t[n?n-1:0],t[n],t[r1;r--)e*=r;return i[t]=e,e}),CatmullRom:function(t,e,r,i,n){var s=.5*(r-t),o=.5*(i-e),a=n*n;return(2*e-2*r+s+o)*(n*a)+(-3*e+3*r-2*s-o)*a+s*n+e}}},l=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),c=new o,h=function(){function t(t,e){void 0===e&&(e=c),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=n.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=l.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?s()+parseFloat(t):t:s(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,r,i){for(var n in r){var s=t[n],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(r[n]);if("undefined"!==a&&"function"!==a){if(l){var c=r[n];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,s)),r[n]=[s].concat(c)}if("object"!==a&&!o||!s||l)void 0===e[n]&&(e[n]=s),o||(e[n]*=1),i[n]=l?r[n].slice().reverse():e[n]||0;else{for(var h in e[n]=o?[]:{},s)e[n][h]=s[h];i[n]=o?[]:{},this._setupProperties(s,e[n],r[n],i[n])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=s()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=s()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;tn)return!1;e&&this.start(t)}if(this._goToEnd=!1,t1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(r in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a{"use strict";r.d(e,{Q:()=>Y,Z:()=>lt});var i=r(99477);const n=1e3/60,s=function(t){t.id&&(clearInterval(t.id),t.id=void 0),t.waitTimer&&(clearInterval(t.waitTimer),t.waitTimer=void 0),t.keyframe=0},o=function(t){s(t),t.isEnded()&&t.dispatchEvent({type:"animation-ended"}),t.dispatchEvent({type:"animation-stopped"}),t.duration=0};class a extends i.EventDispatcher{constructor(){super(),this.id=null,this.keyframe=0,this.duration=0,this.state=0,this.waitTimer=null,this.callback=()=>{}}isPlaying(){return 1===this.state}isStopped(){return 0===this.state}isEnded(){return 2===this.state}setCallback(t){this.callback=t}play(t){this.duration=t,this.dispatchEvent({type:"animation-started"}),this.state=1,s(this),this.id=setInterval(this.frame.bind(this),n)}playLater(t,e){const r=Math.floor(n*e);window.clearInterval(this.waitTimer);const i=this;this.waitTimer=window.setTimeout((()=>{i.play(t)}),r)}stop(){this.state=0,o(this)}frame(){this.keyframe1&&void 0!==arguments[1]?arguments[1]:{};super(),this._view=t,this._domElement=t.domElement;let r=!0;Object.defineProperty(this,"enabled",{get:()=>r,set:t=>{t||(this.onKeyUp(),this.onPointerUp()),r=t}});let n=!0;Object.defineProperty(this,"enableKeys",{get:()=>n,set:t=>{t||this.onKeyUp(),n=t}}),this.NONE={};let s=this.NONE;Object.defineProperty(this,"currentState",{get:()=>s,set:t=>{if(s!==t){const e=s;s=t,this.dispatchEvent({type:"state-changed",viewCoords:p,previous:e})}}}),this._clickTimeStamp=0,this._lastMousePressed={viewCoords:new i.Vector2},this._currentMousePressed=void 0,this._currentKeyPressed=void 0,this._onPointerDown=this.onPointerDown.bind(this),this._onPointerMove=this.onPointerMove.bind(this),this._onPointerUp=this.onPointerUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onBlur=this.onBlur.bind(this),this._onContextMenu=this.onContextMenu.bind(this),this._domElement.addEventListener("pointerdown",this._onPointerDown,!1),this._domElement.addEventListener("wheel",this._onMouseWheel,!1),this._domElement.addEventListener("keydown",this._onKeyDown,!1),this._domElement.addEventListener("keyup",this._onKeyUp,!1),this._domElement.addEventListener("blur",this._onBlur),this._domElement.addEventListener("contextmenu",this._onContextMenu,!1),this.setFromOptions(e)}inputToState(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const i of Object.keys(d)){const n=this[i];if(n.enable&&n.mouseButton===t&&n.keyboard===e&&n.double===r){if(!n._trigger)return n;this.dispatchEvent({type:n._event,viewCoords:void 0!==t&&p,direction:n._direction})}}return this.NONE}touchToState(t){for(const e of Object.keys(d)){const r=this[e];if(r.enable&&t==r.finger)return r}return this.NONE}setFromOptions(t){for(const e in d)if({}.hasOwnProperty.call(d,e)){let r={};r=t[e]||this[e]||Object.assign(r,d[e]),t[e]&&void 0===t[e].enable&&(r.enable=this[e].enable),r.double=!!r.double,r._event=d[e]._event,r._trigger=d[e]._trigger,r._direction=d[e]._direction,this[e]=r}}onPointerDown(t){this.enabled&&(p.copy(this._view.eventToViewCoords(t)),"mouse"===t.pointerType&&(this._currentMousePressed=t.button,void 0===this._currentKeyPressed&&(t.ctrlKey?this._currentKeyPressed=17:t.shiftKey?this._currentKeyPressed=16:t.metaKey&&(this._currentKeyPressed=91)),this.currentState=this.inputToState(this._currentMousePressed,this._currentKeyPressed,t.timeStamp-this._clickTimeStamp<500&&this._lastMousePressed.button===this._currentMousePressed&&this._lastMousePressed.viewCoords.distanceTo(p)<5),this._clickTimeStamp=t.timeStamp,this._lastMousePressed.button=this._currentMousePressed,this._lastMousePressed.viewCoords.copy(p)),this._domElement.addEventListener("pointermove",this._onPointerMove,!1),this._domElement.addEventListener("pointerup",this._onPointerUp,!1),this._domElement.addEventListener("mouseleave",this._onPointerUp,!1))}onPointerMove(t){t.preventDefault(),this.enabled&&(p.copy(this._view.eventToViewCoords(t)),"mouse"===t.pointerType)&&this.dispatchEvent({type:this.currentState._event,viewCoords:p})}onPointerUp(){this.enabled&&(this._currentMousePressed=void 0,this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("mouseleave",this._onPointerUp,!1),this.currentState=this.NONE)}onMouseWheel(t){t.preventDefault(),this.enabled&&this.ZOOM.enable&&this.dispatchEvent({type:this.ZOOM._event,delta:t.deltaY})}onKeyDown(t){this.enabled&&this.enableKeys&&(this._currentKeyPressed=t.keyCode,this.inputToState(this._currentMousePressed,this._currentKeyPressed))}onKeyUp(){this.enabled&&this.enableKeys&&(this._currentKeyPressed=void 0,void 0===this._currentMousePressed&&(this.currentState=this.NONE))}onBlur(){this.onKeyUp(),this.onPointerUp()}onContextMenu(t){t.preventDefault()}dispose(){this._clickTimeStamp=0,this._lastMousePressed=void 0,this._currentKeyPressed=void 0,this._domElement.removeEventListener("pointerdown",this._onPointerDown,!1),this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("wheel",this._onMouseWheel,!1),this._domElement.removeEventListener("keydown",this._onKeyDown,!1),this._domElement.removeEventListener("keyup",this._onKeyUp,!1),this._domElement.removeEventListener("blur",this._onBlur),this._domElement.removeEventListener("contextmenu",this._onContextMenu,!1)}}const m=f;var g=r(36873);const A=1e-6,y={up:new i.Vector2(0,1),bottom:new i.Vector2(0,-1),left:new i.Vector2(1,0),right:new i.Vector2(-1,0)},v=new i.Vector2,x=new i.Vector2,b=new i.Vector2,_=new i.Spherical(1,.01,0),w=new i.Spherical(1,0,0);let E=1;const M=new i.Vector2,S=new i.Vector2,C=new i.Vector2,T=new i.Vector3,I=new i.Vector2,R=new i.Vector2,B=new i.Vector2;let L;const P=new i.Quaternion,D=new i.Object3D,O=new c.Z("EPSG:4978");D.matrixWorldInverse=new i.Matrix4;const k=new c.Z("EPSG:4978",0,0,0),U=new c.Z("EPSG:4326",0,0,0);function N(t,e){k.setFromVector3(t).as("EPSG:4326",U),e.position.copy(t),e.lookAt(U.geodesicNormal.add(t)),e.rotateX(.5*Math.PI),e.updateMatrixWorld(!0)}let F=0,z=!0;const G=new i.Quaternion(0,0,0,1),Q=new i.Vector3,j=new i.Vector3,V=new i.Quaternion,H=new i.Sphere,W=new i.Vector3,q=new i.Vector3,Z={},Y={PAN_CHANGED:"pan-changed",ORIENTATION_CHANGED:"orientation-changed",RANGE_CHANGED:"range-changed",CAMERA_TARGET_CHANGED:"camera-target-changed"},X=new i.Quaternion,J=new i.Quaternion,K=new i.Vector3(1,0,0);let $=1/0;const tt=new i.Vector3,et=new i.Vector3,rt=new i.Raycaster,it=new i.Vector3,nt=new i.Vector3,st=new i.Sphere;let ot;class at extends i.EventDispatcher{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.player=new l,this.view=t,this.camera=t.camera3D,this.states=new m(this.view),Object.defineProperty(this,"enabled",{get:()=>this.states.enabled,set:t=>{console.warn("GlobeControls.enabled property is deprecated. Use StateControl.enabled instead - which you can access with GlobeControls.states.enabled."),this.states.enabled=t}}),r.zoomSpeed&&(console.warn("Controls zoomSpeed parameter is deprecated. Use zoomFactor instead."),r.zoomFactor=r.zoomFactor||r.zoomSpeed),this.zoomFactor=r.zoomFactor||1.25,this.minDistance=r.minDistance||250,this.maxDistance=r.maxDistance||8*h.c.x,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.rotateSpeed=r.rotateSpeed||.25,this.keyPanSpeed=r.keyPanSpeed||7,this.minPolarAngle=i.MathUtils.degToRad(r.minPolarAngle??.5),this.maxPolarAngle=i.MathUtils.degToRad(r.minPolarAngle??86),this.minAzimuthAngle=r.minAzimuthAngle?i.MathUtils.degToRad(r.minAzimuthAngle):-1/0,this.maxAzimuthAngle=r.maxAzimuthAngle?i.MathUtils.degToRad(r.maxAzimuthAngle):1/0,this.handleCollision=void 0===r.handleCollision||r.handleCollision,this.minDistanceCollision=60,Object.defineProperty(this,"enableKeys",{get:()=>this.states.enableKeys,set:t=>{console.warn("GlobeControls.enableKeys property is deprecated. Use StateControl.enableKeys instead - which you can access with GlobeControls.states.enableKeys."),this.states.enableKeys=t}}),this.enableDamping=!1!==r.enableDamping,this.dampingMoveFactor=null!=r.dampingMoveFactor?r.dampingMoveFactor:.25,this.startEvent={type:"start"},this.endEvent={type:"end"},this.updateHelper=function(){},this._onEndingMove=null,this._onTravel=this.travel.bind(this),this._onTouchStart=this.onTouchStart.bind(this),this._onTouchEnd=this.onTouchEnd.bind(this),this._onTouchMove=this.onTouchMove.bind(this),this._onStateChange=this.onStateChange.bind(this),this._onRotation=this.handleRotation.bind(this),this._onDrag=this.handleDrag.bind(this),this._onDolly=this.handleDolly.bind(this),this._onPan=this.handlePan.bind(this),this._onPanoramic=this.handlePanoramic.bind(this),this._onZoom=this.handleZoom.bind(this),this.states.addEventListener("state-changed",this._onStateChange,!1),this.states.addEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.addEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.addEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.addEventListener(this.states.PAN._event,this._onPan,!1),this.states.addEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.addEventListener("zoom",this._onZoom,!1),this.view.domElement.addEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.addEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.addEventListener("touchmove",this._onTouchMove,!1),this.states.addEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.addEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),t.scene.add(D),e.isExtent?e.center().as("EPSG:4978",k):(e.coord.as("EPSG:4978",k),e.tilt=e.tilt||89.5,e.heading=e.heading||0),N(k,D),this.lookAtCoordinate(e,!1),O.crs=this.view.referenceCrs}get dollyInScale(){return this.zoomFactor}get dollyOutScale(){return 1/this.zoomFactor}get isPaused(){return this.states.currentState===this.states.NONE&&!this.player.isPlaying()}onEndingMove(t){this._onEndingMove&&(this.player.removeEventListener("animation-stopped",this._onEndingMove),this._onEndingMove=null),this.handlingEvent(t)}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.theta-=t}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.phi-=t}panLeft(t){const e=this.camera.matrix.elements;T.fromArray(e),T.multiplyScalar(-t),Q.add(T)}panUp(t){const e=this.camera.matrix.elements;T.fromArray(e,4),T.multiplyScalar(t),Q.add(T)}mouseToPan(t,e){const r=this.view.mainLoop.gfxEngine;if(this.camera.isPerspectiveCamera){let n=this.camera.position.distanceTo(this.getCameraTargetPosition());n*=2*Math.tan(i.MathUtils.degToRad(.5*this.camera.fov)),this.panLeft(t*n/r.width*this.camera.aspect),this.panUp(e*n/r.height)}else this.camera.isOrthographicCamera&&(this.panLeft(t*(this.camera.right-this.camera.left)/r.width),this.panUp(e*(this.camera.top-this.camera.bottom)/r.height))}dolly(t){0!==t&&(L=t>0?this.dollyInScale:this.dollyOutScale,this.camera.isPerspectiveCamera?E/=L:this.camera.isOrthographicCamera&&(this.camera.zoom=i.MathUtils.clamp(this.camera.zoom*L,this.minZoom,this.maxZoom),this.camera.updateProjectionMatrix(),this.view.notifyChange(this.camera)))}getMinDistanceCameraBoundingSphereObbsUp(t){if(t.level>10&&1==t.children.length&&t.geometry){const e=t.obb;st.center.copy(this.camera.position),st.radius=this.minDistanceCollision,e.isSphereAboveXYBox(st)&&($=Math.min(st.center.z-e.box3D.max.z,$))}}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.states.currentState;if($=1/0,this.handleCollision&&this.view.tileLayer)for(const t of this.view.tileLayer.level0Nodes)t.traverse(this.getMinDistanceCameraBoundingSphereObbsUp.bind(this));switch(t){case this.states.MOVE_GLOBE:if($<0)D.translateY(-$),this.camera.position.setLength(this.camera.position.length()-$);else if($r&&w.phi>0){const t=e-r,i=1-(t-($-r))/t;w.phi*=i*i}else if($-r&&w.phi>n){let t=-Math.asin(.25*(r-$)/_.radius);t=i.MathUtils.clamp(t,n,0);const e=1-(r-$)/(2*r);w.phi=i.MathUtils.lerp(w.phi,t,e),$-=Math.sin(w.phi)*_.radius}_.theta+=w.theta,_.phi+=w.phi,_.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,_.theta)),_.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,_.phi)),_.radius=this.camera.position.length()*E,_.makeSafe(),_.radius=Math.max(this.minDistance,Math.min(this.maxDistance,_.radius)),this.camera.position.setFromSpherical(_),$<0&&(this.camera.position.y-=$,_.setFromVector3(this.camera.position),w.phi=0),D.localToWorld(this.camera.position)}}this.camera.up.copy(D.position).normalize(),this.camera.lookAt(D.position),this.enableDamping?(w.theta*=.75,w.phi*=.75,P.slerp(G,.2*this.dampingMoveFactor)):(w.theta=0,w.phi=0,P.set(0,0,0,1)),E=1,Q.set(0,0,0),(j.distanceToSquared(this.camera.position)>A||8*(1-V.dot(this.camera.quaternion))>A)&&(this.view.notifyChange(this.camera),j.copy(this.camera.position),V.copy(this.camera.quaternion)),this.enableDamping&&t===this.states.ORBIT&&this.player.isStopped()&&(w.theta>A||w.phi>A)&&(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.playLater(60,2)),this.view.dispatchEvent({type:g.b.CAMERA_MOVED,coord:O.setFromVector3(D.position),range:_.radius,heading:-i.MathUtils.radToDeg(_.theta),tilt:90-i.MathUtils.radToDeg(_.phi)})}onStateChange(t){this.states.currentState!==this.states.NONE?(u.ZP.stop(this.view,this.camera),this.onEndingMove(),this.player.stop(),this.updateTarget(),ot=u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,nt),v.copy(t.viewCoords),this.view.getPickingPositionFromDepth(t.viewCoords,W)&&(H.radius=W.length(),tt.copy(W).normalize(),this.updateHelper(W,Z.picking)),I.copy(t.viewCoords),M.copy(t.viewCoords)):this.handleEndMovement(t)}handleRotation(t){this.player.stop(),this.handlePanoramic(t)}handleDrag(t){const e=this.view.viewToNormalizedCoords(t.viewCoords);this.camera.updateMatrixWorld(),rt.setFromCamera(e,this.camera),rt.ray.intersectSphere(H,q)?(et.copy(q).normalize(),P.setFromUnitVectors(et,tt),F=Date.now(),this.update()):this.states.onPointerUp()}handleDolly(t){R.copy(t.viewCoords),B.subVectors(R,I),this.dolly(-B.y),I.copy(R),this.update()}handlePan(t){t.viewCoords?(S.copy(t.viewCoords),C.subVectors(S,M),M.copy(S)):t.direction&&C.copy(y[t.direction]).multiplyScalar(this.keyPanSpeed),this.mouseToPan(C.x,C.y),this.update(this.states.PAN)}handlePanoramic(t){x.copy(t.viewCoords),b.subVectors(x,v);const e=this.view.mainLoop.gfxEngine;w.theta-=2*Math.PI*b.x/e.width*this.rotateSpeed,w.phi-=2*Math.PI*b.y/e.height*this.rotateSpeed,v.copy(x),this.update()}handleEndMovement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dispatchEvent(this.endEvent),this.player.stop(),this.enableDamping?t.previous===this.states.ORBIT&&(w.theta>A||w.phi>A)?(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.play(60),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):t.previous===this.states.MOVE_GLOBE&&Date.now()-F<50?(this.player.setCallback((()=>{this.update(this.states.MOVE_GLOBE)})),this.player.play(120),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):this.onEndingMove():this.onEndingMove()}updateTarget(){if(this.view.getPickingPositionFromDepth(null,nt)){const t=isNaN(nt.x)?100:this.camera.position.distanceTo(nt);it.set(0,0,-t),this.camera.localToWorld(it),N(it,D),D.matrixWorldInverse.copy(D.matrixWorld).invert(),it.copy(this.camera.position),it.applyMatrix4(D.matrixWorldInverse),_.setFromVector3(it)}}handlingEvent(t){t=t||u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera);const e=u.ZP.getDiffParams(ot,t);if(e&&(e.range&&this.dispatchEvent({type:Y.RANGE_CHANGED,previous:e.range.previous,new:e.range.new}),e.coord&&this.dispatchEvent({type:Y.CAMERA_TARGET_CHANGED,previous:e.coord.previous,new:e.coord.new}),e.tilt||e.heading)){const t={type:Y.ORIENTATION_CHANGED};e.tilt&&(t.previous={tilt:e.tilt.previous},t.new={tilt:e.tilt.new}),e.heading&&(t.previous=t.previous||{},t.new=t.new||{},t.new.heading=e.heading.new,t.previous.heading=e.heading.previous),this.dispatchEvent(t)}}travel(t){this.player.stop();const e=this.view.getPickingPositionFromDepth(t.viewCoords),r=this.getRange(e);if(e&&r>this.minDistance)return this.lookAtCoordinate({coord:new c.Z("EPSG:4978",e),range:r*("out"===t.direction?1/.6:.6),time:1500})}handleZoom(t){this.player.stop(),u.ZP.stop(this.view,this.camera),this.updateTarget();const e=-t.delta;this.dolly(e);const r=this.getRange(nt);this.update();const i=this.getRange(nt);Math.abs(i-r)/r>.001&&this.dispatchEvent({type:Y.RANGE_CHANGED,previous:r,new:i}),this.dispatchEvent(this.startEvent),this.dispatchEvent(this.endEvent)}onTouchStart(t){if(this.player.stop(),!1!==this.states.enabled&&(this.state=this.states.touchToState(t.touches.length),this.updateTarget(),this.state!==this.states.NONE)){switch(this.state){case this.states.MOVE_GLOBE:{const e=this.view.eventToViewCoords(t);this.view.getPickingPositionFromDepth(e,W)?(H.radius=W.length(),tt.copy(W).normalize(),this.updateHelper(W,Z.picking)):this.state=this.states.NONE;break}case this.states.ORBIT:case this.states.DOLLY:{const e=t.touches[0].pageX,r=t.touches[0].pageY,i=e-t.touches[1].pageX,n=r-t.touches[1].pageY,s=Math.sqrt(i*i+n*n);I.set(0,s),v.set(e,r);break}case this.states.PAN:M.set(t.touches[0].pageX,t.touches[0].pageY)}this.dispatchEvent(this.startEvent)}}onTouchMove(t){if(this.player.isPlaying()&&this.player.stop(),!1!==this.states.enabled){switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case this.states.MOVE_GLOBE.finger:{const e=this.view.eventToViewCoords(t),r=this.view.viewToNormalizedCoords(e);this.camera.updateMatrixWorld(),rt.setFromCamera(r,this.camera),rt.ray.intersectSphere(H,q)?(et.copy(q).normalize(),P.setFromUnitVectors(et,tt),F=Date.now()):this.onTouchEnd();break}case this.states.ORBIT.finger:case this.states.DOLLY.finger:{const e=this.view.mainLoop.gfxEngine;x.set(t.touches[0].pageX,t.touches[0].pageY),b.subVectors(x,v),this.rotateLeft(2*Math.PI*b.x/e.width*this.rotateSpeed),this.rotateUp(2*Math.PI*b.y/e.height*this.rotateSpeed),v.copy(x);const r=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(r*r+i*i);R.set(0,n),B.subVectors(R,I),this.dolly(B.y),I.copy(R);break}case this.states.PAN.finger:S.set(t.touches[0].pageX,t.touches[0].pageY),C.subVectors(S,M),this.mouseToPan(C.x,C.y),M.copy(S);break;default:this.state=this.states.NONE}this.state!==this.states.NONE&&this.update(this.state)}}onTouchEnd(){this.handleEndMovement({previous:this.state}),this.state=this.states.NONE}dispose(){this.view.domElement.removeEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.removeEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.removeEventListener("touchmove",this._onTouchMove,!1),this.states.dispose(),this.states.removeEventListener("state-changed",this._onStateChange,!1),this.states.removeEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.removeEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.removeEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.removeEventListener(this.states.PAN._event,this._onPan,!1),this.states.removeEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.removeEventListener("zoom",this._onZoom,!1),this.states.removeEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.removeEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),this.dispatchEvent({type:"dispose"})}setTilt(t,e){return this.lookAtCoordinate({tilt:t},e)}setHeading(t,e){return this.lookAtCoordinate({heading:t},e)}setRange(t,e){return this.lookAtCoordinate({range:t},e)}getCameraTargetPosition(){return D.position}getRange(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).range}getTilt(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).tilt}getHeading(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).heading}pan(t){return this.mouseToPan(t.x,t.y),this.update(this.states.PAN),Promise.resolve()}getCameraOrientation(){return this.view.getPickingPositionFromDepth(null,nt),[this.getTilt(nt),this.getHeading(nt)]}getCameraCoordinate(){return new c.Z("EPSG:4978",this.camera.position).as("EPSG:4326")}getLookAtCoordinate(){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera).coord}setAnimationEnabled(t){z=t}isAnimationEnabled(){return z}getZoom(){return this.view.tileLayer.computeTileZoomFromDistanceCamera(this.getRange(),this.view.camera)}setZoom(t,e){return this.lookAtCoordinate({zoom:t},e)}getScale(t){return console.warn("Deprecated, use View#getScale instead."),this.view.getScale(t)}pixelsToMeters(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;return console.warn("Deprecated use View#getPixelsToMeters instead."),t*e/this.getScale(e)/1e3}pixelsToDegrees(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.");const r=this.pixelsToMeters(t,e);return i.MathUtils.radToDeg(2*Math.asin(r/(2*h.c.x)))}metersToPixels(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getMetersToPixels instead.");const r=this.getScale(e);return e/=1e3,t*r/e}setScale(t,e,r){return this.lookAtCoordinate({scale:t,pitch:e},r)}lookAtCoordinate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isAnimationEnabled();if(this.player.stop(),!t.isExtent&&(t.zoom?t.range=this.view.tileLayer.computeDistanceCameraFromTileZoom(t.zoom,this.view.camera):t.scale&&(t.range=this.view.getScaleFromDistance(t.pitch,t.scale),(t.rangethis.maxDistance)&&(console.warn(`This scale ${t.scale} can not be reached`),t.range=i.MathUtils.clamp(t.range,this.minDistance,this.maxDistance))),void 0!==t.tilt)){const e=90-i.MathUtils.radToDeg(this.maxPolarAngle),r=90-i.MathUtils.radToDeg(this.minPolarAngle);(t.tiltr)&&(t.tilt=i.MathUtils.clamp(t.tilt,e,r),console.warn("Tilt was clamped to ",t.tilt,` the interval is between ${e} and ${r} degree`))}return ot=u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera),e?(t.callback=t=>D.position.copy(t.targetWorldPosition),this.dispatchEvent({type:"animation-started"}),u.ZP.animateCameraToLookAtTarget(this.view,this.camera,t).then((t=>(this.dispatchEvent({type:"animation-ended"}),this.handlingEvent(t),t)))):u.ZP.transformCameraToLookAtTarget(this.view,this.camera,t).then((t=>(D.position.copy(t.targetWorldPosition),this.handlingEvent(t),t)))}pickGeoPosition(t){const e=this.view.getPickingPositionFromDepth(t);if(e)return new c.Z("EPSG:4978",e).as("EPSG:4326")}}const lt=at},44450:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>Q,uZ:()=>z});var i=r(99477),n=r(49469);const s=i.MOUSE.LEFT,o=i.MOUSE.MIDDLE,a=i.MOUSE.RIGHT;let l;const c=new i.Vector3,h=new i.Quaternion;let u=0;const d=new i.Vector3,p=-1,f={default:"auto",drag:"move",pan:"cell",travel:"wait",rotate:"move",ortho_zoom:"wait"},m=new i.Vector3,g=new i.Vector2,A=new i.Vector2,y=new i.Vector2(0,0),v=new i.Vector3,x=new i.Vector3,b=new i.Vector3,_=new i.Vector3(0,0,0);let w=0;const E=new i.Vector3,M=new i.Quaternion,S=new i.Vector2,C=new i.Vector3,T=new i.Vector3,I=new i.Quaternion,R=new i.Quaternion;let B=0,L=0,P=!1,D=!1,O=0,k=0;const U=new i.Raycaster,N=new i.Plane(new i.Vector3(0,0,-1)),F={enabled:!0,enableRotation:!0,rotateSpeed:2,minPanSpeed:.05,maxPanSpeed:15,zoomTravelTime:.2,zoomFactor:2,maxResolution:0,minResolution:1/0,maxAltitude:5e7,groundLevel:200,autoTravelTimeMin:1.5,autoTravelTimeMax:4,autoTravelTimeDist:5e4,smartTravelHeightMin:75,smartTravelHeightMax:500,instantTravel:!1,minZenithAngle:0,maxZenithAngle:82.5,handleCollision:!0,minDistanceCollision:30,enableSmartTravel:!0,enablePan:!0},z={MOVED:"moved"};class G extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.camera=t.camera3D,this.enabled="boolean"==typeof e.enabled?e.enabled:F.enabled,this.camera.isOrthographicCamera?(u=this.camera.zoom,this.enableRotation=!1,this.enablePan=!1,this.maxAltitude=1/0,this.zoomTravelTime="number"==typeof e.zoomTravelTime?e.zoomTravelTime:F.zoomTravelTime):(this.enableRotation=void 0===e.enableRotation?F.enableRotation:e.enableRotation,this.rotateSpeed=e.rotateSpeed||F.rotateSpeed,this.enablePan=void 0===e.enablePan?F.enablePan:e.enablePan,this.minPanSpeed=e.minPanSpeed||F.minPanSpeed,this.maxPanSpeed=e.maxPanSpeed||F.maxPanSpeed,this.maxAltitude=e.maxAltitude||F.maxAltitude,this.zoomTravelTime=e.zoomTravelTime||F.zoomTravelTime),e.zoomInFactor&&(console.warn("Controls zoomInFactor parameter is deprecated. Use zoomFactor instead."),e.zoomFactor=e.zoomFactor||e.zoomInFactor),e.zoomOutFactor&&(console.warn("Controls zoomOutFactor parameter is deprecated. Use zoomFactor instead."),e.zoomFactor=e.zoomFactor||e.zoomInFactor||1/e.zoomOutFactor),0===e.zoomFactor&&(console.warn("Controls zoomFactor parameter can not be equal to 0. Its value will be set to default."),e.zoomFactor=F.zoomFactor),this.zoomInFactor=e.zoomFactor||F.zoomFactor,this.zoomOutFactor=1/(e.zoomFactor||F.zoomFactor),this.maxResolution=e.maxResolution||F.maxResolution,this.minResolution=e.minResolution||F.minResolution,this.groundLevel=e.groundLevel||F.groundLevel,this.autoTravelTimeMin=e.autoTravelTimeMin||F.autoTravelTimeMin,this.autoTravelTimeMax=e.autoTravelTimeMax||F.autoTravelTimeMax,this.autoTravelTimeDist=e.autoTravelTimeDist||F.autoTravelTimeDist,e.smartZoomHeightMin&&(console.warn("Controls smartZoomHeightMin parameter is deprecated. Use smartTravelHeightMin instead."),e.smartTravelHeightMin=e.smartTravelHeightMin||e.smartZoomHeightMin),e.smartZoomHeightMax&&(console.warn("Controls smartZoomHeightMax parameter is deprecated. Use smartTravelHeightMax instead."),e.smartTravelHeightMax=e.smartTravelHeightMax||e.smartZoomHeightMax),this.smartTravelHeightMin=e.smartTravelHeightMin||F.smartTravelHeightMin,this.smartTravelHeightMax=e.smartTravelHeightMax||F.smartTravelHeightMax,this.instantTravel=e.instantTravel||F.instantTravel,this.minZenithAngle=(e.minZenithAngle||F.minZenithAngle)*Math.PI/180,this.maxZenithAngle=(e.maxZenithAngle||F.maxZenithAngle)*Math.PI/180,e.focusOnMouseOver&&console.warn("Planar controls 'focusOnMouseOver' optional parameter has been removed."),e.focusOnMouseClick&&console.warn("Planar controls 'focusOnMouseClick' optional parameter has been removed."),this.handleCollision=void 0===e.handleCollision?F.handleCollision:e.handleCollision,this.minDistanceCollision=F.minDistanceCollision,this.enableSmartTravel=void 0===e.enableSmartTravel?F.enableSmartTravel:e.enableSmartTravel,c.copy(this.camera.position),h.copy(this.camera.quaternion),this.state=p,this.cursor=f,this.view.controls&&(console.warn("Deprecated use of PlanarControls. See examples to correct PlanarControls implementation."),this.view.controls.dispose()),this.view.controls=this,this._handlerOnKeyDown=this.onKeyDown.bind(this),this._handlerOnMouseDown=this.onMouseDown.bind(this),this._handlerOnMouseUp=this.onMouseUp.bind(this),this._handlerOnMouseMove=this.onMouseMove.bind(this),this._handlerOnMouseWheel=this.onMouseWheel.bind(this),this._handlerContextMenu=this.onContextMenu.bind(this),this._handlerUpdate=this.update.bind(this),this.view.addFrameRequester(n.Ao.AFTER_CAMERA_UPDATE,this._handlerUpdate),this.addInputListeners()}dispose(){this.removeInputListeners(),this.view.removeFrameRequester(n.Ao.AFTER_CAMERA_UPDATE,this._handlerUpdate)}update(t,e){e&&(t=16);const r=this.state!==p;switch(this.state){case 3:this.handleTravel(t),this.view.notifyChange(this.camera);break;case 4:this.handleZoomOrtho(t),this.view.notifyChange(this.camera);break;case 0:this.handleDragMovement(),this.view.notifyChange(this.camera);break;case 2:this.handleRotation(),this.view.notifyChange(this.camera);break;case 1:this.handlePanMovement(),this.view.notifyChange(this.camera)}this.handleCollision&&this.view.camera.adjustAltitudeToAvoidCollisionWithLayer(this.view,this.view.tileLayer,this.minDistanceCollision),r&&this.view.dispatchEvent({type:z.MOVED}),y.set(0,0)}initiateDrag(){this.state=0,v.copy(this.getWorldPointAtScreenXY(g)),b.set(0,0,0)}handleDragMovement(){this.getWorldPointFromMathPlaneAtScreenXY(g,v.z,x),b.subVectors(v,x),this.camera.position.add(b),b.set(0,0,0)}initiatePan(){this.state=1}handlePanMovement(){E.set(-y.x,y.y,0),this.camera.localToWorld(E),this.camera.position.copy(E)}initiateRotation(){this.state=2,_.copy(this.getWorldPointAtScreenXY(new i.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height)));const t=this.camera.position.distanceTo(_);w=Math.acos((this.camera.position.z-_.z)/t)}handleRotation(){const t=-this.rotateSpeed*y.x/this.view.mainLoop.gfxEngine.width,e=-this.rotateSpeed*y.y/this.view.mainLoop.gfxEngine.height,r=this.camera.position.clone().sub(_);0===t&&0===e||(w+e>=this.minZenithAngle&&w+e<=this.maxZenithAngle&&0!==e&&(w+=e,E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E),r.applyQuaternion(M),E.setFromMatrixColumn(this.camera.matrix,0),M.setFromAxisAngle(E,e),r.applyQuaternion(M),E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E).invert(),r.applyQuaternion(M)),0!==t&&(E.set(0,0,1),M.setFromAxisAngle(E,t),r.applyQuaternion(M))),this.camera.position.copy(r),this.camera.lookAt(m),this.camera.position.add(_),this.camera.updateMatrixWorld()}initiateZoom(t){const e=-t.deltaY;d.copy(this.getWorldPointAtScreenXY(g));const r=new i.Vector3;if(e>0||e<0&&this.maxAltitude>this.camera.position.z){const t=e>0?this.zoomInFactor:this.zoomOutFactor,i=this.view.getPixelsToMeters()/t;if(this.maxResolution>i||i>this.minResolution)return;this.camera.isOrthographicCamera?(this.state=4,this.view.notifyChange(this.camera),O=this.camera.zoom,k=O*t,d.z=this.camera.position.z,B=0,L=this.zoomTravelTime,this.updateMouseCursorType()):(r.lerpVectors(this.camera.position,d,1-1/t),this.initiateTravel(r,this.zoomTravelTime,null,!1))}}handleZoomOrtho(t){B=Math.min(B+t/1e3/L,1);const e=O+B*(k-O);this.camera.zoom!==e&&(this.camera.zoom=e,this.camera.updateProjectionMatrix(),this.view.viewToNormalizedCoords(g,E),E.z=0,E.unproject(this.camera),this.camera.position.x+=d.x-E.x,this.camera.position.y+=d.y-E.y,this.camera.updateMatrixWorld(!0)),this.testAnimationEnd()}initiateSmartTravel(){const t=this.getWorldPointAtScreenXY(g),e=new i.Vector3;e.copy(t).sub(this.camera.position),e.z=0,e.normalize();const r=this.camera.position.distanceTo(t),n=i.MathUtils.lerp(this.smartTravelHeightMin,this.smartTravelHeightMax,Math.min(r/5e3,1)),s=new i.Vector3;s.copy(t),this.enableRotation&&s.add(e.multiplyScalar(2*-n)),s.z=t.z+n,this.camera.isOrthographicCamera&&(O=this.camera.zoom,k=O*(1+Math.min(r/5e3,1)),s.z=this.camera.position.z),this.initiateTravel(s,"auto",t,!0)}initiateTravel(t,e,r,n){if(this.state=3,this.view.notifyChange(this.camera),B=0,this.updateMouseCursorType(),P=this.enableRotation&&r&&(r.isQuaternion||r.isVector3),D=n,T.copy(this.camera.position),I.copy(this.camera.quaternion),P&&(r.isQuaternion?R.copy(r):r.isVector3&&(t===r?(this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I)):(this.camera.position.copy(t),this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I),this.camera.position.copy(T)))),C.copy(t),this.instantTravel)L=0;else if("auto"===e){const e=Math.min(1,t.distanceTo(this.camera.position)/this.autoTravelTimeDist);if(L=i.MathUtils.lerp(this.autoTravelTimeMin,this.autoTravelTimeMax,e),P){const t=.5-.5*R.normalize().dot(this.camera.quaternion.normalize());L*=1+2*t,L=Math.min(L,this.autoTravelTimeMax)}}else L=e}handleTravel(t){B=Math.min(B+t/1e3/L,1);const e=D?this.smooth(B):B;this.camera.position.lerpVectors(T,C,e);const r=O+e*(k-O);this.camera.isOrthographicCamera&&this.camera.zoom!==r&&(this.camera.zoom=r,this.camera.updateProjectionMatrix()),!0===P&&this.camera.quaternion.slerpQuaternions(I,R,e),this.testAnimationEnd()}testAnimationEnd(){1===B&&(this.state=p,this.updateMouseCursorType())}goToTopView(){const t=new i.Vector3,e=new i.Quaternion;t.copy(this.getWorldPointAtScreenXY(new i.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height))),t.z+=Math.min(this.maxAltitude,this.camera.position.distanceTo(t)),e.setFromAxisAngle(new i.Vector3(1,0,0),0),this.initiateTravel(t,"auto",e,!0)}goToStartView(){this.camera.isOrthographicCamera&&(O=this.camera.zoom,k=u),this.initiateTravel(c,"auto",h,!0)}getWorldPointFromMathPlaneAtScreenXY(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Vector3;return S.copy(this.view.viewToNormalizedCoords(t)),U.setFromCamera(S,this.camera),N.constant=e,U.ray.intersectPlane(N,r),r}getWorldPointAtScreenXY(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;return this.view.getPickingPositionFromDepth(t,e)||this.getWorldPointFromMathPlaneAtScreenXY(t,this.groundLevel,e),e}addInputListeners(){this.view.domElement.addEventListener("keydown",this._handlerOnKeyDown,!1),this.view.domElement.addEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.addEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.addEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.addEventListener("contextmenu",this._handlerContextMenu,!1)}removeInputListeners(){this.view.domElement.removeEventListener("keydown",this._handlerOnKeyDown,!0),this.view.domElement.removeEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.removeEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.removeEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._handlerContextMenu,!1)}updateMouseCursorType(){switch(this.state){case p:this.view.domElement.style.cursor=this.cursor.default;break;case 0:this.view.domElement.style.cursor=this.cursor.drag;break;case 1:this.view.domElement.style.cursor=this.cursor.pan;break;case 3:this.view.domElement.style.cursor=this.cursor.travel;break;case 4:this.view.domElement.style.cursor=this.cursor.ortho_zoom;break;case 2:this.view.domElement.style.cursor=this.cursor.rotate}}updateMousePositionAndDelta(t){this.view.eventToViewCoords(t,g),y.copy(g).sub(A),A.copy(g)}setCursor(t,e){this.cursor[t]=e,this.updateMouseCursorType()}onMouseDown(t){if(this.enabled&&(t.preventDefault(),this.view.domElement.focus(),p===this.state)){if(l=t.button,this.updateMousePositionAndDelta(t),s===t.button)if(t.ctrlKey){if(!this.enableRotation)return;this.initiateRotation()}else this.initiateDrag();else if(o===t.button){if(!this.enableSmartTravel)return;this.initiateSmartTravel()}else if(a===t.button){if(!this.enablePan)return;this.initiatePan()}this.updateMouseCursorType()}}onMouseUp(t){t.preventDefault(),3!==this.state&&4!==this.state&&l===t.button&&(this.state=p),this.updateMouseCursorType()}onMouseMove(t){this.enabled&&(t.preventDefault(),this.updateMousePositionAndDelta(t),p!==this.state&&this.view.notifyChange())}onKeyDown(t){if(p===this.state&&this.enabled)switch(t.keyCode){case 84:this.camera.isOrthographicCamera||this.goToTopView();break;case 89:this.goToStartView();break;case 32:this.enableSmartTravel&&this.initiateSmartTravel(t)}}onMouseWheel(t){this.enabled&&(t.preventDefault(),t.stopPropagation(),p===this.state&&this.initiateZoom(t))}onContextMenu(t){t.preventDefault()}smooth(t){return(t**2*(3-2*t))**1.2}}const Q=G},16916:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var i=r(99477);const n={BYTE:1,UNSIGNED_BYTE:1,SHORT:2,UNSIGNED_SHORT:2,INT:4,UNSIGNED_INT:4,FLOAT:4,DOUBLE:8},s={BYTE:Int8Array,UNSIGNED_BYTE:Uint8Array,SHORT:Int16Array,UNSIGNED_SHORT:Uint16Array,INT:Int32Array,UNSIGNED_INT:Uint32Array,FLOAT:Float32Array,DOUBLE:Float64Array},o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},a={VEC2:i.Vector2,VEC3:i.Vector3,VEC4:i.Vector4},l=function(t,e,r,i,l){if(!t)throw new Error("Buffer is mandatory to parse binary property.");if(null==e)throw new Error("batchLength is mandatory to parse binary property.");if(null==r)throw new Error("byteOffset is mandatory to parse binary property.");if(!n[i])throw new Error(`Uknown component type: ${i}. Cannot access binary property.`);if(!o[l])throw new Error(`Uknown type: ${l}. Cannot access binary property.`);const c=o[l],h=new s[i](t,r,e*c);if("SCALAR"===l)return Array.from(h);{const t=[];for(let e=0;e<=h.length-c;e+=c){const r=new a[l];r.fromArray(h,e),t.push(r)}return t}};var c=r(24147);const h=new TextDecoder,u=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ArrayBuffer,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4?arguments[4]:void 0;4!==arguments.length||"object"!=typeof i||Array.isArray(i)||null===i||console.warn("You most likely used a deprecated constructor of C3DTBatchTable."),e+r!==t.byteLength&&console.error("3DTiles batch table json length and binary length are not consistent with total buffer length. The batch table may be wrong."),this.type=c.h.batchtable,this.batchLength=i;const s=t.slice(0,e),o=h.decode(new Uint8Array(s)),a=""===o?null:JSON.parse(o);if(r>0){const i=t.slice(e,e+r);for(const t in a){if(!Object.prototype.hasOwnProperty.call(a,t))continue;const e=a[t];Array.isArray(e)||(void 0!==(null==e?void 0:e.byteOffset)&&void 0!==(null==e?void 0:e.componentType)&&void 0!==(null==e?void 0:e.type)?a[t]=l(i,this.batchLength,e.byteOffset,e.componentType,e.type):console.error("Invalid 3D Tiles batch table property that is neither a JSON array nor a valid accessor to a binary body"))}}a&&a.extensions&&(this.extensions=n.parseExtensions(a.extensions,this.type),delete a.extensions),this.content=a}getInfoById(t){if(t<0&&t{"use strict";r.d(e,{Z:()=>g});var i=r(99477),n=r(16828),s=r(60145),o=r(24147);const a=new n.Z,l=new i.Vector3,c=new i.Vector3,h=new s.Z("EPSG:4326"),u=new i.Vector3,d=new s.Z("EPSG:4326"),p=new i.Vector3,f=new i.Vector3,m=new i.Vector3,g=class{constructor(t,e,r){if(this.type=o.h.boundingVolume,t.region)this.initialVolumeType=o.D.region,this.volume=function(t,e){const r=t[2],n=t[0],s=t[1],o=t[3],l=t[4],c=t[5],m=i.MathUtils.radToDeg(r),g=i.MathUtils.radToDeg(n),A=i.MathUtils.radToDeg(s),y=i.MathUtils.radToDeg(o);d.setFromValues(g,y,l),a.cartographicToCartesian(d,p),h.setFromValues(m,A,c),a.cartographicToCartesian(h,u);const v=new i.Vector3;v.lerpVectors(p,u,.5);const x=f.subVectors(p,u).length()/2,b=new i.Sphere(v,x);return b.applyMatrix4(e),b}(t.region,e);else if(t.box)this.initialVolumeType=o.D.box,this.volume=function(t){c.set(t[0],t[1],t[2]),l.set(t[3],t[7],t[11]).multiplyScalar(2);const e=new i.Box3;return e.setFromCenterAndSize(c,l),e}(t.box);else{if(!t.sphere)throw new Error(`Unknown bounding volume type: ${t}. 3D Tiles nodes must have a bounding volume of type\n region, box or sphere.`);this.initialVolumeType=o.D.sphere,this.volume=function(t){const e=new i.Vector3;return e.set(t[0],t[1],t[2]),new i.Sphere(e,t[3])}(t.sphere)}t.extensions&&(this.extensions=r.parseExtensions(t.extensions,this.type))}boundingVolumeCulling(t,e){if(this.initialVolumeType===o.D.box)return!t.isBox3Visible(this.volume,e);if(this.initialVolumeType===o.D.sphere||this.initialVolumeType===o.D.region)return!t.isSphereVisible(this.volume,e);throw new Error("Unknown bounding volume type.")}viewerRequestVolumeCulling(t,e){return this.initialVolumeType===o.D.region?(console.warn("Region viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.D.box?(console.warn("Bounding box viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.D.sphere&&(m.copy(this.volume.center),m.applyMatrix4(e),!(t.camera3D.position.distanceTo(m)<=this.volume.radius))}}},83500:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const i=class{registerExtension(t,e){this[t]=e}getExtension(t,e){if(this[t]&&this[t][e])return this[t][e];console.error(`No extension manager registered for extension ${t} and for class ${e}`)}isExtensionRegistered(t){return this[t]}parseExtensions(t,e){const r={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=new(this.getExtension(i,e))(t[i]));return r}}},97498:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});var i=r(99477);const n=class{#t;constructor(t,e,r,i,n,s){s||console.error("BREAKING CHANGE: C3DTFeature constructor changed from (tileId, batchId, groups, info, userData) to (tileId, batchId, groups, info, userData, object3d)"),this.object3d=s,this.batchId=e,this.groups=r,this.userData=n,this.#t=i,this.tileId=t}computeWorldBox3(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Box3;return t.max.x=-1/0,t.max.y=-1/0,t.max.z=-1/0,t.min.x=1/0,t.min.y=1/0,t.min.z=1/0,this.groups.forEach((e=>{const r=3*e.start,i=3*(e.start+e.count);for(let e=r;e{"use strict";r.d(e,{D:()=>n,h:()=>i});const i={tileset:"tileset",batchtable:"batchtable",boundingVolume:"boundingVolume"},n={region:"region",box:"box",sphere:"sphere"}},45571:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var i=r(99477),n=r(25655),s=r(24147);const o=new i.Matrix4,a=class{constructor(t,e,r){this.type=s.h.tileset,this.asset=t.asset,this.properties=t.properties,this.geometricError=t.geometricError,this.extensionsUsed=t.extensionsUsed,this.extensionsRequired=t.extensionsRequired,this.tiles=[],this.parseTiles(t.root,e,void 0,r),t.extensions&&(this.extensions=r.parseExtensions(t.extensions,this.type))}parseTiles(t,e,r,s){if(t.transform=t.transform?(new i.Matrix4).fromArray(t.transform):void 0,t._worldFromLocalTransform=t.transform,r&&r._worldFromLocalTransform&&(t.transform?t._worldFromLocalTransform=(new i.Matrix4).multiplyMatrices(r._worldFromLocalTransform,t.transform):t._worldFromLocalTransform=r._worldFromLocalTransform),(t.viewerRequestVolume&&t.viewerRequestVolume.region||t.boundingVolume&&t.boundingVolume.region)&&(t._worldFromLocalTransform?o.copy(t._worldFromLocalTransform).invert():o.identity()),t.viewerRequestVolume=t.viewerRequestVolume?new n.Z(t.viewerRequestVolume,o,s):null,t.boundingVolume=t.boundingVolume?new n.Z(t.boundingVolume,o,s):null,this.tiles.push(t),t.tileId=this.tiles.length-1,t.baseURL=e,t.children)for(const r of t.children)this.parseTiles(r,e,t,s)}extendTileset(t,e,r,i){this.parseTiles(t.root,r,this.tiles[e],i),this.tiles[e].children=[t.root],this.tiles[e].isTileset=!0}}},86896:(t,e,r)=>{"use strict";r.d(e,{Dx:()=>a,S_:()=>n,_F:()=>s,ie:()=>o});var i=r(27240);const n=t=>(t.fx&&(console.warn("ColorLayer fx is deprecated, use ColorLayer.effect_type and ColorLayer.effect_parameter instead."),t.fx>2?(t.effect_parameter=t.fx,t.effect_type=i.pO.removeLightColor):t.fx>0&&(t.effect_parameter=t.fx,t.effect_type=i.pO.removeWhiteColor)),t),s=t=>{if(t.crsOut||t.crsIn){console.warn("Parsing options with crsIn and crsOut are deprecated, use { in, out } structure.");const e={in:{},out:{}};return e.in.crs=t.crsIn,e.in.isInverted=t.isInverted,e.in.styles=t.styles,e.in.layers=t.layers,e.in.filter=t.filter,e.out.crs=t.crsOut,e.out.mergeFeatures=t.mergeFeatures,t.withAltitude&&t.withNormal?(console.warn("Parsing options withAltitude and withNormal is deprecated, use out.structure: 2d or 3d."),e.out.structure="3d"):e.out.structure="2d",e.out.filteringExtent=t.filteringExtent,e.out.style=t.style,void 0!==t.crsOut.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead"),e.out.filter=t.filter,e}return t.out&&(void 0===t.out.withAltitude&&void 0===t.out.withNormal||(console.warn("Parsing options out.withAltitude and out.withNormal is deprecated, use out.structure: 2d or 3d."),t.out.withAltitude&&t.out.withNormal?t.out.structure="3d":t.out.structure="2d"),void 0!==t.out.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead")),t},o=t=>{t.color&&console.error("Color convert option is removed, use Style.xxx.color"),t.extrude&&console.error("extrude convert option is removed, use Style.fill.extrusion_height instead"),t.altitude&&console.error("altitude convert option is removed, use Style.xxx.base_altitude instead")},a=t=>{!1===t.isWebGL2&&console.warn("WebGL1 support (isWebGL2=false) is deprecated and will be removed in iTowns 2.43. This follows its deprecation by three.js. If you are impacted by this change, please discuss in the following issue: https://github.com/iTowns/itowns/issues/2152.")}},94596:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>g,iL:()=>d,t1:()=>_,tg:()=>u});var i=r(99477),n=r(99128),s=r(60145),o=r(82150),a=r(48891);function l(t){return new n.ZP(t,1/0,-1/0,1/0,-1/0)}function c(t,e){t.normals&&e.geodesicNormal.toArray(t.normals,t._pos),t._pushValues(e.x,e.y,e.z)}const h=new s.Z("EPSG:4326",0,0,0),u={POINT:0,LINE:1,POLYGON:2};class d{#e;constructor(t){this.indices=[],this.properties={},this.size=t.size,t.extent&&(this.extent=l(t.extent.crs),this.#e=l(t.extent.crs))}startSubGeometry(t,e){const r=this.indices.length-1,i=this.extent?l(this.extent.crs):void 0,n=r>-1?this.indices[r].offset+this.indices[r].count:e.vertices.length/this.size;this.indices.push({offset:n,count:t,extent:i}),this.#e=i,function(t,e){t.vertices.length+=e*t.size,t.normals&&(t.normals.length=t.vertices.length)}(e,t)}closeSubGeometry(t,e){const r=this.indices.length-1,i=r>-1?this.indices[r].offset+this.indices[r].count:e.vertices.length/this.size-t;this.indices.push({offset:i,count:t,extent:this.#e}),this.extent&&(this.extent.union(this.#e),this.#e=l(this.extent.crs))}getLastSubGeometry(){const t=this.indices.length-1;return this.indices[t]}pushCoordinates(t,e){if(t.isCoordinates)return console.warn("Deprecated: change in arguments order, use pushCoordinates(feature, coordIn) instead"),void this.pushCoordinates(e,t);e.as(t.crs,h),t.transformToLocalSystem(h),c(t,h),this.#e&&this.#e.expandByCoordinates(t.useCrsOut?h:e)}pushCoordinatesValues(t,e,r){if((arguments.length<=3?0:arguments.length-3)>0)return console.warn("Deprecated: change in arguments, use pushCoordinatesValues(feature, {x: long, y: lat, normal}, coordProj) instead"),void this.pushCoordinatesValues(t,{x:e,y:r,normal:arguments.length<=3?void 0:arguments[3]},arguments.length<=4?void 0:arguments[4]);c(t,e),this.#e&&this.#e.expandByValuesCoordinates(e.x,e.y)}updateExtent(){if(this.extent){const t=this.indices[this.indices.length-1];t&&this.extent.union(t.extent)}}}function p(t,e){this.vertices[this._pos++]=t,this.vertices[this._pos++]=e}function f(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.vertices[this._pos++]=t,this.vertices[this._pos++]=e,this.vertices[this._pos++]=r}class m{constructor(t,e){if(!Object.keys(u).find((e=>u[e]===t)))throw new Error(`Unsupported Feature type: ${t}`);this.type=t,this.geometries=[],this.vertices=[],this.crs=e.crs,this.size=e.size,this.normals="EPSG:4978"==e.crs?[]:void 0,this.hasRawElevationData=!1,this.transformToLocalSystem=e.transformToLocalSystem.bind(e),e.extent&&(this.extent=l(e.extent.crs),this.useCrsOut=this.extent.crs==this.crs),this._pos=0,this._pushValues=(3===this.size?f:p).bind(this),this.style=a.ZP.setFromProperties}bindNewGeometry(){const t=new d(this);return this.geometries.push(t),t}updateExtent(t){this.extent&&this.extent.union(t.extent)}get geometryCount(){return this.geometries.length}}const g=m,A=()=>{},y=(t,e)=>(t.geodesicNormal.applyNormalMatrix(e.normalMatrixInverse),t.applyMatrix4(e.matrixWorldInverse)),v=(t,e)=>t.applyMatrix4(e.matrixWorldInverse),x=new i.Vector3(0,0,1),b=new i.Quaternion;class _ extends i.Object3D{#r=v;#i=A;constructor(t){var e;super(),this.isFeatureCollection=!0,this.crs=o.Z.formatToEPSG(t.accurate||null===(e=t.source)||void 0===e||!e.crs?t.crs:t.source.crs),this.features=[],this.mergeFeatures=void 0===t.mergeFeatures||t.mergeFeatures,this.size="3d"==t.structure?3:2,this.filterExtent=t.filterExtent,this.style=t.style,this.isInverted=!1,this.matrixWorldInverse=new i.Matrix4,this.center=new s.Z("EPSG:4326",0,0),2==this.size?(this.extent=!1===t.buildExtent?void 0:l(t.forcedExtentCrs||this.crs),this.#i=t=>{t.as(this.crs,this.center),this.position.copy(t),this.updateMatrixWorld(),this.#i=A}):(this.extent=t.buildExtent?l(t.forcedExtentCrs||this.crs):void 0,this.#i=t=>{t.as("EPSG:4326",this.center),"EPSG:4978"==this.crs&&(this.quaternion.setFromUnitVectors(x,t.geodesicNormal),b.setFromAxisAngle(x,i.MathUtils.degToRad(90+this.center.longitude)),this.quaternion.multiply(b)),this.position.copy(t),this.updateMatrixWorld(),this.normalMatrix.getNormalMatrix(this.matrix),this.normalMatrixInverse=(new i.Matrix3).copy(this.normalMatrix).invert(),this.#i=A},this.#r=y)}transformToLocalSystem(t){return this.#i(t),this.#r(t,this)}updateExtent(t){if(this.extent){const e=t?[t]:this.features.map((t=>t.extent));for(const t of e)this.extent.union(t)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}removeEmptyFeature(){this.features=this.features.filter((t=>t.geometries.length))}pushFeature(t){this.features.push(t),this.updateExtent(t.extent)}requestFeature(t,e){const r=this.features.find(e);if(r&&this.mergeFeatures)return r;{const e=new m(t,this);return this.features.push(e),e}}requestFeatureByType(t){return this.requestFeature(t,(e=>e.type===t))}requestFeatureById(t,e){return this.requestFeature(e,(e=>e.id===t))}newFeatureByReference(t){const e=new m(t.type,this);return e.extent=t.extent,e.geometries=t.geometries,e.normals=t.normals,e.size=t.size,e.vertices=t.vertices,e._pos=t._pos,this.features.push(e),e}}},60145:(t,e,r)=>{"use strict";r.d(e,{Z:()=>f});var i=r(99477),n=r(24472),s=r(82150),o=r(16828);n.default.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const a=new o.Z,l={},c=new i.Vector3,h=new i.Vector3;let u,d;class p{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.isCoordinates=!0,s.Z.isValid(t),this.crs=t,this.x=0,this.y=0,this.z=0,this._normal=new i.Vector3,e.length>0?this.setFromArray(e):e.isVector3||e.isCoordinates?this.setFromVector3(e):this.setFromValues(e,r,n),this._normalNeedsUpdate=!0}setCrs(t){s.Z.isValid(t),this.crs=t}setFromValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.x=null==t?0:t,this.y=null==e?0:e,this.z=null==r?0:r,this._normalNeedsUpdate=!0,this}setFromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.setFromValues(t[e],t[e+1],t[e+2])}setFromVector3(t){return this.setFromValues(t.x,t.y,t.z)}clone(){return new p(this.crs,this)}copy(t){return this.crs=t.crs,this.setFromVector3(t)}get longitude(){return this.x}get latitude(){return this.y}get altitude(){return this.z}set altitude(t){this.z=t}get geodesicNormal(){return this._normalNeedsUpdate&&(this._normalNeedsUpdate=!1,s.Z.is4326(this.crs)?a.geodeticSurfaceNormalCartographic(this,this._normal):"EPSG:4978"==this.crs?a.geodeticSurfaceNormal(this,this._normal):this._normal.set(0,0,1)),this._normal}toVector3(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector3).copy(this)}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i.Vector3.prototype.toArray.call(this,t,e)}planarDistanceTo(t){return this.toVector3(c).setZ(0),t.toVector3(h).setZ(0),c.distanceTo(h)}geodeticDistanceTo(t){return this.as("EPSG:4326",u),t.as("EPSG:4326",d),a.geodesicDistance(u,d)}spatialEuclideanDistanceTo(t){return this.as("EPSG:4978",u).toVector3(c),t.as("EPSG:4978",d).toVector3(h),c.distanceTo(h)}applyMatrix4(t){return i.Vector3.prototype.applyMatrix4.call(this,t)}as(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new p(t);var r,o;return this.crs==t?e.copy(this):(s.Z.is4326(this.crs)&&"EPSG:3857"==t&&(this.y=i.MathUtils.clamp(this.y,-89.999999,89.999999)),e.setFromArray((r=this.crs,o=t,l[r]||(l[r]={}),l[r][o]||(l[r][o]=(0,n.default)(r,o)),l[r][o]).forward([this.x,this.y,this.z]))),e.crs=t,e}}u=new p("EPSG:4326",0,0,0),d=new p("EPSG:4326",0,0,0);const f=p},82150:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var i=r(24472);function n(t){return"string"==typeof t||t instanceof String}function s(t){if(!n(t))throw new Error(`Crs parameter value must be a string: '${t}'`)}function o(t){return n(t)&&t.startsWith("TMS")}function a(t){return n(t)&&t.startsWith("EPSG")}function l(t){return s(t),a(t)?t:`EPSG:${t.match(/\d+/)[0]}`}i.default.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const c={DEGREE:1,METER:2};function h(t){return"EPSG:4326"===t}function u(t){switch(s(t),t){case"EPSG:4326":return c.DEGREE;case"EPSG:4978":return c.METER;default:{const r=i.default.defs(l(t));if(!r)return;return"degrees"===(e=r.units)?c.DEGREE:"m"===e?c.METER:void 0}}var e}function d(t){s(t);const e=u(t);if(void 0===e)throw new Error(`No unit found for crs: '${t}'`);return e}const p={UNIT:c,isValid(t){d(t)},isGeographic:t=>d(t)==c.DEGREE,isMetricUnit:t=>u(t)==c.METER,toUnit:u,is4326:h,isGeocentric:function(t){s(t);const e=i.default.defs(t);return!!e&&"geocent"==e.projName},reasonnableEpsilon:t=>h(t)?.01:.001,formatToEPSG:l,formatToTms:function(t){return s(t),o(t)?t:`TMS:${t.match(/\d+/)[0]}`},isTms:o,isEpsg:a,tms_3857:"TMS:3857",tms_4326:"TMS:4326",defs:(t,e)=>i.default.defs(t,e)}},99128:(t,e,r)=>{"use strict";r.d(e,{Mh:()=>E,ZP:()=>R,dS:()=>M});var i=r(99477),n=r(60145),s=r(82150);const o=new i.Vector2,a=new i.Vector2,l=new i.Vector2,c=new i.Box3,h=new i.Vector2,u=new i.Vector2,d=new i.Vector2(2,2),p={row:0,col:0,invDiff:0},f=new n.Z("EPSG:4326",0,0,0),m=new n.Z("EPSG:4326",0,0,0),g=new n.Z("EPSG:4326",0,0,0),A=new i.Vector3,y=new i.Vector3;function v(t,e){const r=2**(t.zoom-e);return p.invDiff=1/r,p.row=(t.row-t.row%r)*p.invDiff,p.col=(t.col-t.col%r)*p.invDiff,p}let x,b;const _=new Array(8);for(let t=_.length-1;t>=0;t--)_[t]=new n.Z("EPSG:4326",0,0,0,0);const w=new n.Z("EPSG:4326",0,0),E=new Map,M=new Map;function S(t){const e=s.Z.formatToEPSG(t),r=E.get(e),i=r.planarDimensions(a),n=s.Z.formatToTms(t);return{epsg:e,globalExtent:r,globalDimension:i,sTs:M.get(n)||M.get("default"),isInverted:!n.includes(":NI")}}function C(t,e){const r=M.get(s.Z.formatToTms(t))||M.get("default"),i=2**e;return l.set(i,i).multiply(r),l}class T{constructor(t,e,r,i,n){if(s.Z.isGeocentric(t))throw new Error(`${t} is a geocentric projection, it doesn't make sense with a geographical extent`);this.isExtent=!0,this.crs=t,this.zoom=0,s.Z.isTms(this.crs)?(this.row=0,this.col=0):(this.west=0,this.east=0,this.south=0,this.north=0),this.set(e,r,i,n)}clone(){return s.Z.isTms(this.crs)?new T(this.crs,this.zoom,this.row,this.col):new T(this.crs,this.west,this.east,this.south,this.north)}tiledCovering(t){if("EPSG:4326"==this.crs&&t==s.Z.tms_3857){const e=[],r=x.copy(this).as(s.Z.formatToEPSG(t),b),{globalExtent:i,globalDimension:n,sTs:o}=S(s.Z.formatToEPSG(t));r.clampByExtent(i),r.planarDimensions(u);const a=this.zoom+1||Math.floor(Math.log2(Math.round(n.x/(u.x*o.x)))),l=C(t,a),c=r.center(w);h.x=c.x-i.west,h.y=i.north-r.north,h.divide(n).multiply(l).floor();for(let s=Math.ceil((i.north-r.south)/n.x*l.y)-1;s>=h.y;s--)e.push(new T(t,a,s,h.x));return e}{const e=new T(t,0,0,0),{globalExtent:r,globalDimension:i,sTs:n,isInverted:s}=S(this.crs),o=this.center(w);this.planarDimensions(u);const a=Math.floor(Math.log2(Math.round(i.x/(u.x*n.x)))),l=C(t,a);return h.x=o.x-r.west,h.y=s?r.north-o.y:o.y-r.south,h.divide(i).multiply(l).floor(),e.set(a,h.y,h.x),[e]}}as(t,e){if(s.Z.isValid(t),e=e||new T("EPSG:4326",[0,0,0,0]),s.Z.isTms(this.crs)){const{epsg:r,globalExtent:i,globalDimension:n}=S(this.crs),s=C(this.crs,this.zoom);return u.set(1,1).divide(s).multiply(n),e.west=i.west+(n.x-u.x*(s.x-this.col)),e.east=e.west+u.x,e.south=i.south+u.y*(s.y-this.row-1),e.north=e.south+u.y,e.crs=r,e.zoom=this.zoom,t==r?e:e.as(t,e)}if(s.Z.isEpsg(t)){if(this.crs!=t){const r=this.center(w);_[0].setFromValues(this.west,this.north),_[1].setFromValues(r.x,this.north),_[2].setFromValues(this.east,this.north),_[3].setFromValues(this.east,r.y),_[4].setFromValues(this.east,this.south),_[5].setFromValues(r.x,this.south),_[6].setFromValues(this.west,this.south),_[7].setFromValues(this.west,r.y),e.set(1/0,-1/0,1/0,-1/0);for(let r=0;r<_.length;r++)_[r].crs=this.crs,_[r].as(t,w),e.north=Math.max(e.north,w.y),e.south=Math.min(e.south,w.y),e.east=Math.max(e.east,w.x),e.west=Math.min(e.west,w.x);return e.zoom=this.zoom,e.crs=t,e}return e.crs=t,e.zoom=this.zoom,e.set(this.west,this.east,this.south,this.north),e}}center(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Z(this.crs);if(s.Z.isTms(this.crs))throw new Error("Invalid operation for WMTS bbox");return this.planarDimensions(o),t.crs=this.crs,t.setFromValues(this.west+.5*o.x,this.south+.5*o.y),t}dimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return console.warn("Extent.dimensions is deprecated, use planarDimensions, geodeticDimensions or spatialEuclideanDimensions"),t.x=Math.abs(this.east-this.west),t.y=Math.abs(this.north-this.south),t}planarDimensions(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2).set(Math.abs(this.east-this.west),Math.abs(this.north-this.south))}geodeticDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return f.crs=this.crs,m.crs=this.crs,g.crs=this.crs,f.setFromValues(this.west,this.north,0),m.setFromValues(this.west,this.south,0),g.setFromValues(this.east,this.north,0),t.set(f.geodeticDistanceTo(g),f.geodeticDistanceTo(m))}spatialEuclideanDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return f.crs=this.crs,m.crs=this.crs,g.crs=this.crs,f.setFromValues(this.west,this.north,0),m.setFromValues(this.west,this.south,0),g.setFromValues(this.east,this.north,0),t.set(f.spatialEuclideanDistanceTo(g),f.spatialEuclideanDistanceTo(m))}isPointInside(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.crs==t.crs?w.copy(t):t.as(this.crs,w),w.x<=this.east+e&&w.x>=this.west-e&&w.y<=this.north+e&&w.y>=this.south-e}isInside(t,e){return s.Z.isTms(this.crs)?this.zoom==t.zoom?this.row==t.row&&this.col==t.col:!(this.zoom1&&void 0!==arguments[1]?arguments[1]:new i.Vector4;if(this.crs!=t.crs)throw new Error("unsupported mix");if(s.Z.isTms(this.crs))return v(this,t.zoom),e.set(this.col*p.invDiff-p.col,this.row*p.invDiff-p.row,p.invDiff,p.invDiff);t.planarDimensions(o),this.planarDimensions(a);const r=(this.west-t.west)/o.x,n=(t.north-this.north)/o.y,l=a.x/o.x,c=a.y/o.y;return e.set(r,n,l,c)}tiledExtentParent(t){return t&&t=r.east||t.east<=r.west||t.south>=r.north||t.north<=r.south)}intersect(t){return this.intersectsExtent(t)?(t.crs!=this.crs&&(t=t.as(this.crs,x)),new T(this.crs,Math.max(this.west,t.west),Math.min(this.east,t.east),Math.max(this.south,t.south),Math.min(this.north,t.north))):new T(this.crs,0,0,0,0)}set(t,e,r,i){if(null==t)throw new Error("No values to set in the extent");return t.isExtent&&(s.Z.isTms(t.crs)?(e=t.row,r=t.col,t=t.zoom):(e=t.east,r=t.south,i=t.north,t=t.west)),s.Z.isTms(this.crs)?(this.zoom=t,this.row=e,this.col=r):t.isCoordinates?(this.west=t.x,this.east=e.x,this.south=t.y,this.north=e.y):void 0!==t.west?(this.west=t.west,this.east=t.east,this.south=t.south,this.north=t.north):4==t.length?(this.west=t[0],this.east=t[1],this.south=t[2],this.north=t[3]):void 0!==i&&(this.west=t,this.east=e,this.south=r,this.north=i),this}copy(t){return this.crs=t.crs,this.set(t)}union(t){if(t.crs!=this.crs)throw new Error("unsupported union between 2 diff crs");if(this.west===1/0)this.copy(t);else{const e=t.west;ethis.east&&(this.east=r);const i=t.south;ithis.north&&(this.north=n)}}expandByCoordinates(t){const e=t.crs==this.crs?t:t.as(this.crs,w);this.expandByValuesCoordinates(e.x,e.y)}expandByValuesCoordinates(t,e){tthis.east&&(this.east=t),ethis.north&&(this.north=e)}static fromBox3(t,e){return s.Z.isGeocentric(t)&&(t="EPSG:4326",e=c.copy(e),m.crs=t,m.setFromVector3(e.min).as(t,m).toVector3(e.min),g.crs=t,g.setFromVector3(e.max).as(t,g).toVector3(e.max)),new T(t,{west:e.min.x,east:e.max.x,south:e.min.y,north:e.max.y})}toString(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return s.Z.isTms(this.crs)?`${this.zoom}${t}${this.row}${t}${this.col}`:`${this.east}${t}${this.north}${t}${this.west}${t}${this.south}`}subdivision(){return this.subdivisionByScheme()}subdivisionByScheme(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;const e=[],r=this.planarDimensions(o).divide(t);for(let i=t.x-1;i>=0;i--)for(let n=t.y-1;n>=0;n--){const t=this.west+i*r.x,s=this.south+n*r.y;e.push(new T(this.crs,t,t+r.x,s,s+r.y))}return e}applyMatrix4(t){if(!s.Z.isTms(this.crs)){if(A.set(this.west,this.south,0).applyMatrix4(t),y.set(this.east,this.north,0).applyMatrix4(t),this.west=A.x,this.east=y.x,this.south=A.y,this.north=y.y,this.west>this.east){const t=this.west;this.west=this.east,this.east=t}if(this.south>this.north){const t=this.south;this.south=this.north,this.north=t}return this}}clampSouthNorth(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.south,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.north;return this.south=Math.max(this.south,t),this.north=Math.min(this.north,e),this}clampWestEast(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.west,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.east;return this.west=Math.max(this.west,t),this.east=Math.min(this.east,e),this}clampByExtent(t){return this.clampSouthNorth(t.south,t.north),this.clampWestEast(t.west,t.east)}}x=new T("EPSG:4326",[0,0,0,0]),b=new T("EPSG:4326",[0,0,0,0]),E.set("EPSG:4326",new T("EPSG:4326",-180,180,-90,90));const I=E.get("EPSG:4326").as("EPSG:3857");I.clampSouthNorth(I.west,I.east),E.set("EPSG:3857",I),M.set("default",new i.Vector2(1,1)),M.set(s.Z.tms_3857,M.get("default")),M.set(s.Z.tms_4326,new i.Vector2(2,1));const R=T},67503:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477),n=r(60145),s=r(82150);const o=new n.Z("EPSG:4326"),a=new i.Vector2,l=class{constructor(t,e,r){s.Z.isGeographic(t.crs),this.extent=t,this.step=new i.Vector2(e.x,e.y||e.x),this.dimensions=this.extent.planarDimensions(),this.dataSize=(new i.Vector2).addVectors(this.step,this.dimensions).divide(this.step).round(),this.getData=r}getHeightAtCoordinates(t){return t.as(this.extent.crs,o),a.set((this.dataSize.x-1)*(o.x-this.extent.west)/this.dimensions.x,(this.dataSize.y-1)*(o.y-this.extent.south)/this.dimensions.y),a.x<0||a.x>=this.dataSize.x-1||a.y<0||a.y>=this.dataSize.y-1?0:function(t,e){const r=Math.floor(t.x),i=Math.floor(t.y),n=t.x-r,s=t.y-i;return(1-n)*((1-s)*e(i,r)+s*e(i+1,r))+n*((1-s)*e(i,r+1)+s*e(i+1,r+1))}(a,this.getData)}}},57918:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var i=r(99477),n=r(79295);const s=new(r(60145).Z)("EPSG:4326");let o,a="";a=void 0!==document.documentElement.style.transform?"transform":void 0!==document.documentElement.style.webkitTransform?"webkitTransform":void 0!==document.documentElement.style.mozTransform?"mozTransform":void 0!==document.documentElement.style.oTransform?"oTransform":"transform";class l extends i.Object3D{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)throw new Error("coordinates are mandatory to add a Label");arguments.length>3&&console.warn("Deprecated argument sprites in Label constructor. Sprites must be configured in style argument."),super();let i=this.visible;Object.defineProperty(this,"visible",{set(t){t!=i&&(i=t,this.content.style.display=t?"block":"none")},get:()=>i}),this.isLabel=!0,this.coordinates=e,this.projectedPosition={x:0,y:0},this.boundaries={left:0,right:0,top:0,bottom:0},"string"==typeof t?(this.content=document.createElement("div"),this.content.textContent=r.text.field):this.content=t.cloneNode(!0),this.content.classList.add("itowns-label"),this.content.style.userSelect="none",this.content.style.position="absolute",r.isStyle?(this.anchor=r.getTextAnchorPosition(),this.styleOffset=r.text.offset,"string"==typeof t&&(r.text.haloWidth>0&&this.content.classList.add("itowns-stroke-single"),r.applyToHTML(this.content).then((t=>{t&&(this.icon=t)})))):(this.anchor=[0,0],this.styleOffset=[0,0]),this.iconOffset={left:0,right:0,top:0,bottom:0},this.zoom={min:r.zoom&&null!=r.zoom.min?r.zoom.min:2,max:r.zoom&&null!=r.zoom.max?r.zoom.max:24},this.order=r.order||0,this.padding=2}updateProjectedPosition(t,e){const r=Math.round(t),i=Math.round(e);r==this.projectedPosition.x&&i==this.projectedPosition.y||(this.projectedPosition.x=r,this.projectedPosition.y=i,this.boundaries.left=t+this.offset.left-this.padding,this.boundaries.right=t+this.offset.right+this.padding,this.boundaries.top=e+this.offset.top-this.padding,this.boundaries.bottom=e+this.offset.bottom+this.padding,0===this.iconOffset.left&&0===this.iconOffset.right&&0===this.iconOffset.top&&0===this.iconOffset.bottom||(this.boundaries.left=Math.min(this.boundaries.left,t+this.iconOffset.left),this.boundaries.right=Math.max(this.boundaries.right,t+this.iconOffset.right),this.boundaries.top=Math.min(this.boundaries.top,e+this.iconOffset.top),this.boundaries.bottom=Math.max(this.boundaries.bottom,e+this.iconOffset.bottom)))}updateCSSPosition(){this.content.style[a]=`translate(${this.projectedPosition.x+this.offset.left}px, ${this.projectedPosition.y+this.offset.top}px)`,this.icon&&(this.icon.style[a]=`translate(${-this.offset.left}px, ${-this.offset.top}px)`)}initDimensions(){if(!this.offset){o=this.content.getBoundingClientRect();const t=Math.round(o.width),e=Math.round(o.height);this.offset={left:t*this.anchor[0]+this.styleOffset[0],top:e*this.anchor[1]+this.styleOffset[1]},this.offset.right=this.offset.left+t,this.offset.bottom=this.offset.top+e,this.icon&&(o=this.icon.getBoundingClientRect(),this.iconOffset={left:Math.floor(o.x),top:Math.floor(o.y),right:Math.ceil(o.x+o.width),bottom:Math.ceil(o.y+o.height)})}}update3dPosition(t){this.coordinates.as(t,s).toVector3(this.position),this.updateMatrixWorld()}updateElevationFromLayer(t,e){if(0==t.attachedLayers.filter((t=>t.isElevationLayer)).length)return;let r=Math.max(0,n.Z.getElevationValueAt(t,this.coordinates,n.Z.FAST_READ_Z,e));isNaN(r)&&(r=Math.max(0,n.Z.getElevationValueAt(t,this.coordinates,n.Z.FAST_READ_Z))),isNaN(r)||r==this.coordinates.z||(this.coordinates.z=r)}updateHorizonCullingPoint(){this.horizonCullingPoint&&this.getWorldPosition(this.horizonCullingPoint)}}const c=l},49469:(t,e,r)=>{"use strict";r.d(e,{Ao:()=>s,HR:()=>n,ZP:()=>c});var i=r(99477);const n=0,s={UPDATE_START:"update_start",BEFORE_CAMERA_UPDATE:"before_camera_update",AFTER_CAMERA_UPDATE:"after_camera_update",BEFORE_LAYER_UPDATE:"before_layer_update",AFTER_LAYER_UPDATE:"after_layer_update",BEFORE_RENDER:"before_render",AFTER_RENDER:"after_render",UPDATE_END:"update_end"};function o(t,e,r){if(r)for(const i of r){const r=e.update(t,e,i),n=e.getObjectToUpdateForAttachedLayers(i);if(n)if(n.element)for(const r of e.attachedLayers)r.ready&&(r.update(t,r,n.element,n.parent),r.cache.flush());else if(n.elements)for(let r=0;r{t===e||t.isCamera?(e.info.clear(),r=!0):t.layer===e&&i.add(t)})),r?new Set([e]):i}class l extends i.EventDispatcher{#n=!1;#s=!0;#o=0;constructor(t,e){super(),this.renderingState=n,this.scheduler=t,this.gfxEngine=e}scheduleViewUpdate(t,e){this.#n|=e,1!==this.renderingState&&(this.renderingState=1,this.gfxEngine.renderer.xr.isPresenting||requestAnimationFrame((e=>{this.step(t,e)})))}#a(t,e,r){const i={camera:t.camera,engine:this.gfxEngine,scheduler:this.scheduler,view:t};e.forEach((t=>{const r=t.layer||t;r.isLayer&&r.parent&&e.add(r.parent)}));for(const n of t.getLayers(((t,e)=>!e)))if(i.geometryLayer=n,n.ready&&n.visible&&!n.frozen){t.execFrameRequesters(s.BEFORE_LAYER_UPDATE,r,this.#s,n);const l=a(e,n);if(l.size>0){for(const t of n.attachedLayers)t.ready&&t.preUpdate&&t.preUpdate(i,l);const t=n.preUpdate(i,l);o(i,n,t),n.postUpdate(i,n,e)}n.cache.flush(),t.execFrameRequesters(s.AFTER_LAYER_UPDATE,r,this.#s,n)}}step(t,e){const r=e-this.#o;t._executeFrameRequestersRemovals(),t.execFrameRequesters(s.UPDATE_START,r,this.#s);const i=this.#n;this.#o=e,this.#n=!1,this.renderingState=n;const o=new Set(t._changeSources);t._changeSources.clear();const a=this.gfxEngine.getWindowSize();t.execFrameRequesters(s.BEFORE_CAMERA_UPDATE,r,this.#s),t.camera.update(a.x,a.y),t.execFrameRequesters(s.AFTER_CAMERA_UPDATE,r,this.#s);const l=t.camera3D.matrixAutoUpdate;t.camera3D.matrixAutoUpdate=!1,this.#a(t,o,r),0==this.scheduler.commandsWaitingExecutionCount()&&this.dispatchEvent({type:"command-queue-empty"}),i&&this.#l(t,r),this.#s=this.renderingState===n,t.camera3D.matrixAutoUpdate=l,t.execFrameRequesters(s.UPDATE_END,r,this.#s)}#l(t,e){t.execFrameRequesters(s.BEFORE_RENDER,e,this.#s),t.render?t.render():this.gfxEngine.renderView(t),t.execFrameRequesters(s.AFTER_RENDER,e,this.#s)}}const c=l},16828:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l,c:()=>o});var i=r(99477),n=r(24472),s=r(60145);const o=new i.Vector3(n.default.WGS84.a,n.default.WGS84.a,n.default.WGS84.b),a=new i.Vector3,l=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;this.size=new i.Vector3,this._radiiSquared=new i.Vector3,this._invRadiiSquared=new i.Vector3,this.eccentricity=0,this.setSize(t)}geodeticSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;return t.toVector3(e).multiply(this._invRadiiSquared).normalize()}geodeticSurfaceNormalCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;const r=i.MathUtils.degToRad(t.longitude),n=i.MathUtils.degToRad(t.latitude),s=Math.cos(n);return e.set(s*Math.cos(r),s*Math.sin(r),Math.sin(n))}setSize(t){this.size.set(t.x,t.y,t.z),this._radiiSquared.multiplyVectors(t,t),this._invRadiiSquared.x=0==t.x?0:1/this._radiiSquared.x,this._invRadiiSquared.y=0==t.y?0:1/this._radiiSquared.y,this._invRadiiSquared.z=0==t.z?0:1/this._radiiSquared.z,this.eccentricity=Math.sqrt(this._radiiSquared.x-this._radiiSquared.z)/this.size.x}cartographicToCartesian(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;a.copy(t.geodesicNormal),e.multiplyVectors(this._radiiSquared,a);const r=Math.sqrt(a.dot(e));return e.divideScalar(r),a.multiplyScalar(t.altitude),e.add(a)}cartesianToCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.Z("EPSG:4326",0,0,0);const r=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),n=this.size.x,o=this.size.z,a=Math.abs((n*n-o*o)/(n*n)),l=1-Math.sqrt(1-a),c=Math.sqrt(t.x*t.x+t.y*t.y),h=Math.atan2(t.y,t.x),u=Math.atan(t.z/c*(1-l+a*n/r)),d=Math.sin(u),p=Math.cos(u),f=Math.atan((t.z*(1-l)+a*n*d*d*d)/((1-l)*(c-a*n*p*p*p))),m=c*Math.cos(f)+t.z*Math.sin(f)-n*Math.sqrt(1-a*Math.sin(f)*Math.sin(f));return e.setFromValues(i.MathUtils.radToDeg(h),i.MathUtils.radToDeg(f),m)}cartographicToCartesianArray(t){const e=[];for(let r=0;r{"use strict";r.d(e,{Z:()=>g});var i=r(99477),n=r(32475),s=r(27240),o=r(60145);const a=new i.Vector4;function l(t,e){let r;for(let i=0;i<=t;i++){const t=i*i;for(let n=-i;n<=i;n++){const s=n*n;for(let o=-i;o<=i;o++){const i=s+o*o;if(!(i>t||i<=r||!1!==e(n,o)))return}}r=t}}function c(t){return t.layer?t.layer:t.parent?c(t.parent):void 0}const h=new i.Raycaster,u=new i.Vector2,d=new i.Vector3,p=new o.Z("EPSG:4978"),f=new i.Vector3,m=new o.Z("EPSG:4978"),g={pickTilesAt(t,e,r,o){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const h=function(t,e,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const c=t.mainLoop.gfxEngine.getWindowSize();r=r||new i.Vector2(Math.floor(c.x/2),Math.floor(c.y/2));const h=e.level0Nodes.map((t=>n.Z.push(t,n.Z.MODES.ID))),u=t.mainLoop.gfxEngine.renderViewToBuffer({camera:t.camera,scene:e.object3d},{x:r.x-o,y:r.y-o,width:1+2*o,height:1+2*o});h.forEach((t=>t()));const d=[];return l(o,((t,e)=>{const r=4*(2*e*o+t),i=u.slice(r,r+4||void 0);a.fromArray(i).divideScalar(255);const n=(0,s.On)(a,256**3),l=Math.round(n);d.includes(l)||d.push(l)})),d}(t,o,e,r),u=t=>{h.includes(t.id)&&t.isTileMesh&&c.push({object:t,layer:o})};for(const t of o.level0Nodes)t.traverse(u);return c},pickPointsAt(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!i.root)return;i.object3d.traverse((t=>{t.isPoints&&t.baseId&&t.material.enablePicking(!0)}));const s=t.mainLoop.gfxEngine.renderViewToBuffer({camera:t.camera,scene:i.object3d},{x:e.x-r,y:e.y-r,width:1+2*r,height:1+2*r}),o=[];return l(r,((t,e)=>{const i=4*(2*e*r+t),n=s.slice(i,i+4),a={objId:n[0]<<8|n[1],index:n[2]<<8|n[3]};for(let t=0;t{if(e.isPoints&&e.baseId){e.material.enablePicking(!1);for(let r=0;r4&&void 0!==arguments[4]?arguments[4]:[];if(t.viewToNormalizedCoords(e,u),r<0){h.setFromCamera(u,t.camera3D);const e=h.intersectObject(n,!0);for(const t of e)t.layer=c(t.object),s.push(t);return s}const o={x:e.x-r,y:e.y-r,width:1+2*r,height:1+2*r},a=t.mainLoop.gfxEngine.renderViewToBuffer({scene:n,camera:t.camera},o),d=new i.Color;t.mainLoop.gfxEngine.renderer.getClearColor(d);const p=Math.round(255*d.r),f=Math.round(255*d.g),m=Math.round(255*d.b),g=u.clone();return l(r,((e,i)=>{const o=4*((i+r)*(2*r+1)+(e+r)),l=a[o],d=a[o+1],A=a[o+2];if(Math.abs(p-l)<=1&&Math.abs(f-d)<=1&&Math.abs(m-A)<=1)return;g.setX(u.x+e/t.camera.width).setY(u.y+i/t.camera.height),h.setFromCamera(g,t.camera3D);const y=h.intersectObject(n,!0);for(const t of y)t.layer=c(t.object),s.push(t);return 0==s.length})),s}}},56564:(t,e,r)=>{"use strict";r.d(e,{Z:()=>f});var i=r(99477),n=r(60145),s=r(99128);const o=Math.PI/4,a=1/(2*Math.PI),l=new i.Vector3(0,0,1),c=new i.Vector3(0,1,0),h=new i.Quaternion,u=new i.Quaternion,d=new i.Quaternion;function p(t){return 1-(.5-Math.log(Math.tan(o+.5*i.MathUtils.degToRad(t)))*a)}const f=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.tmp={coords:[new n.Z("EPSG:4326",0,0),new n.Z("EPSG:4326",0,0)],position:new i.Vector3,dimension:new i.Vector2},this.crs=t.crs,this.uvCount=t.uvCount,this.computeUvs=[()=>{},t=>{const e=p(t.projected.latitude)*t.nbRow;return(isFinite(e)?e:0)-t.deltaUV1}]}prepare(t){t.nbRow=2**(t.level+1);let e=p(t.extent.south);isFinite(e)||(e=0);const r=e%(1/t.nbRow);t.deltaUV1=(e-r)*t.nbRow,t.quatNormalToZ=d.setFromAxisAngle(c,-(.5*Math.PI-i.MathUtils.degToRad(t.extent.center().latitude))),t.projected={longitude:0,latitude:0},t.extent.planarDimensions(this.tmp.dimension)}center(t){return t.center(this.tmp.coords[0]).as(this.crs,this.tmp.coords[1]).toVector3()}vertexPosition(t){return this.tmp.coords[0].setFromValues(t.projected.longitude,t.projected.latitude),this.tmp.coords[0].as(this.crs,this.tmp.coords[1]).toVector3(this.tmp.position),this.tmp.position}vertexNormal(){return this.tmp.coords[1].geodesicNormal}uProjecte(t,e){e.projected.longitude=e.extent.west+t*this.tmp.dimension.x}vProjecte(t,e){e.projected.latitude=e.extent.south+t*this.tmp.dimension.y}computeSharableExtent(t){const e=Math.abs(t.west-t.east)/2,r=new s.ZP(t.crs,-e,e,t.south,t.north),n=i.MathUtils.degToRad(t.west-r.west),o=i.MathUtils.degToRad(90-t.center(this.tmp.coords[0]).latitude);return h.setFromAxisAngle(l,n),u.setFromAxisAngle(c,o),h.multiply(u),{sharableExtent:r,quaternion:h.clone(),position:this.center(t)}}}},10268:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(99477),n=r(62968),s=r(16828),o=r(99128),a=r(56564),l=r(75963),c=r(82150);const h=new i.Matrix4,u=new i.Vector3;let d=0;const p=new i.Vector3;class f extends n.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=o.dS.get(c.Z.tms_4326),l=o.Mh.get("EPSG:4326").subdivisionByScheme(n);r.tileMatrixSets=[c.Z.tms_4326,c.Z.tms_3857];const u=r.tileMatrixSets.length,d=new a.Z({crs:"EPSG:4978",uvCount:u});super(t,e||new i.Group,l,d,r),this.isGlobeLayer=!0,this.options.defaultPickingRadius=5,this.minSubdivisionLevel=null==this.minSubdivisionLevel?2:this.minSubdivisionLevel,this.maxSubdivisionLevel=null==this.maxSubdivisionLevel?19:this.maxSubdivisionLevel,this.maxDeltaElevationLevel=this.maxDeltaElevationLevel||4,this.extent=this.schemeTile[0].clone();for(let t=1;t0:d{"use strict";r.d(e,{b:()=>R,Z:()=>L});var i=r(99477),n=r(36873),s=r(11925),o=r(60145),a=r(10268),l=r(20193),c=r(16828);const h={getSunPosition(){const t=Math,e=t.PI,r=t.sin,i=t.cos,n=t.tan,s=t.asin,o=t.atan2,a=e/180,l=23.4397*a;function c(t,e,s){return o(r(t),i(t)*r(e)-n(s)*i(e))}function h(t,e,n){return s(r(e)*r(n)+i(e)*i(n)*i(t))}return function(t,u,d){const p=a*u,f=function(t){return function(t){return t.valueOf()/864e5-.5+2440588}(t)-2451545}(t),m=function(t){return a*(357.5291+.98560028*t)}(f),g=function(t){return a*(1.9148*r(t)+.02*r(2*t)+3e-4*r(3*t))}(m),A=function(t,r){return t+r+102.9372*a+e}(m,g),y=(v=A,s(r(0)*i(l)+i(0)*r(l)*r(v)));var v;const x=function(t,e){return o(r(t)*i(l)-n(0)*r(l),i(t))}(A),b=function(t,e){return a*(280.16+360.9856235*t)-e}(f,a*-d),_=b-x;return{EclipticLongitude:A,declinaison:y,ascension:x,H:_,SiderealTime:b,altitude:h(_,p,y),azimuth:c(_,p,y)+e/2}}},getSunPositionInScene(t,e,r){const i=864e5,n=h.getSunPosition()(t,e,r).ascension+t%i/i*-360+180;return new o.Z("EPSG:4326",n,e,5e7).as("EPSG:4978").toVector3()}},u=h,d={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},v3LightPosition:{type:"v3",value:new i.Vector3},up:{type:"v3",value:new i.Vector3(0,1,0)}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( cameraPosition + position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( cameraPosition + position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 v3LightPosition;","uniform vec3 up;","varying vec3 vWorldPosition;","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","vec3 up2 = normalize(cameraPosition.xyz);","float sunfade = 1.0-clamp(1.0-exp((v3LightPosition.y/450000.0)),0.0,1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(v3LightPosition);","float sunE = sunIntensity(dot(sunDirection, up2));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up2, normalize(vWorldPosition - cameraPosition))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPosition), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up2, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPosition);","float theta = acos(direction.y); // elevation --\x3e y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --\x3e x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPosition).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1. - ( (length(cameraPosition) - 6400000.) / 1000.);","}"].join("\n")};class p extends i.Mesh{constructor(){const t=i.UniformsUtils.clone(d.uniforms),e=new i.ShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:t,side:i.BackSide,transparent:!0,depthWrite:!1});super(new i.SphereGeometry(4e4,32,15),e)}}const f=p,m="#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvec4 glowColor = vec4(0.45, 0.74, 1. ,1.0);\n\nvoid main() {\n #include \n gl_FragColor = glowColor * intensity;\n}\n\n",g="#include \n#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvoid main()\n{\n vec3 normalES = normalize( normalMatrix * normal );\n vec3 normalCAMES = normalize( normalMatrix * cameraPosition );\n\n if(atmoIN == 0) {\n intensity = pow(0.666 - dot(normalES, normalCAMES), 4. );\n } else {\n intensity = pow( 1. - dot(normalES, normalCAMES), 0.8 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n #include \n}\n\n\n",A=new i.Vector3(1,0,0),y=new i.Vector3,v=new o.Z("EPSG:4326"),x=new o.Z("EPSG:4326"),b=new i.Color(9688568),_=new i.Color,w=new i.Color(197896),E=6e5,M=160*c.c.x;class S extends l.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"atmosphere",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.source=!1,super(t,new i.Object3D,e),this.isAtmosphere=!0;const r=new i.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:0},screenSize:{type:"v2",value:new i.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:i.BackSide,blending:i.AdditiveBlending,transparent:!0,wireframe:!1}),n=new i.SphereGeometry(1,64,64),s=new i.Mesh(n,r);s.scale.copy(c.c).multiplyScalar(1.14),this.basicAtmosphere=new i.Object3D,this.realisticAtmosphere=new i.Object3D,this.realisticAtmosphere.visible=!1,this.object3d.add(this.basicAtmosphere),this.object3d.add(this.realisticAtmosphere),this.basicAtmosphere.add(s);const o=new i.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:1},screenSize:{type:"v2",value:new i.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:i.FrontSide,blending:i.AdditiveBlending,transparent:!0,depthWrite:!1}),a=new i.Mesh(n,o);a.scale.copy(c.c).multiplyScalar(1.002),this.basicAtmosphere.add(a),this.realisticLightingPosition={x:-.5,y:0,z:1},this.fog={enable:!0,distance:M},this.realisticAtmosphereInitParams=e.Kr?e:{Kr:.0025,Km:.0015,ESun:20,g:-.95,innerRadius:64e5,outerRadius:67e5,wavelength:[.65,.57,.475],scaleDepth:.25},this.object3d.updateMatrixWorld()}update(t,e,r){r.material.fogDistance=this.fog.distance,r.material.lightingEnabled=this.realisticAtmosphere.visible,r.material.lightPosition=this.realisticLightingPosition}preUpdate(t){const e=t.view.camera3D.position;if(this.fog.enable){y.setFromMatrixPosition(t.view.tileLayer.object3d.matrixWorld);const r=y.distanceTo(e);this.fog.distance=M*(.25*(r-.99*c.c.x)/c.c.x)**1.5}else this.fog.distance=1e11;const r=t.view.mainLoop.gfxEngine.renderer;v.crs=t.view.referenceCrs,v.setFromVector3(e).as("EPSG:4326",x);const i=x.altitude;it.material.uniforms.v3LightPosition.value.copy(this.realisticLightingPosition)))),this.basicAtmosphere.visible=!t,this.realisticAtmosphere.visible=t}}const C=S;var T=r(4596),I=r(82150);const R={GLOBE_INITIALIZED:n.b.INITIALIZED,LAYER_ADDED:n.b.LAYER_ADDED,LAYER_REMOVED:n.b.LAYER_REMOVED,COLOR_LAYERS_ORDER_CHANGED:n.b.COLOR_LAYERS_ORDER_CHANGED};class B extends n.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.Object3D.DEFAULT_UP.set(0,0,1),super("EPSG:4978",t,r),this.isGlobeView=!0,this.camera3D.near=Math.max(15,2352e-9*c.c.x),this.camera3D.far=10*c.c.x;const n=new a.Z("globe",r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=n.info;const l=new i.DirectionalLight;l.position.set(-.5,0,1),l.updateMatrixWorld(!0),this.scene.add(l),this.addLayer(n),this.tileLayer=n,e.isExtent||(e.coord=e.coord||new o.Z("EPSG:4326",0,0),e.tilt=e.tilt||89.5,e.heading=e.heading||0,e.range=e.range||2*c.c.x),r.noControls?T.ZP.transformCameraToLookAtTarget(this,this.camera3D,e):(this.controls=new s.Z(this,e,r.controls),this.controls.handleCollision=void 0===r.handleCollision||r.handleCollision),this.addLayer(new C("atmosphere",r.atmosphere)),this.camera.resize(t.clientWidth,t.clientHeight)}addLayer(t){if(!t||!t.isLayer)return Promise.reject(new Error("Add Layer type object"));if(t.isColorLayer){if(!this.tileLayer.tileMatrixSets.includes(I.Z.formatToTms(t.source.crs)))return t._reject(`Only ${this.tileLayer.tileMatrixSets} tileMatrixSet are currently supported for color layers`)}else if(t.isElevationLayer&&I.Z.formatToTms(t.source.crs)!==this.tileLayer.tileMatrixSets[0])return t._reject(`Only ${this.tileLayer.tileMatrixSets[0]} tileMatrixSet is currently supported for elevation layers`);return super.addLayer(t,this.tileLayer)}getPixelsToDegrees(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.getMetersToDegrees(this.getPixelsToMeters(t,e))}getPixelsToDegreesFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.getMetersToDegrees(this.getPixelsToMetersFromDistance(t,e))}getMetersToDegrees(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return i.MathUtils.radToDeg(2*Math.asin(t/(2*c.c.x)))}}const L=B},64561:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var i=r(99477),n=r(62968),s=r(99128),o=r(82150),a=r(60145);const l=new i.Quaternion,c=new i.Vector3;class h extends n.Z{constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const h=o.Z.formatToTms(e.crs);s.Mh.get(e.crs)||s.Mh.set(e.crs,e),n.tileMatrixSets=[h],super(t,r||new i.Group,[e],new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.projection&&(console.warn("PlanarTileBuilder projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs)throw new Error("options.crs is mandatory for PlanarTileBuilder");this.crs=t.crs,this.tmp={coords:new a.Z("EPSG:4326",0,0),position:new i.Vector3,normal:new i.Vector3(0,0,1)},this.uvCount=t.uvCount||1}prepare(t){t.nbRow=2**(t.zoom+1),t.projected=new i.Vector3}center(t){return t.center(this.tmp.coords),c.set(this.tmp.coords.x,this.tmp.coords.y,0),c}vertexPosition(t){return this.tmp.position.set(t.projected.x,t.projected.y,0),this.tmp.position}vertexNormal(){return this.tmp.normal}uProjecte(t,e){e.projected.x=e.extent.west+t*(e.extent.east-e.extent.west)}vProjecte(t,e){e.projected.y=e.extent.south+t*(e.extent.north-e.extent.south)}computeSharableExtent(t){return{sharableExtent:new s.ZP(t.crs,0,Math.abs(t.west-t.east),0,Math.abs(t.north-t.south)),quaternion:l,position:this.center(t).clone()}}}({crs:e.crs}),n),this.isPlanarLayer=!0,this.extent=e,this.minSubdivisionLevel=null==this.minSubdivisionLevel?0:this.minSubdivisionLevel,this.maxSubdivisionLevel=null==this.maxSubdivisionLevel?5:this.maxSubdivisionLevel,this.maxDeltaElevationLevel=this.maxDeltaElevationLevel||4}}const u=h},48682:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var i=r(99477),n=r(36873),s=r(4596),o=r(44450),a=r(64561);class l extends n.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.Object3D.DEFAULT_UP.set(0,0,1),super(e.crs,t,r),this.isPlanarView=!0;const n=e.planarDimensions(),l=Math.max(n.x,n.y);this.camera3D.near=.1,this.camera3D.far=this.camera3D.isOrthographicCamera?2e3:2*l,this.camera3D.updateProjectionMatrix();const c=new a.Z("planar",e,r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=c.info,this.addLayer(c);const h=r.placement||{};h.isExtent||(h.coord=h.coord||e.center(),h.tilt=h.tilt||90,h.heading=h.heading||0,h.range=h.range||l),s.ZP.transformCameraToLookAtTarget(this,this.camera3D,h),r.noControls||(this.controls=new o.ZP(this,r.controls)),this.tileLayer=c}addLayer(t){return super.addLayer(t,this.tileLayer)}}const c=l},9417:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});var i=r(99477);function n(t){const e={index:null,position:null,normal:null,uvs:[]},r=[],n=t.builder,s=t.segment||8,o=(s+1)*(s+1)+(t.disableSkirt?0:4*s);if(o>2**32)throw new Error("Tile segments count is too big");const a=s*s*2+(t.disableSkirt?0:4*s*2);e.position=new Float32Array(3*o),e.normal=new Float32Array(3*o);const l=t.builder.uvCount;l>1&&(e.uvs[1]=new Float32Array(o)),r[0]=()=>{},t.buildIndexAndUv_0&&(o<256?e.index=new Uint8Array(3*a):o<65536?e.index=new Uint16Array(3*a):o<2**32&&(e.index=new Uint32Array(3*a)),e.uvs[0]=new Float32Array(2*o),r[0]=(t,r,i)=>{e.uvs[0][2*t+0]=r,e.uvs[0][2*t+1]=i});const c=Math.max(2,Math.floor(s)||2),h=Math.max(2,Math.floor(s)||2);let u=0;const d=[];let p=[];const f=[];n.prepare(t);for(let i=0;i<=h;i++){const s=[],o=i/h;if(n.vProjecte(o,t),l>1){const i=n.computeUvs[1](t);r[1]=t=>{e.uvs[1][t]=i}}for(let a=0;a<=c;a++){const l=a/c,d=3*u;n.uProjecte(l,t);const m=n.vertexPosition(t,t.projected),g=n.vertexNormal(t);m.sub(t.center),t.quatNormalToZ&&(m.applyQuaternion(t.quatNormalToZ),g.applyQuaternion(t.quatNormalToZ)),m.toArray(e.position,d),g.toArray(e.normal,d);for(const t of r)t(u,l,o);t.disableSkirt||0!==i&&i!==h&&(a===c?p.push(u):0===a&&f.push(u)),s.push(u),u++}d.push(s),0===i?p=p.concat(s):i===h&&(p=p.concat(s.slice().reverse()))}function m(t,r,i,n){return e.index[n+0]=t,e.index[n+1]=r,e.index[n+2]=i,n+3}t.disableSkirt||(p=p.concat(f.reverse()));let g=0;if(t.buildIndexAndUv_0)for(let t=0;t1&&(e.uvs[1][u]=e.uvs[1][i]);const c=(t+1)%p.length;g=n(g,i,u,0===c?A:u+1,p[c]),u++}}return e}},1537:(t,e,r)=>{"use strict";let i;r.d(e,{D:()=>n,Z:()=>s});const n={INFINITE:1/0,TEXTURE:9e5,GEOMETRY:9e5},s=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.INFINITE;this.lifeTime=t,this.lastTimeFlush=Date.now(),this.data=new Map}getByArray(t){return this.get(t[0],t[1],t[2])}setByArray(t,e){return this.set(t,e[0],e[1],e[2])}get(t,e,r){const n=this.data.get(t);if(null!=n){if(null!=n.lastTimeUsed)i=n;else{const t=n.get(e);if(null==t)return;if(null!=t.lastTimeUsed)i=t;else{const e=t.get(r);if(null==e)return;i=e}}return i.value?(i.lastTimeUsed=Date.now(),i.value):void 0}}set(t,e,r,n){if(i={value:t,lastTimeUsed:Date.now()},null==r)return this.data.set(e,i),t;this.data.get(e)||this.data.set(e,new Map);const s=this.data.get(e);return null==n?(s.set(r,i),t):(s.get(r)||s.set(r,new Map),s.get(r).set(n,i),t)}delete(t,e,r){const i=this.data.get(t);if(void 0!==i)if(null!=i.lastTimeUsed)this.data.get(t),this.data.delete(t);else{const n=i.get(e);if(void 0===n)return;if(null!=n.lastTimeUsed)i.get(e),i.delete(e),0==i.size&&this.data.delete(t);else{if(void 0===n.get(r))return;n.get(r),n.delete(r),0==n.size&&(i.delete(e),0==i.size&&this.data.delete(t))}}}clear(){this.data.clear()}flush(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.lifeTime==n.INFINITE||this.lifeTime>t-this.lastTimeFlush||!this.data.size||(this.lastTimeFlush=1/0,this.data.forEach(((e,r)=>{this.lifeTime{this.lifeTime{this.lifeTime{"use strict";r.d(e,{uP:()=>_,ZP:()=>S,Lu:()=>m});var i=r(94596),n=r(1537),s=r(33347),o=r(92294),a=r(99477);function l(t){let e,r,i,n=t.r||t[0]/255,s=t.g||t[1]/255,o=t.b||t[2]/255;return n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,e=(.4124*n+.3576*s+.1805*o)/.95047,r=(.2126*n+.7152*s+.0722*o)/1,i=(.0193*n+.1192*s+.9505*o)/1.08883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(e-r),200*(r-i)]}function c(t,e){const r=l(t),i=l(e),n=r[0]-i[0],s=r[1]-i[1],o=r[2]-i[2],a=Math.sqrt(r[1]*r[1]+r[2]*r[2]),c=a-Math.sqrt(i[1]*i[1]+i[2]*i[2]);let h=s*s+o*o-c*c;h=h<0?0:Math.sqrt(h);const u=n/1,d=c/(1+.045*a),p=h/(1+.015*a),f=u*u+d*d+p*p;return f<0?0:Math.sqrt(f)}var h=r(60145);const u=new n.Z,d=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),p="undefined"!=typeof document?document.createElement("canvas"):{};function f(t,e){var r,i,n;return(null==e||null===(r=e.coordinates)||void 0===r?void 0:r.z)||(null==e||null===(i=e.collection)||void 0===i||null===(n=i.center)||void 0===n?void 0:n.z)||0}function m(t,e){if(null!=t){if(t.expression)return t.expression.evaluate(e);if(t.stops){for(let r=t.stops.length-1;r>=0;r--){const i=t.stops[r];if(e.zoom>=i[0])return i[1]}return t.stops[0][1]}return("string"==typeof t||t instanceof String)&&(t=t.replace(/\{(.+?)\}/g,((t,r)=>e.properties[r]||"")).trim()),t instanceof Function?t(e.properties,e):t}}function g(t){if(!t)return{};if(t.stops||t.expression)return{color:t};if("string"==typeof t){const e=t.match(/(?:((hsl|rgb)a? *\(([\d.%]+(?:deg|g?rad|turn)?)[ ,]*([\d.%]+)[ ,]*([\d.%]+)[ ,/]*([\d.%]*)\))|(#((?:[\d\w]{3}){1,2})([\d\w]{1,2})?))/i);if(!e)return{color:t,opacity:1};if(e[7]){let t=1;return e[9]&&(t=.00392156862745098*parseInt(1==e[9].length?`${e[9]}${e[9]}`:e[9],16)),{color:`#${e[8]}`,opacity:t}}if(e[0])return{color:`${e[2]}(${e[3]},${e[4]},${e[5]})`,opacity:Number(e[6])||1}}}function A(t,e){if(null!=t)return o.th.isExpression(t)?o.th.createExpression(t,e).value:t}async function y(t){let e=u.get(t,"null");return e||(e=s.Z.texture(t,{crossOrigin:"anonymous"}),u.set(e,t,"null")),(await e).image}function v(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:t.naturalWidth,height:t.naturalHeight};p.width=e.width,p.height=e.height;const r=p.getContext("2d",{willReadFrequently:!0});return r.drawImage(t,e.x||0,e.y||0,e.width,e.height,0,0,e.width,e.height),r.getImageData(0,0,e.width,e.height)}const x={left:[0,-.5],right:[-1,-.5],top:[-.5,0],bottom:[-.5,-1],"top-right":[-1,0],"bottom-left":[0,-1],"bottom-right":[-1,-1],center:[-.5,-.5],"top-left":[0,0]};function b(t,e,r,i,n){let s;Object.defineProperty(t[e],r,{enumerable:!0,get:()=>{var o,a;if(null!=s)return s;if(null!=i)return m(i,t.context);const l=null===(o=t.context.featureStyle)||void 0===o||null===(a=o[e])||void 0===a?void 0:a[r];return null!=l?m(l,t.context):n instanceof Function?n(t.context.properties,t.context):n},set:t=>{s=t}})}class _{#c=new h.Z("EPSG:4326",0,0,0);#h=new h.Z("EPSG:4326",0,0,0);#u=!0;#d={};#p={};setZoom(t){this.zoom=t}setFeature(t){this.#d=t}setGeometry(t){this.#p=t}setCollection(t){this.collection=t,this.#h.setCrs(t.crs)}setLocalCoordinatesFromArray(t,e){return this.#u=!1,this.#h.setFromArray(t,e)}get properties(){return this.#p.properties}get type(){return this.#d.type}get featureStyle(){let t=this.#d.style;return t instanceof Function&&(t=t(this.properties,this)),t}get coordinates(){return this.#u||(this.#u=!0,this.#c.copy(this.#h).applyMatrix4(this.collection.matrixWorld),"EPSG:4978"!=this.#h.crs)?this.#c:this.#c.as("EPSG:4326",this.#c)}}class w{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isStyle=!0,this.context=new _,this.order=t.order||0,t.zoom=t.zoom||{},t.fill=t.fill||{},t.stroke=t.stroke||{},t.point=t.point||{},t.text=t.text||{},t.icon=t.icon||{},this.zoom={},b(this,"zoom","min",t.zoom.min),b(this,"zoom","max",t.zoom.max),this.fill={},b(this,"fill","color",t.fill.color),b(this,"fill","opacity",t.fill.opacity,1),b(this,"fill","pattern",t.fill.pattern),b(this,"fill","base_altitude",t.fill.base_altitude,f),t.fill.extrusion_height&&b(this,"fill","extrusion_height",t.fill.extrusion_height),this.stroke={},b(this,"stroke","color",t.stroke.color),b(this,"stroke","opacity",t.stroke.opacity,1),b(this,"stroke","width",t.stroke.width,1),b(this,"stroke","dasharray",t.stroke.dasharray,[]),b(this,"stroke","base_altitude",t.stroke.base_altitude,f),this.point={},b(this,"point","color",t.point.color),b(this,"point","line",t.point.line),b(this,"point","opacity",t.point.opacity,1),b(this,"point","radius",t.point.radius,2),b(this,"point","width",t.point.width,0),b(this,"point","base_altitude",t.point.base_altitude,f),t.point.model&&b(this,"point","model",t.point.model),this.text={},b(this,"text","field",t.text.field),b(this,"text","zOrder",t.text.zOrder,"auto"),b(this,"text","color",t.text.color,"#000000"),b(this,"text","anchor",t.text.anchor,"center"),b(this,"text","offset",t.text.offset,[0,0]),b(this,"text","padding",t.text.padding,2),b(this,"text","size",t.text.size,16),b(this,"text","placement",t.text.placement,"point"),b(this,"text","rotation",t.text.rotation,"auto"),b(this,"text","wrap",t.text.wrap,10),b(this,"text","spacing",t.text.spacing,0),b(this,"text","transform",t.text.transform,"none"),b(this,"text","justify",t.text.justify,"center"),b(this,"text","opacity",t.text.opacity,1),b(this,"text","font",t.text.font,["Open Sans Regular","Arial Unicode MS Regular","sans-serif"]),b(this,"text","haloColor",t.text.haloColor,"#000000"),b(this,"text","haloWidth",t.text.haloWidth,0),b(this,"text","haloBlur",t.text.haloBlur,0),this.icon={},b(this,"icon","source",t.icon.source),t.icon.key&&(console.warn("'icon.key' is deprecated: use 'icon.id' instead"),t.icon.id=t.icon.key),b(this,"icon","id",t.icon.id),b(this,"icon","cropValues",t.icon.cropValues),b(this,"icon","anchor",t.icon.anchor,"center"),b(this,"icon","size",t.icon.size,1),b(this,"icon","color",t.icon.color),b(this,"icon","opacity",t.icon.opacity,1)}copy(t){return Object.assign(this.fill,t.fill),Object.assign(this.stroke,t.stroke),Object.assign(this.point,t.point),Object.assign(this.text,t.text),Object.assign(this.icon,t.icon),this}clone(){return(new w).copy(this)}setContext(t){this.context=t}static setFromProperties(t,e){const r=e.type,n={};if(r===i.tg.POINT){const e={...void 0!==t.fill&&{color:t.fill},...void 0!==t["fill-opacity"]&&{opacity:t["fill-opacity"]},...void 0!==t.stroke&&{line:t.stroke},...void 0!==t.radius&&{radius:t.radius}};Object.keys(e).length&&(n.point=e);const r={...void 0!==t["label-color"]&&{color:t["label-color"]},...void 0!==t["label-opacity"]&&{opacity:t["label-opacity"]},...void 0!==t["label-size"]&&{size:t["label-size"]}};Object.keys(e).length&&(n.text=r);const i={...void 0!==t.icon&&{source:t.icon},...void 0!==t["icon-scale"]&&{size:t["icon-scale"]},...void 0!==t["icon-opacity"]&&{opacity:t["icon-opacity"]},...void 0!==t["icon-color"]&&{color:t["icon-color"]}};Object.keys(i).length&&(n.icon=i)}else{const e={...void 0!==t.stroke&&{color:t.stroke},...void 0!==t["stroke-width"]&&{width:t["stroke-width"]},...void 0!==t["stroke-opacity"]&&{opacity:t["stroke-opacity"]}};if(Object.keys(e).length&&(n.stroke=e),r!==i.tg.LINE){const e={...void 0!==t.fill&&{color:t.fill},...void 0!==t["fill-opacity"]&&{opacity:t["fill-opacity"]}};Object.keys(e).length&&(n.fill=e)}}return n}static setFromVectorTileLayer(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n={fill:{},stroke:{},point:{},text:{},icon:{}};if(t.layout=t.layout||{},t.paint=t.paint||{},n.order=r,"fill"===t.type){const{color:r,opacity:i}=g(A(t.paint["fill-color"]||t.paint["fill-pattern"],{type:"color"}));if(n.fill.color=r,n.fill.opacity=A(t.paint["fill-opacity"])||i,t.paint["fill-pattern"])try{n.fill.pattern={id:t.paint["fill-pattern"],source:e.source,cropValues:e[t.paint["fill-pattern"]]}}catch(e){throw e.message=`VTlayer '${t.id}': argument sprites must not be null when using layer.paint['fill-pattern']`,e}if(t.paint["fill-outline-color"]){const{color:e,opacity:r}=g(A(t.paint["fill-outline-color"],{type:"color"}));n.stroke.color=e,n.stroke.opacity=r,n.stroke.width=1,n.stroke.dasharray=[]}}else if("line"===t.type){const e=A(t.paint["line-color"],{type:"color"}),{color:r,opacity:i}=g(e);n.stroke.dasharray=A(t.paint["line-dasharray"]),n.stroke.color=r,n.stroke.lineCap=t.layout["line-cap"],n.stroke.width=A(t.paint["line-width"]),n.stroke.opacity=A(t.paint["line-opacity"])||i}else if("circle"===t.type||i){const{color:e,opacity:r}=g(A(t.paint["circle-color"],{type:"color"}));n.point.color=e,n.point.opacity=r,n.point.radius=A(t.paint["circle-radius"])}else if("symbol"===t.type){n.text.zOrder=A(t.layout["symbol-z-order"]),"auto"==n.text.zOrder?n.text.zOrder=A(t.layout["symbol-sort-key"])||"Y":"viewport-y"==n.text.zOrder?n.text.zOrder="Y":"source"==n.text.zOrder&&(n.text.zOrder=0),n.text.anchor=A(t.layout["text-anchor"]),n.text.offset=A(t.layout["text-offset"]),n.text.padding=A(t.layout["text-padding"]),n.text.size=A(t.layout["text-size"]),n.text.placement=A(t.layout["symbol-placement"]),n.text.rotation=A(t.layout["text-rotation-alignment"]),n.text.field=A(t.layout["text-field"]),n.text.wrap=A(t.layout["text-max-width"]),n.text.spacing=A(t.layout["text-letter-spacing"]),n.text.transform=A(t.layout["text-transform"]),n.text.justify=A(t.layout["text-justify"]);const{color:r,opacity:i}=g(A(t.paint["text-color"],{type:"color"}));n.text.color=r,n.text.opacity=A(t.paint["text-opacity"])||void 0!==i&&i,n.text.font=A(t.layout["text-font"]);const s=A(t.paint["text-halo-color"],{type:"color"});s&&(n.text.haloColor=s.color||s,n.text.haloWidth=A(t.paint["text-halo-width"]),n.text.haloBlur=A(t.paint["text-halo-blur"]));const o=A(t.layout["icon-image"]);if(o)try{n.icon.id=o,n.icon.source=e.source,n.icon.cropValues=e[o],n.icon.size=A(t.layout["icon-size"])||1;const{color:r,opacity:i}=g(A(t.paint["icon-color"],{type:"color"}));n.icon.color=r,n.icon.opacity=A(t.paint["icon-opacity"])||void 0!==i&&i}catch(e){throw e.message=`VTlayer '${t.id}': argument sprites must not be null when using layer.layout['icon-image']`,e}}return n.zoom={min:t.minzoom||0,max:t.maxzoom||24},n}applyToCanvasPolygon(t,e,r,i){const n=this.context;this.stroke&&this._applyStrokeToPolygon(t,r,e,n),i&&this.fill&&this._applyFillToPolygon(t,r,e,n)}_applyStrokeToPolygon(t,e,r){t.strokeStyle!==this.stroke.color&&(t.strokeStyle=this.stroke.color);const i=(this.stroke.width||2)*e;t.lineWidth!==i&&(t.lineWidth=i);const n=null==this.stroke.opacity?1:this.stroke.opacity;n!==t.globalAlpha&&"number"==typeof n&&(t.globalAlpha=n),t.lineCap!==this.stroke.lineCap&&(t.lineCap=this.stroke.lineCap),t.setLineDash(this.stroke.dasharray.map((t=>t*e*2))),t.stroke(r)}async _applyFillToPolygon(t,e,r){if(this.fill.pattern){let r=this.fill.pattern;const i=this.fill.pattern.cropValues;this.fill.pattern.source&&(r=await y(this.fill.pattern.source)),v(r,i),t.fillStyle=t.createPattern(p,"repeat"),t.fillStyle.setTransform?t.fillStyle.setTransform(d.scale(e)):console.warn("Raster pattern isn't completely supported on Ie and edge",t.fillStyle)}else t.fillStyle!==this.fill.color&&(t.fillStyle=this.fill.color);this.fill.opacity!==t.globalAlpha&&(t.globalAlpha=this.fill.opacity),t.fill(r)}async applyToHTML(t){if(arguments.length>1&&console.warn("Deprecated argument sprites. Sprites must be configured in style."),t.style.padding=`${this.text.padding}px`,t.style.maxWidth=`${this.text.wrap}em`,t.style.color=this.text.color,this.text.size>0&&(t.style.fontSize=`${this.text.size}px`),t.style.fontFamily=this.text.font.join(","),t.style.textTransform=this.text.transform,t.style.letterSpacing=`${this.text.spacing}em`,t.style.textAlign=this.text.justify,t.style["white-space"]="pre-line",this.text.haloWidth>0&&(t.style.setProperty("--text_stroke_display","block"),t.style.setProperty("--text_stroke_width",`${this.text.haloWidth}px`),t.style.setProperty("--text_stroke_color",this.text.haloColor),t.setAttribute("data-before",t.textContent)),!this.icon.source)return;const e=document.createElement("img"),r=new Promise(((r,i)=>{const n={size:this.icon.size,color:this.icon.color,opacity:this.icon.opacity,anchor:this.icon.anchor};e.onload=()=>r(function(t,e,r){const i=t.cloneNode();switch(i.setAttribute("class","itowns-icon"),i.width=t.width*r.size,i.height=t.height*r.size,i.style.color=r.color,i.style.opacity=r.opacity,i.style.position="absolute",i.style.top="0",i.style.left="0",r.anchor){case"left":i.style.top=-.5*i.height+"px";break;case"right":i.style.top=-.5*i.height+"px",i.style.left=-i.width+"px";break;case"top":i.style.left=-.5*i.width+"px";break;case"bottom":i.style.top=-i.height+"px",i.style.left=-.5*i.width+"px";break;case"bottom-left":i.style.top=-i.height+"px";break;case"bottom-right":i.style.top=-i.height+"px",i.style.left=-i.width+"px";break;case"top-left":break;case"top-right":i.style.left=-i.width+"px";break;default:i.style.top=-.5*i.height+"px",i.style.left=-.5*i.width+"px"}return i.style["z-index"]=-1,e.appendChild(i),i}(e,t,n)),e.onerror=t=>i(t)}));if(this.icon.cropValues||this.icon.color){const t=this.icon.cropValues,r=this.icon.color,i=this.icon.id||this.icon.source,n=function(t,e,r){if(!e)return t;const i=u.get(r,e);if(!i){const i=t.data,n=new a.Color(e),s=new a.Color("white");for(let t=0,e=i.length;t{M.innerHTML+=`${E[t]}\n\n`})),"undefined"!=typeof document&&document.getElementsByTagName("head")[0].appendChild(M);const S=w},47052:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});let i=!1,n=8,s=4096;function o(t,e,r){const i=t.getContext(),n=i.createShader(e);return i.shaderSource(n,r),i.compileShader(n),n}function a(){return navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}const l={isLogDepthBufferSupported:()=>i,isFirefox:a,isInternetExplorer:()=>!!document.documentMode,getMaxTextureUnitsCount:()=>n,getMaxTextureSize:()=>s,updateCapabilities(t){const e=t.getContext();n=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),s=e.getParameter(e.MAX_TEXTURE_SIZE);const r=e.createProgram(),l=o(t,e.VERTEX_SHADER,"void main() {\n gl_Position = vec4( 0.0, 0.0, 0.0, 1.0 );\n}");let c=`#define SAMPLE ${n}\n`;c+="uniform sampler2D uni[SAMPLE];\nvoid main() {\n gl_FragColor += texture2D(uni[SAMPLE-1], vec2(0));\n}";const h=o(t,e.FRAGMENT_SHADER,c);if(e.attachShader(r,l),e.attachShader(r,h),e.linkProgram(r),!1===e.getProgramParameter(r,e.LINK_STATUS)){if(!(n>16))throw new Error(`The GPU capabilities could not be determined accurately.\n Impossible to link a shader with the Maximum texture units ${n}`);{const t=e.getProgramInfoLog(r);console.warn(`${t}: using a maximum of 16 texture units instead of the reported value (${n})`),a()&&console.warn("It can come from a Mesa/Firefox bug;\n the shader compiles to an error when using more than 16 sampler uniforms,\n see https://bugzilla.mozilla.org/show_bug.cgi?id=777028"),n=16}}e.deleteProgram(r),e.deleteShader(l),e.deleteShader(h),i=t.capabilities.logarithmicDepthBuffer}}},3590:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(99477),n=r(9417);class s extends i.BufferGeometry{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){t.buildIndexAndUv_0=!0,t.center=t.builder.center(t.extent).clone();const e=(0,n.Z)(t);e.index=new i.BufferAttribute(e.index,1),e.uvs[0]=new i.BufferAttribute(e.uvs[0],2),e.position=new i.BufferAttribute(e.position,3),e.normal=new i.BufferAttribute(e.normal,3);for(let r=1;r{"use strict";r.d(e,{b:()=>H,Z:()=>rt});var i=r(99477),n=r(800);var s=r(49469),o=r(47052),a=r(12276),l=r(27240);const c=class{static isWebGLAvailable(){try{const t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}static isWebGL2Available(){try{const t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(t){return!1}}static isColorSpaceAvailable(t){try{const e=document.createElement("canvas"),r=window.WebGL2RenderingContext&&e.getContext("webgl2");return r.drawingBufferColorSpace=t,r.drawingBufferColorSpace===t}catch(t){return!1}}static getWebGLErrorMessage(){return this.getErrorMessage(1)}static getWebGL2ErrorMessage(){return this.getErrorMessage(2)}static getErrorMessage(t){const e={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let r='Your $0 does not seem to support $1';const i=document.createElement("div");return i.id="webglmessage",i.style.fontFamily="monospace",i.style.fontSize="13px",i.style.fontWeight="normal",i.style.textAlign="center",i.style.background="#fff",i.style.color="#000",i.style.padding="1.5em",i.style.width="400px",i.style.margin="5em auto 0",r=e[t]?r.replace("$0","graphics card"):r.replace("$0","browser"),r=r.replace("$1",{1:"WebGL",2:"WebGL 2"}[t]),i.innerHTML=r,i}};var h=r(6755),u=r(86896);const d=new i.Vector4,p=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,u.Dx)(e);const r=!o.Z.isInternetExplorer();let n,s;void 0===e.antialias&&(e.antialias=!0),void 0===e.alpha&&(e.alpha=!0),void 0===e.logarithmicDepthBuffer&&(e.logarithmicDepthBuffer=this.gLDebug||r),void 0===e.isWebGL2&&(e.isWebGL2=!0),t.domElement?(n=t,s=n.domElement instanceof HTMLDivElement?n.domElement:n.domElement.parentElement):s=t,this.width=s.clientWidth,this.height=s.clientHeight,this.positionBuffer=null,this._nextThreejsLayer=1,this.fullSizeRenderTarget=new i.WebGLRenderTarget(this.width,this.height),this.fullSizeRenderTarget.texture.minFilter=i.LinearFilter,this.fullSizeRenderTarget.texture.magFilter=i.NearestFilter,this.fullSizeRenderTarget.depthBuffer=!0,this.fullSizeRenderTarget.depthTexture=new i.DepthTexture,this.fullSizeRenderTarget.depthTexture.type=i.UnsignedShortType,this.renderView=function(t){this.renderer.clear(),this.renderer.render(t.scene,t.camera3D),t.tileLayer&&this.label2dRenderer.render(t.tileLayer.object3d,t.camera3D)}.bind(this),this.onWindowResize=function(t,e){this.width=t,this.height=e,this.fullSizeRenderTarget.setSize(this.width,this.height),this.renderer.setSize(this.width,this.height),this.label2dRenderer.setSize(this.width,this.height)}.bind(this);try{this.label2dRenderer=new h.Z,this.label2dRenderer.setSize(this.width,this.height),s.appendChild(this.label2dRenderer.domElement),this.renderer=n||new(e.isWebGL2?i.WebGLRenderer:i.WebGL1Renderer)({canvas:document.createElement("canvas"),antialias:e.antialias,alpha:e.alpha,logarithmicDepthBuffer:e.logarithmicDepthBuffer}),this.renderer.domElement.style.position="relative",this.renderer.domElement.style.zIndex=0,this.renderer.domElement.style.top=0}catch(t){const r=e.isWebGL2?"2":"1";console.error(`Failed to create WebGLRenderer webGL ${r}.`),this.renderer=null}if(!this.renderer)throw c.isWebGLAvailable()?c.isWebGL2Available()||s.appendChild(c.getErrorMessage(2)):s.appendChild(c.getErrorMessage(1)),new Error("WebGL unsupported");!n&&e.logarithmicDepthBuffer&&(this.renderer.capabilities.isWebGL2||this.renderer.extensions.get("EXT_frag_depth")||(this.renderer.dispose(),this.renderer=new(e.isWebGL2?i.WebGLRenderer:i.WebGL1Renderer)({canvas:document.createElement("canvas"),antialias:e.antialias,alpha:e.alpha,logarithmicDepthBuffer:!1}))),-1===this.renderer.domElement.tabIndex&&(this.renderer.domElement.tabIndex=-1),o.Z.updateCapabilities(this.renderer),this.renderer.setClearColor(197896),this.renderer.autoClear=!1,this.renderer.sortObjects=!0,this.renderer.debug.checkShaderErrors=!1,n||(this.renderer.setPixelRatio(s.devicePixelRatio),this.renderer.setSize(s.clientWidth,s.clientHeight),s.appendChild(this.renderer.domElement))}getWindowSize(){return new i.Vector2(this.width,this.height)}getRenderer(){return this.renderer}renderViewToBuffer(t,e){return e||(e={x:0,y:0,width:this.width,height:this.height}),e.buffer=e.buffer||new Uint8Array(4*e.width*e.height),this.renderViewToRenderTarget(t,this.fullSizeRenderTarget,e),this.renderer.readRenderTargetPixels(this.fullSizeRenderTarget,e.x,this.height-(e.y+e.height),e.width,e.height,e.buffer),e.buffer}renderViewToRenderTarget(t,e,r){e||(e=this.fullSizeRenderTarget);const i=this.renderer.getRenderTarget();return r&&(this.fullSizeRenderTarget.scissor.set(r.x,e.height-(r.y+r.height),r.width,r.height),this.fullSizeRenderTarget.scissorTest=!0),this.renderer.setRenderTarget(e),this.renderer.clear(!0,!0,!1),this.renderer.render(t.scene,t.camera.camera3D),this.renderer.setRenderTarget(i),this.fullSizeRenderTarget.scissorTest=!1,e}bufferToImage(t,e,r){const i=document.createElement("canvas"),n=i.getContext("2d",{willReadFrequently:!0});i.width=e,i.height=r;const s=n.getImageData(0,0,e,r);s.data.set(t),n.putImageData(s,0,0);const o=new Image;return o.src=i.toDataURL(),o}depthBufferRGBAValueToOrthoZ(t,e){if(d.fromArray(t).divideScalar(255),o.Z.isLogDepthBufferSupported()&&"PerspectiveCamera"==e.type)return 2**(2*(0,l.On)(d)/(2/(Math.log(e.far+1)/Math.LN2)));{let t=(0,l.On)(d);return t=2*t-1,t}}};var f=r(32475),m=r(82150),g=r(60145),A=r(39683),y=r(95307),v=r.n(y);const x={executeCommand(t){const e=t.layer,r=t.extentsSource,i=t.extentsDestination||r;return Promise.all(r.map(((t,r)=>e.getData(t,i[r]))))}},b=class{constructor(t){this.command=t,this.isCancelledCommandException=!0}toString(){return`Cancelled command ${this.command.requester.id}/${this.command.layer.id}`}},_={executeCommand(t){const e=[],r=t.layer,i=t.requester,n=t.extentsSource;if(i&&!i.material)return Promise.reject(new b(t));for(const t of n)e.push(r.convert(i,t));return Promise.all(e)}};var w=r(82853),E=r(16916);const M=new TextDecoder,S=function(t,e){if(!t)throw new Error("No array buffer provided.");const r=new DataView(t);let n=0;const s={};let o={},a={};if(s.magic=M.decode(new Uint8Array(t,n,4)),n+=4,s.magic){s.version=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.byteLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.FTJSONLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.FTBinaryLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.BTBinaryLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT;let l={};if(s.FTJSONLength>0){const e=n,r=t.slice(e,s.FTJSONLength+e),i=M.decode(new Uint8Array(r));l=JSON.parse(i)}if(s.FTBinaryLength>0&&(a=function(t,e,r){const n=new i.BufferGeometry,s=M.decode(new Uint8Array(t,e,r)),o=JSON.parse(s);let a;if(o.POINTS_LENGTH&&(a=o.POINTS_LENGTH),o.POSITION){const r=o.POSITION.byteOffset+s.length+e,l=new Float32Array(t,r,3*a);n.setAttribute("position",new i.BufferAttribute(l,3))}if(o.RGB){const r=o.RGB.byteOffset+s.length+e,l=new Uint8Array(t,r,3*a);n.setAttribute("color",new i.BufferAttribute(l,3,!0))}if(o.POSITION_QUANTIZED)throw new Error("For pnts loader, POSITION_QUANTIZED: not yet managed");if(o.RGBA)throw new Error("For pnts loader, RGBA: not yet managed");if(o.RGB565)throw new Error("For pnts loader, RGB565: not yet managed");if(o.NORMAL)throw new Error("For pnts loader, NORMAL: not yet managed");if(o.NORMAL_OCT16P)throw new Error("For pnts loader, NORMAL_OCT16P: not yet managed");if(o.BATCH_ID)throw new Error("For pnts loader, BATCH_ID: not yet managed");return{geometry:n,offset:o.RTC_CENTER?(new i.Vector3).fromArray(o.RTC_CENTER):void 0}}(t,n,s.FTJSONLength)),s.BTJSONLength>0){const r=n+s.FTJSONLength+s.FTBinaryLength,c=t.slice(r,s.BTJSONLength+s.BTBinaryLength+r);o=new E.Z(c,s.BTJSONLength,s.BTBinaryLength,l.BATCH_ID&&l.BATCH_LENGTH?l.BATCH_LENGTH:l.POINTS_LENGTH,e),a=function(t,e){if(t.geometry)return e.content&&e.content.Classification&&t.geometry.setAttribute("classification",new i.BufferAttribute(new Uint8Array(e.content.Classification),1,!0)),t}(a,o)}const c={point:a,batchTable:o};return Promise.resolve(c)}throw new Error("Invalid pnts file.")};var C=r(33347),T=r(52521),I=r(32204);const R=new TextDecoder;function B(t,e,r){const n=i.LoaderUtils.extractUrlBase(r),s={gltfUpAxis:e.tileset.asset.gltfUpAxis,urlBase:n,overrideMaterials:e.overrideMaterials,doNotPatchMaterial:e.doNotPatchMaterial,opacity:e.opacity,registeredExtensions:e.registeredExtensions,layer:e};return w.ZP.parse(t,s).then((t=>({batchTable:t.batchTable,object3d:t.gltf.scene})))}function L(t,e){return S(t,e.registeredExtensions).then((t=>{const r=e.material?e.material.clone():new I.ZP({size:.05,mode:e.pntsMode,shape:e.pntsShape,classification:e.classification,sizeMode:e.pntsSizeMode,minAttenuatedSize:e.pntsMinAttenuatedSize,maxAttenuatedSize:e.pntsMaxAttenuatedSize});(0,T.Z)(r,e);const n=new i.Points(t.point.geometry,r);return t.point.offset&&n.position.copy(t.point.offset),{object3d:n,batchTable:t.batchTable}}))}const P={executeCommand:function(t){const e=t.layer,r=t.metadata,n=new i.Object3D;!function(t,e,r,i){t.frustumCulled=!1,t.layer=e,r.transform&&t.applyMatrix4(r.transform),t.geometricError=r.geometricError,t.tileId=r.tileId,r.refine?t.additiveRefinement="ADD"===r.refine.toUpperCase():t.additiveRefinement=!!i&&i.additiveRefinement,t.viewerRequestVolume=r.viewerRequestVolume,t.boundingVolume=r.boundingVolume,t.updateMatrixWorld()}(n,e,r,t.requester);const s=r.content&&(r.content.url||r.content.uri),o=t=>{t.userData.metadata=r,t.layer=e};if(s){const t=s.startsWith("http")?s:r.baseURL+s,i={b3dm:B,pnts:L};return C.Z.arrayBuffer(t,e.source.networkOptions).then((s=>{if(void 0!==s){let a;const l=R.decode(new Uint8Array(s,0,4));if("{"===l[0]){s=JSON.parse(R.decode(new Uint8Array(s)));const i=t.slice(0,t.lastIndexOf("/")+1);e.tileset.extendTileset(s,r.tileId,i,e.registeredExtensions)}else if("b3dm"==l)a=i.b3dm;else{if("pnts"!=l)return Promise.reject(`Unsupported magic code ${l}`);a=i.pnts}if(a)return a(s,e,t).then((t=>(n.content=t.object3d,t.batchTable&&(n.batchTable=t.batchTable),n.add(t.object3d),n.traverse(o),n)))}return n.traverse(o),n}))}return n.traverse(o),Promise.resolve(n)}};var D=r(99128);let O=1;const k={executeCommand(t){const e=t.layer,r=t.requester;return r.load().then((n=>{const s=new i.Points(n,e.material);return function(t){const e=t.geometry.attributes.position.count,r=new Uint8Array(4*e),n=O++;if(e>65535||n>65535)return console.warn("Currently picking is limited to Points with less than 65535 elements and less than 65535 Points instances"),t;for(let t=0;t>24,r[4*t+1]=(16711680&e)>>16,r[4*t+2]=(65280&e)>>8,r[4*t+3]=(255&e)>>0}t.baseId=n,t.geometry.setAttribute("unique_id",new i.BufferAttribute(r,4,!0))}(s),s.frustumCulled=!1,s.matrixAutoUpdate=!1,e.isEntwinePointTileLayer||(s.position.copy(r.bbox.min),s.scale.copy(e.scale)),s.updateMatrix(),s.tightbbox=n.boundingBox.applyMatrix4(s.matrix),s.layer=e,s.extent=D.ZP.fromBox3(t.view.referenceCrs,r.bbox),s.userData.node=r,s}))}};var U=r(13012);function N(t,e){const r=e.priority-t.priority;return 0===r?e.timestamp-t.timestamp:r}function F(){return{queue(t){const e=t.layer;let r=this.storages.get(e.id);r||(r={q:new(v())({comparator:N}),priority:1,accumulator:0},this.storages.set(e.id,r)),r.priority=e.priority||1,r.q.queue(t),this.counters.pending++},storages:new Map,counters:{executing:0,executed:0,failed:0,cancelled:0,pending:0},execute(t,e){return this.counters.pending--,this.counters.executing++,e.executeCommand(t).then((e=>{this.counters.executing--,t.resolve(e),this.counters.executed++}),(e=>{this.counters.executing--,t.reject(e),this.counters.failed++}))}}}function z(){this.defaultQueue=F(),this.hostQueues=new Map,this.providers={},this.maxCommandsPerHost=6,this.initDefaultProviders()}z.prototype.constructor=z,z.prototype.initDefaultProviders=function(){this.addProtocolProvider("tile",_),this.addProtocolProvider("3d-tiles",P),this.addProtocolProvider("pointcloud",k)},z.prototype.runCommand=function(t,e,r){const i=this.getProtocolProvider(t.layer.protocol);if(!i)throw new Error(`No known provider for layer ${t.layer.id}`);e.execute(t,i,r).then((()=>{if(t.view.notifyChange(t.requester,t.redraw),e.counters.executing{t.resolve=e,t.reject=r})),r&&!this.hostQueues.has(r)&&this.hostQueues.set(r,F());const i=r?this.hostQueues.get(r):this.defaultQueue;return t.timestamp=Date.now(),i.queue(t),i.counters.executing{if(i.counters.executing0&&(i+=t.priority,t.accumulator+=t.priority,(!e||t.accumulator>r)&&(e=t,r=t.accumulator))}if(e)return e.accumulator-=i,e.q}(t.storages);for(;e&&e.length>0;){const r=e.dequeue();if(!r.earlyDropFunction||!r.earlyDropFunction(r))return r;t.counters.pending--,t.counters.cancelled++,r.reject(new b(r))}};const G=z;var Q=r(73773),j=r(16655),V=r(1857);const H={LAYERS_INITIALIZED:"layers-initialized",LAYER_REMOVED:"layer-removed",LAYER_ADDED:"layer-added",INITIALIZED:"initialized",COLOR_LAYERS_ORDER_CHANGED:a.i,CAMERA_MOVED:"camera-moved"},W=new i.Vector2,q=new i.Matrix4,Z=new i.Vector2,Y=new i.Ray,X=new i.Vector3,J=new i.Vector3,K=new g.Z("EPSG:4326"),$=[];let tt;class et extends i.EventDispatcher{#f=[];#m=new Uint8Array(4);#g;constructor(t,e){let r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("Invalid viewerDiv parameter (must non be null/undefined)");super(),this.domElement=e,this.referenceCrs=t,r=o.renderer&&o.renderer.domElement?new p(o.renderer):new p(e,o.renderer),this.mainLoop=o.mainLoop||new s.ZP(new G,r),this.scene=o.scene3D||new i.Scene,o.scene3D||(this.scene.matrixWorldAutoUpdate=!1),this.camera=new n.Z(this.referenceCrs,this.mainLoop.gfxEngine.getWindowSize().x,this.mainLoop.gfxEngine.getWindowSize().y,o.camera),this._frameRequesters={},this._resizeListener=()=>this.resize(),window.addEventListener("resize",this._resizeListener,!1),this._changeSources=new Set,this._delayedFrameRequesterRemoval=[],this._allLayersAreReadyCallback=()=>{this.getLayers().every((t=>t.ready))&&0==this.mainLoop.scheduler.commandsWaitingExecutionCount()&&this.mainLoop.renderingState==s.HR&&(this.dispatchEvent({type:H.LAYERS_INITIALIZED}),this.removeFrameRequester(s.Ao.UPDATE_END,this._allLayersAreReadyCallback))},this.camera.resize(this.domElement.clientWidth,this.domElement.clientHeight);const a=()=>{this.removeEventListener(H.LAYERS_INITIALIZED,a),this.dispatchEvent({type:H.INITIALIZED})};let l;this.addEventListener(H.LAYERS_INITIALIZED,a),this.#g=new Uint8Array(4*this.camera.width*this.camera.height),this.domElement.tabIndex=-1,o.disableFocusOnStart||this.domElement.focus(),this.domElement.addEventListener("mouseup",(t=>{2===t.button&&(l&&t.timeStamp-l<500&&this.domElement.dispatchEvent(new MouseEvent("dblclick-right",t)),l=t.timeStamp)})),$.push(this),o.webXR&&((t,e)=>{const r=e.scale||1,n=t.mainLoop.gfxEngine.renderer.xr;n.addEventListener("sessionstart",(()=>{const e=t.camera.camera3D,s=i=>{"Escape"===i.key&&(document.removeEventListener("keydown",s),n.enabled=!1,t.camera.camera3D=e,t.scene.scale.multiplyScalar(1/r),t.scene.updateMatrixWorld(),async function(t){t&&await t.end()}(n.getSession()),t.notifyChange(t.camera.camera3D,!0))};t.scene.scale.multiplyScalar(r),t.scene.updateMatrixWorld(),n.enabled=!0,n.getReferenceSpace("local");const o=t.camera.position(),a=(new i.Quaternion).setFromUnitVectors(new i.Vector3(0,0,1),o.geodesicNormal).invert(),l=new i.Quaternion(-1,0,0,1).normalize().multiply(a),c=e.position.clone().multiplyScalar(-r).applyQuaternion(l),h=new XRRigidTransform(c,l),u=n.getReferenceSpace().getOffsetReferenceSpace(h);n.setReferenceSpace(u),t.camera.camera3D=n.getCamera(),t.camera.resize(t.camera.width,t.camera.height),document.addEventListener("keydown",s,!1),n.setAnimationLoop((e=>{n.isPresenting&&t.camera.camera3D.cameras[0]&&(t.camera.camera3D.updateMatrix(),t.camera.camera3D.updateMatrixWorld(!0),t.notifyChange(t.camera.camera3D,!0)),t.mainLoop.step(t,e)}))}))})(this,o.webXR)}get renderer(){var t,e;return null===(t=this.mainLoop)||void 0===t||null===(e=t.gfxEngine)||void 0===e?void 0:e.getRenderer()}get camera3D(){var t;return null===(t=this.camera)||void 0===t?void 0:t.camera3D}dispose(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=$.indexOf(this);if(-1==e)return void console.warn("View already disposed");window.removeEventListener("resize",this._resizeListener),this.controls&&("function"==typeof this.controls.dispose&&this.controls.dispose(),delete this.controls),this.removeAllFrameRequesters(),this.removeAllEvents();const r=this.getLayers((t=>!t.isTiledGeometryLayer&&!t.isAtmosphere));for(const e of r)this.removeLayer(e.id,t);const i=this.getLayers((t=>t.isAtmosphere));for(const e of i)this.removeLayer(e.id,t);const n=this.getLayers((t=>t.isTiledGeometryLayer));for(const e of n)this.removeLayer(e.id,t);$.splice(e,1),this.scene.traverse(V.Z.cleanup)}addLayer(t,e){if(!t||!t.isLayer)return Promise.reject(new Error("Add Layer type object"));if(this.getLayerById(t.id))return t._reject(new Error(`Invalid id '${t.id}': id already used`));if(t=function(t,e,r){const i=e.source;if(r&&!e.extent&&(e.extent=r.extent,i&&!i.extent&&(i.extent=r.extent)),e.isGeometryLayer&&!e.isLabelLayer?e.crs=t.referenceCrs:e.crs||(r&&r.tileMatrixSets&&r.tileMatrixSets.includes(m.Z.formatToTms(i.crs))?e.crs=i.crs:e.crs=r&&r.extent.crs),e.isLabelLayer)t.mainLoop.gfxEngine.label2dRenderer.registerLayer(e);else if(e.labelEnabled||e.addLabelLayer){e.labelEnabled&&console.info("layer.labelEnabled is deprecated use addLabelLayer, instead of"),e.buildExtent=!0,e.structure="3d";const r=new j.Z(`${e.id}-label`,{source:i,style:e.style,zoom:e.zoom,performance:e.addLabelLayer.performance,crs:i.crs,visible:e.visible,margin:15,forceClampToTerrain:e.addLabelLayer.forceClampToTerrain});e.addEventListener("visible-property-changed",(()=>{r.visible=e.visible}));const n=i=>{i.layerId===e.id&&t.removeLayer(r.id),t.removeEventListener(H.LAYER_REMOVED,n)};t.addEventListener(H.LAYER_REMOVED,n),e.whenReady=e.whenReady.then((()=>(t.addLayer(r),e)))}return e}(this,t,e),e)if(t.isColorLayer){const r=this.getLayers((t=>t.isColorLayer));if(t.sequence=r.length,!(e.countColorLayersTextures(...r,t)<=(0,l.dn)()))return t._reject(new Error(`Cant add color layer ${t.id}: the maximum layer is reached`));e.attach(t)}else if(t.isElevationLayer&&"image/x-bil;bits=32"==t.source.format){var r,i;t.source.networkOptions.isWebGL2=null===(r=this.renderer)||void 0===r||null===(i=r.capabilities)||void 0===i?void 0:i.isWebGL2,e.attach(t)}else e.attach(t);else{if("function"!=typeof t.update)return t._reject(new Error("Cant add GeometryLayer: missing a update function"));if("function"!=typeof t.preUpdate)return t._reject(new Error("Cant add GeometryLayer: missing a preUpdate function"));this.#f.push(t)}return t.object3d&&!t.object3d.parent&&t.object3d!==this.scene&&this.scene.add(t.object3d),Promise.all(t._promises).then((()=>{t._resolve(),this.notifyChange(e||t,!1),this._frameRequesters[s.Ao.UPDATE_END]&&this._frameRequesters[s.Ao.UPDATE_END].includes(this._allLayersAreReadyCallback)||this.addFrameRequester(s.Ao.UPDATE_END,this._allLayersAreReadyCallback),this.dispatchEvent({type:H.LAYER_ADDED,layerId:t.id})}),t._reject),t.whenReady}removeLayer(t,e){const r=this.getLayerById(t);if(r){const i=r.parent;if(r.delete(e),i&&!i.detach(r))throw new Error(`Error to detach ${t} from ${i.id}`);if(null==i&&this.#f.splice(this.#f.findIndex((e=>e.id==t)),1),r.isColorLayer){const t=this.getLayers((t=>t.isColorLayer));for(const e of t)e.sequence>r.sequence&&e.sequence--}let n=0;for(const t of $)n+=t.getLayers((t=>t.source.uid==r.source.uid&&t.crs==r.crs)).length;return r.source.onLayerRemoved({unusedCrs:0==n?r.crs:void 0}),this.notifyChange(this.camera),this.dispatchEvent({type:H.LAYER_REMOVED,layerId:t}),!0}throw new Error(`${t} doesn't exist`)}notifyChange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&(this._changeSources.add(t),this.mainLoop.gfxEngine.renderer.xr.isPresenting||!t.isTileMesh&&!t.isCamera||(this.#g.needsUpdate=!0)),this.mainLoop.scheduleViewUpdate(this,e)}getLayers(t){const e=[];for(const r of this.#f)if(t&&!t(r)||e.push(r),r.attachedLayers)for(const i of r.attachedLayers)t&&!t(i,r)||e.push(i);return e}getLayerById(t){return this.getLayers((e=>e.id===t))[0]}addFrameRequester(t,e){if("function"!=typeof e)throw new Error("frameRequester must be a function");this._frameRequesters[t]?this._frameRequesters[t].push(e):this._frameRequesters[t]=[e]}removeFrameRequester(t,e){this._frameRequesters[t].includes(e)?this._delayedFrameRequesterRemoval.push({when:t,frameRequester:e}):console.error("Invalid call to removeFrameRequester: frameRequester isn't registered")}removeAllFrameRequesters(){for(const t in this._frameRequesters)if(Object.prototype.hasOwnProperty.call(this._frameRequesters,t)){const e=this._frameRequesters[t];for(const r of e)this.removeFrameRequester(t,r)}this._executeFrameRequestersRemovals()}removeAllEvents(){if(void 0!==this._listeners){for(const t in this._listeners)Object.prototype.hasOwnProperty.call(this._listeners,t)&&delete this._listeners[t];this._listeners=void 0}}_executeFrameRequestersRemovals(){for(const t of this._delayedFrameRequesterRemoval){const e=this._frameRequesters[t.when].indexOf(t.frameRequester);e>=0?this._frameRequesters[t.when].splice(e,1):console.warn("FrameReq has already been removed")}this._delayedFrameRequesterRemoval.length=0}execFrameRequesters(t,e,r){if(this._frameRequesters[t]){this._delayedFrameRequesterRemoval.length>0&&this._executeFrameRequestersRemovals();for(var i=arguments.length,n=new Array(i>3?i-3:0),s=3;s1&&void 0!==arguments[1]?arguments[1]:W,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.domElement.getBoundingClientRect();if(t.touches&&t.touches.length)return e.set(t.touches[r].clientX-i.x,t.touches[r].clientY-i.y);if(void 0!==t.offsetX&&void 0!==t.offsetY){const r=t.target.getBoundingClientRect();return e.set(r.x+t.offsetX-i.x,r.y+t.offsetY-i.y)}}eventToNormalizedCoords(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewToNormalizedCoords(this.eventToViewCoords(t,W,e))}viewToNormalizedCoords(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W;return e.x=t.x/this.camera.width*2-1,e.y=t.y/this.camera.height*-2+1,e}normalizedToViewCoords(t){return W.x=.5*(t.x+1)*this.camera.width,W.y=-.5*(t.y-1)*this.camera.height,W}pickObjectsAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;const i=[];if(r&&0!==r.length||(r=this.getLayers((t=>t.isGeometryLayer))),Array.isArray(r)||(r=[r]),r.forEach((t=>{"string"==typeof t&&(t=this.getLayerById(t)),t&&(t.isGeometryLayer||t.isObject3D)&&i.push(t)})),0==i.length)return[];const n=[],s=t instanceof Event?this.eventToViewCoords(t):t;for(const t of i)if(!t.isAtmosphere)if(t.isGeometryLayer){if(!t.ready){console.warn("view.pickObjectAt : layer is not ready : ",t);continue}t.pickObjectsAt(this,s,e,n)}else Q.Z.pickObjectsAt(this,s,e,t,n);return n}getScale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28;return this.camera3D.isOrthographicCamera?.001*t/this.getPixelsToMeters():this.getScaleFromDistance(t,this.getDistanceFromCamera())}getScaleFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t/=1e3;const r=i.MathUtils.degToRad(this.camera3D.fov);return t*(this.camera.height/(2*e*Math.tan(.5*r)))}getDistanceFromCamera(t){return this.getPickingPositionFromDepth(t,J),this.camera3D.position.distanceTo(J)}getPixelsToMeters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(tt=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,t*tt/this.camera.width):this.getPixelsToMetersFromDistance(t,this.getDistanceFromCamera(e))}getPixelsToMetersFromDistance(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)/this.camera._preSSE}getMetersToPixels(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(tt=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,t*this.camera.width/tt):this.getMetersToPixelsFromDistance(t,this.getDistanceFromCamera(e))}getMetersToPixelsFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.camera._preSSE*t/e}pickFeaturesAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;nt.isColorLayer||t.isGeometryLayer)):i).forEach((t=>{"string"==typeof t&&(t=this.getLayerById(t)),t&&t.isLayer&&(o[t.id]=[],t.isColorLayer&&s.push(t.id))}));const a=t instanceof Event?this.eventToViewCoords(t,W):t,l=this.pickObjectsAt(a,e,...i);if(l.length>0&&l.forEach((t=>o[t.layer.id].push(t))),0==s.length)return o;let c;this.getPickingPositionFromDepth(a,J),K.crs=this.referenceCrs,K.setFromVector3(J);const h={M:this.getPixelsToMeters(e,a),D:.001*e};this.isPlanarView?h.D=h.M:this.getPixelsToDegrees&&(h.D=this.getMetersToDegrees(h.M));const u=Q.Z.pickTilesAt(this,a,e,this.tileLayer);for(const t of u)if(t.object.material)for(const e of t.object.material.getLayers(s))for(const t of e.textures)t.features&&(c=m.Z.isMetricUnit(t.features.crs)?h.M:h.D,A.Z.filterFeaturesUnderCoordinate(K,t.features,c).forEach((t=>{o[e.id].find((e=>e.geometry===t.geometry))||o[e.id].push(t)})));return o}readDepthBuffer(t,e,r,i,n){const s=this.mainLoop.gfxEngine,o=this.tileLayer.wireframe,a=this.tileLayer.opacity,l=this.tileLayer.visible;o&&(this.tileLayer.wireframe=!1),a<1&&(this.tileLayer.opacity=1),l||(this.tileLayer.visible=!0);const c=this.tileLayer.level0Nodes.map((t=>f.Z.push(t,f.Z.MODES.DEPTH)));return n=s.renderViewToBuffer({camera:this.camera,scene:this.tileLayer.object3d},{x:t,y:e,width:r,height:i,buffer:n}),c.forEach((t=>t())),this.tileLayer.wireframe!==o&&(this.tileLayer.wireframe=o),this.tileLayer.opacity!==a&&(this.tileLayer.opacity=a),this.tileLayer.visible!==l&&(this.tileLayer.visible=l),n}getPickingPositionFromDepth(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;if(!this.tileLayer||0==this.tileLayer.level0Nodes.length||!this.tileLayer.level0Nodes[0])return void(e=void 0);const r=this.mainLoop,n=0==r.scheduler.commandsWaitingExecutionCount()&&r.renderingState==s.HR,a=r.gfxEngine,l=a.getWindowSize();let c;if((t=t||l.clone().multiplyScalar(.5)).x=Math.floor(t.x),t.y=Math.floor(t.y),n){this.#g.needsUpdate&&(this.readDepthBuffer(0,0,l.x,l.y,this.#g),this.#g.needsUpdate=!1);const e=4*((l.y-t.y-1)*l.x+t.x);c=this.#g.slice(e,e+4)}else c=this.readDepthBuffer(t.x,t.y,1,1,this.#m);if(Z.x=t.x/l.x*2-1,Z.y=-t.y/l.y*2+1,o.Z.isLogDepthBufferSupported()&&"PerspectiveCamera"==this.camera3D.type){Y.origin.copy(this.camera3D.position),Y.direction.set(Z.x,Z.y,.5),q.multiplyMatrices(this.camera3D.matrixWorld,q.copy(this.camera3D.projectionMatrix).invert()),Y.direction.applyMatrix4(q),Y.direction.sub(Y.origin),X.set(0,0,1),X.applyMatrix4(q),X.sub(Y.origin);const t=X.angleTo(Y.direction),r=a.depthBufferRGBAValueToOrthoZ(c,this.camera3D)/Math.cos(t);e.addVectors(this.camera3D.position,Y.direction.setLength(r))}else{const t=a.depthBufferRGBAValueToOrthoZ(c,this.camera3D);e.set(Z.x,Z.y,t),e.unproject(this.camera3D)}return e.length()>1e7?void 0:e}pickTerrainCoordinates(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.Z(this.referenceCrs);return t instanceof Event?this.eventToViewCoords(t):t&&void 0!==t.x&&void 0!==t.y?W.copy(t):W.set(this.mainLoop.gfxEngine.width/2,this.mainLoop.gfxEngine.height/2),this.getPickingPositionFromDepth(W,J),K.crs=this.referenceCrs,K.setFromVector3(J),K.as(e.crs,e),e}pickCoordinates(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.Z(this.referenceCrs);return console.warn("Deprecated, use View#pickTerrainCoordinates instead."),this.pickTerrainCoordinates(t,e)}resize(t,e){t<0||e<0?console.warn(`Trying to resize the View with negative height (${e}) or width (${t}). Skipping resize.`):(null==t&&(t=this.domElement.clientWidth),null==e&&(e=this.domElement.clientHeight),this.#g=new Uint8Array(4*t*e),this.mainLoop.gfxEngine.onWindowResize(t,e),0!==t&&0!==e&&(this.camera.resize(t,e),this.notifyChange(this.camera3D)))}}const rt=et},24266:(t,e,r)=>{"use strict";r.d(e,{Z:()=>g,y:()=>u});var i=r(99477),n=r(20193),s=r(77474),o=r(45571),a=r(83500),l=r(32204),c=(r(48891),r(97498)),h=r(12306);const u={ON_TILE_CONTENT_LOADED:"on-tile-content-loaded",ON_TILE_REQUESTED:"on-tile-requested"},d=(0,s.Ti)();function p(t){let e=t,r=e.tileId;for(;isNaN(r)&&e.parent;)e=e.parent,r=e.tileId;return r}function f(t){return t.geometry&&t.geometry.attributes._BATCHID}class m extends n.Z{#A;constructor(t,e,r){super(t,new i.Group,{source:e.source}),this.isC3DTilesLayer=!0,this.sseThreshold=e.sseThreshold||16,this.cleanupDelay=e.cleanupDelay||1e3,this.protocol="3d-tiles",this.name=e.name,this.registeredExtensions=e.registeredExtensions||new a.Z,this.pntsMode=l.vj.COLOR,this.pntsShape=l.Uz.CIRCLE,this.classification=e.classification,this.pntsSizeMode=l.E7.VALUE,this.pntsMinAttenuatedSize=e.pntsMinAttenuatedSize||3,this.pntsMaxAttenuatedSize=e.pntsMaxAttenuatedSize||10,e.pntsMode&&(Object.values(l.vj).includes(e.pntsMode)?this.pntsMode=e.pntsMode:console.warn("The points cloud mode doesn't exist. Use 'COLOR' or 'CLASSIFICATION' instead.")),e.pntsShape&&(Object.values(l.Uz).includes(e.pntsShape)?this.pntsShape=e.pntsShape:console.warn("The points cloud point shape doesn't exist. Use 'CIRCLE' or 'SQUARE' instead.")),e.pntsSizeMode&&(Object.values(l.E7).includes(e.pntsSizeMode)?this.pntsSizeMode=e.pntsSizeMode:console.warn("The points cloud size mode doesn't exist. Use 'VALUE' or 'ATTENUATED' instead.")),this._style=e.style||null,this.#A=new Map,this.tilesC3DTileFeatures=new Map,e.onTileContentLoaded&&(console.warn("DEPRECATED onTileContentLoaded should not be passed at the contruction, use C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED event instead"),this.addEventListener(u.ON_TILE_CONTENT_LOADED,e.onTileContentLoaded)),e.overrideMaterials&&(console.warn("overrideMaterials is deprecated, use style API instead"),this.overrideMaterials=e.overrideMaterials),this._cleanableTiles=[];const n=this.addInitializationStep();this.source.whenReady.then((t=>{if(this.tileset=new o.Z(t,this.source.baseUrl,this.registeredExtensions),this.tileset.extensionsUsed)for(const t of this.tileset.extensionsUsed)this.registeredExtensions.isExtensionRegistered(t)||(this.tileset.extensionsRequired&&this.tileset.extensionsRequired.includes(t)?console.error(`3D Tiles tileset required extension "${t}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`):console.warn(`3D Tiles tileset used extension "${t}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`));(0,s.SR)(r,r.mainLoop.scheduler,this,t.root).then(n)}))}preUpdate(){return s.SY.bind(this)()}update(t,e,r){return d(t,e,r)}getObjectToUpdateForAttachedLayers(t){if(t.content){const e=[];t.content.traverse((r=>{r.isObject3D&&r.material&&r.layer==t.layer&&e.push(r)}));const r=t.parent;return r&&r.content?{elements:e,parent:r.content}:{elements:e}}}findBatchTable(t){return t.batchTable?t.batchTable:t.parent?this.findBatchTable(t.parent):void 0}getC3DTileFeatureFromIntersectsArray(t){let e=null;for(let r=0;r{if(f(e)){const r=this.findBatchTable(e);if(!r)throw new Error("no batchTable");const i=e.geometry.attributes;let n=i._BATCHID.array[0],s=0,o=0;const a=()=>{if(this.tilesC3DTileFeatures.get(t.tileId).has(n))this.tilesC3DTileFeatures.get(t.tileId).get(n).groups.push({start:s,count:o});else{const i=new c.Z(t.tileId,n,[{start:s,count:o}],r.getInfoById(n),{},e);this.tilesC3DTileFeatures.get(t.tileId).set(n,i)}};for(let t=0;t=i.position.array.length&&a()}}}))}updateStyle(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this._style)return!1;if(!this.object3d)return!1;const e=[],r=new Map;this.object3d.traverse((e=>{if(f(e)){const i=p(e);if(t&&!t.includes(i))return;r.has(i)||r.set(i,[]),r.get(i).push(e)}}));for(const[t,n]of r){const r=this.tilesC3DTileFeatures.get(t);n.forEach((t=>{t.geometry.clearGroups(),t.material=[];for(const[,e]of r){if(e.object3d!=t)continue;let r=null;r="function"==typeof this._style.fill.color?new i.Color(this._style.fill.color(e)):new i.Color(this._style.fill.color);let n=null;n="function"==typeof this._style.fill.opacity?this._style.fill.opacity(e):this._style.fill.opacity;const s=r.getHexString()+n;let o=null;this.#A.has(s)?o=this.#A.get(s):(o=new i.MeshStandardMaterial({color:r,opacity:n,transparent:n<1,alphaTest:.09}),this.#A.set(s,o));let a=-1;for(let e=0;e{t.geometry.addGroup(e.start,e.count,a)}))}(0,h.O)(t),t.material instanceof Array?t.material.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(t.material)||e.push(t.material)}))}for(const[t,r]of this.#A)e.includes(r)||(r.dispose(),this.#A.delete(t));return!0}get materialCount(){return this.#A.size}set style(t){this._style=t,this.updateStyle()}get style(){return this._style}}const g=m},27313:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a,c:()=>s});var i=r(66165),n=r(52872);function s(t){var e;return null==t||null===(e=t.attachedLayers.filter((t=>t.isGeoidLayer))[0])||void 0===e?void 0:e.visible}class o extends i.Z{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.isGeoidLayer=!0,this.defineLayerProperty("visible",!0)}updateNodeZ(t){t.material.geoidHeight=this.visible?t.geoidHeight:0,t.obb.updateZ({geoidHeight:t.material.geoidHeight})}update(t,e,r,i){if(!i||!r.material)return;const s=r.getExtentsByProjection(e.crs),o=s[0].zoom;if(!(o>e.zoom.max||othis.updateNodeZ(r);e.addEventListener("visible-property-changed",t),r.addEventListener("dispose",(()=>{e.removeEventListener("visible-property-changed",t)}))}if(!e.frozen&&e.visible&&r.material.visible&&r.layerUpdateState[e.id].canTryUpdate())return r.layerUpdateState[e.id].newTry(),this.getData(r.extent,s).then((t=>{r.geoidHeight=t.getHeightAtCoordinates(r.extent.center()),this.updateNodeZ(r),r.layerUpdateState[e.id].noMoreUpdatePossible()}))}}}const a=o},20193:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(66165),n=r(73773),s=r(1537),o=r(1857);class a extends i.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.cacheLifeTime=r.cacheLifeTime??s.D.GEOMETRY;const i=r.visible;if(delete r.visible,super(t,r),this.isGeometryLayer=!0,!e||!e.isObject3D)throw new Error("Missing/Invalid object3d parameter (must be a\n three.js Object3D instance)");"Group"===e.type&&""===e.name&&(e.name=t),Object.defineProperty(this,"object3d",{value:e,writable:!1,configurable:!0}),this.opacity=1,this.wireframe=!1,this.attachedLayers=[],this.visible=i??!0,Object.defineProperty(this.zoom,"max",{value:1/0,writable:!1}),this.filteringExtent=!this.source.isFileSource,this.structure="3d"}get visible(){return this.object3d.visible}set visible(t){if(this.object3d.visible!==t){const e={type:"visible-property-changed",previous:{},new:{}};e.previous.visible=this.object3d.visible,e.new.visible=t,this.dispatchEvent(e),this.object3d.visible=t}}getObjectToUpdateForAttachedLayers(t){if(t.parent&&t.material)return{element:t,parent:t.parent}}postUpdate(){}culling(){return!0}attach(t){if(!t.update)throw new Error(`Missing 'update' function -> can't attach layer\n ${t.id}`);this.attachedLayers.push(t),t.parent=this}detach(t){const e=this.attachedLayers.length;return this.attachedLayers=this.attachedLayers.filter((e=>e.id!=t.id)),t.parent=void 0,this.attachedLayers.length2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return n.Z.pickObjectsAt(t,e,r,this.object3d,i)}}const l=a},63133:(t,e,r)=>{"use strict";r.d(e,{$:()=>s,Z:()=>n});var i=r(99128);class n{constructor(t){this.layer=t}clear(){}update(){}}class s extends n{constructor(t){super(t),this.displayed={tiles:new Set},Object.defineProperty(this.displayed,"layers",{get:()=>{let t=[];return this.displayed.tiles.forEach((e=>{const r=e.material;t=[...new Set([...t,...r.colorLayerIds.filter((t=>r.getLayer(t))),...r.elevationLayerIds])]})),this.layer.attachedLayers.filter((e=>t.includes(e.id)))}}),Object.defineProperty(this.displayed,"extent",{get:()=>{const t=new i.ZP(this.layer.extent.crs,1/0,-1/0,1/0,-1/0);return t.min=1/0,t.max=-1/0,this.displayed.tiles.forEach((e=>{t.union(e.extent),t.min=Math.min(e.obb.z.min,t.min),t.max=Math.max(e.obb.z.max,t.max)})),t}})}clear(){this.displayed.tiles.clear()}update(t){t.material.visible?this.displayed.tiles.add(t):this.displayed.tiles.delete(t)}}},16655:(t,e,r)=>{"use strict";r.d(e,{Z:()=>_});var i=r(99477),n=r(52872),s=r(1857),o=r(20193),a=r(60145),l=r(99128),c=r(57918),h=r(94596),u=r(48891),d=r(6755);const p=new u.uP,f=new a.Z("EPSG:4326",0,0,0),m=new l.ZP("EPSG:4326",0,0,0,0),g=new i.Vector2,A=new i.Vector2,y=new i.Vector2;class v{#y=!1;constructor(){this.dom=document.createElement("div"),this.dom.style.display="none",this.visible=!0}get visible(){return this.#y}set visible(t){t!==this.#y&&(this.#y=t,this.dom.style.display=t?"block":"none")}hide(){this.visible=!1}show(){this.visible=!0}add(t){this.dom.append(t.dom)}}class x extends i.Group{constructor(t){super(),this.nodeParent=t,this.needsUpdate=!0}initializeDom(){this.domElements=new v,this.domElements.labels=new v,this.domElements.add(this.domElements.labels),this.domElements.labels.dom.style.opacity="0"}addLabel(t){this.add(t),this.domElements.labels.dom.append(t.content),t.initDimensions(),this.nodeParent.layer.isGlobeLayer&&this.nodeParent.level<4&&(t.horizonCullingPoint=new i.Vector3)}removeLabel(t){this.remove(t),this.domElements.labels.dom.removeChild(t.content)}updatePosition(t){this.needsUpdate&&(this.needsAltitude&&t.updateElevationFromLayer(this.nodeParent.layer,[this.nodeParent]),t.update3dPosition(this.nodeParent.layer.crs),t.updateHorizonCullingPoint())}count(){return this.children.length}get labels(){return this.children}}class b extends o.Z{#v=new d.R;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.domElement;delete e.domElement,super(t,e.object3d||new i.Group,e),this.isLabelLayer=!0,this.domElement=new v,this.domElement.show(),this.domElement.dom.id=`itowns-label-${this.id}`,this.buildExtent=!0,this.crs=e.source.crs,this.performance=e.performance||!0,this.forceClampToTerrain=e.forceClampToTerrain||!1,this.toHide=new i.Group,this.labelDomelement=r,this.margin=e.margin}get visible(){return super.visible}set visible(t){var e,r;super.visible=t,t?null===(e=this.domElement)||void 0===e||e.show():null===(r=this.domElement)||void 0===r||r.hide()}get submittedLabelNodes(){return this.object3d.children}convert(t,e){const r=[];return e.as(t.crs,m),f.crs=t.crs,p.setZoom(e.zoom),t.features.forEach((e=>{var i,n,s,o;if(e.type!==h.tg.POINT)return;p.setFeature(e);const a=null===(i=e.style)||void 0===i||null===(n=i.text)||void 0===n?void 0:n.field,l=null===(s=e.style)||void 0===s||null===(o=s.point)||void 0===o?void 0:o.base_altitude,d=l instanceof Function&&"baseAltitudeDefault"==l.name;r.needsAltitude=r.needsAltitude||!0===this.forceClampToTerrain||d&&!e.hasRawElevationData,e.geometries.forEach((i=>{if(f.setFromArray(e.vertices,i.size*i.indices[0].offset),f.applyMatrix4(t.matrixWorld),!m.isPointInside(f))return;const n=i.properties.style&&i.properties.style.text&&i.properties.style.text.field;let s;p.setGeometry(i),this.style.setContext(p);const o=this.style.text&&this.style.text.field;if(this.labelDomelement)s=(0,u.Lu)(this.labelDomelement,p);else if(!(n||a||o||i.properties.style&&(i.properties.style.icon.source||i.properties.style.icon.key)||e.style&&e.style.icon&&(e.style.icon.source||e.style.icon.key)||this.style.icon&&(this.style.icon.source||this.style.icon.key)))return;const l=new c.Z(s,f.clone(),this.style);l.layerId=this.id,l.padding=this.margin||l.padding,r.push(l)}))})),r}preUpdate(t,e){e.has(this.parent)&&(this.object3d.clear(),this.#v.width=.5*this.parent.maxScreenSizeNode,this.#v.height=.5*this.parent.maxScreenSizeNode,this.#v.resize())}#x(t){this.object3d.add(t)}#b(t){this.toHide.add(t)}#_(t){var e,r;return null!==(e=t.parent)&&void 0!==e&&e.isTileMesh?(null===(r=t.parent.link[this.id])||void 0===r?void 0:r.domElements)||this.#_(t.parent):this.domElement}#w(t){return t.children.every((t=>{var e;return t.layerUpdateState&&(null===(e=t.layerUpdateState[this.id])||void 0===e?void 0:e.hasFinished())}))}#E(t){const e=t.children.slice();this.#v.reset(),e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{t.nodeParent.extent.planarDimensions(g),f.crs=t.nodeParent.extent.crs,f.setFromValues(t.nodeParent.extent.west,t.nodeParent.extent.north,0).toVector3(A),f.copy(e.coordinates).as(t.nodeParent.extent.crs,f).toVector3(y),y.sub(A),y.y+=g.y,y.divide(g).multiplyScalar(this.#v.width),e.updateProjectedPosition(y.x,y.y),this.#v.insert(e)||t.removeLabel(e)}))}update(t,e,r,i){if(!i&&r.link[e.id])return void s.Z.removeChildrenAndCleanupRecursively(this,r);const o=r.link[e.id]||new x(r);if(r.link[e.id]=o,this.frozen||!r.visible||!this.visible)return;if(!r.material.visible&&this.#w(r))return this.#b(o);const a=r.getExtentsByProjection(this.source.crs)||[r.extent],l=a[0].zoom;if(le.zoom.max)return this.#b(o);if(void 0===r.layerUpdateState[this.id]&&(r.layerUpdateState[this.id]=new n.Z),!this.source.extentInsideLimit(r.extent,l))return void r.layerUpdateState[this.id].noMoreUpdatePossible();if(this.#w(r.parent))return r.material.visible||(o.needsUpdate=!0),void this.#x(o);if(!r.layerUpdateState[this.id].canTryUpdate())return;r.layerUpdateState[this.id].newTry();const c={layer:this,extentsSource:a,view:t.view,requester:r};return t.scheduler.execute(c).then((e=>{if(!e)return;const i=t.view.mainLoop.gfxEngine.label2dRenderer;o.initializeDom(),this.#_(r).add(o.domElements),e.forEach((t=>{r.parent?(o.needsAltitude=o.needsAltitude||t.needsAltitude,t.forEach((t=>{r.extent.isPointInside(t.coordinates)&&o.addLabel(t)}))):t.forEach((t=>{s.Z.removeChildrenAndCleanupRecursively(this,t),i.removeLabelDOM(t)}))})),o.count()&&(o.domElements.labels.hide(),o.domElements.labels.dom.style.opacity="1.0",r.addEventListener("show",(()=>o.domElements.labels.show())),r.addEventListener("hidden",(()=>this.#b(o))),r.addEventListener("removed",(()=>this.removeNodeDomElement(r))),o.needsAltitude&&r.material.getElevationLayer()&&r.material.getElevationLayer().addEventListener("rasterElevationLevelChanged",(()=>{o.needsUpdate=!0})),this.performance&&this.#E(o)),r.layerUpdateState[this.id].noMoreUpdatePossible()}))}removeLabelsFromNodeRecursive(t){t.children.forEach((t=>{t.link[this.id]&&delete t.link[this.id],this.removeLabelsFromNodeRecursive(t)})),this.removeNodeDomElement(t)}removeNodeDomElement(t){var e;if(null!==(e=t.link[this.id])&&void 0!==e&&e.domElements){const e=t.link[this.id].domElements.dom;e.parentElement.removeChild(e),delete t.link[this.id].domElements}}delete(t){t&&this.cache.clear(),this.domElement.dom.parentElement.removeChild(this.domElement.dom),this.parent.level0Nodes.forEach((t=>this.removeLabelsFromNodeRecursive(t)))}}const _=b},66165:(t,e,r)=>{"use strict";r.d(e,{M:()=>u,Z:()=>h});var i=r(99477),n=r(54919),s=r(63133),o=r(51123),a=r(1537),l=r(48891);class c extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.projection&&(console.warn("Layer projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),void 0===e.source||!0===e.source)throw new Error(`Layer ${t} needs Source`);var r;super(),this.isLayer=!0,!e.style||e.style instanceof l.ZP||("string"==typeof(null===(r=e.style.fill)||void 0===r?void 0:r.pattern)&&(console.warn("Using style.fill.pattern = { source: Img|url } is adviced"),e.style.fill.pattern={source:e.style.fill.pattern}),e.style=new l.ZP(e.style)),this.style=e.style||new l.ZP,Object.assign(this,e),Object.defineProperty(this,"id",{value:t,writable:!1}),this.options=e.options||{},this.updateStrategy||(this.updateStrategy={type:n.R3,options:{}}),this.defineLayerProperty("frozen",!1),e.zoom?(this.zoom={max:e.zoom.max,min:e.zoom.min||0},null==this.zoom.max&&(this.zoom.max=1/0)):this.zoom={max:1/0,min:0},this.info=new s.Z(this),this.source=this.source||new o.ZP({url:"none"}),this.ready=!1,this._promises=[],this.whenReady=new Promise(((t,e)=>{this._resolve=t,this._reject=e})).then((()=>(this.ready=!0,this.source.onLayerAdded({out:this}),this))),this._promises.push(this.source.whenReady),this.cache=new a.Z(e.cacheLifeTime),this.mergeFeatures=void 0===this.mergeFeatures||e.mergeFeatures,this.filter=this.filter||this.source.filter}addInitializationStep(){let t;return this._promises.push(new Promise((e=>{t=e}))),t}defineLayerProperty(t,e,r){const i=Object.getOwnPropertyDescriptor(this,t);if(!i||!i.set){let i=null==this[t]?e:this[t];Object.defineProperty(this,t,{get:()=>i,set:e=>{if(i!==e){const n={type:`${t}-property-changed`,previous:{},new:{}};n.previous[t]=i,n.new[t]=e,i=e,r&&r(this,t),this.dispatchEvent(n)}}})}}convert(t){return t}getData(t,e){const r=this.source.requestToKey(this.source.isVectorSource?e:t);let i=this.cache.getByArray(r);return i||(i=this.source.loadData(t,this).then((t=>this.convert(t,e)),(t=>{throw t})),this.cache.setByArray(i,r)),i}isValidData(){}delete(){console.warn("Function delete doesn't exist for this layer")}}const h=c,u={moveLayerToIndex:function(t,e,r){e=Math.min(e,r.length-1),e=Math.max(e,0);const i=t.sequence;for(const n of r)n.id===t.id?n.sequence=e:n.sequence>i&&n.sequence<=e?n.sequence--:n.sequence>=e&&n.sequence0&&this.moveLayerToIndex(t,t.sequence-1,e)},moveLayerUp:function(t,e){const r=e.length-1;t.sequencet.sequence-e.sequence)),e.map((t=>t.id))}}},52872:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=[1,3,7,60],n=class{constructor(){this.state=0,this.lastErrorTimestamp=0,this.errorCount=0,this.failureParams={lowestLevelError:1/0}}hasFinished(){return 4==this.state}canTryUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();switch(this.state){case 0:return!0;case 3:case 1:case 4:return!1;default:return 1e3*this.secondsUntilNextTry()<=t-this.lastErrorTimestamp}}secondsUntilNextTry(){if(2!==this.state)return 0;const t=Math.max(0,Math.min(this.errorCount,i.length)-1);return i[t]}newTry(){this.state=1}success(){this.lastErrorTimestamp=0,this.state=0}noMoreUpdatePossible(){this.state=4}noData(t){this.state=0,this.failureParams.lowestLevelError=Math.min(t.targetLevel,this.failureParams.lowestLevelError)}failure(t,e,r){r&&null!=r.targetLevel&&(this.failureParams.lowestLevelError=Math.min(r.targetLevel,this.failureParams.lowestLevelError)),this.lastErrorTimestamp=t,this.state=e?3:2,this.errorCount++}inError(){return 3==this.state||2==this.state}}},54919:(t,e,r)=>{"use strict";r.d(e,{AE:()=>s,ET:()=>a,R3:()=>n,c:()=>o,k5:()=>h});var i=r(79736);const n=0,s=1,o=2,a=3;function l(t,e){const r=e.groups.filter((e=>e<=t));return r.length?r[r.length-1]:e.groups[0]}function c(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e==i.pL?r.zoom?r.zoom.min:0:Math.min(t,Math.ceil((e+t)/2))}function h(t,e){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.level,n=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0;const d=h.source.zoom?h.source.zoom.max:1/0;if(u.lowestLevelError!=1/0)r=c(u.lowestLevelError,n,h.source),r=u.lowestLevelError==r?r-1:r,t==s&&(r=l(r,h.updateStrategy.options));else{switch(t){case s:r=l(i,h.updateStrategy.options);break;case o:r=function(t,e,r){return Math.min(t,e+(r.increment||1))}(i,n,h.updateStrategy.options);break;case a:r=c(i,n,h.source);break;default:r=function(t,e,r,i){return t.pendingSubdivision&&!i.isVectorTileSource?r:e}(e,i,n,h.source)}r=Math.min(r,d)}return r}},52521:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const i=function(t,e){if(e&&e.isGeometryLayer){let r=t.transparent;t.layer=e,t.uniforms&&null!=t.uniforms.opacity?Object.defineProperty(t.uniforms.opacity,"value",{get:()=>t.layer.opacity}):null!=t.opacity&&Object.defineProperty(t,"opacity",{get:()=>t.layer.opacity}),t.uniforms&&null!=t.uniforms.mode&&Object.defineProperty(t.uniforms.mode,"value",{get:()=>t.layer.pntsMode}),t.uniforms&&null!=t.uniforms.shape&&Object.defineProperty(t.uniforms.shape,"value",{get:()=>t.layer.pntsShape}),t.uniforms&&null!=t.uniforms.sizeMode&&Object.defineProperty(t.uniforms.sizeMode,"value",{get:()=>t.layer.pntsSizeMode}),t.uniforms&&null!=t.uniforms.minAttenuatedSize&&Object.defineProperty(t.uniforms.minAttenuatedSize,"value",{get:()=>t.layer.pntsMinAttenuatedSize}),t.uniforms&&null!=t.uniforms.maxAttenuatedSize&&Object.defineProperty(t.uniforms.maxAttenuatedSize,"value",{get:()=>t.layer.pntsMaxAttenuatedSize}),Object.defineProperty(t,"wireframe",{get:()=>t.layer.wireframe}),Object.defineProperty(t,"transparent",{get:()=>(r!=t.layer.opacity<1&&(t.needsUpdate=!0,r=t.layer.opacity<1),r)})}return t}},62968:(t,e,r)=>{"use strict";r.d(e,{Z:()=>C});var i=r(99477),n=r(20193),s=r(63133),o=r(73773),a=r(82150),l=r(27313);class c extends i.Mesh{#M=new Map;#S=!0;constructor(t,e,r,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(super(t,e),!n)throw new Error("extent is mandatory to build a TileMesh");this.layer=r,this.extent=n,this.extent.zoom=s,this.level=s,this.material.objectId=this.id,this.obb=this.geometry.OBB.clone(),this.boundingSphere=new i.Sphere,this.obb.box3D.getBoundingSphere(this.boundingSphere);for(const t of r.tileMatrixSets)this.#M.set(t,this.extent.tiledCovering(t));this.frustumCulled=!1,this.matrixAutoUpdate=!1,this.rotationAutoUpdate=!1,this.layerUpdateState={},this.isTileMesh=!0,this.geoidHeight=0,this.link={},Object.defineProperty(this,"visible",{get(){return this.#S},set(t){this.#S!=t&&(this.#S=t,this.dispatchEvent({type:t?"shown":"hidden"}))}})}setBBoxZ(t){t.geoidHeight=(0,l.c)(this.layer)?this.geoidHeight:0,this.obb.updateZ(t),this.horizonCullingPointElevationScaled&&this.horizonCullingPointElevationScaled.setLength(this.obb.z.delta+this.horizonCullingPoint.length()),this.obb.box3D.getBoundingSphere(this.boundingSphere)}getExtentsByProjection(t){return this.#M.get(a.Z.formatToTms(t))}findCommonAncestor(t){if(t)return t.level==this.level?t.id==this.id?t:0!=t.level?this.parent.findCommonAncestor(t.parent):void 0:t.level{c=t})),A.set(l,o,e.level,a),e.extent=r,e.center=t.center(e.extent).clone();let h,u=g.get(a);e.buildIndexAndUv_0=!u,e.builder=t;try{h=(0,f.Z)(e)}catch(t){return Promise.reject(t)}u||(u={},u.index=new i.BufferAttribute(h.index,1),u.uv=new i.BufferAttribute(h.uvs[0],2),g.set(a,u)),h.index=u.index,h.uvs[0]=u.uv,h.position=new i.BufferAttribute(h.position,3),h.normal=new i.BufferAttribute(h.normal,3),e.builder.uvCount>1&&(h.uvs[1]=new i.BufferAttribute(h.uvs[1],1));const p=new d.Z(e,h);return p.OBB=new m.Z(p.boundingBox.min,p.boundingBox.max),p._count=0,p.dispose=()=>{p._count--,p._count<=0&&(p.index=null,delete p.attributes.uv_0,i.BufferGeometry.prototype.dispose.call(p),A.delete(o,e.level,a))},c(p),Promise.resolve({geometry:p,quaternion:n,position:s})}return l.then((t=>({geometry:t,quaternion:n,position:s})))}(n,a).then((t=>{t.geometry._count++;const a=r.tileMatrixSets.length,c=new u.ZP(r.materialOptions,a);(0,y.Z)(c,r);const d=new h(t.geometry,c,r,e,o);if(s&&s.isTileMesh){const e=n.computeSharableExtent(s.extent);t.position.sub(e.position).applyQuaternion(e.quaternion.invert()),t.quaternion.premultiply(e.quaternion)}if(d.position.copy(t.position),d.quaternion.copy(t.quaternion),d.visible=!1,d.updateMatrix(),function(t,e){if(e.diffuse&&(t.material.diffuse=e.diffuse),e.isGlobeLayer){t.horizonCullingPoint=t.extent.center().as("EPSG:4978").toVector3(),t.extent.planarDimensions(v).multiplyScalar(i.MathUtils.DEG2RAD);const e=v.length(),r=Math.abs(1/Math.cos(.5*e));t.horizonCullingPoint.setLength(r*t.horizonCullingPoint.length()),t.horizonCullingPointElevationScaled=t.horizonCullingPoint.clone()}}(d,r),s){d.geoidHeight=s.geoidHeight;const t=(0,l.c)(r)?d.geoidHeight:0;d.setBBoxZ({min:s.obb.z.min,max:s.obb.z.max,geoidHeight:t}),d.material.geoidHeight=t}return d}))}};var b=r(1857),_=r(75963),w=r(66165);const E=new i.Vector3,M=new i.Vector3;class S extends n.Z{constructor(t,e,r,i,n){if(n.cacheLifeTime=p.D.INFINITE,n.source=!1,super(t,e,n),this.isTiledGeometryLayer=!0,this.object3d.geoidHeight=0,this.protocol="tile",this.sseSubdivisionThreshold=this.sseSubdivisionThreshold||1,this.schemeTile=r,this.builder=i,this.info=new s.$(this),!this.schemeTile)throw new Error(`Cannot init tiled layer without schemeTile for layer ${this.id}`);if(!this.builder)throw new Error(`Cannot init tiled layer without builder for layer ${this.id}`);this.level0Nodes=[];const o=[];for(const t of this.schemeTile)o.push(this.convert(void 0,t));this._promises.push(Promise.all(o).then((t=>{this.level0Nodes=t,this.object3d.add(...t),this.object3d.updateMatrixWorld()}))),this.maxScreenSizeNode=this.sseSubdivisionThreshold*(2*_.kE)}pickObjectsAt(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return o.Z.pickTilesAt(t,e,r,this,i)}preUpdate(t,e){if(e.has(void 0)||0==e.size)return this.level0Nodes;t.colorLayers=t.view.getLayers(((t,e)=>e&&e.id==this.id&&t.isColorLayer)),t.elevationLayers=t.view.getLayers(((t,e)=>e&&e.id==this.id&&t.isElevationLayer)),t.maxElevationLevel=-1;for(const e of t.elevationLayers)t.maxElevationLevel=Math.max(e.source.zoom.max,t.maxElevationLevel);let r;-1==t.maxElevationLevel&&(t.maxElevationLevel=1/0),this.colorLayersOrder=w.M.getColorLayersIdOrderedBySequence(t.colorLayers);for(const t of e.values()){if(t.isCamera)return this.level0Nodes;if(t.layer===this){if(r){if(r=t.findCommonAncestor(r),!r)return this.level0Nodes}else r=t;null==r.material&&(r=void 0)}}return r?[r]:this.level0Nodes}update(t,e,r){if(!r.parent)return b.Z.removeChildrenAndCleanup(this,r);if(r.parent.pendingSubdivision)return r.visible=!1,r.material.visible=!1,void this.info.update(r);if(r.visible=!this.culling(r,t.camera),r.visible){let e=!1;return r.material.visible=!0,this.info.update(r),(r.pendingSubdivision||S.hasEnoughTexturesToSubdivide(t,r)&&this.subdivision(t,this,r))&&(this.subdivideNode(t,r),r.material.visible=r.pendingSubdivision,this.info.update(r),e=!0),r.material.visible&&!e?b.Z.removeChildren(this,r):e?r.children.filter((t=>t.layer==this)):void 0}return r.material.visible=!1,this.info.update(r),b.Z.removeChildren(this,r)}convert(t,e){return x.convert(t,e,this)}countColorLayersTextures(){return arguments.length}culling(t,e){return!e.isBox3Visible(t.obb.box3D,t.matrixWorld)}static hasEnoughTexturesToSubdivide(t,e){const r=e.layerUpdateState||{};let i=e.material.getElevationLayer();for(const n of t.elevationLayers){const t=e.getExtentsByProjection(n.crs)[0].zoom;if(!(t>n.zoom.max||tn.zoom.max||tt.layer==this))){const r=e.extent.subdivision();e.pendingSubdivision=!0;const i={view:t.view,requester:e,layer:this,priority:1e4,extentsSource:r,redraw:!1};return t.scheduler.execute(i).then((r=>{for(const t of r)e.add(t),t.updateMatrixWorld(!0);e.pendingSubdivision=!1,t.view.notifyChange(e,!1)}),(t=>{if(e.pendingSubdivision=!1,!t.isCancelledCommandException)throw new Error(t)}))}}subdivision(t,e,r){if(r.level{"use strict";r.r(e),r.d(e,{$3dTilesCulling:()=>Ri.y,$3dTilesSubdivisionControl:()=>Ri.Y0,C3DTBatchTable:()=>Si.Z,C3DTBatchTableHierarchyExtension:()=>Ii,C3DTBoundingVolume:()=>Mi.Z,C3DTExtensions:()=>Ci.Z,C3DTFeature:()=>wi.Z,C3DTILES_LAYER_EVENTS:()=>Ye.y,C3DTilesBoundingVolumeTypes:()=>Ti.D,C3DTilesIonSource:()=>ai,C3DTilesLayer:()=>Ye.Z,C3DTilesSource:()=>oi,C3DTilesTypes:()=>Ti.h,C3DTileset:()=>Ei.Z,CAMERA_TYPE:()=>ee.P,CONTROL_EVENTS:()=>C.Q,CRS:()=>l.Z,CameraCalibrationParser:()=>ar,CameraUtils:()=>Yt.ZP,Capabilities:()=>te.Z,ClassificationScheme:()=>S.wy,ColorLayer:()=>Ce,ColorLayersOrdering:()=>pr.Z,Coordinates:()=>o.Z,DEMUtils:()=>Zt.Z,ElevationLayer:()=>Te,Ellipsoid:()=>c.Z,EntwinePointTileLayer:()=>Mr,EntwinePointTileSource:()=>pi,Extent:()=>s.ZP,FEATURE_TYPES:()=>ct.tg,Feature:()=>ct.ZP,Feature2Mesh:()=>Wt,FeatureCollection:()=>ct.t1,FeatureGeometry:()=>ct.iL,FeatureGeometryLayer:()=>Be,FeatureProcessing:()=>x,FeaturesUtils:()=>qt.Z,Fetcher:()=>d.Z,FileSource:()=>Tr,FirstPersonControls:()=>Z,FlyControls:()=>U,GDFParser:()=>xi.Z,GLOBE_VIEW_EVENTS:()=>h.b,GTXParser:()=>bi.ZP,GeoJsonParser:()=>nr.Z,GeoidGrid:()=>a.Z,GeoidLayer:()=>y.Z,GeometryLayer:()=>Ie.Z,GlobeControls:()=>C.Z,GlobeLayer:()=>fr.Z,GlobeView:()=>h.Z,GpxParser:()=>fi.Z,ISGParser:()=>vi.Z,ImageryLayers:()=>ie.M,KMLParser:()=>mi.Z,LASParser:()=>ui,Label:()=>re.Z,LabelLayer:()=>gr.Z,Layer:()=>ie.Z,MAIN_LOOP_EVENTS:()=>p.Ao,OrientationUtils:()=>bt,OrientedImageCamera:()=>M,OrientedImageLayer:()=>ur,OrientedImageSource:()=>$r,PLANAR_CONTROL_EVENT:()=>ot.uZ,PNTS_MODE:()=>S.vj,PNTS_SHAPE:()=>S.Uz,PNTS_SIZE_MODE:()=>S.E7,PlanarControls:()=>ot.ZP,PlanarLayer:()=>mr.Z,PlanarView:()=>u.Z,PointCloudLayer:()=>ze,PointsMaterial:()=>S.ZP,PotreeLayer:()=>Ze,PotreeSource:()=>ni,REVISION:()=>Bi,STRATEGY_DICHOTOMY:()=>dr.ET,STRATEGY_GROUP:()=>dr.AE,STRATEGY_MIN_NETWORK_TRAFFIC:()=>dr.R3,STRATEGY_PROGRESSIVE:()=>dr.c,ShaderChunk:()=>Kt,ShapefileParser:()=>yi,Source:()=>Sr.ZP,StreetControls:()=>st,Style:()=>_t.ZP,THREE:()=>i,TMSSource:()=>Lr,TiledGeometryLayer:()=>Xe.Z,VIEW_EVENTS:()=>f.b,VectorTilesSource:()=>Jr,View:()=>f.Z,WFSSource:()=>Dr,WMSSource:()=>kr,WMTSSource:()=>Ur,colorLayerEffects:()=>$t.pO,ellipsoidSizes:()=>c.c,enableDracoLoader:()=>_i.qw,enableKtx2Loader:()=>_i.hu,getMaxColorSamplerUnitsCount:()=>$t.dn,glTFLoader:()=>_i.zL,legacyGLTFLoader:()=>_i.mp,process3dTilesNode:()=>Ri.Ti,proj4:()=>n.default,updateLayeredMaterialNodeElevation:()=>b.pN,updateLayeredMaterialNodeImagery:()=>b.XP});var i=r(99477),n=r(24472),s=r(99128),o=r(60145),a=r(67503),l=r(82150),c=r(16828),h=r(91742),u=r(48682),d=r(33347),p=r(49469),f=r(36873),m=r(52872),g=r(1857),A=r(13324),y=r(27313);const v=new o.Z("EPSG:4326",0,0,0),x={update(t,e,r){if(!r.parent&&r.children.length)return void g.Z.removeChildrenAndCleanupRecursively(e,r);if(!r.visible)return;if(void 0===r.layerUpdateState[e.id])r.layerUpdateState[e.id]=new m.Z;else if(!r.layerUpdateState[e.id].canTryUpdate()){var i;return void(null===(i=r.link[e.id])||void 0===i||i.forEach((t=>{t.layer.object3d.add(t),t.meshes.position.z=(0,y.c)(e.parent)?r.geoidHeight:0,t.meshes.updateMatrixWorld()})))}const n=r.getExtentsByProjection(e.source.crs)||[r.extent],s=n[0].zoom;if(s!=e.zoom.min||!this.source.extentInsideLimit(r.extent,s)||e.source.isFileSource&&!r.extent.isPointInside(e.source.extent.center(v)))return void r.layerUpdateState[e.id].noMoreUpdatePossible();r.layerUpdateState[e.id].newTry();const o={layer:e,extentsSource:n,view:t.view,requester:r};return t.scheduler.execute(o).then((i=>{r.layerUpdateState[e.id].noMoreUpdatePossible(),i.forEach((i=>{i?(r.link[e.id]=r.link[e.id]||[],i.as(t.view.referenceCrs),i.meshes.position.z=(0,y.c)(e.parent)?r.geoidHeight:0,i.updateMatrixWorld(),e.onMeshCreated&&e.onMeshCreated(i,t),r.parent?(e.object3d.add(i),r.link[e.id].push(i)):g.Z.removeChildrenAndCleanupRecursively(e,i),i.layer=e):r.layerUpdateState[e.id].failure(1,!0)}))}),(i=>(0,A.Z)(i,r,e,r.level,t.view)))}};var b=r(75963);class _{constructor(t){this.size=t,this.pps=null,this.polynom=null,this.l1l2=null}setFromMicmacCalibration(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.pps=(new i.Vector2).fromArray(t.pps),this.polynom=(new i.Vector4).fromArray(t.poly357),this.l1l2=new i.Vector3,this.pps.y=e?this.size.y-this.pps.y:this.pps.y,this.polynom.w=t.limit**2,t.l1l2&&(this.l1l2.fromArray(t.l1l2),this.l1l2.z=t.etats)}clone(){const t=new _(this.size.clone());return t.pps=this.pps.clone(),t.polynom=this.polynom.clone(),t.l1l2=this.l1l2.clone(),t}}const w=new i.Vector3;class E extends i.PerspectiveCamera{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e4,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;t=t.isVector2?t:new i.Vector2(t,t),a=a||t.x/t.y,super(void 0,a,n,s),this.size=t,this.focal=e.isVector2?e:new i.Vector2(e,e),this.center=r||t.clone().multiplyScalar(.5),this.skew=o||0,this.textureMatrixWorldInverse=new i.Matrix4,Object.defineProperty(this,"fov",{get:()=>2*i.MathUtils.radToDeg(Math.atan2(this.size.y,2*this.focal.y)),set:t=>{const e=.5*this.size.y/Math.tan(i.MathUtils.degToRad(.5*t));this.focal.x=e,this.focal.y=e}}),this.distortion=new _(this.size),this.maskPath=void 0,this.mask=void 0,this.updateProjectionMatrix()}updateProjectionMatrix(){if(!this.focal)return;const t=this.near,e=t/this.focal.x,r=t/this.focal.y,i=-e*this.center.x,n=-r*this.center.y,s=i+e*this.size.x,o=n+r*this.size.y;this.projectionMatrix.makePerspective(i,s,o,n,t,this.far),this.projectionMatrix.elements[4]=2*this.skew/this.size.x;const a=this.size.x/this.size.y,l=this.aspect/a;w.set(this.zoom,this.zoom,1),l>1?w.x/=l:w.y*=l,this.projectionMatrix.scale(w)}copy(t,e){return super.copy(t,e),this.size=t.size.clone(),this.focal=t.focal.clone(),this.center=t.center.clone(),this.distortion=t.distortion.clone(),this.textureMatrixWorldInverse=t.textureMatrixWorldInverse.clone(),this.skew=t.skew,this.maskPath=t.maskPath,this.mask=t.mask,this}}const M=E;var S=r(32204),C=r(11925);const T={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"rotateZ",sign:1,noSpeed:!0},34:{method:"rotateZ",sign:-1,noSpeed:!0},wheelup:{method:"translateZ",sign:1,oneshot:!0},wheeldown:{method:"translateZ",sign:-1,oneshot:!0}};function I(t){t.preventDefault(),this._isMouseDown=!0;const e=this.view.eventToViewCoords(t);this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y}function R(t){t.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=t.touches[0].pageX,this._onMouseDownMouseY=t.touches[0].pageY}function B(t){if(!0===this._isMouseDown){const e=this.view.eventToViewCoords(t),r=i.MathUtils.degToRad(this._camera3D.fov)/this.view.mainLoop.gfxEngine.height;this._camera3D.rotateY((e.x-this._onMouseDownMouseX)*r),this._camera3D.rotateX((e.y-this._onMouseDownMouseY)*r),this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y,this.view.notifyChange(this._camera3D,!1)}}function L(){this._isMouseDown=!1}function P(t){const e=T[t.keyCode];e&&(this.moves.delete(e),t.preventDefault())}function D(t){const e=T[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(this._camera3D,!1),t.preventDefault())}function O(t){-t.deltaY<0?this.moves.add(T.wheelup):this.moves.add(T.wheeldown),this.view.notifyChange(this._camera3D,!1)}class k extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.options=e,this._camera3D=t.camera3D,this.moves=new Set,this.moveSpeed=10,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._isMouseDown=!1,t.domElement.addEventListener("mousedown",I.bind(this),!1),t.domElement.addEventListener("touchstart",R.bind(this),!1);const r=B.bind(this);t.domElement.addEventListener("mousemove",r,!1),t.domElement.addEventListener("touchmove",r,!1),t.domElement.addEventListener("mouseup",L.bind(this),!1),t.domElement.addEventListener("touchend",L.bind(this),!1),t.domElement.addEventListener("wheel",O.bind(this),!1),t.domElement.addEventListener("keyup",P.bind(this),!0),t.domElement.addEventListener("keydown",D.bind(this),!0),this.view.addFrameRequester(p.Ao.AFTER_CAMERA_UPDATE,this.update.bind(this)),e.focusOnMouseOver&&t.domElement.addEventListener("mouseover",(()=>t.domElement.focus())),e.focusOnClick&&t.domElement.addEventListener("click",(()=>t.domElement.focus()))}isUserInteracting(){return 0!==this.moves.size||this._isMouseDown}update(t,e){e&&(t=16);for(const e of this.moves)this._camera3D[e.method](e.sign*(e.noSpeed?1:this.moveSpeed)*t/1e3);if(this.moves.size>0||this._isMouseDown){this.view.notifyChange(this._camera3D);for(const t of this.moves)t.oneshot&&this.moves.delete(t)}}}const U=k;function N(t,e,r){const n=.5*i.MathUtils.degToRad(r-t.fov);return i.MathUtils.clamp(e,-n,n)}const F=new i.Vector3(0,1,0);function z(t,e,r){e.quaternion.setFromUnitVectors(F,e.up),e.rotateY(r.rotateY),e.rotateX(r.rotateX),t.notifyChange(t.camera3D)}const G={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"translateY",sign:1},34:{method:"translateY",sign:-1}};function Q(t){this.camera.position.z+=t}const j=new i.Vector3,V=new i.Quaternion,H=new i.Euler(0,0,0,"YXZ");function W(t){j.copy(this.camera.position),j.normalize(),this.camera.position.add(j.multiplyScalar(t))}class q extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.isFirstPersonControls=!0,this.camera=t.camera3D,this.view=t,this.moves=new Set,e.panoramaRatio){const t=200*e.panoramaRatio/(2*Math.PI);e.verticalFOV=2==e.panoramaRatio?180:i.MathUtils.radToDeg(2*Math.atan(200/(2*t)))}e.verticalFOV=e.verticalFOV||180,e.moveSpeed=void 0===e.moveSpeed?10:e.moveSpeed,this.options=e,this._isMouseDown=!1,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._state={rotateX:0,rotateY:0,snapshot(){return{rotateX:this.rotateX,rotateY:this.rotateY}}},this.reset(),this.eventListeners=e.disableEventListeners,e.disableEventListeners||(this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseUp=this.onMouseUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onContextMenu=this.onContextMenu.bind(this),t.domElement.addEventListener("mousedown",this._onMouseDown,!1),t.domElement.addEventListener("touchstart",this._onMouseDown,!1),t.domElement.addEventListener("mousemove",this._onMouseMove,!1),t.domElement.addEventListener("touchmove",this._onMouseMove,!1),t.domElement.addEventListener("mouseup",this._onMouseUp,!1),t.domElement.addEventListener("touchend",this._onMouseUp,!1),t.domElement.addEventListener("wheel",this._onMouseWheel,!1),t.domElement.addEventListener("contextmenu",this._onContextMenu,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)),this.view.addFrameRequester(p.Ao.AFTER_CAMERA_UPDATE,this.update.bind(this)),this._onFocus=()=>t.domElement.focus(),this.focusOnMouseOver=e.focusOnMouseOver,e.focusOnMouseOver&&t.domElement.addEventListener("mouseover",this._onFocus),this.focusOnClick=e.focusOnClick,e.focusOnClick&&t.domElement.addEventListener("click",this._onFocus),"EPSG:4978"==t.referenceCrs?this.moveCameraVertical=W:this.moveCameraVertical=Q}isUserInteracting(){return 0!==this.moves.size&&!this._isMouseDown}reset(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];V.setFromUnitVectors(F,this.camera.up),V.invert(),V.multiply(this.camera.quaternion),H.setFromQuaternion(V),t||(this._state.rotateX=H.x),this._state.rotateY=H.y}update(t,e,r){if(0!=this.enabled){e&&(t=16);for(const e of this.moves)"translateY"===e.method?this.moveCameraVertical(e.sign*this.options.moveSpeed*t/1e3):this.camera[e.method](e.sign*this.options.moveSpeed*t/1e3);!0!==this._isMouseDown&&!0!==r||z(this.view,this.camera,this._state),this.moves.size&&this.view.notifyChange(this.camera)}}onMouseDown(t){if(0==this.enabled)return;this._isMouseDown=!0;const e=this.view.eventToViewCoords(t);this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y,this._stateOnMouseDown=this._state.snapshot()}onMouseUp(){0!=this.enabled&&(this._isMouseDown=!1)}onMouseMove(t){if(0!=this.enabled&&!0===this._isMouseDown){const e=i.MathUtils.degToRad(this.camera.fov)/this.view.mainLoop.gfxEngine.height,r=this.view.eventToViewCoords(t);this._state.rotateY=(r.x-this._onMouseDownMouseX)*e+this._stateOnMouseDown.rotateY,this._state.rotateX=N(this.camera,(r.y-this._onMouseDownMouseY)*e+this._stateOnMouseDown.rotateX,this.options.verticalFOV),z(this.view,this.camera,this._state)}}onMouseWheel(t){if(0==this.enabled)return;const e=t.deltaY;this.camera.fov=i.MathUtils.clamp(this.camera.fov+Math.sign(e),10,Math.min(100,this.options.verticalFOV)),this.camera.updateProjectionMatrix(),this._state.rotateX=N(this.camera,this._state.rotateX,this.options.verticalFOV),z(this.view,this.camera,this._state)}onKeyUp(t){if(0==this.enabled)return;const e=G[t.keyCode];e&&(this.moves.delete(e),this.view.notifyChange(void 0,!1),t.preventDefault())}onKeyDown(t){if(0==this.enabled)return;const e=G[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(void 0,!1),t.preventDefault())}onContextMenu(t){t.preventDefault()}dispose(){this.eventListeners||(this.view.domElement.removeEventListener("mousedown",this._onMouseDown,!1),this.view.domElement.removeEventListener("touchstart",this._onMouseDown,!1),this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("touchmove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("touchend",this._onMouseUp,!1),this.view.domElement.removeEventListener("wheel",this._onMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._onContextMenu,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)),this.focusOnMouseOver&&this.view.domElement.removeEventListener("mouseover",this._onFocus),this.focusOnClick&&this.view.domElement.removeEventListener("click",this._onFocus),this.dispatchEvent({type:"dispose"})}}const Z=q;var Y=r(36194);const X=new i.MeshBasicMaterial({color:16777215,depthTest:!1,transparent:!0,opacity:.5});function J(t,e,r){t.position.copy(e),t.up.copy(e).normalize(),t.lookAt(r),t.updateMatrixWorld(!0)}const K=new i.Vector3,$=new i.Vector3,tt=new i.Matrix3,et=new i.Vector3,rt=new i.Quaternion;function it(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{},n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{};e.getPickingPositionFromDepth(e.eventToViewCoords(t),K);const o=e.camera3D.position.distanceTo(K),a=r?e.pickObjectsAt(t,-1,r):[];a.length&&a[0].distance1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.isStreetControls=!0,this._onMouseOut=super.onMouseUp.bind(this),t.domElement.addEventListener("mouseout",this._onMouseOut),this.previousPosition=void 0,this.currentPosition=void 0,this.nextPosition=void 0,this.keyGoToNextPosition=90,this.keyGoToPreviousPosition=83,this.keySetCameraToCurrentPositionAndLookAtNext=65,this.keySetCameraToCurrentPositionAndLookAtPrevious=81,this.tweenGroup=new Y.ZP.Group,this.surfaceGround=e.surfaceGround||function(){const t=new i.CircleGeometry(1,32);return new i.Mesh(t,X)}(),this.surfaceWall=e.surfaceWall||function(){const t=new i.PlaneGeometry(4,2,1),e=new i.Mesh(t,X);return e.rotateX(.5*-Math.PI),e}(),this.surfaces=new i.Object3D,this.surfaces.add(this.surfaceGround),this.surfaces.add(this.surfaceWall),this.view.scene.add(this.surfaces),this.wallMaxDistance=e.wallMaxDistance||1e3,this.animationDurationWall=e.animationDurationWall||200,this.buildingsLayer=e.buildingsLayer,this.computeTime=e.computeTime||nt,this.offset=e.offset||4,this.transformationPositionPickOnTheGround=e.transformationPositionPickOnTheGround||(t=>t),this.end=this.camera.clone()}setCurrentPosition(t){this.currentPosition=t}setNextPosition(t){this.nextPosition=t}setPreviousPosition(t){this.previousPosition=t}onMouseUp(t){0!=this.enabled&&(super.onMouseUp(),this._stateOnMouseDrag?this._stateOnMouseDrag=!1:it(t,this.view,this.buildingsLayer,this.onClickOnGround.bind(this),this.onClickOnWall.bind(this)))}onMouseMove(t){0!=this.enabled&&(super.onMouseMove(t),this._isMouseDown?(this._stateOnMouseDrag=!0,this.stopAnimations()):this.tween||(it(t,this.view,this.buildingsLayer,((t,e)=>{J(this.surfaces,t,e),this.surfaceGround.visible=!0,this.surfaceWall.visible=!1}),((t,e)=>{J(this.surfaces,t,e),this.surfaceWall.visible=!0,this.surfaceGround.visible=!1})),this.view.notifyChange(this.surfaces)))}setCameraToCurrentPosition(t){t?this.setCameraOnPosition(this.currentPosition,this.previousPosition):this.setCameraOnPosition(this.currentPosition,this.nextPosition)}setCameraOnPosition(t,e){t&&e&&(this.camera.position.copy(t),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?this.camera.up.copy(t).normalize():this.camera.up.set(0,0,1),this.camera.lookAt(e),this.camera.updateMatrixWorld(),this.reset())}onClickOnGround(t){t=this.transformationPositionPickOnTheGround(t),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?et.copy(t).normalize():et.set(0,0,1),t.add(et.multiplyScalar(this.offset));const e=this.camera.position.distanceTo(t),r=this.computeTime(e);this.moveCameraTo(t,r)}onClickOnWall(t){this.camera.position.distanceTo(t){this.stopAnimations()})).onUpdate((t=>{this.camera.quaternion.slerpQuaternions(rt,this.end.quaternion,t.t)})).start(),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.reset(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera)}moveCameraTo(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;if(!t)return Promise.resolve();const i=new Promise((t=>{e=t}));return this.stopAnimations(),this.tween=new Y.ZP.Tween(this.camera.position,this.tweenGroup).to(t.clone(),r).easing(Y.ZP.Easing.Quadratic.Out).onComplete((()=>{this.stopAnimations(),e()})).start(),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera),i}stopAnimations(){this.tween&&(this.tween.stop(),this.tween=void 0),this.animationFrameRequester&&(this.view.removeFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.animationFrameRequester=null)}moveCameraToCurrentPosition(){this.moveCameraTo(this.currentPosition)}onKeyDown(t){0!=this.enabled&&(super.onKeyDown(t),t.keyCode==this.keyGoToNextPosition&&this.moveCameraTo(this.nextPosition),t.keyCode==this.keyGoToPreviousPosition&&this.moveCameraTo(this.previousPosition),t.keyCode==this.keySetCameraToCurrentPositionAndLookAtNext&&(this.setCameraToCurrentPosition(),this.view.notifyChange(this.view.camera3D)),t.keyCode==this.keySetCameraToCurrentPositionAndLookAtPrevious&&(this.setCameraToCurrentPosition(!0),this.view.notifyChange(this.view.camera3D)))}dispose(){this.view.domElement.removeEventListener("mouseout",this._onMouseOut,!1),super.dispose()}};var ot=r(44450),at=r(9187),lt=r.n(at),ct=r(94596),ht=r(52521),ut=r(86896);const dt=i.MathUtils.DEG2RAD,pt=new i.Matrix4,ft=new i.Vector3,mt=new i.Vector3,gt=(new i.Vector3).set(0,0,1),At=new o.Z("EPSG:4326",0,0,0),yt=new i.Euler,vt=new i.Quaternion;function xt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return t?e.set(0,0,0,1):xt}const bt={quaternionFromRollPitchHeading(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;return t*=dt,e*=dt,r*=dt,n.setFromEuler(yt.set(-e,-t,-r,"YXZ"))},quaternionFromOmegaPhiKappa(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;return t*=dt,e*=dt,r*=dt,n.setFromEuler(yt.set(t,e,r,"XYZ")),n.set(n.w,n.z,-n.y,-n.x),n},quaternionFromAttitude(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return void 0!==t.roll||void 0!==t.pitch||void 0!==t.heading?this.quaternionFromRollPitchHeading(t.roll,t.pitch,t.heading,e):void 0!==t.omega||void 0!==t.phi||void 0!==t.kappa?this.quaternionFromOmegaPhiKappa(t.omega,t.phi,t.kappa,e):e.set(0,0,0,1)},quaternionFromEnuToGeocent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return t?this.quaternionFromEnuToGeocent()(t,e):function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;const r=t.geodesicNormal;return 0==r.x&&0==r.y?e.set(0,0,0,1):(mt.set(-r.y,r.x,0).normalize(),ft.crossVectors(r,mt),pt.makeBasis(mt,ft,r),e.setFromRotationMatrix(pt))}},quaternionFromGeocentToEnu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;if(t)return this.quaternionFromGeocentToEnu()(t,e);const r=this.quaternionFromEnuToGeocent();return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return r(t,e).conjugate()}},quaternionFromLCCToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromLCCToEnu(t)(e,r);const n=Math.sin(t.lat0);return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;const s=e.as(At.crs,At).longitude*dt;return r.setFromAxisAngle(gt,n*(t.long0-s))}},quaternionFromEnuToLCC(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToLCC(t)(e,r);const n=this.quaternionFromLCCToEnu(t);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return n(t,e).conjugate()}},quaternionFromTMercToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromTMercToEnu(t)(e,r);const n=t.a*t.a,s=t.b*t.b,o=t.e*t.e,a=t.e?o/(1-o):n/s-1;return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;e.as(At.crs,At);const n=At.longitude*dt,s=At.latitude*dt,o=t.long0-n,l=Math.cos(s),c=Math.sin(s),h=l*l,u=o*o*h,d=a*h;return r.setFromAxisAngle(gt,o*c*(1+u/3*(1+3*d+2*d*d)+u*u*(2-c/l)/15))}},quaternionFromEnuToTMerc(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToTMerc(t)(e,r);const n=this.quaternionFromTMercToEnu(t);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return n(t,e).conjugate()}},quaternionFromLongLatToEnu(t){return xt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion)},quaternionFromEnuToLongLat(t){return xt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion)},quaternionUnimplemented(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;return console.warn("This quaternion function is not implemented for projections of type",t.projName),xt(e,r)},quaternionFromEnuToCRS(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToCRS(t)(e,r);const s=t.projName?t:n.default.defs(t);switch(s.projName){case"geocent":return this.quaternionFromEnuToGeocent();case"lcc":return this.quaternionFromEnuToLCC(s);case"tmerc":return this.quaternionFromEnuToTMerc(s);case"longlat":return this.quaternionFromEnuToLongLat();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromCRSToEnu(t)(e,r);const s=t.projName?t:n.default.defs(t);switch(s.projName){case"geocent":return this.quaternionFromGeocentToEnu();case"lcc":return this.quaternionFromLCCToEnu(s);case"tmerc":return this.quaternionFromTMercToEnu(s);case"longlat":return this.quaternionFromLongLatToEnu();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToCRS(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;if(r)return this.quaternionFromCRSToCRS(t,e)(r,n);if(t==e)return function(){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion).set(0,0,0,1)};const s=this.quaternionFromCRSToEnu(t),o=this.quaternionFromEnuToCRS(e);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return o(t,e).multiply(s(t,vt))}}};var _t=r(48891);const wt=new o.Z("EPSG:4326",0,0,0),Et=new _t.uP,Mt=new _t.ZP;let St;const Ct=new i.Vector2,Tt=new i.Vector2,It=new i.Vector3,Rt=new i.Vector3,Bt=new i.Vector3,Lt=new i.Vector3,Pt=new s.ZP("EPSG:4326",0,0,0,0),Dt=new i.Color,Ot=255,kt=65535,Ut="EPSG:4326";class Nt extends i.Group{#C;#T;#I=new i.Group;#R=new i.Group;constructor(t,e){super(),this.meshes=(new i.Group).add(...t),this.#I=(new i.Group).add(this.meshes),this.#I.quaternion.copy(e.quaternion),this.#I.position.copy(e.position),"EPSG:4978"==e.crs?It.copy(e.center.geodesicNormal):It.set(0,0,1),It.multiplyScalar(e.center.z),this.#I.position.sub(It),this.#I.scale.copy(e.scale),this.#I.updateMatrix(),this.#T=e.crs,this.#C=this.#T,this.extent=e.extent,this.add(this.#R.add(this.#I))}as(t){if(this.#C!==t)if(this.#C=t,t==this.#T)this.place.position.set(0,0,0),this.position.set(0,0,0),this.scale.set(1,1,1),this.quaternion.identity();else{wt.crs=l.Z.formatToEPSG(this.#T),Pt.copy(this.extent).applyMatrix4(this.#I.matrix),Pt.as(wt.crs,Pt),Pt.spatialEuclideanDimensions(Ct),Pt.planarDimensions(Tt),Tt.x&&Tt.y&&this.scale.copy(Ct).divide(Tt).setZ(1),this.#R.position.copy(this.#I.position).negate(),wt.setFromVector3(this.#I.position);const e="EPSG:3857"==this.#T?Ut:this.#T;bt.quaternionFromCRSToCRS(e,t)(wt.as(Ut),this.quaternion),wt.as(t,wt).toVector3(this.position)}return this}}function Ft(t){return t?"Color"==t.type?t:Dt.set(t):Dt.set(16777215*Math.random())}function zt(t,e){return e<=Ot?new Uint8Array(t):e<=kt?new Uint16Array(t):new Uint32Array(t)}function Gt(t,e,r,i,n){const s=t.length;t.length+=6*(i-1);for(let o=r,a=s;oe);let a=0;const l=new Float32Array(r);Lt.setFromMatrixScale(Et.collection.matrixWorldInverse),It.set(0,0,1).multiply(Lt);const c=[];Et.setFeature(t);for(const e of t.geometries){const r=e.indices[0].offset,i=e.indices[0].count,h=o(e.properties,a);Et.setGeometry(e);for(let e=3*r,o=r;o1&&console.warn("Too many differents point.radius, only the first one will be used"),new i.Points(h,e.pointMaterial)}function jt(t,e,r){const i=(e*=3)+3*r;let n=0;for(let r=i-3,s=e;s{t instanceof i.Mesh&&(t.updateMatrixWorld(),t.geometry.applyMatrix4(t.matrixWorld),e.push(t))})),e}(n).forEach((i=>t.add(Vt(i,r,e)))),t}throw new Error("The format of the model object provided in the style (layer.style.point.model.object) is not supported. Only THREE.Mesh or THREE.Object3D are supported.")}(t),s.isInstancedMesh=!0}catch(r){s=Qt(t,e)}else s=Qt(t,e);break;case ct.tg.LINE:s=function(t,e){const r=t.vertices,n=new Uint8Array(r.length),s=r.length/3,o=new Uint32Array(s),a=e.batchId||((t,e)=>e);let l=0;const c=new Float32Array(r.length),h=new i.BufferGeometry;h.setAttribute("position",new i.BufferAttribute(c,3));const u=[];Et.setFeature(t);const d=zt(2*(s-t.geometries.length),s);let p=0;Lt.setFromMatrixScale(Et.collection.matrixWorldInverse),It.set(0,0,1).multiply(Lt);for(const e of t.geometries){Et.setGeometry(e);const r=a(e.properties,l),i=e.indices[0].offset;if(i>65535){console.warn("Feature to Line: integer overflow, too many points in lines");break}const s=i+e.indices[0].count;for(let e=3*i,a=i;a1&&console.warn("Too many differents stroke.width, only the first one will be used"),h.setAttribute("color",new i.BufferAttribute(n,3,!0)),h.setAttribute("batchId",new i.BufferAttribute(o,1)),h.setIndex(new i.BufferAttribute(d,1)),new i.LineSegments(h,e.lineMaterial)}(t,e);break;case ct.tg.POLYGON:s=St.fill&&Object.keys(St.fill).includes("extrusion_height")?function(t,e){const r=t.vertices,n=new Float32Array(2*r.length),s=r.length/3,o=new Uint8Array(2*r.length),a=[],l=new Uint32Array(n.length/3),c=e.batchId||((t,e)=>e);let h=0;Et.setFeature(t),Lt.setFromMatrixScale(Et.collection.matrixWorldInverse),It.set(0,0,1).multiply(Lt),wt.setCrs(Et.collection.crs);for(const e of t.geometries){Et.setGeometry(e);const i=e.indices[0].offset,u=e.indices.slice(-1)[0],d=u.offset+u.count,p=d-i,f=e.indices[0].ccw??jt(r,i,p)<0,m=3*i,g=i+s,A=c(e.properties,h);for(let e=m,a=m+r.length,c=i;et.offset-i)).slice(1),x=lt()(y,v,3),b=a.length;a.length+=x.length;for(let t=0;te);Et.setFeature(t),Lt.setFromMatrixScale(Et.collection.matrixWorldInverse),It.set(0,0,1).multiply(Lt);let l=0;for(const e of t.geometries){const i=e.indices[0].offset;if(i>4294967295){console.warn("Feature to Polygon: integer overflow, too many points in polygons");break}Et.setGeometry(e);const c=e.indices.slice(-1)[0],h=c.offset+c.count,u=3*i,d=a(e.properties,l);for(let e=u,s=i;et.offset-i)).slice(1),m=lt()(p,f,3),g=s.length;s.length+=m.length;for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};return(0,ut.ie)(t),function(e){if(!e)return;t.pointMaterial||(t.pointMaterial=(0,ht.Z)(new i.PointsMaterial,this),t.lineMaterial=(0,ht.Z)(new i.LineBasicMaterial,this),t.polygonMaterial=(0,ht.Z)(new i.MeshBasicMaterial,this)),St=(null==this?void 0:this.style)||(t.style?new _t.ZP(t.style):Mt),Et.setCollection(e);const r=e.features;if(!r||0==r.length)return;const n=r.map((e=>{const r=Ht(e,t);return r.layer=this,r}));return new Nt(n,e)}}};var qt=r(39683),Zt=r(79295),Yt=r(4596);const Xt={color_layers_pars_fragment:"struct Layer {\n int textureOffset;\n int crs;\n int effect_type;\n float effect_parameter;\n float opacity;\n bool transparent;\n};\n\n#include \n\nuniform sampler2D colorTextures[NUM_FS_TEXTURES];\nuniform vec4 colorOffsetScales[NUM_FS_TEXTURES];\nuniform Layer colorLayers[NUM_FS_TEXTURES];\nuniform int colorTextureCount;\n\nvec3 uvs[NUM_CRS];\n\nfloat getBorderDistance(vec2 uv) {\n vec2 p2 = min(uv, 1. -uv);\n return min(p2.x, p2.y);\n}\n\nfloat tolerance = 0.99;\n\nvec4 applyWhiteToInvisibleEffect(vec4 color) {\n float a = dot(color.rgb, vec3(0.333333333));\n if (a >= tolerance) {\n color.a = 0.0;\n }\n return color;\n}\n\nvec4 applyLightColorToInvisibleEffect(vec4 color, float intensity) {\n float a = max(0.05,1. - length(color.xyz - 1.));\n color.a *= 1.0 - pow(abs(a), intensity);\n color.rgb *= color.rgb * color.rgb;\n return color;\n}\n\n#if defined(DEBUG)\nuniform bool showOutline;\nuniform vec3 outlineColors[NUM_CRS];\nuniform float outlineWidth;\n\nvec4 getOutlineColor(vec3 outlineColor, vec2 uv) {\n float alpha = 1. - clamp(getBorderDistance(uv) / outlineWidth, 0., 1.);\n return vec4(outlineColor, alpha);\n}\n#endif\n\nuniform float minBorderDistance;\nvec4 getLayerColor(int textureOffset, sampler2D tex, vec4 offsetScale, Layer layer) {\n if ( textureOffset >= colorTextureCount ) return vec4(0);\n\n vec3 uv;\n // #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++ ) {\n if ( i == layer.crs ) uv = uvs[ i ];\n }\n\n float borderDistance = getBorderDistance(uv.xy);\n if (textureOffset != layer.textureOffset + int(uv.z) || borderDistance < minBorderDistance ) return vec4(0);\n vec4 color = texture2D(tex, pitUV(uv.xy, offsetScale));\n if (layer.effect_type == 3) {\n #include \n } else {\n if (layer.transparent && color.a != 0.0) {\n color.rgb /= color.a;\n }\n\n if (layer.effect_type == 1) {\n color = applyLightColorToInvisibleEffect(color, layer.effect_parameter);\n } else if (layer.effect_type == 2) {\n color = applyWhiteToInvisibleEffect(color);\n }\n }\n color.a *= layer.opacity;\n return color;\n}\n",custom_body_colorLayer:"// no custom body",custom_header_colorLayer:"// no custom header",elevation_pars_vertex:"#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n uniform float geoidHeight;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n #if defined(WEBGL2)\n return texture2D( tex, uv ).r;\n #else\n return texture2D( tex, uv ).w;\n #endif\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = clamp(getElevationMode(uv, tex, layer.mode), layer.zmin, layer.zmax);\n return d * layer.scale + layer.bias;\n }\n#endif\n",elevation_vertex:"#if NUM_VS_TEXTURES > 0\n if(elevationTextureCount > 0) {\n float elevation = getElevation(uv, elevationTextures[0], elevationOffsetScales[0], elevationLayers[0]);\n transformed += elevation * normal;\n }\n#endif\n",geoid_vertex:"transformed += geoidHeight * normal;\n",fog_fragment:"#if defined(USE_FOG)\n float fogFactor = 1. - min( exp(-vFogDepth / fogDistance), 1.);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n",fog_pars_fragment:"#if defined(USE_FOG)\nuniform vec3 fogColor;\nuniform float fogDistance;\nvarying float vFogDepth;\n#endif\n",lighting_fragment:"if (lightingEnabled) {\n float light = min(2. * dot(vNormal, lightPosition), 1.);\n gl_FragColor.rgb *= light;\n}\n",lighting_pars_fragment:"uniform bool lightingEnabled;\nuniform vec3 lightPosition;\nvarying vec3 vNormal;\n",mode_depth_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\ngl_FragColor = packDepthToRGBA(gl_FragDepthEXT);\n#else\nfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\ngl_FragColor = packDepthToRGBA(fragCoordZ);\n#endif",mode_id_fragment:"// 16777216.0 == 256.0 * 256.0 * 256.0\ngl_FragColor = packDepthToRGBA(float(objectId) / 16777216.0);\n",mode_pars_fragment:"#if MODE == MODE_ID || MODE == MODE_DEPTH\n#include \n#endif\n\n#if MODE == MODE_ID\nuniform int objectId;\n#endif\n",overlay_fragment:"gl_FragColor.rgb = mix(gl_FragColor.rgb, overlayColor, overlayAlpha);\n",overlay_pars_fragment:"uniform vec3 overlayColor;\nuniform float overlayAlpha;\n",pitUV:"vec2 pitUV(vec2 uv, vec4 pit)\n{\n return uv * pit.zw + vec2(pit.x, 1.0 - pit.w - pit.y);\n}\n\n",precision_qualifier:"precision highp float;\nprecision highp int;\n",projective_texturing_vertex:"for(int i = 0; i < ORIENTED_IMAGES_COUNT; ++i)\n projectiveTextureCoords[i] = projectiveTextureMatrix[i] * mvPosition;\n",projective_texturing_pars_vertex:"uniform mat4 projectiveTextureMatrix[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\n",projective_texturing_pars_fragment:"uniform sampler2D projectiveTexture[ORIENTED_IMAGES_COUNT];\nuniform sampler2D mask[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\nuniform float projectiveTextureAlphaBorder;\nuniform float opacity;\nuniform bool boostLight;\n\nstruct Distortion {\n vec2 size;\n#if USE_DISTORTION\n vec2 pps;\n vec4 polynom;\n vec3 l1l2;\n#endif\n};\n\nuniform Distortion projectiveTextureDistortion[ORIENTED_IMAGES_COUNT];\n\nfloat getAlphaBorder(vec2 p)\n{\n vec2 d = clamp(projectiveTextureAlphaBorder * min(p, 1. - p), 0., 1.);\n return min(d.x, d.y);\n}\n\n#if USE_DISTORTION\nvoid distort(inout vec2 p, vec4 polynom, vec2 pps)\n{\n vec2 v = p - pps;\n float v2 = dot(v, v);\n if (v2 > polynom.w) {\n p = vec2(-1.);\n }\n else {\n p += (v2 * (polynom.x + v2 * (polynom.y + v2 * polynom.z) ) ) * v;\n }\n}\n\nvoid distort(inout vec2 p, vec4 polynom, vec3 l1l2, vec2 pps)\n{\n if ((l1l2.x == 0.) && (l1l2.y == 0.)) {\n distort(p, polynom, pps);\n } else {\n vec2 AB = (p - pps) / l1l2.z;\n float R = length(AB);\n float lambda = atan(R) / R;\n vec2 ab = lambda * AB;\n float rho2 = dot(ab, ab);\n float r357 = 1. + rho2* (polynom.x + rho2* (polynom.y + rho2 * polynom.z));\n p = pps + l1l2.z * (r357 * ab + vec2(dot(l1l2.xy, ab), l1l2.y * ab.x));\n }\n}\n#endif\n\nvec4 mixBaseColor(vec4 aColor, vec4 baseColor) {\n #ifdef USE_BASE_MATERIAL\n baseColor.rgb = aColor.a == 1.0 ? aColor.rgb : mix(baseColor, aColor, aColor.a).rgb;\n baseColor.a = min(1.0, aColor.a + baseColor.a);\n #else\n baseColor.rgb += aColor.rgb * aColor.a;\n baseColor.a += aColor.a;\n #endif\n return baseColor;\n}\n\nvec4 projectiveTextureColor(vec4 coords, Distortion distortion, sampler2D tex, sampler2D mask, vec4 baseColor) {\n vec3 p = coords.xyz / coords.w;\n if(p.z * p.z < 1.) {\n#if USE_DISTORTION\n p.xy *= distortion.size;\n distort(p.xy, distortion.polynom, distortion.l1l2, distortion.pps);\n p.xy /= distortion.size;\n#endif\n\n float d = getAlphaBorder(p.xy) * texture2D(mask, p.xy).r;\n\n if(d > 0.) {\n\n#if DEBUG_ALPHA_BORDER\n vec3 r = texture2D(tex, p.xy).rgb;\n return mixBaseColor(vec4( r.r * d, r.g, r.b, 1.0), baseColor);\n#else\n vec4 color = texture2D(tex, p.xy);\n color.a *= d;\n if (boostLight) {\n return mixBaseColor(vec4(sqrt(color.rgb), color.a), baseColor);\n } else {\n return mixBaseColor(color, baseColor);\n }\n#endif\n\n }\n }\n return mixBaseColor(vec4(0.), baseColor);\n}\n",project_pars_vertex:"attribute vec3 position;\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n",WebGL2_pars_vertex:"// Copy from GLSL 3.0 conversion for built-in materials and ShaderMaterial in THREE.WebGLProgram\n// https://github.com/mrdoob/three.js/blob/696d7836d1fc56c4702a475e6991c4adef7357f4/src/renderers/webgl/WebGLProgram.js#L682\n#if defined(WEBGL2)\n#define attribute in\n#define varying out\n#define texture2D texture\n#endif\n",WebGL2_pars_fragment:"// Copy from GLSL 3.0 conversion for built-in materials and ShaderMaterial in THREE.WebGLProgram\n// https://github.com/mrdoob/three.js/blob/696d7836d1fc56c4702a475e6991c4adef7357f4/src/renderers/webgl/WebGLProgram.js#L682\n#if defined(WEBGL2)\n#define varying in\nout highp vec4 pc_fragColor;\n#define gl_FragColor pc_fragColor\n#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad\n#endif\n"},Jt=new class{constructor(t,e){this.path=e,this.target=t,this.install()}customHeaderColorLayer(t){Xt.custom_header_colorLayer=t,this.target[`${this.path}custom_header_colorLayer`]=t}customBodyColorLayer(t){Xt.custom_body_colorLayer=t,this.target[`${this.path}custom_body_colorLayer`]=t}install(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.target,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xt,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.path;return Object.keys(e).forEach((i=>{Object.defineProperty(this,i,{get:()=>e[i]}),t[r+i]=e[i]})),t}}(i.ShaderChunk,"itowns/"),Kt=Jt;var $t=r(27240),te=r(47052),ee=r(800),re=r(57918),ie=r(66165);const ne=new _t.ZP,se=new _t.uP;let oe;function ae(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{offset:0,count:1}],i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;if(0===e.length)return;const l=new Path2D;for(const t of r)if(t.extent&&s.ZP.intersectsExtent(t.extent,n)){const r=t.offset*i,n=r+t.count*i;l.moveTo(e[r],e[r+1]);for(let t=r+i;t(t.generateMipmaps=!1,t.magFilter=e.magFilter||i.LinearFilter,t.minFilter=e.minFilter||i.LinearFilter,t),_e={convert(t,e,r){let n;if(t.isFeatureCollection){const s=r.source.backgroundLayer,o=s&&s.paint?new i.Color(s.paint["background-color"]):void 0;e.as(l.Z.formatToEPSG(r.crs),xe),n=ve.createTextureFromFeature(t,xe,256,r.style,o),n.features=t,n.extent=e}else{if(!t.isTexture)throw new Error("Data type is not supported to convert into texture");n=t}return r.isColorLayer?function(t,e){return t.anisotropy=16,t.premultiplyAlpha=e.transparent,be(t,e)}(n,r):r.isElevationLayer?(n.flipY&&(n.flipY=!1),be(n,r)):void 0}};var we=r(1537);class Ee extends ie.Z{constructor(t,e){e.cacheLifeTime=e.cacheLifeTime??we.D.TEXTURE,super(t,e)}convert(t,e){return _e.convert(t,e,this)}delete(t){t&&this.cache.clear();for(const t of this.parent.level0Nodes)t.traverse((0,b.U8)(this.id))}}const Me=Ee;var Se=r(79736);const Ce=class extends Me{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,ut.S_)(e),super(t,e),this.isColorLayer=!0,this.defineLayerProperty("visible",!0),this.defineLayerProperty("opacity",1),this.defineLayerProperty("sequence",0),this.transparent=e.transparent||this.opacity<1,this.noTextureParentOutsideLimit=!!e.source&&e.source.isFileSource,this.effect_type=e.effect_type??0,this.effect_parameter=e.effect_parameter??1,this.buildExtent=!0,this.structure="2d"}setupRasterNode(t){const e=new Se.AN(t.material,this);return t.material.addLayer(e),t.material.setSequence(this.parent.colorLayersOrder),e}update(t,e,r,i){return(0,b.XP)(t,this,r,i)}},Te=class extends Me{constructor(t){var e,r;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,i),(i.zmin||i.zmax)&&console.warn("Config using zmin and zmax are deprecated, use {clampValues: {min, max}} structure."),this.zmin=(null===(e=i.clampValues)||void 0===e?void 0:e.min)??i.zmin,this.zmax=(null===(r=i.clampValues)||void 0===r?void 0:r.max)??i.zmax,this.isElevationLayer=!0,this.defineLayerProperty("scale",this.scale||1)}setupRasterNode(t){const e=new Se.NO(t.material,this);t.material.addLayer(e),t.material.setSequenceElevation(this.id);const r=()=>t.setBBoxZ({min:e.min,max:e.max,scale:this.scale});return r(),e.addEventListener("rasterElevationLevelChanged",r),this.addEventListener("scale-property-changed",r),t.addEventListener("dispose",(()=>{this.removeEventListener("scale-property-changed",r)})),e}update(t,e,r,i){return(0,b.pN)(t,this,r,i)}};var Ie=r(20193);class Re extends Ie.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.update=x.update,e.convert=Wt.convert({batchId:e.batchId}),super(t,e.object3d||new i.Group,e),this.isFeatureGeometryLayer=!0,this.accurate=e.accurate??!0,this.buildExtent=!this.accurate}preUpdate(t,e){e.has(this.parent)&&this.object3d.clear()}}const Be=Re;var Le=r(73773);const Pe=new i.Vector3,De=new i.Mesh,Oe=new i.Box3;function ke(t,e,r,n,s){return t.camera.camera3D.isOrthographicCamera?function(t,e,r,n){const s=r/2**n.depth,o=new i.Vector4(s);o.applyMatrix4(t.camera.camera3D.projectionMatrix);const a=.5*o.x*t.camera.width,l=.5*o.y*t.camera.height,c=Math.sqrt(a*a+l*l);return Math.max(0,c-e)}(t,e,r,n):function(t,e,r,i,n){if(n<=0)return 1/0;const s=r/2**i.depth,o=t.camera.preSSE*s/n;return Math.max(0,o-e)}(t,e,r,n,s)}function Ue(t){t.obj&&(t.obj.visible=!1),t.notVisibleSince||(t.notVisibleSince=Date.now(),t.sse=-1);for(const e of t.children)Ue(e)}function Ne(t){t.material.intensityRange&&t.material.intensityRange.set(t.minIntensityRange,t.maxIntensityRange)}De.geometry.boundingBox=Oe;class Fe extends Ie.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,new i.Group,e),this.isPointCloudLayer=!0,this.protocol="pointcloud",this.group=e.group||new i.Group,this.object3d.add(this.group),this.bboxes=e.bboxes||new i.Group,this.bboxes.visible=!1,this.object3d.add(this.bboxes),this.group.updateMatrixWorld(),this.octreeDepthLimit=e.octreeDepthLimit||-1,this.pointBudget=e.pointBudget||2e6,this.pointSize=0!==e.pointSize&&isNaN(e.pointSize)?4:e.pointSize,this.sseThreshold=e.sseThreshold||2,this.defineLayerProperty("minIntensityRange",e.minIntensityRange||0,Ne),this.defineLayerProperty("maxIntensityRange",e.maxIntensityRange||1,Ne),this.material=e.material||{},this.material.isMaterial||(e.material=e.material||{},e.material.intensityRange=new i.Vector2(this.minIntensityRange,this.maxIntensityRange),this.material=new S.ZP(e.material)),this.material.defines=this.material.defines||{},this.mode=e.mode||S.vj.COLOR}preUpdate(t,e){let r;t.camera.preSSE=t.camera.height/(2*Math.tan(.5*i.MathUtils.degToRad(t.camera.camera3D.fov))),this.material&&(this.material.visible=this.visible,this.material.opacity=this.opacity,this.material.transparent=this.opacity<1,this.material.size=this.pointSize,this.material.scale=t.camera.preSSE,this.material.updateUniforms&&this.material.updateUniforms());for(const t of e.values()){if(t.isCamera||t==this)return[this.root];if(void 0!==t.obj&&t.obj.isPoints&&t.obj.layer==this)if(r){if(r=t.findCommonAncestor(r),!r)return[this.root]}else r=t}return r?[r]:[this.root]}update(t,e,r){if(r.visible=!1,this.octreeDepthLimit>=0&&this.octreeDepthLimit!t.requester.visible||!this.visible}).then((t=>{this.onPointsCreated&&this.onPointsCreated(e,t),r.obj=t,r.tightbbox=t.tightbbox,this.group.add(r.obj),r.obj.updateMatrixWorld(!0),r.promise=null}),(t=>{t.isCancelledCommandException&&(r.promise=null)}))}if(r.children&&r.children.length){const n=i.distanceToPoint(Pe);if(r.sse=ke(t,e.pointSize,e.spacing,r,n)/this.sseThreshold,r.sse>=1)return r.children;for(const t of r.children)Ue(t)}}else Ue(r)}postUpdate(){this.displayedCount=0;for(const t of this.group.children)if(t.visible){const e=t.geometry.attributes.position.count;t.geometry.setDrawRange(0,e),this.displayedCount+=e}if(this.displayedCount>this.pointBudget)if(this.supportsProgressiveDisplay){const t=this.pointBudget/this.displayedCount;for(const e of this.group.children)if(e.visible){const r=Math.floor(e.geometry.drawRange.count*t);r>0?e.geometry.setDrawRange(0,r):e.visible=!1}this.displayedCount*=t}else{this.group.children.sort(((t,e)=>e.userData.node.sse-t.userData.node.sse));let t=!1;this.displayedCount=0;for(const e of this.group.children){const r=e.geometry.attributes.position.count;t||this.displayedCount+r>this.pointBudget?(e.visible=!1,t=!0):this.displayedCount+=r}}const t=Date.now();for(let e=this.group.children.length-1;e>=0;e--){const r=this.group.children[e];!r.visible&&t-r.userData.node.notVisibleSince>1e4&&(this.group.children.splice(e,1),r.geometry.dispose(),r.material=null,r.geometry=null,r.userData.node.obj=null)}}pickObjectsAt(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Le.Z.pickPointsAt(t,e,r,this,i)}getObjectToUpdateForAttachedLayers(t){if(t.obj){const e=t.parent;return e&&e.obj?{element:t.obj,parent:e.obj}:{element:t.obj}}}}const ze=Fe;class Ge extends i.EventDispatcher{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;super(),this.numPoints=t,this.layer=e,this.children=[],this.bbox=new i.Box3,this.sse=-1}add(t,e){this.children.push(t),t.parent=this,this.createChildAABB(t,e)}load(){return this.octreeIsLoaded||this.loadOctree(),this.layer.source.fetcher(this.url,this.layer.source.networkOptions).then((t=>this.layer.source.parse(t,{out:this.layer,in:this.layer.source})))}findCommonAncestor(t){return t.depth!=this.depth?t.depth1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e),this.childrenBitField=t,this.id="",this.depth=0,this.baseurl=e.source.baseurl}add(t,e,r){super.add(t,e),t.id=this.id+e,t.depth=t.id.length,t.id.length%this.layer.hierarchyStepSize==0?t.baseurl=`${r.baseurl}/${t.id.substr(r.id.length)}`:t.baseurl=r.baseurl}createChildAABB(t,e){t.bbox.copy(this.bbox),this.bbox.getCenter(t.bbox.max),je.copy(t.bbox.max).sub(this.bbox.min),1===e?(t.bbox.min.z+=je.z,t.bbox.max.z+=je.z):3===e?(t.bbox.min.z+=je.z,t.bbox.max.z+=je.z,t.bbox.min.y+=je.y,t.bbox.max.y+=je.y):0===e||(2===e?(t.bbox.min.y+=je.y,t.bbox.max.y+=je.y):5===e?(t.bbox.min.z+=je.z,t.bbox.max.z+=je.z,t.bbox.min.x+=je.x,t.bbox.max.x+=je.x):7===e?(t.bbox.min.add(je),t.bbox.max.add(je)):4===e?(t.bbox.min.x+=je.x,t.bbox.max.x+=je.x):6===e&&(t.bbox.min.y+=je.y,t.bbox.max.y+=je.y,t.bbox.min.x+=je.x,t.bbox.max.x+=je.x))}get octreeIsLoaded(){return!(this.childrenBitField&&0===this.children.length)}get url(){return`${this.baseurl}/r${this.id}.${this.layer.source.extension}`}loadOctree(){const t=`${this.baseurl}/r${this.id}.${this.layer.source.extensionOctree}`;return this.layer.source.fetcher(t,this.layer.source.networkOptions).then((t=>{const e=new DataView(t),r=[];let i=0;for(this.childrenBitField=e.getUint8(0),i+=1,this.numPoints=e.getUint32(1,!0),i+=4,r.push(this);r.length&&i{this.scale=(new i.Vector3).addScalar(t.scale),this.spacing=t.spacing,this.hierarchyStepSize=t.hierarchyStepSize;const e=Array.isArray(t.pointAttributes)&&t.pointAttributes.find((t=>t.startsWith("NORMAL")));return e&&(this.material.defines[e]=1),this.supportsProgressiveDisplay="cin"===this.source.extension,this.root=new He(0,0,this),this.root.bbox.min.set(t.boundingBox.lx,t.boundingBox.ly,t.boundingBox.lz),this.root.bbox.max.set(t.boundingBox.ux,t.boundingBox.uy,t.boundingBox.uz),this.extent=s.ZP.fromBox3(this.source.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r)}))}};var Ye=r(24266),Xe=r(62968),Je=r(77567);const Ke=new i.Matrix4(1,0,0,1,0,1,0,1,0,0,2,0,0,0,0,2),$e=new i.DataTexture(new Uint8Array([255,255,255,255]),1,1,i.RGBAFormat,i.UnsignedByteType);$e.needsUpdate=!0;const tr=new i.Texture,er=new i.RawShaderMaterial;class rr extends i.RawShaderMaterial{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.side=e.side??i.DoubleSide,e.transparent=e.transparent??!0,e.opacity=e.opacity??1;const r={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&void 0!==er[t]&&(r[t]=e[t]);super(r),this.defines.ORIENTED_IMAGES_COUNT=e.OrientedImagesCount??t.length;const n=te.Z.getMaxTextureUnitsCount();this.defines.ORIENTED_IMAGES_COUNT>n&&(console.warn(`OrientedImageMaterial: Can't project ${t.length} textures, because it's more than GPU capabilities maximum texture units (${n})`),this.defines.ORIENTED_IMAGES_COUNT=n-1,console.warn(`OrientedImageMaterial: We'll use only the first ${this.defines.ORIENTED_IMAGES_COUNT} cameras.`)),e.useBaseMaterial&&(this.defines.USE_BASE_MATERIAL=!0),this.defines.USE_DISTORTION=Number(t.some((t=>null!==t.distortion.pps))),this.alphaBorder=20|e.alphaBorder,this.defines.DEBUG_ALPHA_BORDER=0|e.debugAlphaBorder,this.cameras=t;const s=[],o=[],a=[],l=[];this.group=new i.Group;for(let e=0;e\n#include \n#include \n#include \n#include \n#include \n\nvarying vec3 vNormal;\nattribute vec3 normal;\n\nvoid main() {\n #include \n #include \n vNormal = normal;\n #include \n #include \n}\n",this.fragmentShader=Je.Z.unrollLoops("#include \n#include \n#include \n#include \nvarying vec3 vNormal;\n\n#ifdef USE_BASE_MATERIAL\nstruct noPT {\n vec3 lightDirection;\n vec3 ambient;\n float opacity;\n};\n\nuniform noPT noProjectiveMaterial;\n#endif\n\nvoid main(void)\n{\n #include \n #ifdef USE_BASE_MATERIAL\n float nDotVP = (max(0.1, dot(vNormal, normalize(noProjectiveMaterial.lightDirection))));\n vec4 color = vec4(noProjectiveMaterial.ambient + nDotVP, 0.0);\n #else\n vec4 color = vec4(0.0);\n #endif\n\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n\n #ifdef USE_BASE_MATERIAL\n color.a = color.a < 1.0 ? max(noProjectiveMaterial.opacity, color.a) : 1.0 ;\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n #else\n gl_FragColor = vec4(color.rgb / color.a, opacity);\n #endif\n\n}\n",this.defines)}onBeforeCompile(t,e){e.capabilities.isWebGL2&&(this.defines.WEBGL2=!0,t.glslVersion="300 es")}setTextures(t,e,r){if(t){this.group.position.copy(e.position),this.group.quaternion.copy(e.quaternion);for(let e=0;et.name===r[e]));this.uniforms.mask.value[e]=t.maskTexture||$e,this.uniforms.mask.value[e].needsUpdate=!0,this.uniforms.projectiveTextureDistortion.value[e]=t.distortion,this.group.children[e]=t,t.parent=this.group}}this.group.children[e].needsUpdate=!0}this.group.updateMatrixWorld(!0)}}updateUniforms(t){for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=JSON.parse(t)),Promise.all(t.map((t=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=null==e.useMask||e.useMask,n=null==e.imageYDown||e.imageYDown,s=t.projection,o=(new i.Vector2).fromArray(t.size),a=new i.Vector2(s[0],s[4]),l=new i.Vector2(s[2],n?o.y-s[5]:s[5]),c=s[1],h=new M(o,a,l,e.near,e.far,c);h.position.fromArray(t.position);const u=or.fromArray(t.rotation);let d;h.matrix.setFromMatrix3(u),h.quaternion.setFromRotationMatrix(h.matrix),h.rotateX(Math.PI),t.distortion&&h.distortion.setFromMicmacCalibration(t.distortion,n),h.maskPath=t.mask,h.name=t.id;const p=new Promise((t=>{d=t}));return r&&h.maskPath?sr.load(h.maskPath,(t=>{h.maskTexture=t,d(h)})):d(h),p}(t,e))))}},lr=new o.Z("EPSG:4978",0,0,0),cr=t=>t.requester.id!==t.layer.currentPano.id;class hr extends Ie.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.projection&&(console.warn("OrientedImageLayer projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),super(t,new i.Group,e),this.isOrientedImageLayer=!0,this.background=e.background||function(t){if(!t||t<=0)return;const e=new i.SphereGeometry(t,32,32),r=new i.MeshPhongMaterial({color:7829503,side:i.DoubleSide,transparent:!0,opacity:.5,wireframe:!0}),n=new i.Mesh(e,r);return n.visible=!0,n.name="OrientedImageBackground",n}(e.backgroundDistance),this.background&&(this.background.layer=this.background.layer??{},this.background.layer.id=this.background.layer.id??t,this.object3d.add(this.background)),this.currentPano=void 0,this.onPanoChanged=e.onPanoChanged||(()=>{}),this.getCamerasNameFromFeature=e.getCamerasNameFromFeature||(()=>{});const r=this.addInitializationStep();this.mergeFeatures=!1,this.filteringExtent=!1,this.accurate=!0;const n={out:this};this.source.whenReady.then((t=>nr.Z.parse(e.orientation||t.orientation,n).then((t=>{this.panos=t.features;const r=n.in.crs,s=e.crs,o=bt.quaternionFromCRSToCRS(r,s),a=new i.Quaternion;let l=0;for(const e of this.panos)lr.crs=e.crs,lr.setFromArray(e.vertices).applyMatrix4(t.matrix),e.position=lr.toVector3(),o(lr,a),e.quaternion=bt.quaternionFromAttitude(e.geometries[0].properties).premultiply(a),e.id=e.geometries[0].properties.id,e.index=l++})).then((()=>{ar.parse(e.calibration||t.calibration,e).then((t=>{this.cameras=t,this.material=new ir(this.cameras,e),r()}))}))))}update(){}set boostLight(t){this.material.uniforms.boostLight.value=t}get boostLight(){return this.material.uniforms.boostLight.value}preUpdate(t){var e;!function(t,e,r){const i=r.mostNearPano(e.position),n=r.currentPano?r.currentPano.id:void 0;if(i&&n!=i.id){r.currentPano=i,r.onPanoChanged({previousPanoPosition:r.getPreviousPano()?r.getPreviousPano().position:void 0,currentPanoPosition:r.getCurrentPano().position,nextPanoPosition:r.getNextPano().position});const e=i.geometries[0].properties.idSensors,n=r.cameras.map((t=>({cameraId:t.name,panoId:i.id,as:()=>{}}))).filter((t=>!e||e.includes(t.cameraId))),s={layer:r,extentsSource:n,view:t.view,requester:i,earlyDropFunction:cr};t.scheduler.execute(s).then((e=>{i.id===r.currentPano.id&&(r.material.setTextures(e,i,r.getCamerasNameFromFeature(i)),r.material.updateUniforms(t.camera.camera3D),t.view.notifyChange(r,!0))}),(()=>{}))}}(t,t.camera.camera3D,this),this.material.updateUniforms(t.camera.camera3D),(e=this).background&&e.currentPano&&(e.background.position.copy(e.currentPano.position),e.background.updateMatrixWorld(),e.background.material=e.material||e.background.material)}getNextPano(){const t=(this.currentPano.index+1)%this.panos.length;return this.panos[t]}getCurrentPano(){return this.currentPano}getPreviousPano(){const t=(this.currentPano.index-1)%this.panos.length;return this.panos[t]}delete(t){this.background&&super.delete(),t&&this.cache.clear(),this.material.visible=!1,console.warn("You need to replace OrientedImageLayer.material applied on each object. This issue will be fixed when OrientedImageLayer will be a ColorLayer. the material visibility is set to false. To follow issue see https://github.com/iTowns/itowns/issues/1018")}mostNearPano(t){let e,r=1/0;for(const i of this.panos){const n=t.distanceTo(i.position);n5&&void 0!==arguments[5]?arguments[5]:0,n),this.isEntwinePointTileNode=!0,this.depth=t,this.x=e,this.y=r,this.z=i,this.id=xr(t,e,r,i),this.url=`${this.layer.source.url}/ept-data/${this.id}.${this.layer.source.extension}`}createChildAABB(t){const e=2**(t.depth-this.depth);this.bbox.getSize(Ar).divideScalar(e),t.bbox.min.copy(this.bbox.min),yr.copy(this).multiplyScalar(e),vr.subVectors(t,yr).multiply(Ar),t.bbox.min.add(vr),t.bbox.max.copy(t.bbox.min).add(Ar)}get octreeIsLoaded(){return this.numPoints>=0}loadOctree(){return d.Z.json(`${this.layer.source.url}/ept-hierarchy/${this.id}.json`,this.layer.source.networkOptions).then((t=>{this.numPoints=t[this.id];const e=[];for(e.push(this);e.length;){const r=e.shift(),i=r.depth+1,n=2*r.x,s=2*r.y,o=2*r.z;r.findAndCreateChild(i,n,s,o,t,e),r.findAndCreateChild(i,n+1,s,o,t,e),r.findAndCreateChild(i,n,s+1,o,t,e),r.findAndCreateChild(i,n+1,s+1,o,t,e),r.findAndCreateChild(i,n,s,o+1,t,e),r.findAndCreateChild(i,n+1,s,o+1,t,e),r.findAndCreateChild(i,n,s+1,o+1,t,e),r.findAndCreateChild(i,n+1,s+1,o+1,t,e)}}))}findAndCreateChild(t,e,r,i,n,s){const o=n[xr(t,e,r,i)];if("number"==typeof o){const n=new br(t,e,r,i,this.layer,o);this.add(n),s.push(n)}}}const _r=br,wr=new i.Mesh,Er=new i.Box3;wr.geometry.boundingBox=Er;const Mr=class extends ze{constructor(t,e){super(t,e),this.isEntwinePointTileLayer=!0;const r=this.addInitializationStep();this.whenReady=this.source.whenReady.then((()=>(this.root=new _r(0,0,0,0,this,-1),this.root.bbox.min.fromArray(this.source.boundsConforming,0),this.root.bbox.max.fromArray(this.source.boundsConforming,3),this.extent=s.ZP.fromBox3(e.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r))))}get spacing(){return this.source.spacing}};var Sr=r(51123);class Cr extends Sr.ZP{constructor(t){if(t.parsedData&&(console.warn("FileSource parsedData parameter is deprecated, use features instead of."),t.features=t.features||t.parsedData),t.projection&&(console.warn("FileSource projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs){if(!t.features||!t.features.crs)throw new Error("source.crs is required in FileSource");t.crs=t.features.crs}if(!t.url&&!t.fetchedData&&!t.features)throw new Error("url, fetchedData and features are not set in\n FileSource; at least one needs to be present");t.url=t.url||"fake-file-url",super(t),this.isFileSource=!0,this.fetchedData=t.fetchedData,this.fetchedData||t.features?t.features&&(this._featuresCaches[t.features.crs]=new we.Z,this._featuresCaches[t.features.crs].setByArray(Promise.resolve(t.features),[0])):this.whenReady=this.fetcher(this.urlFromExtent(),this.networkOptions).then((t=>{this.fetchedData=t})),this.whenReady.then((()=>this.fetchedData)),this.zoom={min:0,max:1/0}}urlFromExtent(){return this.url}onLayerAdded(t){t.in=this,super.onLayerAdded(t);let e=this._featuresCaches[t.out.crs].getByArray([0]);e||(t.out.buildExtent="EPSG:4978"!=this.crs,t.out.buildExtent&&(t.out.forcedExtentCrs="EPSG:4978"!=t.out.crs?t.out.crs:l.Z.formatToEPSG(this.crs)),e=this.parser(this.fetchedData,t),this._featuresCaches[t.out.crs].setByArray(e,[0])),e.then((t=>{t.extent&&(this.extent=t.extent.clone(),this.extent.crs==t.crs&&this.extent.applyMatrix4(t.matrixWorld))}))}loadData(t,e){return this._featuresCaches[e.crs].getByArray([0])}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Tr=Cr;var Ir=r(13012);const Rr=new s.ZP(l.Z.tms_4326,0,0,0);class Br extends Sr.ZP{constructor(t){if(t.format=t.format||"image/png",super(t),!t.crs)throw new Error("New TMSSource/WMTSSource: crs is required");if(this.isTMSSource=!0,t.extent||(this.extent=s.Mh.get(t.crs)),this.zoom=t.zoom,this.isInverted=t.isInverted||!1,this.url=t.url,this.crs=l.Z.formatToTms(t.crs),this.tileMatrixSetLimits=t.tileMatrixSetLimits,this.extentSetlimits={},this.tileMatrixCallback=t.tileMatrixCallback||(t=>t),!this.zoom)if(this.tileMatrixSetLimits){const t=Object.keys(this.tileMatrixSetLimits),e=t.length,r=Number(t[e-1]);this.zoom={min:r-e+1,max:r}}else this.zoom={min:0,max:1/0}}urlFromExtent(t){return Ir.Z.xyz(t,this)}onLayerAdded(t){super.onLayerAdded(t);const e=t.out.parent,r=e?e.extent.crs:t.out.crs;if(this.tileMatrixSetLimits&&!this.extentSetlimits[r]){this.extentSetlimits[r]={},Rr.crs=this.crs;for(let t=this.zoom.max;t>=this.zoom.min;t--){const e=this.tileMatrixSetLimits[t],{west:i,north:n}=Rr.set(t,e.minTileRow,e.minTileCol).as(r),{east:o,south:a}=Rr.set(t,e.maxTileRow,e.maxTileCol).as(r);this.extentSetlimits[r][t]=new s.ZP(r,i,o,a,n)}}}extentInsideLimit(t,e){return e>=this.zoom.min&&e<=this.zoom.max&&(null==this.extentSetlimits[t.crs]||this.extentSetlimits[t.crs][e].intersectsExtent(t))}}const Lr=Br;class Pr extends Sr.ZP{constructor(t){if(t.projection&&(console.warn("WFSSource projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.typeName)throw new Error("source.typeName is required in wfs source.");if(!t.crs)throw new Error("source.crs is required in wfs source");t.format=t.format||"application/json",super(t),this.isWFSSource=!0,this.typeName=t.typeName,this.version=t.version||"2.0.2",this.bboxDigits=t.bboxDigits,this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${t.url}SERVICE=WFS&REQUEST=GetFeature&typeName=${this.typeName}&VERSION=${this.version}&SRSNAME=${this.crs}&outputFormat=${this.format}&BBOX=%bbox,${this.crs}`,this.zoom={min:0,max:1/0},this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}handlingError(t){return t.response&&400==t.response.status?t.response.text().then((e=>{const r=`${this.url}SERVICE=WFS&REQUEST=GetCapabilities&VERSION=${this.version}`,i=(new DOMParser).parseFromString(e,"application/xml").querySelector("Exception"),n=i.getAttribute("exceptionCode"),s=i.querySelector("ExceptionText").textContent;console.error(`Source ${this.typeName}: bad request when fetching data. Server says: "${n}: ${s}". \nReviewing ${r} may help.`,t)})):super.handlingError(t)}requestToKey(t){return l.Z.isTms(t.crs)?super.requestToKey(t):[t.zoom,t.south,t.west]}urlFromExtent(t){return Ir.Z.bbox(t,this)}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Dr=Pr;class Or extends Sr.ZP{constructor(t){if(!t.name)throw new Error("source.name is required.");if(!t.extent)throw new Error("source.extent is required");if(!t.crs&&!t.projection)throw new Error("source.crs is required");t.format=t.format||"image/png",super(t),this.isWMSSource=!0,this.name=t.name,this.zoom={min:0,max:1/0},this.style=t.style||"",this.width=t.width||t.height||256,this.height=t.height||t.width||256,this.version=t.version||"1.3.0",this.transparent=t.transparent||!1,this.bboxDigits=t.bboxDigits,t.axisOrder||("EPSG:4326"==this.crs?this.axisOrder="1.1.0"===this.version?"wsen":"swne":this.axisOrder="wsen");const e="1.3.0"===this.version?"CRS":"SRS";this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${this.url}SERVICE=WMS&REQUEST=GetMap&LAYERS=${this.name}&VERSION=${this.version}&STYLES=${this.style}&FORMAT=${this.format}&TRANSPARENT=${this.transparent}&BBOX=%bbox&${e}=${this.crs}&WIDTH=${this.width}&HEIGHT=${this.height}`,this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}urlFromExtent(t){return Ir.Z.bbox(t,this)}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const kr=Or,Ur=class extends Lr{constructor(t){if(!t.name)throw new Error("New WMTSSource: name is required");super(t),this.isWMTSSource=!0,this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${this.url}LAYER=${t.name}&FORMAT=${this.format}&SERVICE=WMTS&VERSION=${t.version||"1.0.0"}&REQUEST=GetTile&STYLE=${t.style||"normal"}&TILEMATRIXSET=${t.tileMatrixSet}&TILEMATRIX=%TILEMATRIX&TILEROW=%ROW&TILECOL=%COL`,this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}};var Nr=r(92294);const Fr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/,zr="https://api.mapbox.com",Gr=!0,Qr=null;function jr(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}function Vr(t,e){const r=Wr(zr);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==r.path&&(t.path=`${r.path}${t.path}`),!Gr)return jr(t);if(!(e=e||Qr))throw new Error("An API access token is required");if("s"===e[0])throw new Error("Use a public access token (pk.*), not a secret access token (sk.*).");return t.params=t.params.filter((t=>-1===t.indexOf("access_token"))),t.params.push(`access_token=${e}`),jr(t)}function Hr(t){return 0===t.indexOf("mapbox:")}function Wr(t){const e=t.match(Fr);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}const qr=function(t,e){if(!Hr(t))return t;const r=Wr(t);return r.path=`/styles/v1${r.path}`,Vr(r,e)},Zr=function(t,e){if(!Hr(t))return t;const r=Wr(t);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),Vr(r,e)},Yr=function(t,e,r,i){const n=Wr(t);return Hr(t)?(n.path=`/styles/v1${n.path}/sprite${e}${r}`,Vr(n,i)):(n.path+=`${e}${r}`,jr(n))};function Xr(t){return t.replace(/\{/g,"${")}const Jr=class extends Lr{constructor(t){t.format="application/x-protobuf;type=mapbox-vector",t.crs="EPSG:3857",t.isInverted=!0,t.url=t.url||".",super(t);const e=t.filter||(()=>!0);let r;if(this.layers={},this.styles={},this.isVectorTileSource=!0,this.accessToken=t.accessToken,!t.style)throw new Error("New VectorTilesSource: style is required");if("string"==typeof t.style){const e=qr(t.style,this.accessToken);r=d.Z.json(e,this.networkOptions)}else r=Promise.resolve(t.style);this.whenReady=r.then((e=>{this.jsonStyle=e;const r=t.sprite||e.sprite;if(r){const t=Yr(r,"",".json",this.accessToken);return d.Z.json(t,this.networkOptions).then((t=>{this.sprites=t;const i=Yr(r,"",".png",this.accessToken);return this.sprites.source=i,e}))}return e})).then((t=>{const r=Object.keys(t.sources)[0],i=t.sources[r];if(t.layers.forEach(((t,r)=>{if(t.sourceUid=this.uid,"background"===t.type)this.backgroundLayer=t;else if(e(t)){const e=_t.ZP.setFromVectorTileLayer(t,this.sprites,r,this.symbolToCircle);this.styles[t.id]=e,this.layers[t["source-layer"]]||(this.layers[t["source-layer"]]=[]),this.layers[t["source-layer"]].push({id:t.id,order:r,filterExpression:(0,Nr.TE)(t.filter),zoom:{min:t.minzoom||0,max:t.maxzoom||24}})}})),"."==this.url){if(i.url){const t=Zr(i.url,this.accessToken);return d.Z.json(t,this.networkOptions).then((t=>{t.tiles[0]&&(this.url=Xr(t.tiles[0]))}))}i.tiles[0]&&(this.url=Xr(i.tiles[0]))}}))}onLayerAdded(t){super.onLayerAdded(t),t.out.style&&t.out.isFeatureGeometryLayer&&t.out.accurate&&(console.warn("With VectorTilesSource and FeatureGeometryLayer, the accurate option is always false"),t.out.accurate=!1)}};class Kr extends Sr.ZP{constructor(t){t.format=t.format||"json",super(t),this.isOrientedImageSource=!0;const e=[];e.push(t.orientationsUrl?d.Z.json(t.orientationsUrl,this.networkOptions):Promise.resolve()),e.push(t.calibrationUrl?d.Z.json(t.calibrationUrl,this.networkOptions):Promise.resolve()),this.whenReady=Promise.all(e).then((t=>({orientation:t[0],calibration:t[1]})))}urlFromExtent(t){return this.imageUrl(t.cameraId,t.panoId)}requestToKey(t){return[t.cameraId,t.panoId]}imageUrl(t,e){return this.url.replace("{cameraId}",t).replace("{panoId}",e)}}const $r=Kr,ti={POSITION_CARTESIAN:{numElements:3,arrayType:Float32Array,attributeName:"position"},COLOR_PACKED:{numElements:4,arrayType:Uint8Array,attributeName:"color",normalized:!0},INTENSITY:{numElements:1,numByte:2,arrayType:Uint16Array,attributeName:"intensity",normalized:!0},CLASSIFICATION:{numElements:1,arrayType:Uint8Array,attributeName:"classification",normalized:!0},NORMAL_SPHEREMAPPED:{numElements:2,arrayType:Uint8Array,attributeName:"sphereMappedNormal"},NORMAL_OCT16:{numElements:2,arrayType:Uint8Array,attributeName:"oct16Normal"},NORMAL:{numElements:3,arrayType:Float32Array,attributeName:"normal"}};for(const t of Object.keys(ti)){const e=ti[t];e.potreeName=t,e.numByte=e.numByte||e.arrayType.BYTES_PER_ELEMENT,e.byteSize=e.numElements*e.numByte,e.normalized=e.normalized||!1;const r="getUint"+8*e.numByte;e.getValue=1===e.numByte?function(t,e){return t[r](e)}:function(t,e){return t[r](e,!0)}}const ei={parse:function(t,e){if(!t)throw new Error("No array buffer provided.");const r=new DataView(t);let n=0;for(const t of e.in.pointAttributes)n+=ti[t].byteSize;const s=Math.floor(t.byteLength/n),o=new i.BufferGeometry;let a=0,l=0;for(const t of e.in.pointAttributes){const e=ti[t],c=e.numElements*s,h=new e.arrayType(c);for(let t=0;t(this.pointAttributes=t.pointAttributes,this.baseurl=`${this.url}/${t.octreeDir}/r`,this.extension="CIN"===t.pointAttributes?"cin":"bin",this.parse="cin"===this.extension?ri.parse:ei.parse,t)))}}const ni=ii;class si extends Sr.ZP{constructor(t){super(t),this.isC3DTilesSource=!0,this.baseUrl=this.url.slice(0,this.url.lastIndexOf("/")+1),this.whenReady=d.Z.json(this.url,this.networkOptions)}}const oi=si,ai=class extends oi{constructor(t){if(!t.accessToken)throw new Error("New 3D Tiles Ion Source: access token is required");if(!t.assetId)throw new Error("New 3D Tiles Ion Source: asset id is required");t.url=`https://api.cesium.com/v1/assets/${t.assetId}/endpoint?access_token=${t.accessToken}`,super(t),this.isC3DTilesIonSource=!0,this.accessToken=t.accessToken,this.assetId=t.assetId,this.whenReady=d.Z.json(t.url,this.networkOptions).then((t=>{if("3DTILES"!==t.type)throw new Error(`${t.type} datasets from Cesium ion are not supported with C3DTilesIonSource. Only 3D Tiles datasets are supported.`);return this.url=t.url,this.baseUrl=t.url.slice(0,t.url.lastIndexOf("/")+1),this.networkOptions.headers={},this.networkOptions.headers.Authorization=`Bearer ${t.accessToken}`,this.attribution=t.attributions,d.Z.json(this.url,this.networkOptions)}))}};var li=r(42622),ci=r(37830);const hi=new class{constructor(){this._wasmPath="https://unpkg.com/laz-perf@0.0.6/lib/",this._wasmPromise=null}_initDecoder(){return this._wasmPromise||(this._wasmPromise=li.LazPerf.create({locateFile:t=>`${this._wasmPath}/${t}`})),this._wasmPromise}_parseView(t,e){const r=e.colorDepth??16,i=["X","Y","Z"].map(t.getter),n=t.getter("Intensity"),s=t.getter("ReturnNumber"),o=t.getter("NumberOfReturns"),a=t.getter("Classification"),l=t.getter("PointSourceId"),c=t.dimensions.Red?["Red","Green","Blue"].map(t.getter):void 0,h=new Float32Array(3*t.pointCount),u=new Uint16Array(t.pointCount),d=new Uint8Array(t.pointCount),p=new Uint8Array(t.pointCount),f=new Uint8Array(t.pointCount),m=new Uint16Array(t.pointCount),g=c?new Uint8Array(4*t.pointCount):void 0;for(let e=0;et(e)));if(h[3*e]=t,h[3*e+1]=A,h[3*e+2]=y,u[e]=n(e),d[e]=s(e),p[e]=o(e),c){let[t,i,n]=c.map((t=>t(e)));16===r&&(t/=256,i/=256,n/=256),g[4*e]=t,g[4*e+1]=i,g[4*e+2]=n,g[4*e+3]=255}f[e]=a(e),m[e]=l(e)}return{position:h,intensity:u,returnNumber:d,numberOfReturns:p,classification:f,pointSourceID:m,color:g}}set lazPerf(t){this._wasmPath=t,this._wasmPromise=null}async parseFile(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new Uint8Array(t),i=await ci.Las.PointData.decompressFile(r,this._initDecoder()),n=ci.Las.Header.parse(r),s=e.colorDepth??(1===n.majorVersion&&n.minorVersion<=2?8:16),o=async(t,e)=>r.slice(t,e),a=await ci.Las.Vlr.walk(o,n),l=ci.Las.Vlr.find(a,"LASF_Spec",4),c=l&&ci.Las.ExtraBytes.parse(await ci.Las.Vlr.fetch(o,l)),h=ci.Las.View.create(i,n,c);return{header:n,attributes:this._parseView(h,{colorDepth:s})}}},ui={enableLazPerf(t){if(!t)throw new Error("Path to laz-perf is mandatory");hi.lazPerf=t},parse(t){var e,r;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=n.out)&&void 0!==e&&e.skip&&console.warn("Warning: options 'skip' not supported anymore"),hi.parseFile(t,{colorDepth:null===(r=n.in)||void 0===r?void 0:r.colorDepth}).then((t=>{const e=new i.BufferGeometry,r=t.attributes;e.userData=t.header;const n=new i.BufferAttribute(r.position,3);e.setAttribute("position",n);const s=new i.BufferAttribute(r.intensity,1,!0);e.setAttribute("intensity",s);const o=new i.BufferAttribute(r.returnNumber,1);e.setAttribute("returnNumber",o);const a=new i.BufferAttribute(r.numberOfReturns,1);e.setAttribute("numberOfReturns",a);const l=new i.BufferAttribute(r.classification,1,!0);e.setAttribute("classification",l);const c=new i.BufferAttribute(r.pointSourceID,1);if(e.setAttribute("pointSourceID",c),r.color){const t=new i.BufferAttribute(r.color,4,!0);e.setAttribute("color",t)}return e.computeBoundingBox(),e}))}};class di extends Sr.ZP{constructor(t){super(t),this.isEntwinePointTileSource=!0,this.colorDepth=t.colorDepth,this.url=this.url.replace("/ept.json",""),this.whenReady=d.Z.json(`${this.url}/ept.json`,this.networkOptions).then((t=>(this.parse="laszip"===t.dataType?ui.parse:ei.parse,this.extension="laszip"===t.dataType?"laz":"bin",t.srs&&t.srs.authority&&t.srs.horizontal&&(this.crs=`${t.srs.authority}:${t.srs.horizontal}`,n.default.defs(this.crs)||n.default.defs(this.crs,t.srs.wkt),t.srs.vertical&&t.srs.vertical!==t.srs.horizontal&&console.warn("EntwinePointTileSource: Vertical coordinates system code is not yet supported.")),this.spacing=(Math.abs(t.boundsConforming[3]-t.boundsConforming[0])+Math.abs(t.boundsConforming[4]-t.boundsConforming[1]))/(2*t.span),this.boundsConforming=t.boundsConforming,this.span=t.span,this))),this.fetcher=d.Z.arrayBuffer}}const pi=di;var fi=r(70274),mi=r(99127),gi=r(79003),Ai=r.n(gi);const yi={parse(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=(0,ut._F)(r),t.zip?e=Ai().parseZip(t.zip):t.shp&&t.shx&&t.dbf&&(e=Promise.all([Ai().parseShp(t.shp,t.prj),Ai().parseDbf(t.dbf)]).then(Ai().combine)),r.in=r.in||{},r.in.crs=t.prj?(0,n.default)(t.prj).oProj.datumName:r.in.crs,Promise.resolve(e).then((t=>nr.Z.parse(t,r)))}};var vi=r(49472),xi=r(71077),bi=r(14278),_i=r(82853),wi=r(97498),Ei=r(45571),Mi=r(25655),Si=r(16916),Ci=r(83500),Ti=r(24147);const Ii=class{constructor(t){this.classes=t.classes,this.inverseHierarchy={},this.instancesIdxs=[];const e={};let r=0,i=t.parentCounts;void 0===i&&(i=new Array(t.instancesLength),i.fill(1));for(let n=0;n{"use strict";r.d(e,{ZP:()=>Pt,qw:()=>Bt,hu:()=>Lt,zL:()=>Tt,mp:()=>It});var i=r(99477),n=r(47052);function s(t,e){if(e===i.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===i.TriangleFanDrawMode||e===i.TriangleStripDrawMode){let r=t.getIndex();if(null===r){const e=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t=2.0 are supported.")));const c=new Y(n,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let t=0;t=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}c.setExtensions(s),c.setPlugins(o),c.parse(r,i)}parseAsync(t,e){const r=this;return new Promise((function(i,n){r.parse(t,e,i,n)}))}}function a(){let t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const l={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class c{constructor(t){this.parser=t,this.name=l.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let r=0,i=e.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,n.source,s)}}class _{constructor(t){this.parser=t,this.name=l.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,r=this.parser,i=r.json,n=i.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=i.images[s.source];let a=r.textureLoader;if(o.uri){const t=r.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(t,s.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class w{constructor(t){this.parser=t,this.name=l.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,r=this.parser,i=r.json,n=i.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=i.images[s.source];let a=r.textureLoader;if(o.uri){const t=r.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(t,s.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class E{constructor(t){this.name=l.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,r=e.bufferViews[t];if(r.extensions&&r.extensions[this.name]){const t=r.extensions[this.name],i=this.parser.getDependency("buffer",t.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then((function(e){const r=t.byteOffset||0,i=t.byteLength||0,s=t.count,o=t.byteStride,a=new Uint8Array(e,r,i);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(s,o,a,t.mode,t.filter).then((function(t){return t.buffer})):n.ready.then((function(){const e=new ArrayBuffer(s*o);return n.decodeGltfBuffer(new Uint8Array(e),s,o,a,t.mode,t.filter),e}))}))}return null}}class M{constructor(t){this.name=l.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,r=e.nodes[t];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const n=e.meshes[r.mesh];for(const t of n.primitives)if(t.mode!==D.TRIANGLES&&t.mode!==D.TRIANGLE_STRIP&&t.mode!==D.TRIANGLE_FAN&&void 0!==t.mode)return null;const s=r.extensions[this.name].attributes,o=[],a={};for(const t in s)o.push(this.parser.getDependency("accessor",s[t]).then((e=>(a[t]=e,a[t]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(t)),Promise.all(o).then((t=>{const e=t.pop(),r=e.isGroup?e.children:[e],n=t[0].count,s=[];for(const t of r){const e=new i.Matrix4,r=new i.Vector3,o=new i.Quaternion,l=new i.Vector3(1,1,1),c=new i.InstancedMesh(t.geometry,t.material,n);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new a,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,s=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=navigator.userAgent.indexOf("Firefox")>-1,s=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&s<98?this.textureLoader=new i.TextureLoader(this.options.manager):this.textureLoader=new i.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new i.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const r=this,i=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(t){return t._markDefs&&t._markDefs()})),Promise.all(this._invokeAll((function(t){return t.beforeRoot&&t.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(e){const s={scene:e[0][i.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:i.asset,parser:r,userData:{}};return Q(n,s,i),j(s,i),Promise.all(r._invokeAll((function(t){return t.afterRoot&&t.afterRoot(s)}))).then((function(){t(s)}))})).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[];for(let r=0,i=e.length;r{const r=this.associations.get(t);null!=r&&this.associations.set(e,r);for(const[r,i]of t.children.entries())n(i,e.children[r])};return n(r,i),i.name+="_instance_"+t.uses[e]++,i}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let r=0;r=2&&p.setY(e,u[t*o+1]),o>=3&&p.setZ(e,u[t*o+2]),o>=4&&p.setW(e,u[t*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(t){const e=this.json,r=this.options,i=e.textures[t].source,n=e.images[i];let s=this.textureLoader;if(n.uri){const t=r.manager.getHandler(n.uri);null!==t&&(s=t)}return this.loadTextureImage(t,i,s)}loadTextureImage(t,e,r){const n=this,s=this.json,o=s.textures[t],a=s.images[e],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(e,r).then((function(e){e.flipY=!1,e.name=o.name||a.name||"",""===e.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(e.name=a.uri);const r=(s.samplers||{})[o.sampler]||{};return e.magFilter=k[r.magFilter]||i.LinearFilter,e.minFilter=k[r.minFilter]||i.LinearMipmapLinearFilter,e.wrapS=U[r.wrapS]||i.RepeatWrapping,e.wrapT=U[r.wrapT]||i.RepeatWrapping,n.associations.set(e,{textures:t}),e})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(t,e){const r=this.json,n=this.options;if(void 0!==this.sourceCache[t])return this.sourceCache[t].then((t=>t.clone()));const s=r.images[t],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=this.getDependency("bufferView",s.bufferView).then((function(t){l=!0;const e=new Blob([t],{type:s.mimeType});return a=o.createObjectURL(e),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(t){return new Promise((function(r,s){let o=r;!0===e.isImageBitmapLoader&&(o=function(t){const e=new i.Texture(t);e.needsUpdate=!0,r(e)}),e.load(i.LoaderUtils.resolveURL(t,n.path),o,void 0,s)}))})).then((function(t){var e;return!0===l&&o.revokeObjectURL(a),t.userData.mimeType=s.mimeType||((e=s.uri).search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"),t})).catch((function(t){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),t}));return this.sourceCache[t]=c,c}assignTexture(t,e,r,i){const n=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),n.extensions[l.KHR_TEXTURE_TRANSFORM]){const t=void 0!==r.extensions?r.extensions[l.KHR_TEXTURE_TRANSFORM]:void 0;if(t){const e=n.associations.get(s);s=n.extensions[l.KHR_TEXTURE_TRANSFORM].extendTexture(s,t),n.associations.set(s,e)}}return void 0!==i&&(s.colorSpace=i),t[e]=s,s}))}assignFinalMaterial(t){const e=t.geometry;let r=t.material;const n=void 0===e.attributes.tangent,s=void 0!==e.attributes.color,o=void 0===e.attributes.normal;if(t.isPoints){const t="PointsMaterial:"+r.uuid;let e=this.cache.get(t);e||(e=new i.PointsMaterial,i.Material.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,e.sizeAttenuation=!1,this.cache.add(t,e)),r=e}else if(t.isLine){const t="LineBasicMaterial:"+r.uuid;let e=this.cache.get(t);e||(e=new i.LineBasicMaterial,i.Material.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,this.cache.add(t,e)),r=e}if(n||s||o){let t="ClonedMaterial:"+r.uuid+":";n&&(t+="derivative-tangents:"),s&&(t+="vertex-colors:"),o&&(t+="flat-shading:");let e=this.cache.get(t);e||(e=r.clone(),s&&(e.vertexColors=!0),o&&(e.flatShading=!0),n&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(t,e),this.associations.set(e,this.associations.get(r))),r=e}t.material=r}getMaterialType(){return i.MeshStandardMaterial}loadMaterial(t){const e=this,r=this.json,n=this.extensions,s=r.materials[t];let o;const a={},c=[];if((s.extensions||{})[l.KHR_MATERIALS_UNLIT]){const t=n[l.KHR_MATERIALS_UNLIT];o=t.getMaterialType(),c.push(t.extendParams(a,s,e))}else{const r=s.pbrMetallicRoughness||{};if(a.color=new i.Color(1,1,1),a.opacity=1,Array.isArray(r.baseColorFactor)){const t=r.baseColorFactor;a.color.setRGB(t[0],t[1],t[2],i.LinearSRGBColorSpace),a.opacity=t[3]}void 0!==r.baseColorTexture&&c.push(e.assignTexture(a,"map",r.baseColorTexture,i.SRGBColorSpace)),a.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,a.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(c.push(e.assignTexture(a,"metalnessMap",r.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",r.metallicRoughnessTexture))),o=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),c.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,a)}))))}!0===s.doubleSided&&(a.side=i.DoubleSide);const h=s.alphaMode||"OPAQUE";if("BLEND"===h?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===h&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==i.MeshBasicMaterial&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new i.Vector2(1,1),void 0!==s.normalTexture.scale)){const t=s.normalTexture.scale;a.normalScale.set(t,t)}if(void 0!==s.occlusionTexture&&o!==i.MeshBasicMaterial&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==i.MeshBasicMaterial){const t=s.emissiveFactor;a.emissive=(new i.Color).setRGB(t[0],t[1],t[2],i.LinearSRGBColorSpace)}return void 0!==s.emissiveTexture&&o!==i.MeshBasicMaterial&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,i.SRGBColorSpace)),Promise.all(c).then((function(){const r=new o(a);return s.name&&(r.name=s.name),j(r,s),e.associations.set(r,{materials:t}),s.extensions&&Q(n,r,s),r}))}createUniqueName(t){const e=i.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,r=this.extensions,n=this.primitiveCache;function s(t){return r[l.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(r){return X(r,t,e)}))}const o=[];for(let r=0,a=t.length;r0&&V(p,o),p.name=e.createUniqueName(o.name||"mesh_"+t),j(p,o),d.extensions&&Q(n,p,d),e.assignFinalMaterial(p),h.push(p)}for(let r=0,i=h.length;r1?new i.Group:1===e.length?e[0]:new i.Object3D,a!==e[0])for(let t=0,r=e.length;t{const e=new Map;for(const[t,r]of n.associations)(t instanceof i.Material||t instanceof i.Texture)&&e.set(t,r);return t.traverse((t=>{const r=n.associations.get(t);null!=r&&e.set(t,r)})),e})(s),s}))}_createAnimationTracks(t,e,r,n,s){const o=[],a=t.name?t.name:t.uuid,l=[];let c;switch(z[s.path]===z.weights?t.traverse((function(t){t.morphTargetInfluences&&l.push(t.name?t.name:t.uuid)})):l.push(a),z[s.path]){case z.weights:c=i.NumberKeyframeTrack;break;case z.rotation:c=i.QuaternionKeyframeTrack;break;case z.position:case z.scale:c=i.VectorKeyframeTrack;break;default:c=1===r.itemSize?i.NumberKeyframeTrack:i.VectorKeyframeTrack}const h=void 0!==n.interpolation?G[n.interpolation]:i.InterpolateLinear,u=this._getArrayFromAccessor(r);for(let t=0,r=l.length;t{this.parse(t,e,n)}),r,n)}parse(t,e,r){this.decodeDracoFile(t,e,null,null,i.SRGBColorSpace).catch(r)}decodeDracoFile(t,e,r,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.LinearSRGBColorSpace;const o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:s};return this.decodeGeometry(t,o).then(e)}decodeGeometry(t,e){const r=JSON.stringify(e);if(J.has(t)){const e=J.get(t);if(e.key===r)return e.promise;if(0===t.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const n=this.workerNextTaskID++,s=t.byteLength,o=this._getWorker(n,s).then((r=>(i=r,new Promise(((r,s)=>{i._callbacks[n]={resolve:r,reject:s},i.postMessage({type:"decode",id:n,taskConfig:e,buffer:t},[t])}))))).then((t=>this._createGeometry(t.geometry)));return o.catch((()=>!0)).then((()=>{i&&n&&this._releaseTask(i,n)})),J.set(t,{key:r,promise:o}),o}_createGeometry(t){const e=new i.BufferGeometry;t.index&&e.setIndex(new i.BufferAttribute(t.index.array,1));for(let r=0;r{r.load(t,e,void 0,i)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then((e=>{const r=e[0];t||(this.decoderConfig.wasmBinary=e[1]);const i=$.toString(),n=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending}_getWorker(t,e){return this._initDecoder().then((()=>{if(this.workerPool.lengthe._taskLoad?-1:1}));const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[t]=e,r._taskLoad+=e,r}))}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map((t=>t._taskLoad)))}dispose(){for(let t=0;t{const e=t.draco,o=new e.Decoder;try{const t=function(t,e,i,n){const s=n.attributeIDs,o=n.attributeTypes;let a,l;const c=e.GetEncodedGeometryType(i);if(c===t.TRIANGULAR_MESH)a=new t.Mesh,l=e.DecodeArrayToMesh(i,i.byteLength,a);else{if(c!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new t.PointCloud,l=e.DecodeArrayToPointCloud(i,i.byteLength,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const i in s){const l=self[o[i]];let c,u;if(n.useUniqueIDs)u=s[i],c=e.GetAttributeByUniqueId(a,u);else{if(u=e.GetAttributeId(a,t[s[i]]),-1===u)continue;c=e.GetAttribute(a,u)}const d=r(t,e,a,i,l,c);"color"===i&&(d.vertexColorSpace=n.vertexColorSpace),h.attributes.push(d)}return c===t.TRIANGULAR_MESH&&(h.index=function(t,e,r){const i=3*r.num_faces(),n=4*i,s=t._malloc(n);e.GetTrianglesUInt32Array(r,n,s);const o=new Uint32Array(t.HEAPF32.buffer,s,i).slice();return t._free(s),{array:o,itemSize:1}}(t,e,a)),t.destroy(a),h}(e,o,new Int8Array(i),s),a=t.attributes.map((t=>t.array.buffer));t.index&&a.push(t.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:t},a)}catch(t){console.error(t),self.postMessage({type:"error",id:n.id,error:t.message})}finally{e.destroy(o)}}))}}}class tt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(t){if(!this.workers[t]){const e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,t)),this.workers[t]=e}}_getIdleWorker(){for(let t=0;t{const i=this._getIdleWorker();-1!==i?(this._initWorker(i),this.workerStatus|=1<t.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class et{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class rt{constructor(t,e,r,i){this._dataView=new DataView(t.buffer,t.byteOffset+e,r),this._littleEndian=i,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_nextInt32(){const t=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,t}_skip(t){return this._offset+=t,this}_scan(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==e&&it.arrayBuffer())).then((t=>WebAssembly.instantiate(t,lt))).then(this._init):WebAssembly.instantiate(Buffer.from(ht,"base64"),lt).then(this._init),st)}_init(t){ot=t.instance,lt.env.emscripten_notify_memory_growth(0)}decode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!ot)throw new Error("ZSTDDecoder: Await .init() before decoding.");const r=t.byteLength,i=ot.exports.malloc(r);at.set(t,i),e=e||Number(ot.exports.ZSTD_findDecompressedSize(i,r));const n=ot.exports.malloc(e),s=ot.exports.ZSTD_decompress(n,e,i,r),o=at.slice(n,n+s);return ot.exports.free(i),ot.exports.free(n),o}}const ht="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",ut=new WeakMap;let dt,pt=0;class ft extends i.Loader{constructor(t){super(t),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new tt,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(t){return this.transcoderPath=t,this}setWorkerLimit(t){return this.workerPool.setWorkerLimit(t),this}detectSupport(t){return!0===t.isWebGPURenderer?this.workerConfig={astcSupported:t.hasFeature("texture-compression-astc"),etc1Supported:!1,etc2Supported:t.hasFeature("texture-compression-etc2"),dxtSupported:t.hasFeature("texture-compression-bc"),bptcSupported:!1,pvrtcSupported:!1}:(this.workerConfig={astcSupported:t.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:t.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:t.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:t.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:t.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:t.extensions.has("WEBGL_compressed_texture_pvrtc")||t.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},t.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const t=new i.FileLoader(this.manager);t.setPath(this.transcoderPath),t.setWithCredentials(this.withCredentials);const e=t.loadAsync("basis_transcoder.js"),r=new i.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const n=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([e,n]).then((t=>{let[e,r]=t;const i=ft.BasisWorker.toString(),n=["/* constants */","let _EngineFormat = "+JSON.stringify(ft.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(ft.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(ft.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n])),this.transcoderBinary=r,this.workerPool.setWorkerCreator((()=>{const t=new Worker(this.workerSourceURL),e=this.transcoderBinary.slice(0);return t.postMessage({type:"init",config:this.workerConfig,transcoderBinary:e},[e]),t}))})),pt>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),pt++}return this.transcoderPending}load(t,e,r,n){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new i.FileLoader(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(t,(t=>{if(ut.has(t))return ut.get(t).promise.then(e).catch(n);this._createTexture(t).then((t=>e?e(t):null)).catch(n)}),r,n)}_createTextureFrom(t,e){const{faces:r,width:n,height:s,format:o,type:a,error:l,dfdFlags:c}=t;if("error"===a)return Promise.reject(l);let h;if(6===e.faceCount)h=new i.CompressedCubeTexture(r,o,i.UnsignedByteType);else{const t=r[0].mipmaps;h=e.layerCount>1?new i.CompressedArrayTexture(t,n,s,e.layerCount,o,i.UnsignedByteType):new i.CompressedTexture(t,n,s,o,i.UnsignedByteType)}return h.minFilter=1===r[0].mipmaps.length?i.LinearFilter:i.LinearMipmapLinearFilter,h.magFilter=i.LinearFilter,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=yt(e),h.premultiplyAlpha=!!(1&c),h}async _createTexture(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,it.length);if(e[0]!==it[0]||e[1]!==it[1]||e[2]!==it[2]||e[3]!==it[3]||e[4]!==it[4]||e[5]!==it[5]||e[6]!==it[6]||e[7]!==it[7]||e[8]!==it[8]||e[9]!==it[9]||e[10]!==it[10]||e[11]!==it[11])throw new Error("Missing KTX 2.0 identifier.");const r=new et,i=17*Uint32Array.BYTES_PER_ELEMENT,n=new rt(t,it.length,i,!0);r.vkFormat=n._nextUint32(),r.typeSize=n._nextUint32(),r.pixelWidth=n._nextUint32(),r.pixelHeight=n._nextUint32(),r.pixelDepth=n._nextUint32(),r.layerCount=n._nextUint32(),r.faceCount=n._nextUint32();const s=n._nextUint32();r.supercompressionScheme=n._nextUint32();const o=n._nextUint32(),a=n._nextUint32(),l=n._nextUint32(),c=n._nextUint32(),h=n._nextUint64(),u=n._nextUint64(),d=new rt(t,it.length+i,3*s*8,!0);for(let e=0;e{const e=new ct;await e.init(),t(e)}))),r=await dt);const n=[];for(let s=0;s>s),a=Math.max(1,t.pixelHeight>>s),l=t.pixelDepth?Math.max(1,t.pixelDepth>>s):0,c=t.levels[s];let h,u;if(0===t.supercompressionScheme)h=c.levelData;else{if(2!==t.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");h=r.decode(c.levelData,c.uncompressedByteLength)}u=At[e]===i.FloatType?new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):At[e]===i.HalfFloatType?new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):h,n.push({data:u,width:o,height:a,depth:l})}let s;if(mt.has(gt[e]))s=0===t.pixelDepth?new i.DataTexture(n[0].data,t.pixelWidth,t.pixelHeight):new i.Data3DTexture(n[0].data,t.pixelWidth,t.pixelHeight,t.pixelDepth);else{if(t.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new i.CompressedTexture(n,t.pixelWidth,t.pixelHeight)}return s.mipmaps=n,s.type=At[e],s.format=gt[e],s.colorSpace=yt(t),s.needsUpdate=!0,Promise.resolve(s)}(r);const n=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:t,taskConfig:e},[t]))).then((t=>this._createTextureFrom(t.data,r)));return ut.set(t,{promise:n}),n}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),pt--,this}}ft.BasisFormat={ETC1S:0,UASTC_4x4:1},ft.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},ft.EngineFormat={RGBAFormat:i.RGBAFormat,RGBA_ASTC_4x4_Format:i.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:i.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:i.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:i.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:i.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:i.RGB_ETC1_Format,RGB_ETC2_Format:i.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:i.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:i.RGB_S3TC_DXT1_Format},ft.BasisWorker=function(){let t,e,r;const i=_EngineFormat,n=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",(function(o){const u=o.data;switch(u.type){case"init":t=u.config,d=u.transcoderBinary,e=new Promise((t=>{r={wasmBinary:d,onRuntimeInitialized:t},BASIS(r)})).then((()=>{r.initializeBasis(),void 0===r.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":e.then((()=>{try{const{faces:e,buffers:o,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g}=function(e){const o=new r.KTX2File(new Uint8Array(e));function u(){o.close(),o.delete()}if(!o.isValid())throw u(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=o.isUASTC()?s.UASTC_4x4:s.ETC1S,p=o.getWidth(),f=o.getHeight(),m=o.getLayers()||1,g=o.getLevels(),A=o.getFaces(),y=o.getHasAlpha(),v=o.getDFDFlags(),{transcoderFormat:x,engineFormat:b}=function(e,r,o,h){let u,d;const p=e===s.ETC1S?a:l;for(let i=0;i1?(n=a.origWidth,s=a.origHeight):(n=a.width,s=a.height);const l=new Uint8Array(o.getImageTranscodedSizeInBytes(r,e,0,x));if(!o.transcodeImage(l,r,e,t,x,0,-1,-1))throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");i.push(l)}const a=h(i);e.push({data:a,width:n,height:s}),w.push(a.buffer)}_.push({mipmaps:e,width:p,height:f,format:b})}return u(),{faces:_,buffers:w,width:p,height:f,hasAlpha:y,format:b,dfdFlags:v}}(u.buffer);self.postMessage({type:"transcode",id:u.id,faces:e,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g},o)}catch(t){console.error(t),self.postMessage({type:"error",id:u.id,error:t.message})}}))}var d}));const o=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.BC1,n.BC3],engineFormat:[i.RGB_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.ETC1],engineFormat:[i.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],a=o.sort((function(t,e){return t.priorityETC1S-e.priorityETC1S})),l=o.sort((function(t,e){return t.priorityUASTC-e.priorityUASTC}));function c(t){return t<=2||0==(t&t-1)&&0!==t}function h(t){if(1===t.length)return t[0];let e=0;for(let r=0;r=0&&(c[n.KHR_MATERIALS_COMMON]=new s(h)),new C(h,c,{crossOrigin:this.crossOrigin,manager:this.manager,path:e||this.resourcePath||""}).parse((function(t,e,i,n){r({scene:t,scenes:e,cameras:i,animations:n})}))}}function e(){var t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}},update:function(e,r){for(var i in t){var n=t[i];n.update&&n.update(e,r)}}}}function r(t,e){var r={},n=t.material.uniforms;for(var s in n){var o=n[s];if(o.semantic){var a=o.node,l=t;a&&(l=e[a]),r[s]={semantic:o.semantic,sourceNode:l,targetNode:t,uniform:o}}}this.boundUniforms=r,this._m4=new i.Matrix4}t.Shaders={update:function(){console.warn("threeExamples.LegacyGLTFLoader.Shaders has been deprecated, and now updates automatically.")}},r.prototype.update=function(t,e){var r=this.boundUniforms;for(var i in r){var n=r[i];switch(n.semantic){case"MODELVIEW":n.uniform.value.multiplyMatrices(e.matrixWorldInverse,n.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var s=n.uniform.value;this._m4.multiplyMatrices(e.matrixWorldInverse,n.sourceNode.matrixWorld),s.getNormalMatrix(this._m4);break;case"PROJECTION":n.uniform.value.copy(e.projectionMatrix);break;case"JOINTMATRIX":for(var o=n.uniform.value,a=0;a0){const e=c,r=t.slice(e,l.FTJSONLength+e),i=Ct.decode(new Uint8Array(r));u=JSON.parse(i),u.RTC_CENTER?d.fromArray(u.RTC_CENTER):d.set(0,0,0)}if(l.FTBinaryLength>0&&console.warn("3D Tiles feature table binary not supported yet."),l.BTJSONLength>0){const r=c+l.FTJSONLength+l.FTBinaryLength,i=t.slice(r,r+l.BTJSONLength+l.BTBinaryLength);h.push(Promise.resolve(new _t.Z(i,l.BTJSONLength,l.BTBinaryLength,u.BATCH_LENGTH,e.registeredExtensions)))}else h.push(Promise.resolve(new _t.Z));const p=c+l.FTJSONLength+l.FTBinaryLength+l.BTJSONLength+l.BTBinaryLength,f=t.slice(p),m=new DataView(f,0,20);return h.push(new Promise((t=>{const o=s=>{for(const t of s.scenes)t.traverse(Rt);void 0===r||"Y"===r?s.scene.applyMatrix4(Mt):"X"===r&&s.scene.applyMatrix4(St),s.scene.position.copy(d);const o=new Uint8Array(f,20,m.getUint32(12,!0)),a=Ct.decode(new Uint8Array(o)),l=JSON.parse(a);l.extensions&&l.extensions.CESIUM_RTC&&(s.scene.position.fromArray(l.extensions.CESIUM_RTC.center),s.scene.updateMatrixWorld(!0)),s.scene.traverse((function(t){if(t.frustumCulled=!1,t.material){if(e.overrideMaterials){const r=t.material;"object"==typeof e.overrideMaterials&&e.overrideMaterials.isMaterial?t.material=e.overrideMaterials:t.material=new i.MeshBasicMaterial,(0,Et.Z)(r)}else n.Z.isLogDepthBufferSupported()&&t.material.isRawShaderMaterial&&!e.doNotPatchMaterial&&(bt.Z.patchMaterialForLogDepthSupport(t.material),console.warn("b3dm shader has been patched to add log depth buffer support"));(0,wt.Z)(t.material,e.layer)}})),t(s)};1===m.getUint32(4,!0)?It.parse(f,s,o):Tt.parse(f,s,o)}))),Promise.all(h).then((t=>({gltf:t[1],batchTable:t[0]})))}throw new Error("Invalid b3dm file.")}}},71077:(t,e,r)=>{"use strict";r.d(e,{S:()=>a,Z:()=>l});var i=r(99477),n=r(67503),s=r(99128),o=r(14278);function a(t,e){const r=t[t.indexOf(t.find((t=>t.includes(e))))].split(" ").filter((t=>""!==t));return parseFloat(r[r.length-1])}const l={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.split("\n"),l=r.indexOf(r.find((t=>t.includes("end_of_head"))))+1,c=r.slice(0,l),h={minX:a(c,"longlimit_west"),maxX:a(c,"longlimit_east"),minY:a(c,"latlimit_south"),maxY:a(c,"latlimit_north"),stepX:a(c,"gridstep"),stepY:a(c,"gridstep"),nRows:a(c,"latitude_parallels"),nColumns:a(c,"longitude_parallels")},u=new DataView(new ArrayBuffer(o.h8*h.nRows*h.nColumns));let d=0;for(let t of r.slice(l,r.length))t=t.split(" ").filter((t=>""!==t)),t.length&&(u.setFloat64(d*o.h8,parseFloat(t[2])),d++);const p=new s.ZP(e.in.crs||"EPSG:4326",h.minX,h.maxX,h.minY,h.maxY),f=new i.Vector2(h.stepX,h.stepY);return Promise.resolve(new n.Z(p,f,((t,e)=>u.getFloat64((h.nColumns*(h.nRows-t-1)+e)*o.h8))))}}},14278:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>a,h8:()=>o});var i=r(99477),n=r(67503),s=r(99128);const o=8,a={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=e.in.dataType||"float";if(!["float","double"].includes(r))throw new Error("`dataType` parameter is incorrect for GTXParser.parse method. This parameter must be either `double` or `float`.");const a=new DataView(t,0,40),l={minX:a.getFloat64(8),minY:a.getFloat64(0),stepX:a.getFloat64(24),stepY:a.getFloat64(16),nColumns:a.getInt32(36),nRows:a.getInt32(32)},c=new DataView(t,40),h=l.minX+l.stepX*(l.nColumns-1),u=l.minY+l.stepY*(l.nRows-1),d=new s.ZP(e.in.crs||"EPSG:4326",l.minX,h,l.minY,u),p=new i.Vector2(l.stepX,l.stepY);return Promise.resolve(new n.Z(d,p,((t,e)=>"float"===r?c.getFloat32(4*(l.nColumns*t+e)):"double"===r?c.getFloat64((l.nColumns*t+e)*o):void 0)))}}},97400:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(60145),n=r(94596),s=r(86896);const o=new i.Z("EPSG:4978",0,0,0),a=new i.Z("EPSG:4978",0,0,0),l=new i.Z("EPSG:4978",0,0,0),c=(t,e,r)=>(o.crs=r,o.setFromArray(e[0]),!t.isPointInside(o)),h={populateGeometry(t,e,r,i){r.startSubGeometry(e.length,i),o.crs=t;for(const t of e)o.setFromValues(t[0],t[1],t[2]),r.pushCoordinates(i,o);r.updateExtent()},populateGeometryWithCCW(t,e,r,i){r.startSubGeometry(e.length,i),o.crs=t;let n=0;l.setFromValues(e[0][0],e[0][1],e[0][2]),a.copy(l);for(let t=0;tvoid 0===t||Array.isArray(t)&&!isNaN(t[0])?t:d(t[0]);function p(t,e,r){var i,s;if(null===(i=e.geometry)||void 0===i||!i.type)return console.warn("No geometry provided"),null;const o=e.geometry.type.toLowerCase(),a=function(t){switch(t){case"point":case"multipoint":return n.tg.POINT;case"linestring":case"multilinestring":return n.tg.LINE;case"polygon":case"multipolygon":return n.tg.POLYGON;default:throw new Error(`Unhandled geometry type ${t}`)}}(o),l=r.requestFeatureByType(a),c="point"!=o?e.geometry.coordinates:[e.geometry.coordinates],p=e.properties||{};l.hasRawElevationData=3===(null===(s=d(c))||void 0===s?void 0:s.length);for(const t of Object.keys(e))u.includes(t.toLowerCase())||(p.geojson=p.geojson||{},p.geojson[t]=e[t]);return function(t,e,r,i,n,s){if(0!=i.length)switch(t){case"point":case"linestring":return h.default(e,r,i,n,s);case"multipoint":return h.multi("point",e,r,i,n,s);case"multilinestring":return h.multi("default",e,r,i,n,s);case"polygon":return h.polygon(e,r,i,n,s);case"multipolygon":return h.multi("polygon",e,r,i,n,s);default:throw new Error(`Unhandled geojson type ${e.type}`)}}(o,l,t,c,r,p),l}function f(t,e,r){const i=new n.t1(r),s=r.filter||(()=>!0);for(const r of e)s(r.properties,r.geometry)&&p(t,r,i);return i.removeEmptyFeature(),i.updateExtent(),i}const m={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=(0,s._F)(e),e.in=e.in||{};const r=e.out,i=e.in;switch("string"==typeof t&&(t=JSON.parse(t)),i.crs=i.crs||function(t){if(t.crs){if("epsg"==t.crs.type.toLowerCase())return`EPSG:${t.crs.properties.code}`;if("name"==t.crs.type.toLowerCase()){if(t.crs.properties.name.toLowerCase().includes("epsg:")){const e=t.crs.properties.name.lastIndexOf(":");if(e>0)return`EPSG:${t.crs.properties.name.substr(e+1)}`}throw new Error(`Unsupported CRS authority '${t.crs.properties.name}'`)}throw new Error(`Unsupported CRS type '${t.crs}'`)}return"EPSG:4326"}(t),r.filteringExtent&&("boolean"==typeof r.filteringExtent?r.filterExtent=t.extent.as(i.crs):r.filteringExtent.isExtent&&(r.filterExtent=r.filteringExtent)),t.type.toLowerCase()){case"featurecollection":return Promise.resolve(f(i.crs,t.features,r));case"feature":return Promise.resolve(f(i.crs,[t],r));default:throw new Error(`Unsupported GeoJSON type: '${t.type}`)}}}},70274:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(75153),n=r(97400),s=r(86896);const o={parse:(t,e)=>(e=(0,s._F)(e),n.Z.parse((0,i.ng)(t),e))}},49472:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477),n=r(67503),s=r(99128),o=r(71077),a=r(14278);const l={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.split("\n"),l=r.indexOf(r.find((t=>t.includes("end_of_head"))))+1,c=r.slice(0,l),h={minX:(0,o.S)(c,"lon min"),maxX:(0,o.S)(c,"lon max"),minY:(0,o.S)(c,"lat min"),maxY:(0,o.S)(c,"lat max"),stepX:(0,o.S)(c,"delta lon"),stepY:(0,o.S)(c,"delta lat"),nRows:(0,o.S)(c,"nrows"),nColumns:(0,o.S)(c,"ncols")},u=new DataView(new ArrayBuffer(a.h8*h.nRows*h.nColumns));let d=0;for(let t of r.slice(l,r.length))if(t=t.split(" ").filter((t=>""!==t)),t.length)for(const e of t)u.setFloat64(d*a.h8,parseFloat(e)),d++;const p=new s.ZP(e.in.crs||"EPSG:4326",h.minX+h.stepX/2,h.maxX-h.stepX/2,h.minY+h.stepY/2,h.maxY-h.stepY/2),f=new i.Vector2(h.stepX,h.stepY);return Promise.resolve(new n.Z(p,f,((t,e)=>u.getFloat64((h.nColumns*t+e)*a.h8))))}}},99127:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(75153),n=r(97400),s=r(86896);const o={parse:(t,e)=>(e=(0,s._F)(e),n.Z.parse((0,i.DS)(t),e))}},77474:(t,e,r)=>{"use strict";r.d(e,{SR:()=>m,SY:()=>d,Ti:()=>y,Y0:()=>v,y:()=>h});var i=r(99477),n=r(1857),s=r(24147),o=r(24266);function a(t,e,r,i,n,s){const a={view:t,requester:n,layer:r,priority:n?1/(n.distance+1):100,metadata:i,redraw:s};return r.dispatchEvent({type:o.y.ON_TILE_REQUESTED,metadata:i}),e.execute(a)}function l(t){return t.children.filter((e=>e.layer==t.layer&&e.tileId))}const c=new i.Matrix4;function h(t,e,r,i){return!(!r.viewerRequestVolume||!r.viewerRequestVolume.viewerRequestVolumeCulling(e,i))||!(!r.boundingVolume||!r.boundingVolume.boundingVolumeCulling(e,i))}function u(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=e.additiveRefinement||r>0;for(let s=0;sthis.cleanupDelay){this.root.cleanableSince=void 0;let e=0;for(;ethis.cleanupDelay))break;u(this,r)}this._cleanableTiles.splice(0,e)}return[this.root]}const p=new i.Box3,f=new i.Sphere;function m(t,e,r,i){return a(t,e,r,i,void 0,!0).then((t=>{r.object3d.add(t),t.updateMatrixWorld(),r.tileset.tiles[t.tileId].loaded=!0,r.root=t,r.onTileContentLoaded(t)}))}function g(t,e){t.content&&(t.content.visible=e)}function A(t,e){e.cleanableSince||(e.cleanableSince=Date.now(),t._cleanableTiles.push(e))}function y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return function(r,i,n){if(n.parent.pendingSubdivision&&!n.parent.additiveRefinement)return void(n.visible=!1);const s=!t||!t(i,r.camera,n,n.matrixWorld);if(n.visible=s,s){let s;if(n.cleanableSince&&(i._cleanableTiles.splice(i._cleanableTiles.indexOf(n),1),n.cleanableSince=void 0),n.pendingSubdivision||e(r,i,n))(function(t,e,r,i){r.additiveRefinement?function(t,e,r,i){for(const n of e.tileset.tiles[r.tileId].children){if(n.promise||n.loaded)continue;let s=r.matrixWorld;n.transform&&(s=c.multiplyMatrices(r.matrixWorld,n.transform)),(!i||!i(e,t.camera,n,s))&&(n.promise=a(t.view,t.scheduler,e,n,r,!0).then((i=>{r.add(i),i.updateMatrixWorld(),e.onTileContentLoaded(i),t.view.notifyChange(n),n.loaded=!0,delete n.promise})))}}(t,e,r,i):function(t,e,r){if(!r.pendingSubdivision&&0==l(r).length){const i=e.tileset.tiles[r.tileId].children;if(void 0===i||0===i.length)return;r.pendingSubdivision=!0;const n=[];for(let s=0;s{i[s].loaded=!0,r.add(n),n.updateMatrixWorld(),r.additiveRefinement&&t.view.notifyChange(r),e.tileset.tiles[n.tileId].loaded=!0,e.onTileContentLoaded(n)})));Promise.all(n).then((()=>{r.pendingSubdivision=!1,t.view.notifyChange(r)}))}}(t,e,r)})(r,i,n,t),g(n,n.pendingSubdivision||n.additiveRefinement),s=l(n);else{g(n,!0);for(const t of l(n))t.visible=!1,A(i,t)}return s}A(i,n)}}function v(t,e,r){if(void 0===e.tileset.tiles[r.tileId].children)return!1;if(e.tileset.tiles[r.tileId].isTileset)return!0;const i=function(t,e){if(e.distance=0,e.boundingVolume.initialVolumeType===s.D.box)p.copy(e.boundingVolume.volume),p.applyMatrix4(e.matrixWorld),e.distance=p.distanceToPoint(t.camera3D.position);else{if(e.boundingVolume.initialVolumeType!==s.D.sphere&&e.boundingVolume.initialVolumeType!==s.D.region)return 1/0;f.copy(e.boundingVolume.volume),f.applyMatrix4(e.matrixWorld),e.distance=Math.max(0,f.distanceToPoint(t.camera3D.position))}return 0===e.distance?1/0:t._preSSE*(e.geometricError/e.distance)}(t.camera,r);return i>e.sseThreshold}},75963:(t,e,r)=>{"use strict";r.d(e,{U8:()=>u,XP:()=>c,kE:()=>o,pN:()=>h});var i=r(54919),n=r(52872),s=r(13324);const o=131072**.5;function a(t){return!(t.requester.parent&&t.requester.material&&!(t.layer.isElevationLayer&&t.requester.material.getElevationLayer()&&t.targetLevel<=t.requester.material.getElevationLayer().level)&&t.requester.layerUpdateState[t.layer.id]&&t.layer.source._featuresCaches[t.layer.crs]&&t.requester.material.visible)}function l(t,e,r,i,n){return{view:t,layer:e,extentsSource:r,extentsDestination:i,requester:n,priority:(s=n.material,s.visible?100:10),earlyDropFunction:a};var s}function c(t,e,r,o){const a=r.material;if(!o||!a)return;const c=r.getExtentsByProjection(e.crs),h=c[0].zoom;if(h>e.zoom.max||h=e.source.zoom.min)return void t.view.notifyChange(r,!1)}if(!a.visible)return;if(!e.visible||!r.layerUpdateState[e.id].canTryUpdate())return;if(u.level>=c[0].zoom)return void r.layerUpdateState[e.id].noMoreUpdatePossible();if(e.frozen)return;const p=r.layerUpdateState[e.id].failureParams,f=c[0].zoom||r.level,m=(0,i.k5)(e.updateStrategy.type,r,f,u.level,e,p);if(!e.source.isVectorSource&&m<=u.level||m>f)return void(p.lowestLevelError!=1/0&&r.layerUpdateState[e.id].noMoreUpdatePossible());if(!e.source.extentInsideLimit(r.extent,m))return r.layerUpdateState[e.id].noData({targetLevel:m}),void t.view.notifyChange(r,!1);const g=c.map((t=>t.tiledExtentParent(m)));r.layerUpdateState[e.id].newTry();const A=l(t.view,e,g,c,r);return t.scheduler.execute(A).then((t=>{if(!r.layerUpdateState[e.id])return;const i=c.map(((e,r)=>e.offsetToParent(t[r].extent,u.offsetScales[r])));u.setTextures(t,i),r.layerUpdateState[e.id].success()}),(i=>(0,s.Z)(i,r,e,m,t.view)))}function h(t,e,r,o){const a=r.material;if(!o||!a)return;const c=r.getExtentsByProjection(e.crs),h=c[0].zoom;if(h>e.zoom.max||h=e.source.zoom.min)return void t.view.notifyChange(r,!1)}if(e.frozen||!a.visible||!r.layerUpdateState[e.id].canTryUpdate())return;const p=r.layerUpdateState[e.id].failureParams,f=(0,i.k5)(e.updateStrategy.type,r,c[0].zoom,u.level,e,p);if(f<=u.level||f>c[0].zoom)return void r.layerUpdateState[e.id].noMoreUpdatePossible();if(!e.source.extentInsideLimit(r.extent,f))return r.layerUpdateState[e.id].noData({targetLevel:f}),void t.view.notifyChange(r,!1);const m=c.map((t=>t.tiledExtentParent(f)));r.layerUpdateState[e.id].newTry();const g=l(t.view,e,m,c,r);return t.scheduler.execute(g).then((t=>{if(!r.layerUpdateState[e.id])return;if(f<=u.level)return void r.layerUpdateState[e.id].noMoreUpdatePossible();const i=c.map(((e,r)=>e.offsetToParent(t[r].extent,u.offsetScales[r])));u.setTextures(t,i),r.layerUpdateState[e.id].success()}),(i=>(0,s.Z)(i,r,e,f,t.view)))}function u(t){return function(e){var r;null!==(r=e.material)&&void 0!==r&&r.removeLayer&&(e.material.removeLayer(t),e.material.elevationLayerIds[0]==t&&e.setBBoxZ({min:0,max:0})),e.layerUpdateState&&e.layerUpdateState[t]&&delete e.layerUpdateState[t]}}},1857:(t,e,r)=>{"use strict";function i(t){t.dispose();for(const e of Object.keys(t)){const r=t[e];r&&r.isTexture&&r.dispose()}}r.d(e,{Z:()=>n});const n={cleanup(t){if(t.layer=null,t.isScene||"function"!=typeof t.dispose){if(t.geometry&&t.geometry.dispose(),t.material)if(Array.isArray(t.material))for(const e of t.material)i(e);else i(t.material);t.dispatchEvent({type:"dispose"})}else t.dispose()},removeChildren(t,e){const r=e.children.filter((e=>(e.layer&&e.layer.id)===t.id));return e.remove(...r),r},removeChildrenAndCleanup(t,e){const r=e.children.filter((e=>(e.layer&&e.layer.id)===t.id));return e.remove(...r),e.layer===t&&this.cleanup(e),r},removeChildrenAndCleanupRecursively(t,e){let r=e.children.filter((e=>e.layer&&e.layer.id===t.id));const i=e.link&&e.link[t.id];null!=i&&i.children.length&&(r=r.concat(i.children),delete e.link[t.id]);for(const e of r)this.removeChildrenAndCleanupRecursively(t,e);return e.remove(...r),e.layer&&e.layer.id===t.id&&this.cleanup(e),r}}},13324:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=4;function n(t,e,r,n,s){if(e.layerUpdateState[r.id])if(t.isCancelledCommandException)e.layerUpdateState[r.id].success();else if(t instanceof SyntaxError)e.layerUpdateState[r.id].failure(0,!0);else{const t=e.layerUpdateState[r.id].errorCount>i;e.layerUpdateState[r.id].failure(Date.now(),t,{targetLevel:n}),t||window.setTimeout((()=>{s.notifyChange(e,!1)}),1e3*e.layerUpdateState[r.id].secondsUntilNextTry())}}},33347:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477);const n=new i.TextureLoader,s=256;function o(t){if(!t.ok){const e=new Error(`Error loading ${t.url}: status ${t.status}`);throw e.response=t,e}}const a=function(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(o(t),t.arrayBuffer())))},l={text(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(o(t),t.text())))},json(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(o(t),t.json())))},xml(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(o(t),t.text()))).then((t=>(new window.DOMParser).parseFromString(t,"text/xml")))},texture(t){let e,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.crossOrigin=i.crossOrigin;const s=new Promise(((t,i)=>{e=t,r=i}));return n.load(t,e,(()=>{}),r),s},arrayBuffer:a,textureFloat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a(t,e).then((t=>{const r=function(t){if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){const e=new i.DataTexture(t,s,s,i.RedFormat,i.FloatType);return e.internalFormat="R32F",e.needsUpdate=!0,e}return new i.DataTexture(t,s,s,i.AlphaFormat,i.FloatType)}(new Float32Array(t),e.isWebGL2);return r}))},multiple(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[];let n;for(const s in e){if(!this[s])throw new Error(`${s} is not a valid Fetcher method.`);for(const o of e[s])n=`${t}.${o}`,i.push(this[s](n,r).then((t=>({type:o,result:t}))))}return Promise.all(i).then((t=>{const e={};for(const r of t)e[r.type]=r.result;return Promise.resolve(e)}))}}},13012:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});const i=new(r(99128).ZP)("EPSG:4326",[0,0,0,0]);let n=0;function s(t){const e=/\$\{u:([\w-_.|]+)\}/.exec(t);if(!e)return t;const r=e[1].split("|");return t.replace(e[0],r[n++%r.length])}const o={subDomains:s,xyz:function(t,e){return s(e.url.replace(/(\$\{z\}|%TILEMATRIX)/,e.tileMatrixCallback(t.zoom)).replace(/(\$\{y\}|%ROW)/,t.row).replace(/(\$\{x\}|%COL)/,t.col))},bbox:function(t,e){let r="EPSG:4326"==e.crs?9:2;void 0!==e.bboxDigits&&(r=e.bboxDigits),t.as(e.crs,i);const n=i.west.toFixed(r),o=i.south.toFixed(r),a=i.east.toFixed(r),l=i.north.toFixed(r);let c=e.axisOrder||"wsen";return c=c.replace("w",`${n},`).replace("s",`${o},`).replace("e",`${a},`).replace("n",`${l},`).slice(0,-1),s(e.url.replace("%bbox",c))}}},800:(t,e,r)=>{"use strict";r.d(e,{P:()=>o,Z:()=>u});var i=r(99477),n=r(60145),s=r(79295);const o={PERSPECTIVE:0,ORTHOGRAPHIC:1},a={frustum:new i.Frustum,matrix:new i.Matrix4,box3:new i.Box3},l=new i.Box3(new i.Vector3(-1,-1,-1),new i.Vector3(1,1,1));function c(t,e,r){if(t.camera3D.isOrthographicCamera)t._preSSE=e;else{const n=i.MathUtils.degToRad(r);t._preSSE=e/(2*Math.tan(.5*n))}}const h=[new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3],u=class{#B=!0;#L=new i.Matrix4;constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(this.crs=t,n.isCamera)console.warn("options.camera parameter is deprecated. Use options.camera.cameraThree to place a custom camera as a parameter. See the documentation of Camera."),this.camera3D=n;else if(n.cameraThree)this.camera3D=n.cameraThree;else switch(n.type){case o.ORTHOGRAPHIC:this.camera3D=new i.OrthographicCamera;break;case o.PERSPECTIVE:default:this.camera3D=new i.PerspectiveCamera(30)}if(this.camera3D.aspect=this.camera3D.aspect??1,this.width=e,this.height=r,this.resize(e,r),this._preSSE=1/0,this.camera3D.isPerspectiveCamera){let t=this.camera3D.fov;Object.defineProperty(this.camera3D,"fov",{get:()=>t,set:e=>{t=e,c(this,this.height,t)}})}}resize(t,e){if(!t||t<=0||!e||e<=0)return void console.warn(`Trying to resize the Camera with invalid height (${e}) or width (${t}). Skipping resize.`);const r=t/e;if(this.camera3D.aspect!==r){if(this.camera3D.isOrthographicCamera){this.camera3D.zoom*=this.width/t;const e=this.camera3D.top*this.camera3D.aspect/r;this.camera3D.bottom=-e,this.camera3D.top=e}else this.camera3D.isPerspectiveCamera&&(this.camera3D.fov=2*i.MathUtils.radToDeg(Math.atan(e/this.height*Math.tan(i.MathUtils.degToRad(this.camera3D.fov)/2))));this.camera3D.aspect=r}this.width=t,this.height=e,c(this,this.height,this.camera3D.fov),this.camera3D.updateProjectionMatrix&&(this.camera3D.updateProjectionMatrix(),this.#B=!0)}update(){this.camera3D.updateMatrixWorld(),this.#B=!0}position(t){return new n.Z(this.crs,this.camera3D.position).as(t||this.crs)}setPosition(t){this.camera3D.position.copy(t.as(this.crs))}isBox3Visible(t,e){return this.box3SizeOnScreen(t,e).intersectsBox(l)}isSphereVisible(t,e){return this.#B&&(this.#L.multiplyMatrices(this.camera3D.projectionMatrix,this.camera3D.matrixWorldInverse),this.#B=!1),e?(a.matrix.multiplyMatrices(this.#L,e),a.frustum.setFromProjectionMatrix(a.matrix)):a.frustum.setFromProjectionMatrix(this.#L),a.frustum.intersectsSphere(t)}box3SizeOnScreen(t,e){const r=function(t,e,r){let i=t.camera3D.matrixWorldInverse;r&&(i=a.matrix.multiplyMatrices(t.camera3D.matrixWorldInverse,r)),h[0].set(e.min.x,e.min.y,e.min.z).applyMatrix4(i),h[1].set(e.min.x,e.min.y,e.max.z).applyMatrix4(i),h[2].set(e.min.x,e.max.y,e.min.z).applyMatrix4(i),h[3].set(e.min.x,e.max.y,e.max.z).applyMatrix4(i),h[4].set(e.max.x,e.min.y,e.min.z).applyMatrix4(i),h[5].set(e.max.x,e.min.y,e.max.z).applyMatrix4(i),h[6].set(e.max.x,e.max.y,e.min.z).applyMatrix4(i),h[7].set(e.max.x,e.max.y,e.max.z).applyMatrix4(i);let n=!1;for(let e=0;e<8;e++)h[e].z<=-t.camera3D.near?n=!0:h[e].z=-t.camera3D.near;return n?h:void 0}(this,t,e);if(!r)return a.box3.makeEmpty();for(let t=0;t<8;t++)r[t].applyMatrix4(this.camera3D.projectionMatrix);return a.box3.setFromPoints(r)}adjustAltitudeToAvoidCollisionWithLayer(t,e,r){const i=t.camera.position().as("EPSG:4326");if(void 0!==e){const n=s.Z.getElevationValueAt(e,i);void 0!==n&&i.altitude-(n+r)<0&&(i.altitude=n+r,t.camera3D.position.copy(i.as(t.referenceCrs)),t.notifyChange(this.camera3D))}}}},12276:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o,i:()=>s});var i=r(66165);function n(t,e){const r=i.M.getColorLayersIdOrderedBySequence(e),n=function(t){var e;null!==(e=t.material)&&void 0!==e&&e.setSequence&&t.material.setSequence(r)};for(const e of t.level0Nodes)e.traverse(n)}const s="layers-order-changed",o={moveLayerUp(t,e){const r=t.getLayers((t=>t.isColorLayer)),o=t.getLayerById(e);if(!o)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(r);i.M.moveLayerUp(o,r),n(t.tileLayer,r),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(t.tileLayer)}},moveLayerDown(t,e){const r=t.getLayers((t=>t.isColorLayer)),o=t.getLayerById(e);if(!o)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(r);i.M.moveLayerDown(o,r),n(t.tileLayer,r),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(t.tileLayer)}},moveLayerToIndex(t,e,r){const o=t.getLayers((t=>t.isColorLayer)),a=t.getLayerById(e);if(!a)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(o);i.M.moveLayerToIndex(a,r,o),n(t.tileLayer,o),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(o)}}),t.notifyChange(t.tileLayer)}}}},96586:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});var i=r(99477);const n={setDefineMapping(t,e,r){Object.keys(r).forEach((i=>{t.defines[`${e}_${i}`]=r[i]}))},setDefineProperty(t,e,r,i){t.defines[r]=i,Object.defineProperty(t,e,{get:()=>t.defines[r],set:e=>{t.defines[r]!=e&&(t.defines[r]=e,t.needsUpdate=!0)}})},setUniformProperty(t,e,r){t.uniforms[e]=new i.Uniform(r),Object.defineProperty(t,e,{get:()=>t.uniforms[e].value,set:r=>{t.uniforms[e].value!=r&&(t.uniforms[e].value=r)}})}}},6755:(t,e,r)=>{"use strict";r.d(e,{R:()=>o,Z:()=>l});var i=r(99477),n=r(10268);const s=new i.Frustum;class o{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=t,this.y=e,this.grid=[],this.visible=[],this.resize(),this.reset(),this.width=r,this.height=i}reset(){for(let t=0;t0&&this.grid[s][e].some((e=>{return r=e.boundaries,i=t.boundaries,!(r.left>i.right||r.righti.bottom||r.bottomt.isLabelLayer&&t.visible));0!=r.length&&(this.grid.reset(),s.setFromProjectionMatrix(e.projectionMatrix),r.forEach((t=>{t.submittedLabelNodes.forEach((t=>{t.labels.forEach((r=>{t.updatePosition(r),this.culling(r,e)})),t.domElements.labels.show(),t.needsUpdate=!1}))})),this.grid.visible.sort(((t,e)=>{const r=e.order-t.order;return 0==r?!t.visible&&e.visible?1:-1:r})),this.grid.visible.forEach((t=>{this.grid.insert(t)?(t.visible=!0,t.updateCSSPosition()):t.visible=!1})),r.forEach((t=>{t.toHide.children.forEach((t=>{var e;return null===(e=t.domElements)||void 0===e?void 0:e.labels.hide()})),t.toHide.clear()})))}culling(t,e){t.getWorldPosition(a),!s.containsPoint(a.applyMatrix4(e.matrixWorldInverse))||t.horizonCullingPoint&&n.Z.horizonCulling(t.horizonCullingPoint)||this.grid.visible.some((e=>{const r=t.content.textContent;return""!==r&&e.content.textContent.toLowerCase()==r.toLowerCase()}))?t.visible=!1:(a.applyMatrix4(e.projectionMatrix),t.updateProjectedPosition(a.x*this.halfWidth+this.halfWidth,-a.y*this.halfHeight+this.halfHeight),this.grid.visible.push(t))}removeLabelDOM(t){this.garbage.appendChild(t.content),this.garbage.innerHTML=""}}},27240:(t,e,r)=>{"use strict";r.d(e,{On:()=>d,ZP:()=>w,dn:()=>m,pO:()=>g,zQ:()=>v});var i=r(99477),n=r(77567),s=r(47052),o=r(32475),a=r(96586);const l=new i.Vector4(0,0,1,1),c=new i.Texture,h=255/256,u=new i.Vector4(5.9371814131736755e-8,h/65536,.0038909912109375,h);function d(t,e){return e?u.dot(t)*e:u.dot(t)}const p=15,f=1;function m(){const t=s.Z.getMaxTextureUnitsCount();return Math.min(t-f,p)}const g={noEffect:0,removeLightColor:1,removeWhiteColor:2,customEffect:3},A={bias:0,noDataValue:-99999,zmin:0,zmax:0,scale:0,mode:0,textureOffset:0,opacity:0,crs:0,effect_parameter:0,effect_type:g.noEffect,transparent:!1};function y(t,e,r){const i=t.layers.value,n=t.textures.value,s=t.offsetScales.value,o=t.textureCount;let a=0;for(const t of e){t.textureOffset=a;for(let e=0,o=t.textures.length;er&&console.warn(`LayeredMaterial: Not enough texture units (${r} < ${a}), excess textures have been discarded.`),o.value=a;for(let t=a;t1?arguments[1]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),x=x||[f,m()],this.defines.NUM_VS_TEXTURES=x[0],this.defines.NUM_FS_TEXTURES=x[1],this.defines.USE_FOG=1,this.defines.NUM_CRS=t,a.Z.setDefineMapping(this,"ELEVATION",v),a.Z.setDefineMapping(this,"MODE",o.Z.MODES),a.Z.setDefineProperty(this,"mode","MODE",o.Z.MODES.FINAL),s.Z.isLogDepthBufferSupported()&&(this.defines.USE_LOGDEPTHBUF=1,this.defines.USE_LOGDEPTHBUF_EXT=1),this.vertexShader="#include \n#include \n#include \n#include \n#include \n#include \nattribute vec2 uv_0;\n#if NUM_CRS > 1\nattribute float uv_1;\n#endif\nattribute vec3 normal;\n\nuniform mat4 modelMatrix;\nuniform bool lightingEnabled;\nvarying vec2 vHighPrecisionZW;\n\n#if MODE == MODE_FINAL\n#include \nvarying vec3 vUv;\nvarying vec3 vNormal;\n#endif\nvoid main() {\n vec2 uv = vec2(uv_0.x, 1.0 - uv_0.y);\n\n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n#if MODE == MODE_FINAL\n #include \n #if NUM_CRS > 1\n vUv = vec3(uv_0, (uv_1 > 0.) ? uv_1 : uv_0.y); // set uv_1 = uv_0 if uv_1 is undefined\n #else\n vUv = vec3(uv_0, 0.0);\n #endif\n vNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\n#endif\n}\n",b[t]=b[t]||n.Z.unrollLoops("#include \n#include \n#include \n#include \n#include \n#if MODE == MODE_FINAL\n#include \n#include \n#include \n#endif\n#include \n\nuniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vUv; // uv_0.x/uv_1.x, uv_0.y, uv_1.y\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n #include \n\n#if MODE == MODE_ID\n\n #include \n\n#elif MODE == MODE_DEPTH\n\n #include \n\n#else\n\n gl_FragColor = vec4(diffuse, opacity);\n\n uvs[0] = vec3(vUv.xy, 0.);\n\n#if NUM_CRS > 1\n uvs[1] = vec3(vUv.x, fract(vUv.z), floor(vUv.z));\n#endif\n\n vec4 color;\n #pragma unroll_loop\n for ( int i = 0; i < NUM_FS_TEXTURES; i ++ ) {\n color = getLayerColor( i , colorTextures[ i ], colorOffsetScales[ i ], colorLayers[ i ]);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n\n #if defined(DEBUG)\n if (showOutline) {\n #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++) {\n color = getOutlineColor( outlineColors[ i ], uvs[ i ].xy);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n }\n #endif\n\n #include \n #include \n #include \n\n#endif\n}\n",this.defines),this.fragmentShader=b[t],a.Z.setUniformProperty(this,"diffuse",new i.Color(.04,.23,.35)),a.Z.setUniformProperty(this,"opacity",this.opacity),a.Z.setUniformProperty(this,"lightingEnabled",!1),a.Z.setUniformProperty(this,"lightPosition",new i.Vector3(-.5,0,1)),a.Z.setUniformProperty(this,"fogDistance",1e9),a.Z.setUniformProperty(this,"fogColor",new i.Color(.76,.85,1)),a.Z.setUniformProperty(this,"overlayAlpha",0),a.Z.setUniformProperty(this,"overlayColor",new i.Color(1,.3,0)),a.Z.setUniformProperty(this,"objectId",0),a.Z.setUniformProperty(this,"geoidHeight",0),a.Z.setUniformProperty(this,"minBorderDistance",-.01),this.layers=[],this.elevationLayerIds=[],this.colorLayerIds=[],this.uniforms.elevationLayers=new i.Uniform(new Array(x[0]).fill(A)),this.uniforms.elevationTextures=new i.Uniform(new Array(x[0]).fill(c)),this.uniforms.elevationOffsetScales=new i.Uniform(new Array(x[0]).fill(l)),this.uniforms.elevationTextureCount=new i.Uniform(0),this.uniforms.colorLayers=new i.Uniform(new Array(x[1]).fill(A)),this.uniforms.colorTextures=new i.Uniform(new Array(x[1]).fill(c)),this.uniforms.colorOffsetScales=new i.Uniform(new Array(x[1]).fill(l)),this.uniforms.colorTextureCount=new i.Uniform(0),Object.defineProperty(this,"visible",{get(){return this.#P},set(t){this.#P!=t&&(this.#P=t,this.dispatchEvent({type:t?"shown":"hidden"}))}})}onBeforeCompile(t,e){e.capabilities.isWebGL2&&(this.defines.WEBGL2=!0,t.glslVersion="300 es")}getUniformByType(t){return{layers:this.uniforms[`${t}Layers`],textures:this.uniforms[`${t}Textures`],offsetScales:this.uniforms[`${t}OffsetScales`],textureCount:this.uniforms[`${t}TextureCount`]}}updateLayersUniforms(){const t=this.layers.filter((t=>this.colorLayerIds.includes(t.id)&&t.visible&&t.opacity>0));if(t.sort(((t,e)=>this.colorLayerIds.indexOf(t.id)-this.colorLayerIds.indexOf(e.id))),y(this.getUniformByType("color"),t,this.defines.NUM_FS_TEXTURES),this.elevationLayerIds.some((t=>this.getLayer(t)))||this.uniforms.elevationTextureCount.value&&!this.elevationLayerIds.length){const t=this.getElevationLayer()?[this.getElevationLayer()]:[];y(this.getUniformByType("elevation"),t,this.defines.NUM_VS_TEXTURES)}this.layersNeedUpdate=!1}dispose(){this.dispatchEvent({type:"dispose"}),this.layers.forEach((t=>t.dispose(!0))),this.layers.length=0,this.layersNeedUpdate=!0}setSequence(t){this.colorLayerIds=t,this.layersNeedUpdate=!0}setSequenceElevation(t){this.elevationLayerIds[0]=t,this.layersNeedUpdate=!0}removeLayer(t){const e=this.layers.findIndex((e=>e.id===t));if(e>-1){this.layers[e].dispose(),this.layers.splice(e,1);const r=this.colorLayerIds.indexOf(t);r>-1?this.colorLayerIds.splice(r,1):this.elevationLayerIds=[]}}addLayer(t){t.layer.id in this.layers&&console.warn('The "{layer.id}" layer was already present in the material, overwritting.'),this.layers.push(t)}getLayer(t){return this.layers.find((e=>e.id===t))}getLayers(t){return this.layers.filter((e=>t.includes(e.id)))}getElevationLayer(){return this.layers.find((t=>t.id===this.elevationLayerIds[0]))}setElevationScale(t){this.elevationLayerIds.length&&(this.getElevationLayer().scale=t)}}const w=_},44996:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(99477),n=r(3590),s=r(56564),o=r(60145),a=r(82150);const l=new s.Z({crs:"EPSG:4978",uvCount:1}),c=new i.Vector3,h=new i.Vector2,u=new i.Vector3,d=new o.Z("EPSG:4326",0,0,0);let p;class f extends i.Object3D{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector3(1/0,1/0,1/0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3(-1/0,-1/0,-1/0);super(),this.box3D=new i.Box3(t.clone(),e.clone()),this.natBox=this.box3D.clone(),this.z={min:0,max:0,scale:1}}clone(){return(new f).copy(this)}copy(t){return super.copy(t),this.box3D.copy(t.box3D),this.natBox.copy(t.natBox),this.z.min=t.z.min,this.z.max=t.z.max,this.z.scale=t.z.scale,this}updateZ(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.z.min=t.min??this.z.min,this.z.max=t.max??this.z.max,this.z.scale=t.scale>0?t.scale:this.z.scale,this.z.delta=Math.abs(this.z.max-this.z.min)*this.z.scale;const e=t.geoidHeight||0;this.box3D.min.z=this.natBox.min.z+this.z.min*this.z.scale+e,this.box3D.max.z=this.natBox.max.z+this.z.max*this.z.scale+e}isSphereAboveXYBox(t){const e=this.worldToLocal(t.center),r=Math.max(this.box3D.min.x,Math.min(e.x,this.box3D.max.x)),i=Math.max(this.box3D.min.y,Math.min(e.y,this.box3D.max.y));return Math.sqrt((r-e.x)*(r-e.x)+(i-e.y)*(i-e.y))1&&void 0!==arguments[1]?arguments[1]:t.min||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.max||0;if("EPSG:4326"==t.crs){const{sharableExtent:i,quaternion:s,position:o}=l.computeSharableExtent(t),a=Math.max(Math.floor(i.planarDimensions(h).x/90+1),2),c=new n.Z({extent:i,level:0,segment:a,disableSkirt:!0,builder:l});p.box3D.copy(c.boundingBox),p.natBox.copy(c.boundingBox),this.copy(p),this.updateZ({min:e,max:r}),this.position.copy(o),this.quaternion.copy(s),this.updateMatrixWorld(!0)}else{if(a.Z.isTms(t.crs)||!a.Z.isMetricUnit(t.crs))throw new Error("Unsupported extent crs");t.center(d).toVector3(this.position),t.planarDimensions(h),c.set(h.x,h.y,Math.abs(r-e)),this.box3D.setFromCenterAndSize(u,c),this.updateMatrixWorld(!0)}return this}}p=new f;const m=f},32204:(t,e,r)=>{"use strict";r.d(e,{E7:()=>h,Uz:()=>c,ZP:()=>f,vj:()=>l,wy:()=>d});var i=r(99477),n=r(47052),s=r(77567),o=r(96586);const a="#include \n#include \n#include \n#if defined(USE_TEXTURES_PROJECTIVE)\n#include \n#endif\n\nvarying vec4 vColor;\nuniform bool picking;\nuniform int shape;\n\nvoid main() {\n #include \n //square shape does not require any change.\n if (shape == PNTS_SHAPE_CIRCLE) {\n //circular rendering in glsl\n if ((length(gl_PointCoord - 0.5) > 0.5) || (vColor.a == 0.0)) {\n discard;\n }\n }\n\n#if defined(USE_TEXTURES_PROJECTIVE)\n vec4 color = vColor;\n if (!picking) {\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n } else {\n gl_FragColor = color;\n }\n#else\n gl_FragColor = vColor;\n#endif\n}\n",l={COLOR:0,INTENSITY:1,CLASSIFICATION:2,NORMAL:3},c={CIRCLE:0,SQUARE:1},h={VALUE:0,ATTENUATED:1},u=new i.Color(1,1,1),d={DEFAULT:{0:{visible:!0,name:"never classified",color:new i.Color(.5,.5,.5),opacity:1},1:{visible:!0,name:"unclassified",color:new i.Color(.5,.5,.5),opacity:1},2:{visible:!0,name:"ground",color:new i.Color(.63,.32,.18),opacity:1},3:{visible:!0,name:"low vegetation",color:new i.Color(0,1,0),opacity:1},4:{visible:!0,name:"medium vegetation",color:new i.Color(0,.8,0),opacity:1},5:{visible:!0,name:"high vegetation",color:new i.Color(0,.6,0),opacity:1},6:{visible:!0,name:"building",color:new i.Color(1,.66,0),opacity:1},7:{visible:!0,name:"low point(noise)",color:new i.Color(1,0,1),opacity:1},8:{visible:!0,name:"key-point",color:new i.Color(1,0,0),opacity:1},9:{visible:!0,name:"water",color:new i.Color(0,0,1),opacity:1},10:{visible:!0,name:"rail",color:new i.Color(.8,.8,1),opacity:1},11:{visible:!0,name:"road Surface",color:new i.Color(.4,.4,.7),opacity:1},12:{visible:!0,name:"overlap",color:new i.Color(1,1,0),opacity:1},DEFAULT:{visible:!0,name:"default",color:new i.Color(.3,.6,.6),opacity:.5}}};class p extends i.RawShaderMaterial{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=t.intensityRange||new i.Vector2(0,1),r=t.orientedImageMaterial,u=t.classification||d.DEFAULT,p=null!=t.applyOpacityClassication&&t.applyOpacityClassication,f=t.size||0,m=t.mode||l.COLOR,g=t.shape||c.CIRCLE,A=0===f?h.ATTENUATED:t.sizeMode||h.VALUE,y=t.minAttenuatedSize||3,v=t.maxAttenuatedSize||10;delete t.orientedImageMaterial,delete t.intensityRange,delete t.classification,delete t.applyOpacityClassication,delete t.size,delete t.mode,delete t.shape,delete t.sizeMode,delete t.minAttenuatedSize,delete t.maxAttenuatedSize,super(t),this.vertexShader="#include \n#include \n#include \n#if defined(USE_TEXTURES_PROJECTIVE)\n#include \n#endif\n#include \n#include \n\nuniform float size;\nuniform float scale;\n\nuniform bool picking;\nuniform int mode;\nuniform float opacity;\nuniform vec4 overlayColor;\nuniform vec2 intensityRange;\nuniform bool applyOpacityClassication;\nattribute vec3 color;\nattribute vec4 unique_id;\nattribute float intensity;\nattribute float classification;\nuniform sampler2D classificationLUT;\nuniform int sizeMode;\nuniform float minAttenuatedSize;\nuniform float maxAttenuatedSize;\n\n#if defined(NORMAL_OCT16)\nattribute vec2 oct16Normal;\n#elif defined(NORMAL_SPHEREMAPPED)\nattribute vec2 sphereMappedNormal;\n#else\nattribute vec3 normal;\n#endif\n\nvarying vec4 vColor;\n\n// see https://web.archive.org/web/20150303053317/http://lgdv.cs.fau.de/get/1602\n// and implementation in PotreeConverter (BINPointReader.cpp) and potree (BinaryDecoderWorker.js)\n#if defined(NORMAL_OCT16)\nvec3 decodeOct16Normal(vec2 encodedNormal) {\n vec2 nNorm = 2. * (encodedNormal / 255.) - 1.;\n vec3 n;\n n.z = 1. - abs(nNorm.x) - abs(nNorm.y);\n if (n.z >= 0.) {\n n.x = nNorm.x;\n n.y = nNorm.y;\n } else {\n n.x = sign(nNorm.x) - sign(nNorm.x) * sign(nNorm.y) * nNorm.y;\n n.y = sign(nNorm.y) - sign(nNorm.y) * sign(nNorm.x) * nNorm.x;\n }\n return normalize(n);\n}\n#elif defined(NORMAL_SPHEREMAPPED)\n// see http://aras-p.info/texts/CompactNormalStorage.html method #4\n// or see potree's implementation in BINPointReader.cpp\nvec3 decodeSphereMappedNormal(vec2 encodedNormal) {\n vec2 fenc = 2. * encodedNormal / 255. - 1.;\n float f = dot(fenc,fenc);\n float g = 2. * sqrt(1. - f);\n vec3 n;\n n.xy = fenc * g;\n n.z = 1. - 2. * f;\n return n;\n}\n#endif\n\nvoid main() {\n\n#if defined(NORMAL_OCT16)\n vec3 normal = decodeOct16Normal(oct16Normal);\n#elif defined(NORMAL_SPHEREMAPPED)\n vec3 normal = decodeSphereMappedNormal(sphereMappedNormal);\n#elif defined(NORMAL)\n // nothing to do\n#else\n // default to color\n vec3 normal = color;\n#endif\n\n if (picking) {\n vColor = unique_id;\n } else {\n vColor.a = opacity;\n if (applyOpacityClassication || mode == PNTS_MODE_CLASSIFICATION) {\n vec2 uv = vec2(classification, 0.5);\n vColor = texture2D(classificationLUT, uv);\n vColor.a *= opacity;\n }\n\n if (mode == PNTS_MODE_INTENSITY) {\n // adapt the grayscale knowing the range\n float i = (intensity - intensityRange.x) / (intensityRange.y - intensityRange.x);\n vColor.rgb = vec3(i, i, i);\n } else if (mode == PNTS_MODE_NORMAL) {\n vColor.rgb = abs(normal);\n } else if (mode == PNTS_MODE_COLOR) {\n // default to color mode\n vColor.rgb = mix(color, overlayColor.rgb, overlayColor.a);\n }\n }\n\n #include \n #include \n\n gl_PointSize = size;\n\n if (sizeMode == PNTS_SIZE_MODE_ATTENUATED) {\n bool isPerspective = isPerspectiveMatrix(projectionMatrix);\n\n if (isPerspective) {\n gl_PointSize *= scale / -mvPosition.z;\n gl_PointSize = clamp(gl_PointSize, minAttenuatedSize, maxAttenuatedSize);\n }\n }\n\n#if defined(USE_TEXTURES_PROJECTIVE)\n #include \n#endif\n #include \n}\n";const x=t.scale||.025/Math.tan(.5);o.Z.setDefineMapping(this,"PNTS_MODE",l),o.Z.setDefineMapping(this,"PNTS_SHAPE",c),o.Z.setDefineMapping(this,"PNTS_SIZE_MODE",h),o.Z.setUniformProperty(this,"size",f),o.Z.setUniformProperty(this,"mode",m),o.Z.setUniformProperty(this,"shape",g),o.Z.setUniformProperty(this,"picking",!1),o.Z.setUniformProperty(this,"opacity",this.opacity),o.Z.setUniformProperty(this,"overlayColor",t.overlayColor||new i.Vector4(0,0,0,0)),o.Z.setUniformProperty(this,"intensityRange",e),o.Z.setUniformProperty(this,"applyOpacityClassication",p),o.Z.setUniformProperty(this,"sizeMode",A),o.Z.setUniformProperty(this,"scale",x),o.Z.setUniformProperty(this,"minAttenuatedSize",y),o.Z.setUniformProperty(this,"maxAttenuatedSize",v);const b=new Uint8Array(1024),_=new i.DataTexture(b,256,1,i.RGBAFormat);_.needsUpdate=!0,_.magFilter=i.NearestFilter,o.Z.setUniformProperty(this,"classificationLUT",_),this.classification=u,this.recomputeClassification(),r?(this.uniforms.projectiveTextureAlphaBorder=r.uniforms.projectiveTextureAlphaBorder,this.uniforms.projectiveTextureDistortion=r.uniforms.projectiveTextureDistortion,this.uniforms.projectiveTextureMatrix=r.uniforms.projectiveTextureMatrix,this.uniforms.projectiveTexture=r.uniforms.projectiveTexture,this.uniforms.mask=r.uniforms.mask,this.uniforms.boostLight=r.uniforms.boostLight,this.defines.ORIENTED_IMAGES_COUNT=r.defines.ORIENTED_IMAGES_COUNT,this.defines.USE_DISTORTION=r.defines.USE_DISTORTION,this.defines.DEBUG_ALPHA_BORDER=r.defines.DEBUG_ALPHA_BORDER,this.defines.USE_TEXTURES_PROJECTIVE=!0,this.defines.USE_BASE_MATERIAL=!0,this.fragmentShader=s.Z.unrollLoops(a,this.defines)):this.fragmentShader=a,n.Z.isLogDepthBufferSupported()&&(this.defines.USE_LOGDEPTHBUF=1,this.defines.USE_LOGDEPTHBUF_EXT=1)}recomputeClassification(){const t=this.classification,e=this.classificationLUT.image.data,r=this.classificationLUT.image.width;for(let i=0;i{"use strict";r.d(e,{pL:()=>a,AN:()=>h,NO:()=>u});var i=r(99477),n=r(27240),s=r(79295);var o=r(82150);const a=-1,l=new i.Vector4;class c extends i.EventDispatcher{constructor(t,e){super(),this.layer=e,this.crs=e.parent.tileMatrixSets.indexOf(o.Z.formatToTms(e.crs)),-1==this.crs&&console.error("Unknown crs:",e.crs),this.textures=[],this.offsetScales=[],this.level=a,this.material=t,this._handlerCBEvent=()=>{this.material.layersNeedUpdate=!0},e.addEventListener("visible-property-changed",this._handlerCBEvent),e.addEventListener("opacity-property-changed",this._handlerCBEvent)}get id(){return this.layer.id}get opacity(){return this.layer.opacity}get visible(){return this.layer.visible}initFromParent(t,e){if(t&&t.level>this.level){let r=0;for(const i of e)for(const e of t.textures)if(i.isInside(e.extent)){this.setTexture(r++,e,i.offsetToParent(e.extent));break}}}dispose(t){t&&(this.layer.removeEventListener("visible-property-changed",this._handlerCBEvent),this.layer.removeEventListener("opacity-property-changed",this._handlerCBEvent),this._listeners={});for(const t of this.textures)t.isTexture&&t.dispose();this.level=a,this.textures=[],this.offsetScales=[],this.material.layersNeedUpdate=!0}setTexture(t,e,r){this.level=e&&0==t?e.extent.zoom:this.level,this.textures[t]=e||null,this.offsetScales[t]=r,this.material.layersNeedUpdate=!0}setTextures(t,e){this.dispose(!1);for(let r=0,i=t.length;rnull!=t));return a.length?{min:Math.min(...a),max:Math.max(...a)}:{min:1/0,max:-1/0}}(t,e,r);const c=Math.floor(e.z*i);if(c>2){const t=Math.floor(e.z*n),s=Math.floor(e.x*i),h=Math.floor(e.y*n),u=Math.max(Math.floor(c/32),2);for(let e=h;ea&&(a=r.zmin),r.zmaxe&&t[r-1]>e&&t[Math.sqrt(r)-1]>e&&t[r-Math.sqrt(r)]>e}(n,e)&&function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0,r=arguments.length>2?arguments[2]:void 0;for(let i=0,n=t.length;ir[function(t,e,r){const i=Math.floor(t/r)/r,n=e.x+t%r/r*e.z,s=e.y+i*e.w;return Math.floor(s*r)*r+Math.floor(n*r)}(t,i,256)]}(t,r,i,l),e)}}},32475:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i={FINAL:0,DEPTH:1,ID:2},n={MODES:i,push:function(t,e){const r=t.mode??i.FINAL;if(r==e)return()=>{};const n=t=>e=>{const r=e.material;r&&(r.mode=t)};return t.traverse(n(e)),()=>{t.traverse(n(r))}}}},77567:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});const i=new RegExp("gl_Position.*(?![^]*gl_Position)"),n=new RegExp("[^\\w]*main[^\\w]*(void)?[^\\w]*{"),s={patchMaterialForLogDepthSupport(t){if(t.vertexShader.includes("USE_LOGDEPTHBUF")||t.vertexShader.includes("logdepthbuf_pars_vertex"))return;t.vertexShader=`#include \n#define EPSILON 1e-6\n${t.vertexShader}`;let e=i.exec(t.vertexShader),r=e[0].length+e.index;t.vertexShader=`${t.vertexShader.slice(0,r)}\n#include \n${t.vertexShader.slice(r)}`,t.fragmentShader=`#include \n${t.fragmentShader}`,e=n.exec(t.fragmentShader),r=e[0].length+e.index,t.fragmentShader=`${t.fragmentShader.slice(0,r)}\n#include \n${t.fragmentShader.slice(r)}`,t.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}},unrollLoops:(t,e)=>t.replace(/#pragma unroll_loop\s+for\s*\(\s*int\s+i\s*=\s*([\w\d]+);\s*i\s+<\s+([\w\d]+);\s*i\s*\+\+\s*\)\s*\{\n([^}]*)\}/g,(function(t,r,i,n){let s="";r=r in e?e[r]:parseInt(r,10),i=i in e?e[i]:parseInt(i,10);for(let t=r;t{"use strict";r.d(e,{ZP:()=>L});var i=r(99128),n=r(97400),s=r(99127),o=r(71077),a=r(70274),l=r(14278),c=r(49472),h=r(99477),u=r(3614),d=r.n(u),p=r(38929),f=r(94596),m=r(86896),g=r(60145);const A=i.Mh.get("EPSG:3857").planarDimensions(),y=new h.Vector3(A.x,A.y,1),v=new h.Vector2,x=new h.Vector2;function b(t,e,r,i){const n=i*2**r.z,s=i*r.x,o=i*r.y;return new g.Z("EPSG:4326",360*(t+s)/n-180,360/Math.PI*Math.atan(Math.exp((180-360*(e+o)/n)*Math.PI/180))-90)}function _(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.bindNewGeometry();const n=e.type===f.tg.POLYGON;r=r&&n,i.properties=t.properties;const s=t._pbf;s.pos=t._geometry;const o=s.readVarint()+s.pos;let a=1,l=0,c=0,h=0,u=0,d=0;for(;s.pos>3}if(l--,1===a||2===a){c+=s.readSVarint(),h+=s.readSVarint(),1===a&&(u&&(r&&d>0&&i.indices.length>0&&(e.updateExtent(i),i=e.bindNewGeometry(),i.properties=t.properties),i.closeSubGeometry(u,e),i.getLastSubGeometry().ccw=d<0),u=0,d=0),u++;const o=b(c,h,t.tileNumbers,t.extent);i.pushCoordinatesValues(e,{x:c,y:h},o),1==u?(x.set(c,h),x.coordProj=o,v.set(c,h)):n&&u>1&&(d+=(v.x-c)*(v.y+h),v.set(c,h))}else{if(7!==a)throw new Error(`unknown command ${a}`);u&&(u++,i.pushCoordinatesValues(e,{x:x.x,y:x.y},x.coordProj),n&&(d+=(v.x-x.x)*(v.y+x.y)))}}u&&(r&&d>0&&i.indices.length>0&&(e.updateExtent(i),i=e.bindNewGeometry(),i.properties=t.properties),i.closeSubGeometry(u,e),i.getLastSubGeometry().ccw=d<0),e.updateExtent(i)}const w={parse:(t,e)=>(e=(0,m._F)(e),Promise.resolve(function(t,e){e.out=e.out||{};const r=new p.VectorTile(new(d())(t)),i=Object.keys(r.layers);if(i.length<1)return;const n=t.extent.col,s=t.extent.zoom,o=e.in.isInverted?t.extent.row:(1<{if(!e.in.layers[i])return;const o=r.layers[i];for(let r=o.length-1;r>=0;r--){const l=o.feature(r);l.tileNumbers={x:n,y:t.extent.row,z:s};const c=e.in.layers[i].filter((t=>t.filterExpression.filter({zoom:s},l)&&s>=t.zoom.min&&se.id===t.id))||(h=a.newFeatureByReference(h),h.id=t.id,h.order=t.order,h.style=e.in.styles[h.id]):(h=a.requestFeatureById(t.id,l.type-1),h.id=t.id,h.order=t.order,h.style=e.in.styles[h.id],_(l,h))}})),a.removeEmptyFeature(),a.features.sort(((t,e)=>t.order-e.order)),a.updateExtent(),a.extent=t.extent,a.isInverted=e.in.isInverted,Promise.resolve(a)}(t,e)))};var E=r(33347),M=r(1537),S=r(82150);const C=new Map([["image/x-bil;bits=32",E.Z.textureFloat],["geojson",E.Z.json],["application/json",E.Z.json],["application/kml",E.Z.xml],["application/gpx",E.Z.xml],["application/x-protobuf;type=mapbox-vector",E.Z.arrayBuffer],["application/gtx",E.Z.arrayBuffer],["application/isg",E.Z.text],["application/gdf",E.Z.text]]),T=new Map([["geojson",n.Z.parse],["application/json",n.Z.parse],["application/kml",s.Z.parse],["application/gpx",a.Z.parse],["application/x-protobuf;type=mapbox-vector",w.parse],["application/gtx",l.ZP.parse],["application/isg",c.Z.parse],["application/gdf",o.Z.parse]]),I={getByArray:()=>{},setByArray:t=>t,clear:()=>{}};class R{constructor(t){t.projection&&(console.warn("Source projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),t.crs&&S.Z.isValid(t.crs),this.crs=t.crs}}let B=0;const L=class extends R{constructor(t){if(super(t),this.isSource=!0,!t.url)throw new Error("New Source: url is required");this.uid=B++,this.url=t.url,this.format=t.format,this.fetcher=t.fetcher||C.get(t.format)||E.Z.texture,this.parser=t.parser||T.get(t.format)||(t=>t),this.isVectorSource=null!=(t.parser||T.get(t.format)),this.networkOptions=t.networkOptions||{crossOrigin:"anonymous"},this.attribution=t.attribution,this.whenReady=Promise.resolve(),this._featuresCaches={},t.extent&&!t.extent.isExtent?this.extent=new i.ZP(this.crs,t.extent):this.extent=t.extent}handlingError(t){throw new Error(t)}urlFromExtent(){throw new Error("In extended Source, you have to implement the method urlFromExtent!")}requestToKey(t){return[t.zoom,t.row,t.col]}loadData(t,e){const r=this._featuresCaches[e.crs],i=this.requestToKey(t);let n=r.getByArray(i);return n||(n=r.setByArray(function(t,e){const r=t.urlFromExtent(e);return t.fetcher(r,t.networkOptions).then((t=>(t.extent=e,t)),(e=>t.handlingError(e)))}(this,t).then((t=>this.parser(t,{out:e,in:this})),(t=>this.handlingError(t))),i),this.onParsedFile&&n.then((t=>(this.onParsedFile(t),console.warn("Source.onParsedFile was deprecated"),t)))),n}onLayerAdded(t){this._featuresCaches[t.out.crs]||(this._featuresCaches[t.out.crs]=this.isVectorSource?new M.Z:I)}onLayerRemoved(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._featuresCaches[t.unusedCrs];e&&(e.clear(),delete this._featuresCaches[t.unusedCrs])}extentInsideLimit(){throw new Error("In extented Source, you have to implement the method extentInsideLimit!")}}},4596:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>b});var i=r(99477),n=r(36194),s=r(79295),o=r(49469),a=r(60145),l=r(16828),c=r(44996),h=r(36873);i.Object3D.DEFAULT_UP.set(0,0,1);const u=new i.Vector3,d=new a.Z("EPSG:4326",0,0,0),p=new l.Z,f=[],m=new c.Z,g=new i.Vector3;function A(t){return t-360*Math.floor((t+180)/360)}function y(t){return t.getLayers((t=>t.isTiledGeometryLayer))[0]}class v extends i.Object3D{constructor(){super(),this.seaLevel=new i.Object3D,this.target=new i.Object3D,this.target.rotation.order="ZXY",this.camera=new i.Camera,this.add(this.seaLevel),this.seaLevel.add(this.target),this.target.add(this.camera),this.coord=new a.Z("EPSG:4978",0,0),this.targetWorldPosition=new i.Vector3,this.removeAll=()=>{},this._onChangeCallback=null}applyTransformToCamera(t,e){this.proxy?(e.quaternion._onChange(this._onChangeCallback),this.camera.matrixWorld.decompose(this.proxy.position,e.quaternion,e.scale),e.quaternion._onChange((()=>this.removeProxy(t,e)))):this.camera.matrixWorld.decompose(e.position,e.quaternion,e.scale),t.dispatchEvent({type:h.b.CAMERA_MOVED,coord:this.coord,range:this.range,heading:this.heading,tilt:this.tilt})}setProxy(t,e){!this.proxy&&t&&e&&(this.proxy={position:new i.Vector3},Object.keys(e.position).forEach((r=>function(t,e,r,i){r.proxy.position[i]=e.position[i],Object.defineProperty(e.position,i,{get:()=>r.proxy.position[i],set:n=>{r.removeProxy(t,e),e.position[i]=n}})}(t,e,this,r))),this._onChangeCallback=e.quaternion._onChangeCallback,e.quaternion._onChange((()=>this.removeProxy(t,e))))}removeProxy(t,e){this.stop(t),this.proxy&&t&&e&&(Object.keys(e.position).forEach((t=>Object.defineProperty(e.position,t,{value:this.proxy.position[t],writable:!0}))),e.quaternion._onChange(this._onChangeCallback),this.proxy=null)}setTargetFromCoordinate(t,e){e.as(y(t).extent.crs,this.coord);const r=Math.max(0,s.Z.getElevationValueAt(y(t),this.coord,s.Z.PRECISE_READ_Z)||this.coord.z);this.coord.z=r,this.coord.as(t.referenceCrs).toVector3(u),"EPSG:4978"==t.referenceCrs?(this.lookAt(u),this.seaLevel.position.set(0,0,u.length()-r)):(this.position.set(u.x,u.y,0),this.seaLevel.position.set(0,0,0)),this.target.position.set(0,0,r)}setFromPositions(t,e){this.setTargetFromCoordinate(t,new a.Z(t.referenceCrs,u)),this.target.rotation.set(0,0,0),this.updateMatrixWorld(!0),this.camera.position.copy(e),this.target.worldToLocal(this.camera.position);const r=this.camera.position.length();this.target.rotation.x=Math.asin(this.camera.position.z/r);const n=i.MathUtils.clamp(this.camera.position.y/(Math.cos(this.target.rotation.x)*r),-1,1);this.target.rotation.z=Math.sign(-this.camera.position.x||1)*Math.acos(n),this.camera.position.set(0,r,0)}applyParams(t,e){e.coord&&this.setTargetFromCoordinate(t,e.coord),null!=e.tilt&&(this.target.rotation.x=i.MathUtils.degToRad(e.tilt)),null!=e.heading&&(this.target.rotation.z=i.MathUtils.degToRad(-A(e.heading+180))),e.range&&this.camera.position.set(0,e.range,0),this.camera.rotation.set(.5*-Math.PI,0,Math.PI),this.updateMatrixWorld(!0),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld)}getParams(){return{coord:this.coord.clone(),tilt:this.tilt,heading:this.heading,range:this.range,targetWorldPosition:this.targetWorldPosition}}setfromCamera(t,e,r){e.updateMatrixWorld(!0),null==r&&(r=t.getPickingPositionFromDepth()||function(t,e){const r=new i.Vector3(0,0,.5);if(r.unproject(e),r.sub(e.position).normalize(),"EPSG:4978"==t.referenceCrs)return p.intersection({direction:r,origin:e.position});{const t=e.position.z/r.z;return r.multiplyScalar(t).add(e.position)}}(t,e));const n=r&&!isNaN(r.x)?e.position.distanceTo(r):100;e.localToWorld(u.set(0,0,-n)),this.setFromPositions(t,e.position)}copyObject3D(t){return this.copy(t,!1),this.seaLevel.copy(t.seaLevel,!1),this.target.copy(t.target,!1),this.camera.copy(t.camera),this}animateCameraToLookAtTarget(t,e,r){r.easing=r.easing||n.ZP.Easing.Quartic.InOut,this.setfromCamera(t,e);const s=new n.ZP.Group;this.start=(this.start||new v).copyObject3D(this),this.end=(this.end||new v).copyObject3D(this);const a=r.time||2500,l={t:0},c=[],h=(()=>{let t,e;return{promise:new Promise(((r,i)=>{t=r,e=i})),resolve:t,reject:e}})();this.addPlaceTargetOnGround(t,e,r.coord,l),this.end.applyParams(t,r);const u=this.end.target.rotation.z-this.start.target.rotation.z;return Math.abs(u)>Math.PI&&(this.end.target.rotation.z=this.start.target.rotation.z+u-2*Math.sign(u)*Math.PI),c.push(new n.ZP.Tween(l,s).to({t:1},a).easing(r.easing).onUpdate((e=>{"EPSG:4978"==t.referenceCrs&&this.quaternion.slerpQuaternions(this.start.quaternion,this.end.quaternion,e.t),this.camera.quaternion.slerpQuaternions(this.start.camera.quaternion,this.end.camera.quaternion,e.t),this.target.rotation.set(0,0,0),this.target.rotateZ(i.MathUtils.lerp(this.start.target.rotation.z,this.end.target.rotation.z,e.t)),this.target.rotateX(i.MathUtils.lerp(this.start.target.rotation.x,this.end.target.rotation.x,e.t))}))),"EPSG:4978"!=t.referenceCrs&&c.push(new n.ZP.Tween(this.position,s).to(this.end.position,a).easing(r.easing)),c.push(new n.ZP.Tween(this.seaLevel.position,s).to(this.end.seaLevel.position,a).easing(r.easing)),c.push(new n.ZP.Tween(this.camera.position,s).to(this.end.camera.position,a).easing(r.easing)),this.animationFrameRequester=()=>{s.update(),this.updateMatrixWorld(!0),this.applyTransformToCamera(t,e),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld),r.callback&&r.callback(this),d.crs=t.referenceCrs,d.setFromVector3(this.targetWorldPosition).as(y(t).extent.crs,this.coord),t.notifyChange(e)},this.removeAll=function(e){this.removeAll=()=>{},s.removeAll(),this.animationFrameRequester&&t.removeFrameRequester(o.Ao.BEFORE_RENDER,this.animationFrameRequester),h.resolve(void 0!==e),this.animationFrameRequester=null},c[c.length-1].onComplete(this.removeAll),c.forEach((t=>t.start())),t.addFrameRequester(o.Ao.BEFORE_RENDER,this.animationFrameRequester),t.notifyChange(e),h}stop(t){this.removePlaceTargetOnGround(t),this.removeAll()}addPlaceTargetOnGround(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{t:1};if(this.removePlaceTargetOnGround(t),t&&e){const n=this.target.position.z;this.placeTargetOnGround=()=>{const o=Math.max(0,s.Z.getElevationValueAt(y(t),r||this.coord,s.Z.PRECISE_READ_Z)||0);this.target.position.z=n*(1-i.t)+o*i.t,this.target.updateMatrixWorld(!0),this.applyTransformToCamera(t,e)},this.placeTargetOnGround(),t.addFrameRequester(o.Ao.BEFORE_RENDER,this.placeTargetOnGround)}}removePlaceTargetOnGround(t){t&&this.placeTargetOnGround&&(t.removeFrameRequester(o.Ao.BEFORE_RENDER,this.placeTargetOnGround),this.placeTargetOnGround=null)}get tilt(){return i.MathUtils.radToDeg(this.target.rotation.x)}get heading(){return-A(i.MathUtils.radToDeg(this.target.rotation.z)+180)}get range(){return this.camera.position.y}}function x(t){return f[t.uuid]=f[t.uuid]||new v,f[t.uuid]}const b={defaultStopPlaceOnGroundAtEnd:!1,Easing:n.ZP.Easing,stop(t,e){x(e).stop(t)},getTransformCameraLookingAtTarget(t,e,r){const i=x(e);return i.setfromCamera(t,e,r),i.getParams()},transformCameraToLookAtTarget(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.isExtent&&(r=this.getCameraTransformOptionsFromExtent(t,e,r)),r.proxy=void 0===r.proxy||r.proxy;const i=x(e);return i.stop(t),i.setfromCamera(t,e),r.proxy&&i.setProxy(t,e),i.applyParams(t,r),i.addPlaceTargetOnGround(t,e,r.coord),i.applyTransformToCamera(t,e),t.notifyChange(e),Promise.resolve(i.getParams())},getCameraTransformOptionsFromExtent(t,e,r){const n={coord:new a.Z(r.crs,0,0,0),heading:0,tilt:t.isPlanarView?90:89.9};let s;if(t.isGlobeView?(r=r.as("EPSG:4326"),m.setFromExtent(r),m.box3D.getSize(g),s={x:g.y,y:g.x}):s=(r=r.as(t.referenceCrs)).planarDimensions(),r.center(n.coord),e.isOrthographicCamera)s.x/s.y>e.aspect?e.zoom=(e.right-e.left)/s.x:e.zoom=(e.top-e.bottom)/s.y,e.updateProjectionMatrix(),n.range=1e3;else if(e.isPerspectiveCamera){const r=i.MathUtils.degToRad(e.fov);if(s.x/s.y>e.aspect){const e=.5*t.domElement.clientHeight/Math.tan(.5*r),i=2*Math.atan(.5*t.domElement.clientWidth/e);n.range=s.x/(2*Math.tan(.5*i))}else n.range=s.y/(2*Math.tan(.5*r))}return n},animateCameraToLookAtTarget(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.proxy=void 0===r.proxy||r.proxy;const i=x(e);return i.stop(t),r.proxy&&i.setProxy(t,e),i.animateCameraToLookAtTarget(t,e,r).promise.then((e=>{const n=void 0===r.stopPlaceOnGroundAtEnd?this.defaultStopPlaceOnGroundAtEnd:r.stopPlaceOnGroundAtEnd,s=i.getParams();return n&&i.stop(t),s.finished=e,s}))},sequenceAnimationsToLookAtTarget(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{}]).map((r=>()=>this.animateCameraToLookAtTarget(t,e,r))).reduce(((t,e)=>t.then((t=>!t.length||t[t.length-1].finished?e().then(Array.prototype.concat.bind(t)):Promise.resolve([{finished:!1}])))),Promise.resolve([]))},getDiffParams(t,e){if(!t||!e)return;let r;return Math.abs(t.range-e.range)/t.range>.001&&(r=r||{},r.range={previous:t.range,new:e.range}),Math.abs(t.tilt-e.tilt)>.1&&(r=r||{},r.tilt={previous:t.tilt,new:e.tilt}),Math.abs(t.heading-e.heading)>.1&&(r=r||{},r.heading={previous:t.heading,new:e.heading}),(Math.abs(t.coord.x-e.coord.x)>1e-6||Math.abs(t.coord.y-e.coord.y)>1e-6)&&(r=r||{},r.coord={previous:t.coord,new:e.coord}),r}}},79295:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a,P:()=>p});var i=r(99477),n=r(60145);const s={v:new i.Vector3,coord1:new n.Z("EPSG:4978"),coord2:new n.Z("EPSG:4978"),offset:new i.Vector2};function o(t,e,r,i,o,l){let c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},h=arguments.length>8?arguments[8]:void 0;const u=(arguments.length>7?arguments[7]:void 0)||new n.Z(i);c.worldFromLocal?u.setFromVector3(s.v.copy(o).applyMatrix4(c.worldFromLocal)):u.setFromVector3(o);const d=a.getTerrainObjectAt(t,u,e,r,h);if(d)return d.coord.z+=l,d.coord.as(i,s.coord2).toVector3(o),c.localFromWorld&&o.applyMatrix4(c.localFromWorld),{id:d.texture.id,version:d.texture.version,tile:d.tile}}const a={getElevationValueAt(t,e){const r=A(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e,(arguments.length>3?arguments[3]:void 0)||t.level0Nodes);if(r)return r.coord.z},getTerrainObjectAt(t,e){let r=arguments.length>4?arguments[4]:void 0;return A(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e,(arguments.length>3?arguments[3]:void 0)||t.level0Nodes,r)},FAST_READ_Z:0,PRECISE_READ_Z:1,placeObjectOnGround:function(t,e,r){let s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0;if(console.warn("placeObjectOnGround has been deprecated because it needs review and test"),s=c?c.concat(t.level0Nodes):t.level0Nodes,l.modifyGeometry){const c={worldFromLocal:r.matrixWorld,localFromWorld:(new i.Matrix4).copy(r.matrixWorld).invert()},h=r.geometry;if(h.vertices){l.cache&&(l.cache.length=h.vertices.length);let r=!0;const i=new n.Z(e);for(let n=0;n=0?e:void 0}}let c;function h(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s2&&void 0!==arguments[2]?arguments[2]:new i.Vector2;if(t.crs!=e.crs)throw new Error(`Unsupported mix: ${t.crs} and ${e.crs}`);e.planarDimensions(g);const n=(t.x-e.west)/g.x,s=(e.north-t.y)/g.y;r.set(n,s)}(a,c.extent,m.offset),a.z=1==e?function(t,e,r,n,s){const o=n.x/s.x/16;let a=Math.floor(r.x/o)*o,l=Math.floor(r.y/o)*o;1==a&&(a-=o),1==l&&(l-=o);const c=a,h=a+o,u=l,d=l+o,m=(r.x-a)/o,g=(r.y-l)/o,A=new i.Triangle(new i.Vector3(c,d),new i.Vector3(h,u),1==g||m/(1-g)>=1?new i.Vector3(h,d):new i.Vector3(c,u));A.getBarycoord(new i.Vector3(r.x,r.y),f);const y=t.attachedLayers.filter((t=>t.isElevationLayer))[0],v=p(y,e,A.a.x,A.a.y),x=p(y,e,A.b.x,A.b.y),b=p(y,e,A.c.x,A.c.y);return v*f.x+x*f.y+b*f.z}(t,y,m.offset,d.extent.planarDimensions(),c.extent.planarDimensions()):function(t,e,r){return function(t,e,r,i){const n=u(e,r,i);return h(t,e,n.wu<=0?n.u1:n.u2,n.wv<=0?n.v1:n.v2)}(t.attachedLayers.filter((t=>t.isElevationLayer))[0],e,r.x,r.y)}(t,y,m.offset),null!=a.z?{coord:a,texture:y,tile:d}:void 0}},39683:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(94596);function n(t,e,r,i,n,s){const o=t.x,a=t.y;for(let t=i+s,l=i;t=-r&&p<=d+r&&Math.abs(u*o-h*a+s*n-c*i)/d<=r)return!0}return!1}function s(t,e,r,s,o,a,l){if(e==i.tg.LINE&&n(t,r,s,o,a,l))return!0;if(e==i.tg.POLYGON&&function(t,e,r,i,s,o){const a=t.x,l=t.y;let c=!1;for(let h=i,u=i+s-o;hl!=d>l&&a<(o-i)*(l-s)/(d-s)+i&&(c=!c)}return c}(t,r,s,o,a,l))return!0;if(e==i.tg.POINT){const e=function(t,e,r,i,n,s){const o=t.x,a=t.y;let l,c=r*r;for(let t=i;t2&&void 0!==arguments[2]?arguments[2]:.1;const i=[];if(t.as(e.crs,a),a.applyMatrix4(e.matrixWorldInverse),e.extent.isPointInside(a,r))if(e.isFeatureCollection){r*=Math.sqrt(e.scale.x**2+e.scale.y**2);for(const t of e.features)t.extent&&!t.extent.isPointInside(a,r)||o(a,t,r,i)}else e.geometries&&o(a,e,r,i);return i}}},12306:(t,e,r)=>{"use strict";function i(t){const e=function(t){const e=[];return t.alphaMap&&e.push(t.map),t.aoMap&&e.push(t.map),t.bumpMap&&e.push(t.bumpMap),t.displacementMap&&e.push(t.bumpMap),t.emissiveMap&&e.push(t.emissiveMap),t.envMap&&e.push(t.envMap),t.lightMap&&e.push(t.envMap),t.map&&e.push(t.map),t.metalnessMap&&e.push(t.map),t.normalMap&&e.push(t.map),t.roughnessMap&&e.push(t.map),t.specularMap&&e.push(t.specularMap),e}(t);if(Array.isArray(t))for(const e of t)e.dispose();else t.dispose();for(let t=0;t-1*(t.start-e.start)));const e=t.geometry.groups.length-1;let r=t.geometry.groups[e].materialIndex;const i=[r];for(let n=e-1;n>=0;n--){const e=t.geometry.groups[n];e.materialIndex===r?(t.geometry.groups[n+1].count+=e.count,t.geometry.groups.splice(n,1)):(r=e.materialIndex,i.push(r))}for(let e=t.material.length-1;e>=0;e--)i.includes(e)||(t.geometry.groups.forEach((t=>{t.materialIndex>e&&(t.materialIndex-=1)})),t.material.splice(e,1))}r.d(e,{O:()=>n,Z:()=>i})},79742:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,s=a(t),o=s[0],l=s[1],c=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),h=0,u=l>0?o-4:o;for(r=0;r>16&255,c[h++]=e>>8&255,c[h++]=255&e;return 2===l&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,c[h++]=255&e),1===l&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,c[h++]=e>>8&255,c[h++]=255&e),c},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],o=16383,a=0,c=i-n;ac?c:a+o));return 1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,i){for(var n,s,o=[],a=e;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},48764:(t,e,r)=>{"use strict";var i=r(79742),n=r(80645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=l,e.h2=50;var o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|m(t,e),i=a(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return l.from(i,e,r);var n=function(t){if(l.isBuffer(t)){var e=0|f(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Q(t.length)?a(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return h(t),a(t<0?0:0|f(t))}function d(t){for(var e=t.length<0?0:0|f(t.length),r=a(e),i=0;i=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return i?-1:N(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function A(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var h=-1;for(s=r;sa&&(r=a-l),s=r;s>=0;s--){for(var u=!0,d=0;dn&&(i=n):i=n;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function M(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:c>223?3:c>191?2:1;if(n+u<=r)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[n+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=u}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii.length?l.from(s).copy(i,n):Uint8Array.prototype.set.call(i,s,n);else{if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n)}n+=s.length}return i},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(t,e,r,i,n){if(G(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(i,n),h=t.slice(e,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,i,n,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function D(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function k(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,8),n.write(t,e,r,i,52,8),r+8}l.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t],n=1,s=0;++s>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,i||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return k(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return k(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,i){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function F(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Q(t){return t!=t}var j=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()},94629:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hierarchyItemLength=e.infoLength=void 0,e.infoLength=160,e.hierarchyItemLength=32},73156: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Copc=void 0;const o=s(r(81693)),a=r(26115),l=r(52277),c=r(53216);async function h(t,{pointDataRecordFormat:e,pointDataRecordLength:r},i,n){const s=await async function(t,{pointDataOffset:e,pointDataLength:r}){return a.Getter.create(t)(e,e+r)}(t,i),{pointCount:l}=i;return o.PointData.decompressChunk(s,{pointCount:l,pointDataRecordFormat:e,pointDataRecordLength:r},n)}e.Copc={create:async function(t){const e=a.Getter.create(t),r=e(0,65536);async function i(t,i){return i>=65536?e(t,i):(await r).slice(t,i)}const n=o.Header.parse(await i(0,o.Constants.minHeaderLength)),s=await o.Vlr.walk(i,n),l=o.Vlr.find(s,"copc",1);if(!l)throw new Error("COPC info VLR is required");const h=c.Info.parse(await o.Vlr.fetch(i,l));let u;const d=o.Vlr.find(s,"LASF_Projection",2112);d&&d.contentLength&&(u=a.Binary.toCString(await o.Vlr.fetch(i,d)),""===u&&(u=void 0));let p=[];const f=o.Vlr.find(s,"LASF_Spec",4);return f&&(p=o.ExtraBytes.parse(await o.Vlr.fetch(i,f))),{header:n,vlrs:s,info:h,wkt:u,eb:p}},loadHierarchyPage:async function(t,e){const r=a.Getter.create(t);return l.Hierarchy.load(r,e)},loadPointDataBuffer:h,loadPointDataView:async function(t,e,r,{lazPerf:i,include:n}={}){const s=await h(t,e.header,r,i);return o.View.create(s,e.header,e.eb,n)}}},52277:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hierarchy=void 0;const i=r(26115),n=r(94629);function s(t){const e=i.Binary.toDataView(t);if(e.byteLength%n.hierarchyItemLength!=0)throw new Error(`Invalid hierarchy page length: ${e.byteLength}`);const r={},s={};for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Info=void 0;const i=r(26115),n=r(94629);e.Info={parse:function(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${n.infoLength}): ${e.byteLength}`);const r=[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)],s=e.getFloat64(24,!0);return{cube:[r[0]-s,r[1]-s,r[2]-s,r[0]+s,r[1]+s,r[2]+s],spacing:e.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,i.parseBigInt)((0,i.getBigUint64)(e,40,!0)),pageLength:(0,i.parseBigInt)((0,i.getBigUint64)(e,48,!0))},gpsTimeRange:[e.getFloat64(56,!0),e.getFloat64(64,!0)]}}}},44975:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},98212:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hierarchy=void 0,e.Hierarchy={parse:function(t){return Object.entries(t).reduce(((t,[e,r])=>(-1===r?t.pages[e]={}:r&&(t.nodes[e]={pointCount:r}),t)),{nodes:{},pages:{}})}}},66329: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(44975),e),n(r(98212),e)},37830: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e},o=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.Las=e.Ept=void 0,e.Ept=s(r(66329)),o(r(68750),e),e.Las=s(r(81693)),o(r(26115),e)},50755:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.evlrHeaderLength=e.vlrHeaderLength=e.minHeaderLength=void 0,e.minHeaderLength=375,e.vlrHeaderLength=54,e.evlrHeaderLength=60},14953:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dimensions=void 0;const i=r(26115),n=r(6125);e.Dimensions={create:function(t,e=[]){return Object.keys(t).reduce(((t,r)=>{const i=o[r];if(i)return{...t,[r]:i};const s=e.find((t=>t.name===r)),a=s&&n.ExtraBytes.getDimension(s);if(a)return{...t,[r]:a};throw new Error(`Failed to look up LAS type: ${r}`)}),{})}};const{Type:s}=i.Dimension,o={X:s.float64,Y:s.float64,Z:s.float64,Intensity:s.uint16,ReturnNumber:s.uint8,NumberOfReturns:s.uint8,ScanDirectionFlag:s.boolean,EdgeOfFlightLine:s.boolean,Classification:s.uint8,Synthetic:s.boolean,KeyPoint:s.boolean,Withheld:s.boolean,Overlap:s.boolean,ScanAngle:s.float32,UserData:s.uint8,PointSourceId:s.uint16,GpsTime:s.float64,Red:s.uint16,Green:s.uint16,Blue:s.uint16,ScannerChannel:s.uint8,Infrared:s.uint16}},6125:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtraBytes=void 0;const i=r(26115);e.ExtraBytes={getDimension:function({type:t,length:e}){switch(t){case"signed":case"unsigned":switch(e){case 1:case 2:case 4:case 8:return{type:t,size:e}}case"float":switch(e){case 4:case 8:return{type:t,size:e}}}},parse:function(t){if(t.byteLength%n!=0)throw new Error(`Invalid extra bytes VLR length: ${t.byteLength}`);const e=[];for(let r=0;r=11)throw new Error(`Invalid extra bytes "type" value: ${o}`);if(0===o)return{name:r,description:s,length:a};const l=(c=a,{hasNodata:Boolean(1&c),hasMin:Boolean(c>>1&1),hasMax:Boolean(c>>2&1),hasScale:Boolean(c>>3&1),hasOffset:Boolean(c>>4&1)});var c;const h=function(t){switch(t){case 1:return i.Dimension.Type.uint8;case 2:return i.Dimension.Type.int8;case 3:return i.Dimension.Type.uint16;case 4:return i.Dimension.Type.int16;case 5:return i.Dimension.Type.uint32;case 6:return i.Dimension.Type.int32;case 7:return i.Dimension.Type.uint64;case 8:return i.Dimension.Type.int64;case 9:return i.Dimension.Type.float32;case 10:return i.Dimension.Type.float64}}(o);if(!h)throw new Error(`Failed to extract dimension type: ${o}`);const{type:u,size:d}=h;function p(t){switch(u){case"signed":return(0,i.parseBigInt)(e.getBigInt64(t,!0));case"unsigned":return(0,i.parseBigInt)((0,i.getBigUint64)(e,t,!0));case"float":return e.getFloat64(t,!0)}}const f={name:r,description:s,type:u,length:d};return l.hasNodata&&(f.nodata=p(40)),l.hasMin&&(f.min=p(64)),l.hasMax&&(f.max=p(88)),l.hasScale&&(f.scale=e.getFloat64(112)),l.hasOffset&&(f.offset=e.getFloat64(136)),f}},29032:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Extractor=void 0;const i=r(26115);function n(t){const{scale:e,offset:r}=t,n=a(t);function s(t,e){return t.getUint8(n(e)+14)}function o(t,e){return t.getUint8(n(e)+15)}function l(t,e){return 31&o(t,e)}return{X:(t,s)=>i.Scale.unapply(t.getInt32(n(s),!0),e[0],r[0]),Y:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+4,!0),e[1],r[1]),Z:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+8,!0),e[2],r[2]),Intensity:(t,e)=>t.getUint16(n(e)+12,!0),ReturnNumber:(t,e)=>7&s(t,e),NumberOfReturns:(t,e)=>(56&s(t,e))>>3,ScanDirectionFlag:(t,e)=>(64&s(t,e))>>6,EdgeOfFlightLine:(t,e)=>(128&s(t,e))>>7,Classification:(t,e)=>{const r=l(t,e);return 12===r?0:r},Synthetic:(t,e)=>(32&o(t,e))>>5,KeyPoint:(t,e)=>(64&o(t,e))>>6,Withheld:(t,e)=>(128&o(t,e))>>7,Overlap:(t,e)=>12===l(t,e)?1:0,ScanAngle:(t,e)=>t.getInt8(n(e)+16),UserData:(t,e)=>t.getUint8(n(e)+17),PointSourceId:(t,e)=>t.getUint16(n(e)+18,!0)}}function s(t){const{scale:e,offset:r}=t,n=a(t);function s(t,e){return t.getUint8(n(e)+15)}return{X:(t,s)=>i.Scale.unapply(t.getInt32(n(s),!0),e[0],r[0]),Y:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+4,!0),e[1],r[1]),Z:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+8,!0),e[2],r[2]),Intensity:(t,e)=>t.getUint16(n(e)+12,!0),ReturnNumber:(t,e)=>15&t.getUint16(n(e)+14,!0),NumberOfReturns:(t,e)=>(240&t.getUint16(n(e)+14,!0))>>4,Synthetic:(t,e)=>1&s(t,e),KeyPoint:(t,e)=>(2&s(t,e))>>1,Withheld:(t,e)=>(4&s(t,e))>>2,Overlap:(t,e)=>(8&s(t,e))>>3,ScannerChannel:(t,e)=>(48&s(t,e))>>4,ScanDirectionFlag:(t,e)=>(64&s(t,e))>>6,EdgeOfFlightLine:(t,e)=>(128&s(t,e))>>7,Classification:(t,e)=>t.getUint8(n(e)+16),UserData:(t,e)=>t.getUint8(n(e)+17),ScanAngle:(t,e)=>.006*t.getInt16(n(e)+18,!0),PointSourceId:(t,e)=>t.getUint16(n(e)+20,!0),GpsTime:(t,e)=>t.getFloat64(n(e)+22,!0)}}function o(t){const e=a(t);return{...s(t),Red:(t,r)=>t.getUint16(e(r)+30,!0),Green:(t,r)=>t.getUint16(e(r)+32,!0),Blue:(t,r)=>t.getUint16(e(r)+34,!0)}}function a(t){const{pointDataRecordLength:e}=t;return function(t){return t*e}}e.Extractor={create:function(t,e=[]){const r=function(t,e){let r=function(t){switch(t){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${t}`)}}(t.pointDataRecordFormat);return e.reduce(((e,n)=>{const s=r;r+=n.length;const o=function(t,e,{type:r,length:n}){const s=a(t);switch(r){case"signed":switch(n){case 1:return(t,r)=>t.getInt8(s(r)+e);case 2:return(t,r)=>t.getInt16(s(r)+e,!0);case 4:return(t,r)=>t.getInt32(s(r)+e,!0);case 8:return(t,r)=>(0,i.parseBigInt)(t.getBigInt64(s(r)+e,!0))}case"unsigned":switch(n){case 1:return(t,r)=>t.getUint8(s(r)+e);case 2:return(t,r)=>t.getUint16(s(r)+e,!0);case 4:return(t,r)=>t.getUint32(s(r)+e,!0);case 8:return(t,r)=>(0,i.parseBigInt)((0,i.getBigUint64)(t,s(r)+e,!0))}case"float":switch(n){case 4:return(t,r)=>t.getFloat32(s(r)+e,!0);case 8:return(t,r)=>t.getFloat64(s(r)+e,!0)}}}(t,s,n);if(!o)return e;return{...e,[n.name]:(t,e)=>i.Scale.unapply(o(t,e),n.scale,n.offset)}}),{})}(t,e);return{...(()=>{const{pointDataRecordFormat:e}=t;switch(e){case 0:return n(t);case 1:return function(t){const e=a(t);return{...n(t),GpsTime:(t,r)=>t.getFloat64(e(r)+20,!0)}}(t);case 2:return function(t){const e=a(t);return{...n(t),Red:(t,r)=>t.getUint16(e(r)+20,!0),Green:(t,r)=>t.getUint16(e(r)+22,!0),Blue:(t,r)=>t.getUint16(e(r)+24,!0)}}(t);case 3:return function(t){const e=a(t);return{...n(t),GpsTime:(t,r)=>t.getFloat64(e(r)+20,!0),Red:(t,r)=>t.getUint16(e(r)+28,!0),Green:(t,r)=>t.getUint16(e(r)+30,!0),Blue:(t,r)=>t.getUint16(e(r)+32,!0)}}(t);case 6:return s(t);case 7:return o(t);case 8:return function(t){const e=a(t);return{...o(t),Infrared:(t,r)=>t.getUint16(e(r)+36,!0)}}(t);default:throw new Error(`Unsupported point data record format: ${e}`)}})(),...r}}}},73651:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Header=void 0;const i=r(26115),n=r(50755),s=r(64267);function o(t){const e=i.Binary.toDataView(t),r=[];for(let t=0;t<120;t+=8)r.push((0,i.getBigUint64)(e,t,!0));return r.map((t=>(0,i.parseBigInt)(t)))}function a(t){const e=i.Binary.toDataView(t),r=[];for(let t=0;t<20;t+=4)r.push(e.getUint32(t,!0));return r}e.Header={parse:function(t){if(t.byteLength{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decompressFile=e.decompressChunk=e.PointData=void 0;const i=r(42622),n=r(73651);let s;async function o(t){return t||(s||(s=(0,i.createLazPerf)()),s)}async function a(t,{pointCount:e,pointDataRecordFormat:r,pointDataRecordLength:i},n){const s=await o(n),a=new Uint8Array(e*i),l=s._malloc(t.byteLength),c=s._malloc(i),h=new s.ChunkDecoder;try{s.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),l),h.open(r,i,l);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatGuid=e.parsePoint=void 0;const i=r(26115);e.parsePoint=function(t){const e=i.Binary.toDataView(t);if(24!==e.byteLength)throw new Error(`Invalid tuple buffer length: ${e.byteLength}`);return[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)]},e.formatGuid=function(t){const e=i.Binary.toDataView(t);if(16!==e.byteLength)throw new Error(`Invalid GUID buffer length: ${e.byteLength}`);let r="";for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.View=void 0;const i=r(26115),n=r(14953),s=r(29032);e.View={create:function(t,e,r=[],o){let a=s.Extractor.create(e,r);if(o){const t=new Set([...o]);a=Object.entries(a).reduce(((e,[r,i])=>(t.has(r)&&(e[r]=i),e)),{})}const l=n.Dimensions.create(a,r),c=i.Binary.toDataView(t),h=e.pointDataRecordLength;if(c.byteLength%h!=0)throw new Error(`Invalid buffer length (${c.byteLength}) for point length ${h}`);const u=c.byteLength/e.pointDataRecordLength;return{pointCount:u,dimensions:l,getter:function(t){const e=a[t];if(!e)throw new Error(`No extractor for dimension: ${t}`);return function(t){if(t>=u)throw new RangeError(`View index (${t}) out of range: ${u}`);return e(c,t)}}}}}},79687:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Vlr=void 0;const i=r(26115),n=r(50755);function s(t,e,r){return t.find((t=>t.userId===e&&t.recordId===r))}function o(t,e){return(e?l:a)(t)}function a(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${n.vlrHeaderLength}): ${e.byteLength}`);return{userId:i.Binary.toCString(t.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:e.getUint16(20,!0),description:i.Binary.toCString(t.slice(22,54)),isExtended:!1}}function l(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${n.evlrHeaderLength}): ${e.byteLength}`);return{userId:i.Binary.toCString(t.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:(0,i.parseBigInt)((0,i.getBigUint64)(e,20,!0)),description:i.Binary.toCString(t.slice(28,60)),isExtended:!0}}async function c({get:t,startOffset:e,count:r,isExtended:i}){const s=[];let a=e;const l=i?n.evlrHeaderLength:n.vlrHeaderLength;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBigUint64=e.parseBigInt=void 0,e.parseBigInt=function(t){if(t>BigInt(Number.MAX_SAFE_INTEGER)||t{"use strict";function r(t){return new DataView(t.buffer,t.byteOffset,t.length)}function i(t){const e=r(t);let i="";for(let t=0;t{"use strict";function r([t,e,r,i,n,s]){return[t+(i-t)/2,e+(n-e)/2,r+(s-r)/2]}function i(t){return t[3]-t[0]}function n(t){return t[4]-t[1]}function s(t){return t[5]-t[2]}function o(t,[e,i,n]){const[s,o,a,l,c,h]=t,[u,d,p]=r(t);return[e?u:s,i?d:o,n?p:a,e?l:u,i?c:d,n?h:p]}Object.defineProperty(e,"__esModule",{value:!0}),e.Bounds=void 0,e.Bounds={min:function(t){return[t[0],t[1],t[2]]},max:function(t){return[t[3],t[4],t[5]]},mid:r,width:i,depth:n,height:s,cube:function(t){const e=r(t),o=Math.max(i(t),n(t),s(t))/2;return[e[0]-o,e[1]-o,e[2]-o,e[0]+o,e[1]+o,e[2]+o]},step:o,stepTo:function(t,[e,r,i,n]){for(let s=e-1;s>=0;--s)t=o(t,[r>>s&1,i>>s&1,n>>s&1]);return t},intersection:function(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1]),Math.max(t[2],e[2]),Math.min(t[3],e[3]),Math.min(t[4],e[4]),Math.min(t[5],e[5])]}}},15882:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dimension=void 0,e.Dimension={Type:{int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}},ctype:function({type:t,size:e}){switch(t){case"signed":switch(e){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(e){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(e){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${t}/${e}`)}}},28732: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Getter=void 0;const a=o(r(86747));function l(t){return async function(e,r){if(e<0||r<0||e>r)throw new Error("Invalid range");const i=await(0,a.default)(t,{headers:{Range:`bytes=${e}-${r-1}`}}),n=await i.arrayBuffer();return new Uint8Array(n)}}function c(t){return async function(e,i){const n=await Promise.resolve().then((()=>s(r(Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}())))));return async function(e=0,r=1/0){if(e<0||r<0||e>r)throw new Error("Invalid range");return await n.promises.access(t),async function(t){return await new Promise(((e,r)=>{const i=[];t.on("data",(t=>i.push(t))),t.on("error",r),t.on("end",(()=>e(Buffer.concat(i))))}))}(n.createReadStream(t,{start:e,end:r-1,autoClose:!0}))}(e,i)}}e.Getter={create:function(t){return"function"==typeof t?t:t.startsWith("http://")||t.startsWith("https://")?l(t):c(t)},http:l,file:c}},26115: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.Step=e.Scale=e.Key=e.Getter=e.Dimension=e.Bounds=e.Binary=void 0,n(r(51877),e);var s=r(16467);Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return s.Binary}});var o=r(45314);Object.defineProperty(e,"Bounds",{enumerable:!0,get:function(){return o.Bounds}});var a=r(15882);Object.defineProperty(e,"Dimension",{enumerable:!0,get:function(){return a.Dimension}});var l=r(28732);Object.defineProperty(e,"Getter",{enumerable:!0,get:function(){return l.Getter}});var c=r(49479);Object.defineProperty(e,"Key",{enumerable:!0,get:function(){return c.Key}});var h=r(50350);Object.defineProperty(e,"Scale",{enumerable:!0,get:function(){return h.Scale}});var u=r(96784);Object.defineProperty(e,"Step",{enumerable:!0,get:function(){return u.Step}})},49479:(t,e)=>{"use strict";function r(t){if("string"!=typeof t)return t;const[e,r,i,n,...s]=t.split("-").map((t=>parseInt(t,10))),o=[e,r,i,n];if(0!==s.length||o.some((t=>"number"!=typeof t||Number.isNaN(t))))throw new Error(`Invalid key: ${t}`);return o}Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={create:function(t,e=0,i=0,n=0){return"number"!=typeof t?r(t):[t,e,i,n]},parse:r,toString:function(t){return"string"==typeof t?t:t.join("-")},step:function(t,[r,i,n]){const[s,o,a,l]=e.Key.create(t);return[s+1,2*o+r,2*a+i,2*l+n]},up:function(t,r=1){const[i,n,s,o]=e.Key.create(t);return[i-r,n>>r,s>>r,o>>r]},compare:function(t,e){for(let r=0;re[r])return 1}return 0},depth:function(t){return t[0]}}},50350:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scale=void 0,e.Scale={apply:(t,e=1,r=0)=>(t-r)/e,unapply:(t,e=1,r=0)=>t*e+r}},96784:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Step=void 0,e.Step={fromIndex:function(t){if(t<0||t>=8)throw new Error(`Invalid step index: ${t}`);return[t>>0&1?1:0,t>>1&1?1:0,t>>2&1?1:0]},list:function(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}}},86747:function(t,e){var r="undefined"!=typeof self?self:this,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in t,o="ArrayBuffer"in t;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function m(t){var e=new FileReader,r=f(e);return e.readAsArrayBuffer(t),r}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&n&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var t,e,r,i=p(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,r=f(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i-1?i:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function x(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},A.call(v.prototype),A.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];b.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function w(t,r){return new Promise((function(i,s){var o=new v(t,r);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new b(n,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",l)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}w.polyfill=!0,t.fetch||(t.fetch=w,t.Headers=d,t.Request=v,t.Response=b),e.Headers=d,e.Request=v,e.Response=b,e.fetch=w,Object.defineProperty(e,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e},9187:t=>{"use strict";function e(t,e,i){i=i||2;var s,o,a,l,u,d,f,m=e&&e.length,g=m?e[0]*i:t.length,A=r(t,0,g,i,!0),y=[];if(!A||A.next===A.prev)return y;if(m&&(A=function(t,e,i,n){var s,o,a,l=[];for(s=0,o=e.length;s80*i){s=a=t[0],o=l=t[1];for(var v=i;va&&(a=u),d>l&&(l=d);f=0!==(f=Math.max(a-s,l-o))?32767/f:0}return n(A,y,i,s,o,f,0),y}function r(t,e,r,i,n){var s,o;if(n===S(t,e,r,i)>0)for(s=e;s=e;s-=i)o=w(s,t[s],t[s+1],o);return o&&A(o,o.next)&&(E(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!A(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(E(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function n(t,e,r,c,h,u,p){if(t){!p&&u&&function(t,e,r,i){var n=t;do{0===n.z&&(n.z=d(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){var e,r,i,n,s,o,a,l,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(o>1)}(n)}(t,c,h,u);for(var f,m,g=t;t.prev!==t.next;)if(f=t.prev,m=t.next,u?o(t,c,h,u):s(t))e.push(f.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),E(t),t=m.next,g=m.next;else if((t=m)===g){p?1===p?n(t=a(i(t),e,r),e,r,c,h,u,2):2===p&&l(t,e,r,c,h,u):n(i(t),e,r,c,h,u,1);break}}}function s(t){var e=t.prev,r=t,i=t.next;if(g(e,r,i)>=0)return!1;for(var n=e.x,s=r.x,o=i.x,a=e.y,l=r.y,c=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c,m=i.next;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&f(n,a,s,l,o,c,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,r,i){var n=t.prev,s=t,o=t.next;if(g(n,s,o)>=0)return!1;for(var a=n.x,l=s.x,c=o.x,h=n.y,u=s.y,p=o.y,m=al?a>c?a:c:l>c?l:c,v=h>u?h>p?h:p:u>p?u:p,x=d(m,A,e,r,i),b=d(y,v,e,r,i),_=t.prevZ,w=t.nextZ;_&&_.z>=x&&w&&w.z<=b;){if(_.x>=m&&_.x<=y&&_.y>=A&&_.y<=v&&_!==n&&_!==o&&f(a,h,l,u,c,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,w.x>=m&&w.x<=y&&w.y>=A&&w.y<=v&&w!==n&&w!==o&&f(a,h,l,u,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;_&&_.z>=x;){if(_.x>=m&&_.x<=y&&_.y>=A&&_.y<=v&&_!==n&&_!==o&&f(a,h,l,u,c,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;w&&w.z<=b;){if(w.x>=m&&w.x<=y&&w.y>=A&&w.y<=v&&w!==n&&w!==o&&f(a,h,l,u,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function a(t,e,r){var n=t;do{var s=n.prev,o=n.next.next;!A(s,o)&&y(s,n,n.next,o)&&b(s,o)&&b(o,s)&&(e.push(s.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),E(n),E(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function l(t,e,r,s,o,a){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var h=_(l,c);return l=i(l,l.next),h=i(h,h.next),n(l,e,r,s,o,a,0),void n(h,e,r,s,o,a,0)}c=c.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,i=e,n=t.x,s=t.y,o=-1/0;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){var a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>o&&(o=a,r=i.x=i.x&&i.x>=h&&n!==i.x&&f(sr.x||i.x===r.x&&u(r,i)))&&(r=i,p=l)),i=i.next}while(i!==c);return r}(t,e);if(!r)return e;var n=_(r,t);return i(n,n.next),i(r,r.next)}function u(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(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 p(t){var e=t,r=t;do{(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&y(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var r=t,i=!1,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)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||A(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function A(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,r,i){var n=x(g(t,e,r)),s=x(g(t,e,i)),o=x(g(r,i,t)),a=x(g(r,i,e));return n!==s&&o!==a||!(0!==n||!v(t,r,e))||!(0!==s||!v(t,i,e))||!(0!==o||!v(r,t,i))||!(0!==a||!v(r,e,i))}function v(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 x(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function _(t,e){var r=new M(t.i,t.x,t.y),i=new M(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 w(t,e,r,i){var n=new M(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 E(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 M(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}function S(t,e,r,i){for(var n=0,s=e,o=r-i;s0&&(i+=t[n-1].length,r.holes.push(i))}return r}},80645:(t,e)=>{e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,l=(1<>1,h=-7,u=r?n-1:0,d=r?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,l,c=8*s-n-1,h=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,n),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;t[r+p]=255&a,p+=f,a/=256,n-=8);for(o=o<0;t[r+p]=255&o,p+=f,o/=256,c-=8);t[r+p-f]|=128*m}},25705:(t,e,r)=>{"use strict";var i,n,s=r.g.MutationObserver||r.g.WebKitMutationObserver;if(s){var o=0,a=new s(u),l=r.g.document.createTextNode("");a.observe(l,{characterData:!0}),i=function(){l.data=o=++o%2}}else if(r.g.setImmediate||void 0===r.g.MessageChannel)i="document"in r.g&&"onreadystatechange"in r.g.document.createElement("script")?function(){var t=r.g.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},r.g.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new r.g.MessageChannel;c.port1.onmessage=u,i=function(){c.port2.postMessage(0)}}var h=[];function u(){var t,e;n=!0;for(var r=h.length;r;){for(e=h,h=[],t=-1;++t{t.exports=function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return n(e[o][1][t]||t)}),c,c.exports,t,e,r,i)}return r[o].exports}for(var s=void 0,o=0;o>>1],e)>=0?n=s+1:i=s;return n},e.exports=function(){function t(t){var e;this.options=t,this.comparator=this.options.comparator,this.data=(null!=(e=this.options.initialValues)?e.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return t.prototype.queue=function(t){var e;e=i(this.data,t,this.comparator),this.data.splice(e,0,t)},t.prototype.dequeue=function(){return this.data.pop()},t.prototype.peek=function(){return this.data[this.data.length-1]},t.prototype.clear=function(){this.data.length=0},t}()},{}],4:[function(t,e,r){e.exports=function(){function t(t){var e,r,i,n,s,o,a,l;for(this.comparator=(null!=t?t.comparator:void 0)||function(t,e){return t-e},this.pageSize=(null!=t?t.pageSize:void 0)||512,this.length=0,a=0;1<s;0<=s?++r:--r)e.push(null);if(this._memory=[],this._mask=this.pageSize-1,t.initialValues)for(i=0,n=(o=t.initialValues).length;i0&&(this._write(1,e),this._bubbleDown(1,e)),t},t.prototype.peek=function(){return this._read(1)},t.prototype.clear=function(){this.length=0,this._memory.length=0},t.prototype._write=function(t,e){var r;for(r=t>>this._shift;r>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[r][t&this._mask]=e},t.prototype._read=function(t){return this._memory[t>>this._shift][t&this._mask]},t.prototype._bubbleUp=function(t,e){var r,i,n,s;for(r=this.comparator;t>1&&(i=t&this._mask,t3?n=t&~this._mask|i>>1:i<2?(n=t-this.pageSize>>this._shift,n+=n&~(this._mask>>1),n|=this.pageSize>>1):n=t-2,!(r(s=this._read(n),e)<0));)this._write(n,e),this._write(t,s),t=n},t.prototype._bubbleDown=function(t,e){var r,i,n,s,o;for(o=this.comparator;tthis._mask&&!(t&this._mask-1)?r=i=t+2:t&this.pageSize>>1?(r=(t&~this._mask)>>1,i=1+(r=1+(r|=t&this._mask>>1)<0)for(t=e=1,r=this.data.length;1<=r?er;t=1<=r?++e:--e)this._bubbleUp(t)},t.prototype.queue=function(t){this.data.push(t),this._bubbleUp(this.data.length-1)},t.prototype.dequeue=function(){var t,e;return e=this.data[0],t=this.data.pop(),this.data.length>0&&(this.data[0]=t,this._bubbleDown(0)),e},t.prototype.peek=function(){return this.data[0]},t.prototype.clear=function(){this.length=0,this.data.length=0},t.prototype._bubbleUp=function(t){for(var e,r;t>0&&(e=t-1>>>1,this.comparator(this.data[t],this.data[e])<0);)r=this.data[e],this.data[e]=this.data[t],this.data[t]=r,t=e},t.prototype._bubbleDown=function(t){var e,r,i,n,s;for(e=this.data.length-1;n=1+(r=1+(t<<1)),i=t,r<=e&&this.comparator(this.data[r],this.data[i])<0&&(i=r),n<=e&&this.comparator(this.data[n],this.data[i])<0&&(i=n),i!==t;)s=this.data[i],this.data[i]=this.data[t],this.data[t]=s,t=i},t}()},{}]},{},[1])(1)},55733:(t,e,r)=>{t.exports=function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return n(e[o][1][t]||t)}),c,c.exports,t,e,r,i)}return r[o].exports}for(var s=void 0,o=0;o>2,a=(3&e)<<4|r>>4,l=1>6:64,c=2>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(c++)))>>2,i=(3&a)<<6|(l=s.indexOf(t.charAt(c++))),d[h++]=e,64!==a&&(d[h++]=r),64!==l&&(d[h++]=i);return d}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var i=t("./external"),n=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}a.prototype={getContentWorker:function(){var t=new n(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var i=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var i=t("./utils"),n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,r,i){var s=n,o=0+r;t^=-1;for(var a=0;a>>8^s[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,r,i){var s=n,o=0+r;t^=-1;for(var a=0;a>>8^s[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var i;i="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,r){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=i?"uint8array":"array";function l(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new l("Deflate",t)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function i(t,e){var r,i="";for(r=0;r>>=8;return i}function n(t,e,r,n,o,h){var u,d,p=t.file,f=t.compression,m=h!==a.utf8encode,g=s.transformTo("string",h(p.name)),A=s.transformTo("string",a.utf8encode(p.name)),y=p.comment,v=s.transformTo("string",h(y)),x=s.transformTo("string",a.utf8encode(y)),b=A.length!==p.name.length,_=x.length!==y.length,w="",E="",M="",S=p.dir,C=p.date,T={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(T.crc32=t.crc32,T.compressedSize=t.compressedSize,T.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),m||!b&&!_||(I|=2048);var R=0,B=0;S&&(R|=16),"UNIX"===o?(B=798,R|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(p.unixPermissions,S)):(B=20,R|=function(t){return 63&(t||0)}(p.dosPermissions)),u=C.getUTCHours(),u<<=6,u|=C.getUTCMinutes(),u<<=5,u|=C.getUTCSeconds()/2,d=C.getUTCFullYear()-1980,d<<=4,d|=C.getUTCMonth()+1,d<<=5,d|=C.getUTCDate(),b&&(E=i(1,1)+i(l(g),4)+A,w+="up"+i(E.length,2)+E),_&&(M=i(1,1)+i(l(v),4)+x,w+="uc"+i(M.length,2)+M);var L="";return L+="\n\0",L+=i(I,2),L+=f.magic,L+=i(u,2),L+=i(d,2),L+=i(T.crc32,4),L+=i(T.compressedSize,4),L+=i(T.uncompressedSize,4),L+=i(g.length,2),L+=i(w.length,2),{fileRecord:c.LOCAL_FILE_HEADER+L+g+w,dirRecord:c.CENTRAL_FILE_HEADER+i(B,2)+L+i(v.length,2)+"\0\0\0\0"+i(R,4)+i(n,4)+g+w+v}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),c=t("../signature");function h(t,e,r,i){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,o),h.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:function(t){return c.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,r){"use strict";var i=t("./Uint8ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var i=t("./DataReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var i=t("./ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var i=t("../utils"),n=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new a(t):n.uint8array?new l(i.transformTo("uint8array",t)):new s(i.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../utils");function s(t){i.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../crc32");function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function i(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=i},{}],29:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),l=t("../external"),c=null;if(a.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e,r){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=r,i.checkSupport(o),this._worker=t.pipe(new n(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return function(t,e){return new l.Promise((function(r,n){var s=[],a=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",(function(t,r){s.push(t),e&&e(r)})).on("error",(function(t){s=[],n(t)})).on("end",(function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return i.transformTo(t,e)}}(l,function(t,e){var r,i=0,n=null,s=0;for(r=0;r>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return n.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,n,s,o=t.length,l=new Array(2*o);for(e=r=0;e>10&1023,l[r++]=56320|1023&n)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),i.applyFromCharCode(l)}(t=i.transformTo(n.uint8array?"uint8array":"array",t))},i.inherits(c,o),c.prototype.processChunk=function(t){var e=i.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),l=e;o!==e.length&&(n.uint8array?(l=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(l=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(l),meta:t.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,i.inherits(h,o),h.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var i=t("./support"),n=t("./base64"),s=t("./nodejsUtils"),o=t("./external");function a(t){return t}function l(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r>10&1023,c[i++]=56320|1023&n)}return l(c,i)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,n){var s=i,o=n+r;t^=-1;for(var a=n;a>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){"use strict";var i,n=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),l=t("./messages"),c=0,h=0,u=-2,d=2,p=8,f=286,m=30,g=19,A=2*f+1,y=15,v=3,x=258,b=x+v+1,_=42,w=113;function E(t,e){return t.msg=l[e],e}function M(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(n.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function T(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,C(t.strm)}function I(t,e){t.pending_buf[t.pending++]=e}function R(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function B(t,e){var r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-b?t.strstart-(t.w_size-b):0,c=t.window,h=t.w_mask,u=t.prev,d=t.strstart+x,p=c[s+o-1],f=c[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(c[(r=e)+o]===f&&c[r+o-1]===p&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&sl&&0!=--n);return o<=t.lookahead?o:t.lookahead}function L(t){var e,r,i,s,l,c,h,u,d,p,f=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-b)){for(n.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--r;);for(e=r=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--r;);s+=f}if(0===t.strm.avail_in)break;if(c=t.strm,h=t.window,u=t.strstart+t.lookahead,p=void 0,(d=s)<(p=c.avail_in)&&(p=d),r=0===p?0:(c.avail_in-=p,n.arraySet(h,c.input,c.next_in,p,u),1===c.state.wrap?c.adler=o(c.adler,h,p,u):2===c.state.wrap&&(c.adler=a(c.adler,h,p,u)),c.next_in+=p,c.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=v)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=v&&(t.ins_h=(t.ins_h<=v)if(i=s._tr_tally(t,t.strstart-t.match_start,t.match_length-v),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=v){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=v&&(t.ins_h=(t.ins_h<=v&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-v,i=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-v),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(L(t),0===t.lookahead&&e===c)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,T(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-b&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(T(t,!1),t.strm.avail_out),1)})),new O(4,4,8,4,P),new O(4,5,16,8,P),new O(4,6,32,32,P),new O(4,4,16,16,D),new O(8,16,32,32,D),new O(8,16,128,128,D),new O(8,32,128,256,D),new O(32,128,258,1024,D),new O(32,258,258,4096,D)],r.deflateInit=function(t,e){return F(t,e,p,15,8,0)},r.deflateInit2=F,r.deflateReset=N,r.deflateResetKeep=U,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,h):u},r.deflate=function(t,e){var r,n,o,l;if(!t||!t.state||5>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,3),n.status=w);else{var d=p+(n.w_bits-8<<4)<<8;d|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(d|=32),d+=31-d%31,n.status=w,R(n,d),0!==n.strstart&&(R(n,t.adler>>>16),R(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending!==n.pending_buf_size));)I(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(t),n.pending+2<=n.pending_buf_size&&(I(n,255&t.adler),I(n,t.adler>>8&255),t.adler=0,n.status=w)):n.status=w),0!==n.pending){if(C(t),0===t.avail_out)return n.last_flush=-1,h}else if(0===t.avail_in&&M(e)<=M(r)&&4!==e)return E(t,-5);if(666===n.status&&0!==t.avail_in)return E(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==c&&666!==n.status){var f=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(L(t),0===t.lookahead)){if(e===c)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,i,n,o,a=t.window;;){if(t.lookahead<=x){if(L(t),t.lookahead<=x&&e===c)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=v&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=v?(r=s._tr_tally(t,1,t.match_length-v),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?1:2}(n,e):i[n.level].func(n,e);if(3!==f&&4!==f||(n.status=666),1===f||3===f)return 0===t.avail_out&&(n.last_flush=-1),h;if(2===f&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(S(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(t),0===t.avail_out))return n.last_flush=-1,h}return 4!==e?h:n.wrap<=0?1:(2===n.wrap?(I(n,255&t.adler),I(n,t.adler>>8&255),I(n,t.adler>>16&255),I(n,t.adler>>24&255),I(n,255&t.total_in),I(n,t.total_in>>8&255),I(n,t.total_in>>16&255),I(n,t.total_in>>24&255)):(R(n,t.adler>>>16),R(n,65535&t.adler)),C(t),0=r.w_size&&(0===a&&(S(r.head),r.strstart=0,r.block_start=0,r.insert=0),p=new n.Buf8(r.w_size),n.arraySet(p,e,f-r.w_size,r.w_size,0),e=p,f=r.w_size),l=t.avail_in,c=t.next_in,d=t.input,t.avail_in=f,t.next_in=0,t.input=e,L(r);r.lookahead>=v;){for(i=r.strstart,s=r.lookahead-(v-1);r.ins_h=(r.ins_h<>>=x=v>>>24,f-=x,0==(x=v>>>16&255))S[s++]=65535&v;else{if(!(16&x)){if(0==(64&x)){v=m[(65535&v)+(p&(1<>>=x,f-=x),f<15&&(p+=M[i++]<>>=x=v>>>24,f-=x,!(16&(x=v>>>16&255))){if(0==(64&x)){v=g[(65535&v)+(p&(1<>>=x,f-=x,(x=s-o)<_){if(h<(x=_-x)&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=d,(w=0)===u){if(w+=c-x,x>3,p&=(1<<(f-=b<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=h,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(u),e.distcode=e.distdyn=new i.Buf32(d),e.sane=1,e.back=-1,l):c}function g(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,m(t)):c}function A(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(i.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n<(s=o.wsize-o.wnext)&&(s=n),i.arraySet(o.window,e,r-n,s,o.wnext),(n-=s)?(i.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,N,2,0),v=y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&y)){t.msg="unknown compression method",r.mode=30;break}if(v-=4,P=8+(15&(y>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(N[0]=255&y,N[1]=y>>>8&255,r.check=s(r.check,N,2,0)),v=y=0,r.mode=3;case 3:for(;v<32;){if(0===g)break t;g--,y+=u[f++]<>>8&255,N[2]=y>>>16&255,N[3]=y>>>24&255,r.check=s(r.check,N,4,0)),v=y=0,r.mode=4;case 4:for(;v<16;){if(0===g)break t;g--,y+=u[f++]<>8),512&r.flags&&(N[0]=255&y,N[1]=y>>>8&255,r.check=s(r.check,N,2,0)),v=y=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===g)break t;g--,y+=u[f++]<>>8&255,r.check=s(r.check,N,2,0)),v=y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(g<(E=r.length)&&(E=g),E&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,u,f,E,P)),512&r.flags&&(r.check=s(r.check,u,E,f)),g-=E,f+=E,r.length-=E),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break t;for(E=0;P=u[f+E++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P)),P&&E>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===g)break t;g--,y+=u[f++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===g)break t;g--,y+=u[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(_(r),r.mode=20,6!==e)break;y>>>=2,v-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}y>>>=2,v-=2;break;case 14:for(y>>>=7&v,v-=7&v;v<32;){if(0===g)break t;g--,y+=u[f++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&y,v=y=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(E=r.length){if(g>>=5,v-=5,r.ndist=1+(31&y),y>>>=5,v-=5,r.ncode=4+(15&y),y>>>=4,v-=4,286>>=3,v-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},D=a(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,D){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=C,v-=C,r.lens[r.have++]=I;else{if(16===I){for(k=C+2;v>>=C,v-=C,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}P=r.lens[r.have-1],E=3+(3&y),y>>>=2,v-=2}else if(17===I){for(k=C+3;v>>=C)),y>>>=3,v-=3}else{for(k=C+7;v>>=C)),y>>>=7,v-=7}if(r.have+E>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;E--;)r.lens[r.have++]=P}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,O={bits:r.lenbits},D=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,D){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},D=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,D){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=g&&258<=A){t.next_out=m,t.avail_out=A,t.next_in=f,t.avail_in=g,r.hold=y,r.bits=v,o(t,b),m=t.next_out,d=t.output,A=t.avail_out,f=t.next_in,u=t.input,g=t.avail_in,y=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;T=(U=r.lencode[y&(1<>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>R)])>>>16&255,I=65535&U,!(R+(C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=R,v-=R,r.back+=R}if(y>>>=C,v-=C,r.back+=C,r.length=I,0===T){r.mode=26;break}if(32&T){r.back=-1,r.mode=12;break}if(64&T){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&T,r.mode=22;case 22:if(r.extra){for(k=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;T=(U=r.distcode[y&(1<>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>R)])>>>16&255,I=65535&U,!(R+(C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=R,v-=R,r.back+=R}if(y>>>=C,v-=C,r.back+=C,64&T){t.msg="invalid distance code",r.mode=30;break}r.offset=I,r.extra=15&T,r.mode=24;case 24:if(r.extra){for(k=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===A)break t;if(E=b-A,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}M=E>r.wnext?(E-=r.wnext,r.wsize-E):r.wnext-E,E>r.length&&(E=r.length),S=r.window}else S=d,M=m-r.offset,E=r.length;for(Ay?(x=U[N+u[E]],P[D+u[E]]):(x=96,0),p=1<>I)+(f-=p)]=v<<24|x<<16|b|0,0!==f;);for(p=1<>=1;if(0!==p?(L&=p-1,L+=p):L=0,E++,0==--O[w]){if(w===S)break;w=e[r+u[E]]}if(C>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function C(t,e,r){t.bi_valid>c-r?(t.bi_buf|=e<>c-t.bi_valid,t.bi_valid+=r-c):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function R(t,e,r){var i,n,s=new Array(l+1),o=0;for(i=1;i<=l;i++)s[i]=o=o+r[i-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=I(s[a]++,a))}}function B(t){var e;for(e=0;e>1;1<=r;r--)D(t,s,r);for(n=c;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],D(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,D(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,o,a,c=e.dyn_tree,h=e.max_code,u=e.stat_desc.static_tree,d=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(s=0;s<=l;s++)t.bl_count[s]=0;for(c[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(s=c[2*c[2*(i=t.heap[r])+1]+1]+1)&&(s=m,g++),c[2*i+1]=s,h>=7;i>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e>>3,(o=t.static_len+3+7>>>3)<=n&&(n=o)):n=o=r+5,r+4<=n&&-1!==e?z(t,e,r,i):4===t.strategy||o===n?(C(t,2+(i?1:0),3),O(t,f,m)):(C(t,4+(i?1:0),3),function(t,e,r,i){var n;for(C(t,e-257,5),C(t,r-1,5),C(t,i-4,4),n=0;n>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(A[r]+s+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){C(t,2,3),T(t,256,f),function(t){16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var r,i,n,s,o=1,a={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,r="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(s+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){n.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(t){var e=c.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):function(t){setTimeout(d,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i{var e,r=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var r,i,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){r=t,i=e})),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>W("You are getting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>W("You are setting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var s=Object.assign({},n),o=[],a="./this.program";if(n.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var l,c="";if("undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),e&&(c=e),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var h,u,d,p=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);function m(t,e){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){W("Module."+t+" has been replaced with plain "+e+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function g(t){return"FS_createPath"===t||"FS_createDataFile"===t||"FS_createPreloadedFile"===t||"FS_unlink"===t||"addRunDependency"===t||"FS_createLazyFile"===t||"FS_createDevice"===t||"removeRunDependency"===t}Object.assign(n,s),s=null,h="fetchSettings",Object.getOwnPropertyDescriptor(n,h)&&W("`Module."+h+"` was supplied but `"+h+"` not included in INCOMING_MODULE_JS_API"),n.arguments&&(o=n.arguments),m("arguments","arguments_"),n.thisProgram&&(a=n.thisProgram),m("thisProgram","thisProgram"),n.quit&&n.quit,m("quit","quit_"),y(void 0===n.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.read,"Module.read option was removed (modify read_ in JS)"),y(void 0===n.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),y(void 0===n.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),y(void 0===n.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),y(void 0===n.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),m("read","read_"),m("readAsync","readAsync"),m("readBinary","readBinary"),m("setWindowTitle","setWindowTitle"),y(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),y(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),y(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(u=n.wasmBinary),m("wasmBinary","wasmBinary"),n.noExitRuntime,m("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&W("no native wasm support detected");var A=!1;function y(t,e){t||W("Assertion failed"+(e?": "+e:""))}var v,x,b,_,w,E,M,S,C,T="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(t,e,r){for(var i=e+r,n=e;t[n]&&!(n>=i);)++n;if(n-e>16&&t.buffer&&T)return T.decode(t.subarray(e,n));for(var s="";e>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|a)}else s+=String.fromCharCode(o)}return s}function R(t,e){return t?I(b,t,e):""}function B(t,e,r,i){if(!(i>0))return 0;for(var n=r,s=r+i-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),a<=127){if(r>=s)break;e[r++]=a}else if(a<=2047){if(r+1>=s)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=s)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+3>=s)break;a>1114111&&tt("Invalid Unicode code point 0x"+a.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-n}function L(t){for(var e=0,r=0;r=55296&&i<=57343?(e+=4,++r):e+=3}return e}function P(t){v=t,n.HEAP8=x=new Int8Array(t),n.HEAP16=_=new Int16Array(t),n.HEAP32=E=new Int32Array(t),n.HEAPU8=b=new Uint8Array(t),n.HEAPU16=w=new Uint16Array(t),n.HEAPU32=M=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}var D=65536;n.TOTAL_STACK&&y(D===n.TOTAL_STACK,"the stack size can no longer be determined at runtime");var O,k=n.INITIAL_MEMORY||262144;function U(){if(!A){var t=Ee(),e=M[t>>2],r=M[t+4>>2];34821223==e&&2310721022==r||W("Stack overflow! Stack cookie has been overwritten at 0x"+t.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+e.toString(16)),1668509029!==M[0]&&W("Runtime error: The application has corrupted its heap memory area (address zero)!")}}m("INITIAL_MEMORY","INITIAL_MEMORY"),y(k>=D,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+k+"! (TOTAL_STACK="+D+")"),y("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),y(!n.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),y(262144==k,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var N=[],F=[],z=[],G=!1;y(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Q=0,j=null,V=null,H={};function W(t){n.onAbort&&n.onAbort(t),f(t="Aborted("+t+")"),A=!0;var e=new WebAssembly.RuntimeError(t);throw i(e),e}var q={error:function(){W("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){q.error()},createDataFile:function(){q.error()},createPreloadedFile:function(){q.error()},createLazyFile:function(){q.error()},open:function(){q.error()},mkdev:function(){q.error()},registerDevice:function(){q.error()},analyzePath:function(){q.error()},loadFilesFromDB:function(){q.error()},ErrnoError:function(){q.error()}};n.FS_createDataFile=q.createDataFile,n.FS_createPreloadedFile=q.createPreloadedFile;var Z,Y;function X(t){return t.startsWith("data:application/octet-stream;base64,")}function J(t,e){return function(){var r=t,i=e;return e||(i=n.asm),y(G,"native function `"+r+"` called before runtime initialization"),i[t]||y(i[t],"exported native function `"+r+"` not found"),i[t].apply(null,arguments)}}function K(t){try{if(t==Z&&u)return new Uint8Array(u);if(l)return l(t);throw"both async and sync fetching of the wasm failed"}catch(t){W(t)}}function $(t){for(;t.length>0;)t.shift()(n)}function tt(t){tt.shown||(tt.shown={}),tt.shown[t]||(tt.shown[t]=1,f(t))}function et(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){M[this.ptr+4>>2]=t},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(t){M[this.ptr+8>>2]=t},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_refcount=function(t){E[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,x[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=x[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,x[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=x[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=E[this.ptr>>2];E[this.ptr>>2]=t+1},this.release_ref=function(){var t=E[this.ptr>>2];return E[this.ptr>>2]=t-1,y(t>0),1===t},this.set_adjusted_ptr=function(t){M[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Me(this.get_type()))return M[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}function rt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}X(Z="laz-perf.wasm")||(Y=Z,Z=n.locateFile?n.locateFile(Y,c):c+Y);var it=void 0;function nt(t){for(var e="",r=t;b[r];)e+=it[b[r++]];return e}var st={},ot={},at={},lt=48,ct=57;function ht(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=lt&&e<=ct?"_"+t:t}function ut(t,e){return t=ht(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function dt(t,e){var r=ut(e,(function(t){this.name=e,this.message=t;var r=new Error(t).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var pt=void 0;function ft(t){throw new pt(t)}var mt=void 0;function gt(t){throw new mt(t)}function At(t,e,r){function i(e){var i=r(e);i.length!==t.length&>("Mismatched type converter count");for(var n=0;n{ot.hasOwnProperty(t)?n[e]=ot[t]:(s.push(t),st.hasOwnProperty(t)||(st[t]=[]),st[t].push((()=>{n[e]=ot[t],++o===s.length&&i(n)})))})),0===s.length&&i(n)}function yt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var i=e.name;if(t||ft('type "'+i+'" must have a positive integer typeid pointer'),ot.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;ft("Cannot register type '"+i+"' twice")}if(ot[t]=e,delete at[t],st.hasOwnProperty(t)){var n=st[t];delete st[t],n.forEach((t=>t()))}}function vt(t){ft(t.$$.ptrType.registeredClass.name+" instance already deleted")}var xt=!1;function bt(t){}function _t(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function wt(t,e,r){if(e===r)return t;if(void 0===r.baseClass)return null;var i=wt(t,e,r.baseClass);return null===i?null:r.downcast(i)}var Et={};var Mt=[];function St(){for(;Mt.length;){var t=Mt.pop();t.$$.deleteScheduled=!1,t.delete()}}var Ct=void 0;var Tt={};function It(t,e){return e.ptrType&&e.ptr||gt("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&>("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Bt(Object.create(t,{$$:{value:e}}))}function Rt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=function(t,e){return e=function(t,e){for(void 0===e&&ft("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),Tt[e]}(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var i=r.clone();return this.destructor(t),i}function n(){return this.isSmartPointer?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var s,o=this.registeredClass.getActualType(e),a=Et[o];if(!a)return n.call(this);s=this.isConst?a.constPointerType:a.pointerType;var l=wt(e,this.registeredClass,s.registeredClass);return null===l?n.call(this):this.isSmartPointer?It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}function Bt(t){return"undefined"==typeof FinalizationRegistry?(Bt=t=>t,t):(xt=new FinalizationRegistry((t=>{console.warn(t.leakWarning.stack.replace(/^Error: /,"")),_t(t.$$)})),Bt=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e},i=e.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+i.name+" <0x"+e.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Rt),xt.register(t,r,t)}return t},bt=t=>xt.unregister(t),Bt(t))}function Lt(){}function Pt(t,e,r){if(void 0===t[e].overloadTable){var i=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ft("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[i.argCount]=i}}function Dt(t,e,r,i,n,s,o,a){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=i,this.baseClass=n,this.getActualType=s,this.upcast=o,this.downcast=a,this.pureVirtualFunctions=[]}function Ot(t,e,r){for(;e!==r;)e.upcast||ft("Expected null or instance of "+r.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function kt(t,e){if(null===e)return this.isReference&&ft("null is not a valid "+this.name),0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name);var r=e.$$.ptrType.registeredClass;return Ot(e.$$.ptr,r,this.registeredClass)}function Ut(t,e){var r;if(null===e)return this.isReference&&ft("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&ft("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var i=e.$$.ptrType.registeredClass;if(r=Ot(e.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&ft("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:ft("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var n=e.clone();r=this.rawShare(r,Kt.toHandle((function(){n.delete()}))),null!==t&&t.push(this.rawDestructor,r)}break;default:ft("Unsupporting sharing policy")}return r}function Nt(t,e){if(null===e)return this.isReference&&ft("null is not a valid "+this.name),0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&ft("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;return Ot(e.$$.ptr,r,this.registeredClass)}function Ft(t){return this.fromWireType(E[t>>2])}function zt(t,e,r,i,n,s,o,a,l,c,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=i,this.isSmartPointer=n,this.pointeeType=s,this.sharingPolicy=o,this.rawGetPointee=a,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=h,n||void 0!==e.baseClass?this.toWireType=Ut:i?(this.toWireType=kt,this.destructorFunction=null):(this.toWireType=Nt,this.destructorFunction=null)}var Gt=[];function Qt(t){var e=Gt[t];return e||(t>=Gt.length&&(Gt.length=t+1),Gt[t]=e=O.get(t)),y(O.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e}function jt(t,e){var r=(t=nt(t)).includes("j")?function(t,e){y(t.includes("j")||t.includes("p"),"getDynCaller should only be called with i64 sigs");var r=[];return function(){return r.length=0,Object.assign(r,arguments),function(t,e,r){return t.includes("j")?function(t,e,r){y("dynCall_"+t in n,"bad function pointer type - no table for sig '"+t+"'"),r&&r.length?y(r.length===t.substring(1).replace(/j/g,"--").length):y(1==t.length);var i=n["dynCall_"+t];return r&&r.length?i.apply(null,[e].concat(r)):i.call(null,e)}(t,e,r):(y(Qt(e),"missing table entry in dynCall: "+e),Qt(e).apply(null,r))}(t,e,r)}}(t,e):Qt(e);return"function"!=typeof r&&ft("unknown function pointer with signature "+t+": "+e),r}var Vt=void 0;function Ht(t){var e=_e(t),r=nt(e);return be(e),r}function Wt(t,e){var r=[],i={};throw e.forEach((function t(e){i[e]||ot[e]||(at[e]?at[e].forEach(t):(r.push(e),i[e]=!0))})),new Vt(t+": "+r.map(Ht).join([", "]))}function qt(t,e){for(var r=[],i=0;i>2]);return r}function Zt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function Yt(t,e,r,i,n){var s=e.length;s<2&&ft("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==e[1]&&null!==r,a=!1,l=1;l0?", ":"")+u),d+=(c?"var rv = ":"")+"invoker(fn"+(u.length>0?", ":"")+u+");\n",a)d+="runDestructors(destructors);\n";else for(l=o?1:2;l(t||ft("Cannot use deleted val. handle = "+t),Jt[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Xt.length?Xt.pop():Jt.length;return Jt[e]={refcount:1,value:t},e}}};function $t(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function te(t,e){switch(e){case 2:return function(t){return this.fromWireType(S[t>>2])};case 3:return function(t){return this.fromWireType(C[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function ee(t,e,r){switch(e){case 0:return r?function(t){return x[t]}:function(t){return b[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return w[t>>1]};case 2:return r?function(t){return E[t>>2]}:function(t){return M[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ie(t,e){y(t%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=t,i=r>>1,n=i+e/2;!(i>=n)&&w[i];)++i;if((r=i<<1)-t>32&&re)return re.decode(b.subarray(t,r));for(var s="",o=0;!(o>=e/2);++o){var a=_[t+2*o>>1];if(0==a)break;s+=String.fromCharCode(a)}return s}function ne(t,e,r){if(y(e%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),y("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var i=e,n=(r-=2)<2*t.length?r/2:t.length,s=0;s>1]=o,e+=2}return _[e>>1]=0,e-i}function se(t){return 2*t.length}function oe(t,e){y(t%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,i="";!(r>=e/4);){var n=E[t+4*r>>2];if(0==n)break;if(++r,n>=65536){var s=n-65536;i+=String.fromCharCode(55296|s>>10,56320|1023&s)}else i+=String.fromCharCode(n)}return i}function ae(t,e,r){if(y(e%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),y("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var i=e,n=i+r-4,s=0;s=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++s)),E[e>>2]=o,(e+=4)+4>n)break}return E[e>>2]=0,e-i}function le(t){for(var e=0,r=0;r=55296&&i<=57343&&++r,e+=4}return e}function ce(t){try{return d.grow(t-v.byteLength+65535>>>16),P(d.buffer),1}catch(e){f("emscripten_realloc_buffer: Attempted to grow heap from "+v.byteLength+" bytes to "+t+" bytes, but got error: "+e)}}var he={};function ue(){if(!ue.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(var e in he)void 0===he[e]?delete t[e]:t[e]=he[e];var r=[];for(var e in t)r.push(e+"="+t[e]);ue.strings=r}return ue.strings}var de=[null,[],[]];function pe(t,e){var r=de[t];y(r),0===e||10===e?((1===t?p:f)(I(r,0)),r.length=0):r.push(e)}function fe(t){return t%4==0&&(t%100!=0||t%400==0)}var me=[31,29,31,30,31,30,31,31,30,31,30,31],ge=[31,28,31,30,31,30,31,31,30,31,30,31];function Ae(t,e,r,i){var n=E[i+40>>2],s={tm_sec:E[i>>2],tm_min:E[i+4>>2],tm_hour:E[i+8>>2],tm_mday:E[i+12>>2],tm_mon:E[i+16>>2],tm_year:E[i+20>>2],tm_wday:E[i+24>>2],tm_yday:E[i+28>>2],tm_isdst:E[i+32>>2],tm_gmtoff:E[i+36>>2],tm_zone:n?R(n):""},o=R(r),a={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in a)o=o.replace(new RegExp(l,"g"),a[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function u(t,e,r){for(var i="number"==typeof t?t.toString():t||"";i.length0?1:0}var i;return 0===(i=r(t.getFullYear()-e.getFullYear()))&&0===(i=r(t.getMonth()-e.getMonth()))&&(i=r(t.getDate()-e.getDate())),i}function f(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function m(t){var e=function(t,e){for(var r=new Date(t.getTime());e>0;){var i=fe(r.getFullYear()),n=r.getMonth(),s=(i?me:ge)[n];if(!(e>s-r.getDate()))return r.setDate(r.getDate()+e),r;e-=s-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(t.tm_year+1900,0,1),t.tm_yday),r=new Date(e.getFullYear(),0,4),i=new Date(e.getFullYear()+1,0,4),n=f(r),s=f(i);return p(n,e)<=0?p(s,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var g={"%a":function(t){return c[t.tm_wday].substring(0,3)},"%A":function(t){return c[t.tm_wday]},"%b":function(t){return h[t.tm_mon].substring(0,3)},"%B":function(t){return h[t.tm_mon]},"%C":function(t){return d((t.tm_year+1900)/100|0,2)},"%d":function(t){return d(t.tm_mday,2)},"%e":function(t){return u(t.tm_mday,2," ")},"%g":function(t){return m(t).toString().substring(2)},"%G":function(t){return m(t)},"%H":function(t){return d(t.tm_hour,2)},"%I":function(t){var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),d(e,2)},"%j":function(t){return d(t.tm_mday+function(t,e){for(var r=0,i=0;i<=e;r+=t[i++]);return r}(fe(t.tm_year+1900)?me:ge,t.tm_mon-1),3)},"%m":function(t){return d(t.tm_mon+1,2)},"%M":function(t){return d(t.tm_min,2)},"%n":function(){return"\n"},"%p":function(t){return t.tm_hour>=0&&t.tm_hour<12?"AM":"PM"},"%S":function(t){return d(t.tm_sec,2)},"%t":function(){return"\t"},"%u":function(t){return t.tm_wday||7},"%U":function(t){var e=t.tm_yday+7-t.tm_wday;return d(Math.floor(e/7),2)},"%V":function(t){var e=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&e++,e){if(53==e){var r=(t.tm_wday+371-t.tm_yday)%7;4==r||3==r&&fe(t.tm_year)||(e=1)}}else{e=52;var i=(t.tm_wday+7-t.tm_yday-1)%7;(4==i||5==i&&fe(t.tm_year%400-1))&&e++}return d(e,2)},"%w":function(t){return t.tm_wday},"%W":function(t){var e=t.tm_yday+7-(t.tm_wday+6)%7;return d(Math.floor(e/7),2)},"%y":function(t){return(t.tm_year+1900).toString().substring(2)},"%Y":function(t){return t.tm_year+1900},"%z":function(t){var e=t.tm_gmtoff,r=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(r?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(t){return t.tm_zone},"%%":function(){return"%"}};for(var l in o=o.replace(/%%/g,"\0\0"),g)o.includes(l)&&(o=o.replace(new RegExp(l,"g"),g[l](s)));var A,v,b,_=(!1,v=L(A=o=o.replace(/\0\0/g,"%"))+1,B(A,b=new Array(v),0,b.length),b);return _.length>e?0:(function(t,e){y(t.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),x.set(t,e)}(_,t),_.length-1)}!function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);it=t}(),pt=n.BindingError=dt(Error,"BindingError"),mt=n.InternalError=dt(Error,"InternalError"),Lt.prototype.isAliasOf=function(t){if(!(this instanceof Lt))return!1;if(!(t instanceof Lt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,i=t.$$.ptrType.registeredClass,n=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;i.baseClass;)n=i.upcast(n),i=i.baseClass;return e===i&&r===n},Lt.prototype.clone=function(){if(this.$$.ptr||vt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Bt(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},Lt.prototype.delete=function(){this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ft("Object already scheduled for deletion"),bt(this),_t(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Lt.prototype.isDeleted=function(){return!this.$$.ptr},Lt.prototype.deleteLater=function(){return this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ft("Object already scheduled for deletion"),Mt.push(this),1===Mt.length&&Ct&&Ct(St),this.$$.deleteScheduled=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Tt).length},n.getLiveInheritedInstances=function(){var t=[];for(var e in Tt)Tt.hasOwnProperty(e)&&t.push(Tt[e]);return t},n.flushPendingDeletes=St,n.setDelayFunction=function(t){Ct=t,Mt.length&&Ct&&Ct(St)},zt.prototype.getPointee=function(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},zt.prototype.destructor=function(t){this.rawDestructor&&this.rawDestructor(t)},zt.prototype.argPackAdvance=8,zt.prototype.readValueFromPointer=Ft,zt.prototype.deleteObject=function(t){null!==t&&t.delete()},zt.prototype.fromWireType=Rt,Vt=n.UnboundTypeError=dt(Error,"UnboundTypeError"),n.count_emval_handles=function(){for(var t=0,e=5;e>s])},destructorFunction:null})},_embind_register_class:function(t,e,r,i,s,o,a,l,c,h,u,d,p){u=nt(u),o=jt(s,o),l&&(l=jt(a,l)),h&&(h=jt(c,h)),p=jt(d,p);var f=ht(u);!function(t,e,r){n.hasOwnProperty(t)?(ft("Cannot register public name '"+t+"' twice"),Pt(n,t,t),n.hasOwnProperty(r)&&ft("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),n[t].overloadTable[void 0]=e):n[t]=e}(f,(function(){Wt("Cannot construct "+u+" due to unbound types",[i])})),At([t,e,r],i?[i]:[],(function(e){var r,s;e=e[0],s=i?(r=e.registeredClass).instancePrototype:Lt.prototype;var a=ut(f,(function(){if(Object.getPrototypeOf(this)!==c)throw new pt("Use 'new' to construct "+u);if(void 0===d.constructor_body)throw new pt(u+" has no accessible constructor");var t=d.constructor_body[arguments.length];if(void 0===t)throw new pt("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),c=Object.create(s,{constructor:{value:a}});a.prototype=c;var d=new Dt(u,a,c,p,r,o,l,h),m=new zt(u,d,!0,!1,!1),g=new zt(u+"*",d,!1,!1,!1),A=new zt(u+" const*",d,!1,!0,!1);return Et[t]={pointerType:g,constPointerType:A},function(t,e,r){n.hasOwnProperty(t)||gt("Replacing nonexistant public symbol"),n[t].overloadTable,n[t]=e,n[t].argCount=r}(f,a),[m,g,A]}))},_embind_register_class_constructor:function(t,e,r,i,n,s){y(e>0);var o=qt(e,r);n=jt(i,n),At([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new pt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{Wt("Cannot construct "+t.name+" due to unbound types",o)},At([],o,(function(i){return i.splice(1,0,null),t.registeredClass.constructor_body[e-1]=Yt(r,i,null,n,s),[]})),[]}))},_embind_register_class_function:function(t,e,r,i,n,s,o,a){var l=qt(r,i);e=nt(e),s=jt(n,s),At([],[t],(function(t){var i=(t=t[0]).name+"."+e;function n(){Wt("Cannot call "+i+" due to unbound types",l)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),a&&t.registeredClass.pureVirtualFunctions.push(e);var c=t.registeredClass.instancePrototype,h=c[e];return void 0===h||void 0===h.overloadTable&&h.className!==t.name&&h.argCount===r-2?(n.argCount=r-2,n.className=t.name,c[e]=n):(Pt(c,e,i),c[e].overloadTable[r-2]=n),At([],l,(function(n){var a=Yt(i,n,t,s,o);return void 0===c[e].overloadTable?(a.argCount=r-2,c[e]=a):c[e].overloadTable[r-2]=a,[]})),[]}))},_embind_register_emval:function(t,e){yt(t,{name:e=nt(e),fromWireType:function(t){var e=Kt.toValue(t);return function(t){t>4&&0==--Jt[t].refcount&&(Jt[t]=void 0,Xt.push(t))}(t),e},toWireType:function(t,e){return Kt.toHandle(e)},argPackAdvance:8,readValueFromPointer:Ft,destructorFunction:null})},_embind_register_float:function(t,e,r){var i=rt(r);yt(t,{name:e=nt(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+$t(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:te(e,i),destructorFunction:null})},_embind_register_integer:function(t,e,r,i,n){e=nt(e),-1===n&&(n=4294967295);var s=rt(r),o=t=>t;if(0===i){var a=32-8*r;o=t=>t<>>a}var l=e.includes("unsigned"),c=(t,r)=>{if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+$t(t)+'" to '+r);if(tn)throw new TypeError('Passing a number "'+$t(t)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+i+", "+n+"]!")};yt(t,{name:e,fromWireType:o,toWireType:l?function(t,e){return c(e,this.name),e>>>0}:function(t,e){return c(e,this.name),e},argPackAdvance:8,readValueFromPointer:ee(e,s,0!==i),destructorFunction:null})},_embind_register_memory_view:function(t,e,r){var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function n(t){var e=M,r=e[t>>=2],n=e[t+1];return new i(v,n,r)}yt(t,{name:r=nt(r),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:function(t,e){var r="std::string"===(e=nt(e));yt(t,{name:e,fromWireType:function(t){var e,i=M[t>>2],n=t+4;if(r)for(var s=n,o=0;o<=i;++o){var a=n+o;if(o==i||0==b[a]){var l=R(s,a-s);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),s=a+1}}else{var c=new Array(i);for(o=0;o>2]=i,r&&n)s=e,o=c,y("number"==typeof(a=i+1),"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),B(s,b,o,a);else if(n)for(var h=0;h255&&(be(c),ft("String has UTF-16 code units that do not fit in 8 bits")),b[c+h]=u}else for(h=0;hw,a=1):4===e&&(i=oe,n=ae,o=le,s=()=>M,a=2),yt(t,{name:r,fromWireType:function(t){for(var r,n=M[t>>2],o=s(),l=t+4,c=0;c<=n;++c){var h=t+4+c*e;if(c==n||0==o[h>>a]){var u=i(l,h-l);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),l=h+e}}return be(t),r},toWireType:function(t,i){"string"!=typeof i&&ft("Cannot pass non-string to C++ string type "+r);var s=o(i),l=xe(4+s+e);return M[l>>2]=s>>a,n(i,l+4,s+e),null!==t&&t.push(be,l),l},argPackAdvance:8,readValueFromPointer:Ft,destructorFunction:function(t){be(t)}})},_embind_register_void:function(t,e){yt(t,{isVoid:!0,name:e=nt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},abort:function(){W("native code called abort()")},emscripten_memcpy_big:function(t,e,r){b.copyWithin(t,e,e+r)},emscripten_resize_heap:function(t){var e=b.length;y((t>>>=0)>e);var r,i=2147483648;if(t>i)return f("Cannot enlarge memory, asked to go up to "+t+" bytes, but the limit is "+i+" bytes!"),!1;for(var n=1;n<=4;n*=2){var s=e*(1+.2/n);s=Math.min(s,t+100663296);var o=Math.min(i,(r=Math.max(t,s))+(65536-r%65536)%65536);if(ce(o))return!0}return f("Failed to grow the heap from "+e+" bytes to "+o+" bytes, not enough memory!"),!1},environ_get:function(t,e){var r=0;return ue().forEach((function(i,n){var s=e+r;M[t+4*n>>2]=s,function(t,e,r){for(var i=0;i>0]=t.charCodeAt(i);x[e>>0]=0}(i,s),r+=i.length+1})),0},environ_sizes_get:function(t,e){var r=ue();M[t>>2]=r.length;var i=0;return r.forEach((function(t){i+=t.length+1})),M[e>>2]=i,0},fd_close:function(t){W("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(t,e,r,i,n){return 70},fd_write:function(t,e,r,i){for(var n=0,s=0;s>2],a=M[e+4>>2];e+=8;for(var l=0;l>2]=n,0},strftime_l:function(t,e,r,i){return Ae(t,e,r,i)}},xe=(function(){var t,e={env:ve,wasi_snapshot_preview1:ve};function r(t,e){var r,i=t.exports;n.asm=i,y(d=n.asm.memory,"memory not found in wasm exports"),P(d.buffer),y(O=n.asm.__indirect_function_table,"table not found in wasm exports"),r=n.asm.__wasm_call_ctors,F.unshift(r),function(t){if(Q--,n.monitorRunDependencies&&n.monitorRunDependencies(Q),t?(y(H[t]),delete H[t]):f("warning: run dependency removed without ID"),0==Q&&(null!==j&&(clearInterval(j),j=null),V)){var e=V;V=null,e()}}("wasm-instantiate")}t="wasm-instantiate",Q++,n.monitorRunDependencies&&n.monitorRunDependencies(Q),t?(y(!H[t]),H[t]=1,null===j&&"undefined"!=typeof setInterval&&(j=setInterval((function(){if(A)return clearInterval(j),void(j=null);var t=!1;for(var e in H)t||(t=!0,f("still waiting on run dependencies:")),f("dependency: "+e);t&&f("(end of list)")}),1e4))):f("warning: run dependency added without ID");var s=n;function o(t){y(n===s,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),s=null,r(t.instance)}function a(t){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return K(Z)})):fetch(Z,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return K(Z)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),Z.startsWith("file://")&&f("warning: Loading from a file URI ("+Z+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),W(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(e,r)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(u||"function"!=typeof WebAssembly.instantiateStreaming||X(Z)||"function"!=typeof fetch?a(o):fetch(Z,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(i)}(),n.___wasm_call_ctors=J("__wasm_call_ctors"),n._malloc=J("malloc")),be=n._free=J("free"),_e=n.___getTypeName=J("__getTypeName"),we=(n.__embind_initialize_bindings=J("_embind_initialize_bindings"),n.___errno_location=J("__errno_location"),n._fflush=J("fflush"),n._emscripten_stack_init=function(){return(we=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),Ee=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(Ee=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)}),Me=(n.stackSave=J("stackSave"),n.stackRestore=J("stackRestore"),n.stackAlloc=J("stackAlloc"),n.___cxa_is_pointer_type=J("__cxa_is_pointer_type"));function Se(t){function e(){ye||(ye=!0,n.calledRun=!0,A||(y(!G),G=!0,U(),$(F),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),y(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),z.unshift(t);var t;$(z)}()))}var i;t=t||o,Q>0||(we(),y(0==(3&(i=Ee()))),M[i>>2]=34821223,M[i+4>>2]=2310721022,M[0]=1668509029,function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),N.unshift(t);var t;$(N)}(),Q>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e(),U()))}if(n.dynCall_viijii=J("dynCall_viijii"),n.dynCall_ji=J("dynCall_ji"),n.dynCall_jiji=J("dynCall_jiji"),n.dynCall_iiiiij=J("dynCall_iiiiij"),n.dynCall_iiiiijj=J("dynCall_iiiiijj"),n.dynCall_iiiiiijj=J("dynCall_iiiiiijj"),["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","print","printErr","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readAsmConstArgsArray","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","flush_NO_FILESYSTEM","dlopenMissingError","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var e="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";g(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),W(e)}})})),["ptrToString","zeroMemory","stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getRandomDevice","traverseStack","convertPCtoSourceLocation","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","reallyNegative","unSign","strLen","reSign","formatString","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","checkWasiClock","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","registerInheritedInstance","unregisterInheritedInstance","requireRegisteredType","enumReadValueFromPointer","validateThis","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(t){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var e="`"+t+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";g(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),tt(e)}})})),V=function t(){ye||Se(),ye||(V=t)},n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return Se(),t.ready});t.exports=r},43389:(t,e,r)=>{"use strict";var i=r(25705);function n(){}var s={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==n&&p(this,t)}function h(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function u(t,e,r){i((function(){var i;try{i=e(r)}catch(e){return s.reject(t,e)}i===t?s.reject(t,new TypeError("Cannot resolve promise with itself")):s.resolve(t,i)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var r=!1;function i(e){r||(r=!0,s.reject(t,e))}function n(e){r||(r=!0,s.resolve(t,e))}var o=f((function(){e(n,i)}));"error"===o.status&&i(o.value)}function f(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}t.exports=c,c.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){throw r}))}))},c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===o)return this;var r=new this.constructor(n);return this.state!==l?u(r,this.state===a?t:e,this.outcome):this.queue.push(new h(r,t,e)),r},h.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){s.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},s.resolve=function(t,e){var r=f(d,e);if("error"===r.status)return s.reject(t,r.value);var i=r.value;if(i)p(t,i);else{t.state=a,t.outcome=e;for(var n=-1,o=t.queue.length;++n{r(29718);var i=r(6941).s;function n(t){var e=new i;return(e.write(t)+e.end()).replace(/\0/g,"").trim()}t.exports=function t(e,r){if(!e)return n;try{new TextDecoder(e.trim())}catch(o){var i=s.exec(e);return i&&!r?t("windows-"+i[1],!0):n}return function(t){var r=new TextDecoder(e);return(r.decode(t,{stream:!0})+r.decode()).replace(/\0/g,"").trim()}};var s=/^(?:ANSI\s)?(\d+)$/m},9462:(t,e,r)=>{var i=r(11392);function n(t,e,r,i,n){var s=n(t.slice(e,e+r));switch(i){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return"y"===s.toLowerCase()||"t"===s.toLowerCase();default:return s}}function s(t,e,r,i){for(var s,o,a={},l=0,c=r.length;l{"use strict";t.exports=n;var i=r(80645);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var s=4294967296,o=1/s,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function h(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function u(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,s=this.pos;this.type=7&i,t(n,e,this),this.pos===s&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=x(this.buf,this.pos)+x(this.buf,this.pos+4)*s;return this.pos+=8,t},readSFixed64:function(){var t=x(this.buf,this.pos)+_(this.buf,this.pos+4)*s;return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,s=r.buf;if(i=(112&(n=s[r.pos++]))>>4,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<3,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<10,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<17,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<24,n<128)return c(t,i,e);if(i|=(1&(n=s[r.pos++]))<<31,n<128)return c(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,r){return a.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n239?4:l>223?3:l>191?2:1;if(n+h>r)break;1===h?l<128&&(c=l):2===h?128==(192&(s=t[n+1]))&&(c=(31&l)<<6|63&s)<=127&&(c=null):3===h?(s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&((c=(15&l)<<12|(63&s)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((c=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),n+=h}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==n.Bytes)return t.push(this.readVarint(e));var r=l(this);for(t=t||[];this.pos127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,s=0;s55295&&i<57344){if(!n){i>56319||s+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&h(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&h(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},24472:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>rr});var i=1,n=2,s=3,o=5,a=6378137,l=6356752.314,c=.0066943799901413165,h=484813681109536e-20,u=Math.PI/2,d=1e-10,p=.017453292519943295,f=57.29577951308232,m=Math.PI/4,g=2*Math.PI,A=3.14159265359,y={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const v={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var x=/[\s_\-\/\(\)]/g;function b(t,e){if(t[e])return t[e];for(var r,i=Object.keys(t),n=e.toLowerCase().replace(x,""),s=-1;++s=this.text.length)return;t=this.text[this.place++]}switch(this.state){case E:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},R.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(T.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},R.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=E)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=E,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},R.prototype.number=function(t){if(!I.test(t)){if(T.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},R.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},R.prototype.keyword=function(t){if(C.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=E)}if(!T.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},R.prototype.neutral=function(t){if(S.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(I.test(t))return this.word=t,void(this.state=3);if(!T.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},R.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=D(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(n),n}function k(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?k[t]=_(arguments[1]):k[t]=O(arguments[1]):k[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?k.apply(e,t):k(t)}));if("string"==typeof t){if(t in k)return k[t]}else"EPSG"in t?k["EPSG:"+t.EPSG]=t:"ESRI"in t?k["ESRI:"+t.ESRI]=t:"IAU2000"in t?k["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(k);const U=k;var N=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],F=["3857","900913","3785","102113"];function z(t,e){var r,i;if(t=t||{},!e)return t;for(i in e)void 0!==(r=e[i])&&(t[i]=r);return t}function G(t,e,r){var i=t*e;return r/Math.sqrt(1-i*i)}function Q(t){return t<0?-1:1}function j(t){return Math.abs(t)<=A?t:t-Q(t)*g}function V(t,e,r){var i=t*r,n=.5*t;return i=Math.pow((1-i)/(1+i),n),Math.tan(.5*(u-e))/i}function H(t,e){for(var r,i,n=.5*t,s=u-2*Math.atan(e),o=0;o<=15;o++)if(r=t*Math.sin(s),s+=i=u-2*Math.atan(e*Math.pow((1-r)/(1+r),n))-s,Math.abs(i)<=1e-10)return s;return-9999}function W(t){return t}var q=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,i=t.x,n=t.y;if(n*f>90&&n*f<-90&&i*f>180&&i*f<-180)return null;if(Math.abs(Math.abs(n)-u)<=d)return null;if(this.sphere)e=this.x0+this.a*this.k0*j(i-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(m+.5*n));else{var s=Math.sin(n),o=V(this.e,n,s);e=this.x0+this.a*this.k0*j(i-this.long0),r=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,i=t.x-this.x0,n=t.y-this.y0;if(this.sphere)r=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var s=Math.exp(-n/(this.a*this.k0));if(-9999===(r=H(this.e,s)))return null}return e=j(this.long0+i/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:W,inverse:W,names:["longlat","identity"]}],Z={},Y=[];function X(t,e){var r=Y.length;return t.names?(Y[r]=t,t.names.forEach((function(t){Z[t.toLowerCase()]=r})),this):(console.log(e),!0)}const J={start:function(){q.forEach(X)},add:X,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Z[e]&&Y[Z[e]]?Y[Z[e]]:void 0}};var K={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},$=K.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};K.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var tt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var et={};function rt(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:et[t]||null,isNull:!1}}function it(t){return t/3600*Math.PI/180}function nt(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function st(t){return t.map((function(t){return[it(t.longitudeShift),it(t.latitudeShift)]}))}function ot(t,e,r){return{name:nt(t,e+8,e+16).trim(),parent:nt(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function at(t,e,r,i){for(var n=e+176,s=[],o=0;o-1}))}(t)){var e=O(t);if(function(t){var e=b(t,"authority");if(e){var r=b(e,"epsg");return r&&F.indexOf(r)>-1}}(e))return U["EPSG:3857"];var r=function(t){var e=b(t,"extension");if(e)return b(e,"proj4")}(e);return r?_(r):e}return function(t){return"+"===t[0]}(t)?_(t):void 0}(t);if("object"==typeof r){var a=lt.projections.get(r.projName);if(a){if(r.datumCode&&"none"!==r.datumCode){var l=b(tt,r.datumCode);l&&(r.datum_params=r.datum_params||(l.towgs84?l.towgs84.split(","):null),r.ellps=l.ellipse,r.datumName=l.datumName?l.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var c,u,p,f,m,g,A=function(t,e,r,i,n){if(!t){var s=b(K,i);s||(s=$),t=s.a,e=s.b,r=s.rf}return r&&!e&&(e=(1-1/r)*t),(0===r||Math.abs(t-e)3&&(0===d.datum_params[3]&&0===d.datum_params[4]&&0===d.datum_params[5]&&0===d.datum_params[6]||(d.datum_type=n,d.datum_params[3]*=h,d.datum_params[4]*=h,d.datum_params[5]*=h,d.datum_params[6]=d.datum_params[6]/1e6+1))),u&&(d.datum_type=s,d.grids=u),d.a=r,d.b=a,d.es=l,d.ep2=c,d}(r.datumCode,r.datum_params,A.a,A.b,y.es,y.ep2,v);z(this,r),z(this,a),this.a=A.a,this.b=A.b,this.rf=A.rf,this.sphere=A.sphere,this.es=y.es,this.e=y.e,this.ep2=y.ep2,this.datum=x,this.init(),e(null,this)}else e(t)}else e(t)}lt.projections=J,lt.projections.start();const ct=lt;function ht(t,e,r){var i,n,s,o,a=t.x,l=t.y,c=t.z?t.z:0;if(l<-u&&l>-1.001*u)l=-u;else if(l>u&&l<1.001*u)l=u;else{if(l<-u)return{x:-1/0,y:-1/0,z:t.z};if(l>u)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(l),o=Math.cos(l),s=n*n,{x:((i=r/Math.sqrt(1-e*s))+c)*o*Math.cos(a),y:(i+c)*o*Math.sin(a),z:(i*(1-e)+c)*n}}function ut(t,e,r,i){var n,s,o,a,l,c,h,u,d,p,f,m,g,A,y,v=t.x,x=t.y,b=t.z?t.z:0;if(n=Math.sqrt(v*v+x*x),s=Math.sqrt(v*v+x*x+b*b),n/r<1e-12){if(A=0,s/r<1e-12)return y=-i,{x:t.x,y:t.y,z:t.z}}else A=Math.atan2(x,v);o=b/s,u=(a=n/s)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),d=o*l,g=0;do{g++,c=e*(h=r/Math.sqrt(1-e*d*d))/(h+(y=n*u+b*d-h*(1-e*d*d))),m=(f=o*(l=1/Math.sqrt(1-c*(2-c)*a*a)))*u-(p=a*(1-c)*l)*d,u=p,d=f}while(m*m>1e-24&&g<30);return{x:A,y:Math.atan(f/Math.abs(p)),z:y}}function dt(t){return t===i||t===n}function pt(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var i={x:-r.x,y:r.y},n={x:Number.NaN,y:Number.NaN},s=[];t:for(var o=0;oi.y||p>i.x||A1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=j(s.x+r.ll[0]),i.y=s.y+r.ll[1]}else isNaN(s.x)||(i.x=t.x+s.x,i.y=t.y+s.y);return i}function mt(t,e){var r,i={x:t.x/e.del[0],y:t.y/e.del[1]},n=Math.floor(i.x),s=Math.floor(i.y),o=i.x-1*n,a=i.y-1*s,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=e.lim[0])return l;if(s<0||s>=e.lim[1])return l;r=s*e.lim[0]+n;var c=e.cvs[r][0],h=e.cvs[r][1];r++;var u=e.cvs[r][0],d=e.cvs[r][1];r+=e.lim[0];var p=e.cvs[r][0],f=e.cvs[r][1];r--;var m=e.cvs[r][0],g=e.cvs[r][1],A=o*a,y=o*(1-a),v=(1-o)*(1-a),x=(1-o)*a;return l.x=v*c+y*u+x*m+A*p,l.y=v*h+y*d+x*g+A*f,l}function gt(t,e,r){var i,n,s,o=r.x,a=r.y,l=r.z||0,c={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==r.z)switch(0===s?(i=o,n=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(i=a,n=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(i=l,n="z"),t.axis[s]){case"e":case"n":c[n]=i;break;case"w":case"s":c[n]=-i;break;case"u":void 0!==r[n]&&(c.z=i);break;case"d":void 0!==r[n]&&(c.z=-i);break;default:return null}return c}function At(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function yt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function vt(t,e,r,h){var u,d=void 0!==(r=Array.isArray(r)?At(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){yt(t.x),yt(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===i||t.datum.datum_type===n||t.datum.datum_type===s)&&"WGS84"!==e.datumCode||(e.datum.datum_type===i||e.datum.datum_type===n||e.datum.datum_type===s)&&"WGS84"!==t.datumCode}(t,e)&&(r=vt(t,u=new ct("WGS84"),r,h),t=u),h&&"enu"!==t.axis&&(r=gt(t,!1,r)),"longlat"===t.projName)r={x:r.x*p,y:r.y*p,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===i?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==n||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===o||e.datum_type===o)return r;var h=t.a,u=t.es;if(t.datum_type===s){if(0!==pt(t,!1,r))return;h=a,u=c}var d=e.a,p=e.b,f=e.es;return e.datum_type===s&&(d=a,p=l,f=c),u!==f||h!==d||dt(t.datum_type)||dt(e.datum_type)?(r=ht(r,u,h),dt(t.datum_type)&&(r=function(t,e,r){if(e===i)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===n){var s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6];return{x:u*(t.x-h*t.y+c*t.z)+s,y:u*(h*t.x+t.y-l*t.z)+o,z:u*(-c*t.x+l*t.y+t.z)+a}}}(r,t.datum_type,t.datum_params)),dt(e.datum_type)&&(r=function(t,e,r){if(e===i)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===n){var s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],d=(t.x-s)/u,p=(t.y-o)/u,f=(t.z-a)/u;return{x:d+h*p-c*f,y:-h*d+p+l*f,z:c*d-l*p+f}}}(r,e.datum_type,e.datum_params)),r=ut(r,f,d,p),e.datum_type!==s||0===pt(e,!0,r)?r:void 0):r}(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*f,y:r.y*f,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),h&&"enu"!==e.axis?gt(e,!0,r):(r&&!d&&delete r.z,r)}var xt=ct("WGS84");function bt(t,e,r,i){var n,s,o;return Array.isArray(r)?(n=vt(t,e,r,i)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(r.splice(3)):[n.x,n.y,r[2]].concat(r.splice(3)):[n.x,n.y].concat(r.splice(2)):[n.x,n.y]):(s=vt(t,e,r,i),2===(o=Object.keys(r)).length||o.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;s[i]=r[i]})),s)}function _t(t){return t instanceof ct?t:t.oProj?t.oProj:ct(t)}const wt=function(t,e,r){t=_t(t);var i,n=!1;return void 0===e?(e=t,t=xt,n=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=xt,n=!0),e=_t(e),r?bt(t,e,r):(i={forward:function(r,i){return bt(t,e,r,i)},inverse:function(r,i){return bt(e,t,r,i)}},n&&(i.oProj=e),i)};var Et=6,Mt="AJSAJS",St="AFAFAF",Ct=65,Tt=73,It=79,Rt=86,Bt=90;const Lt={forward:Pt,inverse:function(t){var e=Ut(Ft(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:Dt};function Pt(t,e){return e=e||5,function(t,e){var r,i,n,s,o,a,l,c,h,u,d,p="00000"+t.easting,f="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(h=t.easting,u=t.northing,d=Nt(t.zoneNumber),r=Math.floor(h/1e5),i=Math.floor(u/1e5)%20,n=d-1,s=Mt.charCodeAt(n),o=St.charCodeAt(n),c=!1,(a=s+r-1)>Bt&&(a=a-Bt+Ct-1,c=!0),(a===Tt||sTt||(a>Tt||sIt||(a>It||sBt&&(a=a-Bt+Ct-1),(l=o+i)>Rt?(l=l-Rt+Ct-1,c=!0):c=!1,(l===Tt||oTt||(l>Tt||oIt||(l>It||oRt&&(l=l-Rt+Ct-1),String.fromCharCode(a)+String.fromCharCode(l))+p.substr(p.length-5,e)+f.substr(f.length-5,e)}(function(t){var e,r,i,n,s,o,a,l=t.lat,c=t.lon,h=6378137,u=.00669438,d=.9996,p=Ot(l),f=Ot(c);a=Math.floor((c+180)/6)+1,180===c&&(a=60),l>=56&&l<64&&c>=3&&c<12&&(a=32),l>=72&&l<84&&(c>=0&&c<9?a=31:c>=9&&c<21?a=33:c>=21&&c<33?a=35:c>=33&&c<42&&(a=37)),o=Ot(6*(a-1)-180+3),e=.006739496752268451,r=h/Math.sqrt(1-u*Math.sin(p)*Math.sin(p)),i=Math.tan(p)*Math.tan(p),n=e*Math.cos(p)*Math.cos(p);var m,g,A=d*r*((s=Math.cos(p)*(f-o))+(1-i+n)*s*s*s/6+(5-18*i+i*i+72*n-58*e)*s*s*s*s*s/120)+5e5,y=d*(h*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p))+r*Math.tan(p)*(s*s/2+(5-i+9*n+4*n*n)*s*s*s*s/24+(61-58*i+i*i+600*n-2.2240339282485886)*s*s*s*s*s*s/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(A),zoneNumber:a,zoneLetter:(m=l,g="Z",84>=m&&m>=72?g="X":72>m&&m>=64?g="W":64>m&&m>=56?g="V":56>m&&m>=48?g="U":48>m&&m>=40?g="T":40>m&&m>=32?g="S":32>m&&m>=24?g="R":24>m&&m>=16?g="Q":16>m&&m>=8?g="P":8>m&&m>=0?g="N":0>m&&m>=-8?g="M":-8>m&&m>=-16?g="L":-16>m&&m>=-24?g="K":-24>m&&m>=-32?g="J":-32>m&&m>=-40?g="H":-40>m&&m>=-48?g="G":-48>m&&m>=-56?g="F":-56>m&&m>=-64?g="E":-64>m&&m>=-72?g="D":-72>m&&m>=-80&&(g="C"),g)}}({lat:t[1],lon:t[0]}),e)}function Dt(t){var e=Ut(Ft(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Ot(t){return t*(Math.PI/180)}function kt(t){return t/Math.PI*180}function Ut(t){var e=t.northing,r=t.easting,i=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var s,o,a,l,c,h,u,d,p,f=.9996,m=6378137,g=.00669438,A=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,v=e;i<"N"&&(v-=1e7),u=6*(n-1)-180+3,s=.006739496752268451,p=(d=v/f/6367449.145945056)+(3*A/2-27*A*A*A/32)*Math.sin(2*d)+(21*A*A/16-55*A*A*A*A/32)*Math.sin(4*d)+151*A*A*A/96*Math.sin(6*d),o=m/Math.sqrt(1-g*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),l=s*Math.cos(p)*Math.cos(p),c=.99330562*m/Math.pow(1-g*Math.sin(p)*Math.sin(p),1.5),h=y/(o*f);var x=p-o*Math.tan(p)/c*(h*h/2-(5+3*a+10*l-4*l*l-9*s)*h*h*h*h/24+(61+90*a+298*l+45*a*a-1.6983531815716497-3*l*l)*h*h*h*h*h*h/720);x=kt(x);var b,_=(h-(1+2*a+l)*h*h*h/6+(5-2*l+28*a-3*l*l+8*s+24*a*a)*h*h*h*h*h/120)/Math.cos(p);if(_=u+kt(_),t.accuracy){var w=Ut({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:w.lat,right:w.lon,bottom:x,left:_}}else b={lat:x,lon:_};return b}function Nt(t){var e=t%Et;return 0===e&&(e=Et),e}function Ft(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,i=null,n="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;n+=e,s++}var o=parseInt(n,10);if(0===s||s+3>r)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;i=t.substring(s,s+=2);for(var l=Nt(o),c=function(t,e){for(var r=Mt.charCodeAt(e-1),i=1e5,n=!1;r!==t.charCodeAt(0);){if(++r===Tt&&r++,r===It&&r++,r>Bt){if(n)throw"Bad character: "+t;r=Ct,n=!0}i+=1e5}return i}(i.charAt(0),l),h=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=St.charCodeAt(e-1),i=0,n=!1;r!==t.charCodeAt(0);){if(++r===Tt&&r++,r===It&&r++,r>Rt){if(n)throw"Bad character: "+t;r=Ct,n=!0}i+=1e5}return i}(i.charAt(1),l);h0&&(d=1e5/Math.pow(10,m),p=t.substring(s,s+m),g=parseFloat(p)*d,f=t.substring(s+m),A=parseFloat(f)*d),{easting:g+c,northing:A+h,zoneLetter:a,zoneNumber:o,accuracy:d}}function zt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Gt(t,e,r){if(!(this instanceof Gt))return new Gt(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Gt.fromMGRS=function(t){return new Gt(Dt(t))},Gt.prototype.toMGRS=function(t){return Pt([this.x,this.y],t)};const Qt=Gt;var jt=.046875,Vt=.01953125,Ht=.01068115234375;function Wt(t){var e=[];e[0]=1-t*(.25+t*(jt+t*(Vt+t*Ht))),e[1]=t*(.75-t*(jt+t*(Vt+t*Ht)));var r=t*t;return e[2]=r*(.46875-t*(.013020833333333334+.007120768229166667*t)),r*=t,e[3]=r*(.3645833333333333-.005696614583333333*t),e[4]=r*t*.3076171875,e}function qt(t,e,r,i){return r*=e,e*=e,i[0]*t-r*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))}function Zt(t,e,r){for(var i=1/(1-e),n=t,s=20;s;--s){var o=Math.sin(n),a=1-e*o*o;if(n-=a=(qt(n,o,Math.cos(n),r)-t)*(a*Math.sqrt(a))*i,Math.abs(a)d?Math.tan(s):0,m=Math.pow(f,2),g=Math.pow(m,2);e=1-this.es*Math.pow(a,2),c/=Math.sqrt(e);var A=qt(s,a,l,this.en);r=this.a*(this.k0*c*(1+h/6*(1-m+u+h/20*(5-18*m+g+14*u-58*m*u+h/42*(61+179*g-g*m-479*m)))))+this.x0,i=this.a*(this.k0*(A-this.ml0+a*o*c/2*(1+h/12*(5-m+9*u+4*p+h/30*(61+g-58*m+270*u-330*m*u+h/56*(1385+543*g-g*m-3111*m))))))+this.y0}else{var y=l*Math.sin(o);if(Math.abs(Math.abs(y)-1)=1){if(y-1>d)return 93;i=0}else i=Math.acos(i);s<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=r,t.y=i,t},inverse:function(t){var e,r,i,n,s=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(r=Zt(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(r)d?Math.tan(r):0,h=this.ep2*Math.pow(l,2),p=Math.pow(h,2),f=Math.pow(c,2),m=Math.pow(f,2);e=1-this.es*Math.pow(a,2);var g=s*Math.sqrt(e)/this.k0,A=Math.pow(g,2);i=r-(e*=c)*A/(1-this.es)*.5*(1-A/12*(5+3*f-9*h*f+h-4*p-A/30*(61+90*f-252*h*f+45*m+46*h-A/56*(1385+3633*f+4095*m+1574*m*f)))),n=j(this.long0+g*(1-A/6*(1+2*f+h-A/20*(5+28*f+24*m+8*h*f+6*h-A/42*(61+662*f+1320*m+720*m*f))))/l)}else i=u*Q(o),n=0;else{var y=Math.exp(s/this.k0),v=.5*(y-1/y),x=this.lat0+o/this.k0,b=Math.cos(x);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(v,2))),i=Math.asin(e),o<0&&(i=-i),n=0===v&&0===b?0:j(Math.atan2(v,b)+this.long0)}return t.x=n,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Xt(t){var e=Math.exp(t);return(e-1/e)/2}function Jt(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),i=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function Kt(t,e){for(var r,i=2*Math.cos(2*e),n=t.length-1,s=t[n],o=0;--n>=0;)r=i*s-o+t[n],o=s,s=r;return e+r*Math.sin(2*e)}function $t(t,e,r){for(var i,n,s=Math.sin(e),o=Math.cos(e),a=Xt(r),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(r),c=2*o*l,h=-2*s*a,u=t.length-1,d=t[u],p=0,f=0,m=0;--u>=0;)i=f,n=p,d=c*(f=d)-i-h*(p=m)+t[u],m=h*f-n+c*p;return[(c=s*l)*d-(h=o*a)*m,c*m+h*d]}const te={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Yt.init.apply(this),this.forward=Yt.forward,this.inverse=Yt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var i=Kt(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var r,i=2*Math.cos(e),n=t.length-1,s=t[n],o=0;--n>=0;)r=i*s-o+t[n],o=s,s=r;return Math.sin(e)*r}(this.gtu,2*i))},forward:function(t){var e=j(t.x-this.long0),r=t.y;r=Kt(this.cbg,r);var i=Math.sin(r),n=Math.cos(r),s=Math.sin(e),o=Math.cos(e);r=Math.atan2(i,o*n),e=Math.atan2(s*n,Jt(i,n*o)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(Jt(1,e)+1))),t<0?-e:e}(Math.tan(e));var a,l,c=$t(this.gtu,2*r,2*e);return r+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,r,i=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var s=$t(this.utg,2*n,2*i);n+=s[0],i+=s[1],i=Math.atan(Xt(i));var o=Math.sin(n),a=Math.cos(n),l=Math.sin(i),c=Math.cos(i);n=Math.atan2(o*c,Jt(l,c*a)),e=j((i=Math.atan2(l,c*a))+this.long0),r=Kt(this.cgb,n)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ee={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(j(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*p,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,te.init.apply(this),this.forward=te.forward,this.inverse=te.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function re(t,e){return Math.pow((1-t)/(1+t),e)}const ie={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+m)/(Math.pow(Math.tan(.5*this.lat0+m),this.C)*re(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+m),this.C)*re(this.e*Math.sin(r),this.ratexp))-u,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,i=Math.pow(Math.tan(.5*r+m)/this.K,1/this.C),n=20;n>0&&(r=2*Math.atan(i*re(this.e*Math.sin(t.y),-.5*this.e))-u,!(Math.abs(r-t.y)<1e-14));--n)t.y=r;return n?(t.x=e,t.y=r,t):null},names:["gauss"]},ne={init:function(){ie.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,i,n;return t.x=j(t.x-this.long0),ie.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),i=Math.cos(t.x),n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*i),t.x=n*r*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*r*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,i,n,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var o=2*Math.atan2(s,this.R2);e=Math.sin(o),r=Math.cos(o),n=Math.asin(r*this.sinc0+t.y*e*this.cosc0/s),i=Math.atan2(t.x*e,s*this.cosc0*r-t.y*this.sinc0*e)}else n=this.phic0,i=0;return t.x=i,t.y=n,ie.inverse.apply(this,[t]),t.x=j(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},se={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=d&&(this.k0=.5*(1+Q(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=d&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=d&&Math.abs(Math.cos(this.lat_ts))>d&&(this.k0=.5*this.cons*G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/V(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=G(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,i,n,s,o,a=t.x,l=t.y,c=Math.sin(l),h=Math.cos(l),p=j(a-this.long0);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=d&&Math.abs(l+this.lat0)<=d?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*h*Math.cos(p)),t.x=this.a*e*h*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*h*Math.cos(p))+this.y0,t):(r=2*Math.atan(this.ssfn_(l,c,this.e))-u,n=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=d?(s=V(this.e,l*this.con,this.con*c),o=2*this.a*this.k0*s/this.cons,t.x=this.x0+o*Math.sin(a-this.long0),t.y=this.y0-this.con*o*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)0?j(this.long0+Math.atan2(t.x,-1*t.y)):j(this.long0+Math.atan2(t.x,t.y)):j(this.long0+Math.atan2(t.x*Math.sin(a),o*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=d){if(o<=d)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,i=o*this.cons/(2*this.a*this.k0),r=this.con*H(this.e,i),e=this.con*j(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=d?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/o),e=j(this.long0+Math.atan2(t.x*Math.sin(n),o*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))),r=-1*H(this.e,Math.tan(.5*(u+s)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(u+t))*Math.pow((1-e)/(1+e),.5*r)}},oe={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,i=1/this.rf,n=2*i-Math.pow(i,2),s=this.e=Math.sqrt(n);this.R=this.k0*r*Math.sqrt(1-n)/(1-n*Math.pow(e,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=-this.alpha*(e+r)+this.K,n=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,i=e/this.R,n=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(i)),o=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(n))),a=this.lambda0+o/this.alpha,l=0,c=s,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=c,t},names:["somerc"]};var ae=1e-7;const le={init:function(){var t,e,r,i,n,s,o,a,l,c,h,f,A,y=0,v=0,x=0,b=0,_=0,w=0,E=0;this.no_off=(A="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(A)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),M&&(E=this.alpha),S&&(y=this.rectified_grid_angle*p),M||S)v=this.longc;else if(x=this.long1,_=this.lat1,b=this.long2,w=this.lat2,Math.abs(_-w)<=ae||(t=Math.abs(_))<=ae||Math.abs(t-u)<=ae||Math.abs(Math.abs(this.lat0)-u)<=ae||Math.abs(Math.abs(w)-u)<=ae)throw new Error;var C=1-this.es;e=Math.sqrt(C),Math.abs(this.lat0)>d?(a=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*a*a,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*e/t,(n=(i=this.B*e/(r*Math.sqrt(t)))*i-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(V(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=n=1),M||S?(M?(h=Math.asin(Math.sin(E)/i),S||(y=E)):(h=y,E=Math.asin(i*Math.sin(h))),this.lam0=v-Math.asin(.5*(n-1/n)*Math.tan(h))/this.B):(s=Math.pow(V(this.e,_,Math.sin(_)),this.B),o=Math.pow(V(this.e,w,Math.sin(w)),this.B),n=this.E/s,l=(o-s)/(o+s),c=((c=this.E*this.E)-o*s)/(c+o*s),(t=x-b)<-Math.pi?b-=g:t>Math.pi&&(b+=g),this.lam0=j(.5*(x+b)-Math.atan(c*Math.tan(.5*this.B*(x-b))/l)/this.B),h=Math.atan(2*Math.sin(this.B*j(x-this.lam0))/(n-1/n)),y=E=Math.asin(i*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(E))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(m-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(m+n))},forward:function(t){var e,r,i,n,s,o,a,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-u)>d){if(e=.5*((s=this.E/Math.pow(V(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/s)),r=.5*(s+o),n=Math.sin(this.B*t.x),i=(e*this.singam-n*this.cosgam)/r,Math.abs(Math.abs(i)-1)0?this.v_pole_n:this.v_pole_s,a=this.ArB*t.y;return this.no_rot?(c.x=a,c.y=l):(a-=this.u_0,c.x=l*this.cosrot+a*this.sinrot,c.y=a*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,r,i,n,s,o,a,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((i=Math.exp(-this.BrA*r))-1/i),s=.5*(i+1/i),a=((o=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/s,Math.abs(Math.abs(a)-1)d?this.ns=Math.log(i/a)/Math.log(n/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=d&&(r=Q(r)*(u-2e-10));var i,n,s=Math.abs(Math.abs(r)-u);if(s>d)i=V(this.e,r,Math.sin(r)),n=this.a*this.f0*Math.pow(i,this.ns);else{if((s=r*this.ns)<=0)return null;n=0}var o=this.ns*j(e-this.long0);return t.x=this.k0*(n*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,t},inverse:function(t){var e,r,i,n,s,o=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+a*a),r=1):(e=-Math.sqrt(o*o+a*a),r=-1);var l=0;if(0!==e&&(l=Math.atan2(r*o,r*a)),0!==e||this.ns>0){if(r=1/this.ns,i=Math.pow(e/(this.a*this.f0),r),-9999===(n=H(this.e,i)))return null}else n=-u;return s=j(l/this.ns+this.long0),t.x=s,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},he={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,i,n,s,o,a,l=t.x,c=t.y,h=j(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),i=-h*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),s=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(n)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,i,n,s,o,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(e)),t.x=this.long0-r/this.alfa,o=e,a=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(a=1),o=t.y,c+=1}while(0===a&&c<15);return c>=15?null:t},names:["Krovak","krovak"]};function ue(t,e,r,i,n){return t*n-e*Math.sin(2*n)+r*Math.sin(4*n)-i*Math.sin(6*n)}function de(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function pe(t){return.375*t*(1+.25*t*(1+.46875*t))}function fe(t){return.05859375*t*t*(1+.75*t)}function me(t){return t*t*t*(35/3072)}function ge(t,e,r){var i=e*r;return t/Math.sqrt(1-i*i)}function Ae(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}const be={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-u)0)switch(this.qp=xe(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,e=t*t,r[0]+=.17222222222222222*e,r[1]=.06388888888888888*e,e*=t,r[0]+=.10257936507936508*e,r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=xe(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,i,n,s,o,a,l,c,h,p=t.x,f=t.y;if(p=j(p-this.long0),this.sphere){if(s=Math.sin(f),h=Math.cos(f),i=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+h*i:1+this.sinph0*s+this.cosph0*h*i)<=d)return null;e=(r=Math.sqrt(2/r))*h*Math.sin(p),r*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(f+this.lat0)=0?(e=(c=Math.sqrt(o))*n,r=i*(this.mode===this.S_POLE?c:-c)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,i,n,s,o,a,l,c,h,p=t.x/this.a,f=t.y/this.a;if(this.sphere){var m,g=0,A=0;if((r=.5*(m=Math.sqrt(p*p+f*f)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(A=Math.sin(r),g=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(m)<=d?0:Math.asin(f*A/m),p*=A,f=g*m;break;case this.OBLIQ:r=Math.abs(m)<=d?this.lat0:Math.asin(g*this.sinph0+f*A*this.cosph0/m),p*=A*this.cosph0,f=(g-Math.sin(r)*this.sinph0)*m;break;case this.N_POLE:f=-f,r=u-r;break;case this.S_POLE:r-=u}e=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(o=Math.sqrt(p*p+f*f))1&&(t=t>1?1:-1),Math.asin(t)}const we={init:function(){Math.abs(this.lat1+this.lat2)d?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=xe(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*j(e-this.long0),o=n*Math.sin(s)+this.x0,a=this.rh-n*Math.cos(s)+this.y0;return t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),n=0,0!==e&&(n=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-i*i)/(2*this.ns0)):(r=(this.c-i*i)/this.ns0,o=this.phi1z(this.e3,r)),s=j(n/this.ns0+this.long0),t.x=s,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,i,n,s,o=_e(.5*e);if(t0||Math.abs(s)<=d?(o=this.x0+1*this.a*r*Math.sin(i)/s,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)/s):(o=this.x0+this.infinity_dist*r*Math.sin(i),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*n)),t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),r=Math.sin(n),o=_e((i=Math.cos(n))*this.sin_p14+t.y*r*this.cos_p14/e),s=Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r),s=j(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t},names:["gnom"]},Me={init:function(){this.sphere||(this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,i=t.x,n=t.y,s=j(i-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=xe(this.e,Math.sin(n));e=this.x0+this.a*this.k0*s,r=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=j(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*u:u;for(var i,n,s,o,a=Math.asin(.5*e),l=0;l<30;l++)if(n=Math.sin(a),s=Math.cos(a),o=t*n,a+=i=Math.pow(1-o*o,2)/(2*s)*(e/(1-t*t)-n/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(i)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),e=j(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]},Se={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,i=j(e-this.long0),n=Ae(r-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*n,t},inverse:function(t){var e=t.x,r=t.y;return t.x=j(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Ae(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ce={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=de(this.es),this.e1=pe(this.es),this.e2=fe(this.es),this.e3=me(this.es),this.ml0=this.a*ue(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,i,n=t.x,s=t.y,o=j(n-this.long0);if(i=o*Math.sin(s),this.sphere)Math.abs(s)<=d?(e=this.a*o,r=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(s),r=this.a*(Ae(s-this.lat0)+(1-Math.cos(i))/Math.tan(s)));else if(Math.abs(s)<=d)e=this.a*o,r=-1*this.ml0;else{var a=ge(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(i),r=this.a*ue(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(i))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,i,n,s,o,a,l,c;if(i=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=d)e=j(i/this.a+this.long0),r=0;else{var h;for(o=this.lat0+n/this.a,a=i*i/this.a/this.a+o*o,l=o,s=20;s;--s)if(l+=c=-1*(o*(l*(h=Math.tan(l))+1)-l-.5*(l*l+a)*h)/((l-o)/h-1),Math.abs(c)<=d){r=l;break}e=j(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(n+this.ml0)<=d)r=0,e=j(this.long0+i/this.a);else{var u,p,f,m,g;for(o=(this.ml0+n)/this.a,a=i*i/this.a/this.a+o*o,l=o,s=20;s;--s)if(g=this.e*Math.sin(l),u=Math.sqrt(1-g*g)*Math.tan(l),p=this.a*ue(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(o*(u*(m=p/this.a)+1)-m-.5*u*(m*m+a))/(this.es*Math.sin(2*l)*(m*m+a-2*o*m)/(4*u)+(o-m)*(u*f-2/Math.sin(2*l))-f),Math.abs(c)<=d){r=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=j(this.long0+Math.asin(i*u/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]},Te={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,i=t.y-this.lat0,n=r-this.long0,s=i/h*1e-5,o=n,a=1,l=0;for(e=1;e<=10;e++)a*=s,l+=this.A[e]*a;var c,u=l,d=o,p=1,f=0,m=0,g=0;for(e=1;e<=6;e++)c=f*u+p*d,p=p*u-f*d,f=c,m=m+this.B_re[e]*p-this.B_im[e]*f,g=g+this.B_im[e]*p+this.B_re[e]*f;return t.x=g*this.a+this.x0,t.y=m*this.a+this.y0,t},inverse:function(t){var e,r,i=t.x,n=t.y,s=i-this.x0,o=(n-this.y0)/this.a,a=s/this.a,l=1,c=0,u=0,d=0;for(e=1;e<=6;e++)r=c*o+l*a,l=l*o-c*a,c=r,u=u+this.C_re[e]*l-this.C_im[e]*c,d=d+this.C_im[e]*l+this.C_re[e]*c;for(var p=0;p.999999999999&&(r=.999999999999),e=Math.asin(r);var i=j(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var n=Math.asin(r);return t.x=i,t.y=n,t},names:["Mollweide","moll"]},Le={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;return 0!==r&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere?(n=j(this.long0+s/this.ns),i=Ae(this.g-r/this.a),t.x=n,t.y=i,t):(i=ye(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),n=j(this.long0+s/this.ns),t.x=n,t.y=i,t)},names:["Equidistant_Conic","eqdc"]},Pe={init:function(){this.R=this.a},forward:function(t){var e,r,i=t.x,n=t.y,s=j(i-this.long0);Math.abs(n)<=d&&(e=this.x0+this.R*s,r=this.y0);var o=_e(2*Math.abs(n/Math.PI));(Math.abs(s)<=d||Math.abs(Math.abs(n)-u)<=d)&&(e=this.x0,r=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/s-s/Math.PI),l=a*a,c=Math.sin(o),h=Math.cos(o),p=h/(c+h-1),f=p*p,m=p*(2/c-1),g=m*m,A=Math.PI*this.R*(a*(p-g)+Math.sqrt(l*(p-g)*(p-g)-(g+l)*(f-g)))/(g+l);s<0&&(A=-A),e=this.x0+A;var y=l+p;return A=Math.PI*this.R*(m*y-a*Math.sqrt((g+l)*(l+1)-y*y))/(g+l),r=n>=0?this.y0+A:this.y0-A,t.x=e,t.y=r,t},inverse:function(t){var e,r,i,n,s,o,a,l,c,h,u,p;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=(i=t.x/u)*i+(n=t.y/u)*n,u=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+s))+1+2*n*n+s*s)+(2*(a=o-2*n*n+i*i)*a*a/l/l/l-9*o*a/l/l)/27)/(c=(o-a*a/3/l)/l)/(h=2*Math.sqrt(-c/3)),Math.abs(u)>1&&(u=u>=0?1:-1),p=Math.acos(u)/3,r=t.y>=0?(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(i)2*u*this.a)return;return r=e/this.a,i=Math.sin(r),n=Math.cos(r),s=this.long0,Math.abs(e)<=d?o=this.lat0:(o=_e(n*this.sin_p12+t.y*i*this.cos_p12/e),a=Math.abs(this.lat0)-u,s=Math.abs(a)<=d?this.lat0>=0?j(this.long0+Math.atan2(t.x,-t.y)):j(this.long0-Math.atan2(-t.x,t.y)):j(this.long0+Math.atan2(t.x*i,e*this.cos_p12*n-t.y*this.sin_p12*i))),t.x=s,t.y=o,t}return l=de(this.es),c=pe(this.es),h=fe(this.es),p=me(this.es),Math.abs(this.sin_p12-1)<=d?(o=ye(((f=this.a*ue(l,c,h,p,u))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,c,h,p),s=j(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=o,t):Math.abs(this.sin_p12+1)<=d?(f=this.a*ue(l,c,h,p,u),o=ye(((e=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,l,c,h,p),s=j(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),A=Math.atan2(t.x,t.y),m=ge(this.a,this.e,this.sin_p12),y=Math.cos(A),x=-(v=this.e*this.cos_p12*y)*v/(1-this.es),b=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),E=1-x*(w=(_=e/m)-x*(1+x)*Math.pow(_,3)/6-b*(1+3*x)*Math.pow(_,4)/24)*w/2-_*w*w*w/6,g=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*y),s=j(this.long0+Math.asin(Math.sin(A)*Math.sin(w)/Math.cos(g))),M=Math.sin(g),o=Math.atan2((M-this.es*E*this.sin_p12)*Math.tan(g),M*(1-this.es)),t.x=s,t.y=o,t)},names:["Azimuthal_Equidistant","aeqd"]},Oe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,i,n,s,o,a,l=t.x,c=t.y;return i=j(l-this.long0),e=Math.sin(c),r=Math.cos(c),n=Math.cos(i),((s=this.sin_p14*e+this.cos_p14*r*n)>0||Math.abs(s)<=d)&&(o=1*this.a*r*Math.sin(i),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)),t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o,a;return t.x-=this.x0,t.y-=this.y0,r=_e((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),i=Math.sin(r),n=Math.cos(r),o=this.long0,Math.abs(e)<=d?(a=this.lat0,t.x=o,t.y=a,t):(a=_e(n*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.abs(this.lat0)-u,Math.abs(s)<=d?(o=this.lat0>=0?j(this.long0+Math.atan2(t.x,-t.y)):j(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=a,t):(o=j(this.long0+Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i)),t.x=o,t.y=a,t))},names:["ortho"]};var ke=1,Ue=2,Ne=3,Fe=4;function ze(t,e,r,i){var n;return tm&&n<=u+m?(i.value=Ue,n-=u):n>u+m||n<=-(u+m)?(i.value=Ne,n=n>=0?n-A:n+A):(i.value=Fe,n+=u)),n}function Ge(t,e){var r=t+e;return r<-A?r+=g:r>+A&&(r-=g),r}const Qe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=u-m/2?this.face=5:this.lat0<=-(u-m/2)?this.face=6:Math.abs(this.long0)<=m?this.face=1:Math.abs(this.long0)<=u+m?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,i,n,s,o,a={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,5===this.face)n=u-e,r>=m&&r<=u+m?(l.value=ke,i=r-u):r>u+m||r<=-(u+m)?(l.value=Ue,i=r>0?r-A:r+A):r>-(u+m)&&r<=-m?(l.value=Ne,i=r+u):(l.value=Fe,i=r);else if(6===this.face)n=u+e,r>=m&&r<=u+m?(l.value=ke,i=-r+u):r=-m?(l.value=Ue,i=-r):r<-m&&r>=-(u+m)?(l.value=Ne,i=-r-u):(l.value=Fe,i=r>0?-r+A:-r-A);else{var c,h,d,p,f,g;2===this.face?r=Ge(r,+u):3===this.face?r=Ge(r,+A):4===this.face&&(r=Ge(r,-u)),p=Math.sin(e),f=Math.cos(e),g=Math.sin(r),c=f*Math.cos(r),h=f*g,d=p,1===this.face?i=ze(n=Math.acos(c),d,h,l):2===this.face?i=ze(n=Math.acos(h),d,-c,l):3===this.face?i=ze(n=Math.acos(-c),d,-h,l):4===this.face?i=ze(n=Math.acos(-h),d,c,l):(n=i=0,l.value=ke)}return o=Math.atan(12/A*(i+Math.acos(Math.sin(i)*Math.cos(m))-u)),s=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Ue?o+=u:l.value===Ne?o+=A:l.value===Fe&&(o+=1.5*A),a.x=s*Math.cos(o),a.y=s*Math.sin(o),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var e,r,i,n,s,o,a,l,c,h,d,p,f={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=ke:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=Ue,e-=u):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=Ne,e=e<0?e+A:e-A):(m.value=Fe,e+=u),c=A/12*Math.tan(e),s=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(s),(a=1-(i=Math.cos(e))*i*(n=Math.tan(r))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?a=-1:a>1&&(a=1),5===this.face)l=Math.acos(a),f.phi=u-l,m.value===ke?f.lam=o+u:m.value===Ue?f.lam=o<0?o+A:o-A:m.value===Ne?f.lam=o-u:f.lam=o;else if(6===this.face)l=Math.acos(a),f.phi=l-u,m.value===ke?f.lam=-o+u:m.value===Ue?f.lam=-o:m.value===Ne?f.lam=-o-u:f.lam=o<0?-o-A:-o+A;else{var g,y,v;c=(g=a)*g,y=(c+=(v=c>=1?0:Math.sqrt(1-c)*Math.sin(o))*v)>=1?0:Math.sqrt(1-c),m.value===Ue?(c=y,y=-v,v=c):m.value===Ne?(y=-y,v=-v):m.value===Fe&&(c=y,y=v,v=-c),2===this.face?(c=g,g=-y,y=c):3===this.face?(g=-g,y=-y):4===this.face&&(c=g,g=y,y=-c),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(y,g),2===this.face?f.lam=Ge(f.lam,-u):3===this.face?f.lam=Ge(f.lam,-A):4===this.face&&(f.lam=Ge(f.lam,+u))}return 0!==this.es&&(h=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),h&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var je=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ve=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],He=.8487,We=1.3523,qe=f/5,Ze=1/qe,Ye=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const Xe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=j(t.x-this.long0),r=Math.abs(t.y),i=Math.floor(r*qe);i<0?i=0:i>=18&&(i=17);var n={x:Ye(je[i],r=f*(r-Ze*i))*e,y:Ye(Ve[i],r)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*He+this.x0,n.y=n.y*this.a*We+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*He),y:Math.abs(t.y-this.y0)/(this.a*We)};if(e.y>=1)e.x/=je[18][0],e.y=t.y<0?-u:u;else{var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(Ve[r][0]>e.y)--r;else{if(!(Ve[r+1][0]<=e.y))break;++r}var i=Ve[r],n=5*(e.y-i[0])/(Ve[r+1][0]-i[0]);n=function(t,e,r,i){for(var n=e;i;--i){var s=t(n);if(n-=s,Math.abs(s)<1e-10)break}return n}((function(t){return(Ye(i,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(i,t)}),n,0,100),e.x/=Ye(je[r],n),e.y=(5*r+n)*p,t.y<0&&(e.y=-e.y)}return e.x=j(e.x+this.long0),e},names:["Robinson","robin"]},Je={init:function(){this.name="geocent"},forward:function(t){return ht(t,this.es,this.a)},inverse:function(t){return ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Ke={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const $e={init:function(){if(Object.keys(Ke).forEach(function(t){if(void 0===this[t])this[t]=Ke[t].def;else{if(Ke[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Ke[t].num&&(this[t]=parseFloat(this[t]))}Ke[t].degrees&&(this[t]=this[t]*p)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,r,i,n,s=Math.sin(t.y),o=Math.cos(t.y),a=Math.cos(t.x);switch(this.mode){case 3:r=this.sinph0*s+this.cosph0*o*a;break;case 2:r=o*a;break;case 1:r=-s;break;case 0:r=s}switch(e=(r=this.pn1/(this.p-r))*o*Math.sin(t.x),this.mode){case 3:r*=this.cosph0*s-this.sinph0*o*a;break;case 2:r*=s;break;case 0:r*=-o*a;break;case 1:r*=o*a}return n=1/((i=r*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-r*this.sg)*this.cw*n,r=i*n,t.x=e*this.a,t.y=r*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,r,i,n={x:t.x,y:t.y};i=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*i,r=this.pn1*t.y*this.cw*i,t.x=e*this.cg+r*this.sg,t.y=r*this.cg-e*this.sg;var s=Jt(t.x,t.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,i,n,s=t.x,o=t.y;if(s-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var a=this.radius_p/Jt(this.radius_p*Math.cos(o),Math.sin(o));if(r=a*Math.cos(s)*Math.cos(o),i=a*Math.sin(s)*Math.cos(o),n=a*Math.sin(o),(this.radius_g-r)*r-i*i-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/Jt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/Jt(i,e)))}else"sphere"===this.shape&&(e=Math.cos(o),r=Math.cos(s)*e,i=Math.sin(s)*e,n=Math.sin(o),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/Jt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/Jt(i,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,i,n,s=-1,o=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Jt(1,a)):(o=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Jt(1,o));var l=a/this.radius_p;if(e=o*o+l*l+s*s,(i=(r=2*this.radius_g*s)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),s=this.radius_g+n*s,o*=n,a*=n,t.x=Math.atan2(o,s),t.y=Math.atan(a*Math.cos(t.x)/s),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(o=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),e=o*o+a*a+s*s,(i=(r=2*this.radius_g*s)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),s=this.radius_g+n*s,o*=n,a*=n,t.x=Math.atan2(o,s),t.y=Math.atan(a*Math.cos(t.x)/s)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var er;wt.defaultDatum="WGS84",wt.Proj=ct,wt.WGS84=new wt.Proj("WGS84"),wt.Point=Qt,wt.toPoint=At,wt.defs=U,wt.nadgrid=function(t,e){var r=new DataView(e),i=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),n=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:nt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,i),s=function(t,e,r){for(var i=176,n=[],s=0;s{"use strict";const i=r(43389),n=r(69208),s=r(48764).lW;t.exports=function(t,e){return new i((function(r,i){const o=n(t,e),a=new XMLHttpRequest;a.open("GET",o,!0),"prj"!==e&&"cpg"!==e&&(a.responseType="arraybuffer"),a.addEventListener("load",(function(){return a.status>399?"prj"===e||"cpg"===e?r(!1):i(new Error(a.status)):r("prj"!==e&&"cpg"!==e?s.from(a.response):a.response)}),!1),a.send()}))}},9078:(t,e,r)=>{"use strict";const i=r(94830),n=r(69208),s=r(48764).lW;t.exports=async function(t,e){if(!r.g.fetch)return i(t,e);const o=n(t,e),a="prj"===e||"cpg"===e;try{const t=await fetch(o);if(t.status>399)throw new Error(t.statusText);if(a)return t.text();const e=await t.arrayBuffer();return s.from(e)}catch(t){if(console.log("ERROR",t,e),a||"dbf"===e)return!1;throw t}}},69208:(t,e,r)=>{const i=r.g.URL;t.exports=(t,e)=>{if(!e)return t;const r=new i(t);return r.pathname=`${r.pathname}.${e}`,r.href}},79003:(t,e,r)=>{"use strict";let i=r(24472);i.default&&(i=i.default);const n=r(32555),s=r(9078),o=r(76415),a=r(9462),l=r(43389),c=r(95079),h=r(48764).lW,u=r.g.URL,d=new c({max:20});function p(t){if(!t)throw new Error("forgot to pass buffer");return h.isBuffer(t)?t:f(t)?h.from(t):f(t.buffer)?1===t.BYTES_PER_ELEMENT?h.from(t):h.from(t.buffer):void 0}function f(t){return t instanceof r.g.ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(t)}function m(t,e){return"string"==typeof t&&d.has(t)?l.resolve(d.get(t)):m.getShapefile(t,e).then((function(e){return"string"==typeof t&&d.set(t,e),e}))}m.combine=function([t,e]){const r={type:"FeatureCollection",features:[]};let i=0;const n=t.length;for(e||(e=[]);i-1?l.push(r.slice(0,-3)+r.slice(-3).toLowerCase()):"dbf"!==r.slice(-3).toLowerCase()&&"cpg"!==r.slice(-3).toLowerCase()||(s[r.slice(0,-3)+r.slice(-3).toLowerCase()]=s[r]));if(!l.length)throw new Error("no layers founds");const c=l.map((function(t){let r,i;const n=t.lastIndexOf(".");return n>-1&&t.slice(n).indexOf("json")>-1?(r=JSON.parse(s[t]),r.fileName=t.slice(0,n)):e.indexOf(t.slice(n+1))>-1?(r=s[t],r.fileName=t):(s[t+".dbf"]&&(i=a(s[t+".dbf"],s[t+".cpg"])),r=m.combine([o(s[t+".shp"],s[t+".prj"]),i]),r.fileName=t),r}));return 1===c.length?c[0]:c};const g=async t=>{const e=await l.all([s(t,"shp"),s(t,"prj")]);let r=!1;try{e[1]&&(r=i(e[1]))}catch(t){r=!1}return o(e[0],r)},A=async t=>{const[e,r]=await l.all([s(t,"dbf"),s(t,"cpg")]);if(e)return a(e,r)};m.getShapefile=async function(t,e){if("string"!=typeof t)return m.parseZip(t);if(((t,e)=>".zip"===new u(t).pathname.slice(-4).toLowerCase())(t))return async function(t,e){const r=await s(t);return m.parseZip(r,e)}(t,e);const r=await l.all([g(t),A(t)]);return m.combine(r)},m.parseShp=function(t,e){if(t=p(t),h.isBuffer(e)&&(e=e.toString()),"string"==typeof e)try{e=i(e)}catch(t){e=!1}return o(t,e)},m.parseDbf=function(t,e){return t=p(t),a(t,e)},t.exports=m},76415:t=>{"use strict";function e(t,e){return!function(t){let e=0,r=1;const i=t.length;let n,s;for(;r0}(e)&&t.length?t[t.length-1].push(e):t.push([e]),t}i.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}},i.prototype.parseZPoint=function(t){const e=this.parsePoint(t);return e.coordinates.push(t.readDoubleLE(16)),e},i.prototype.parsePointArray=function(t,e,r){const i=[];let n=0;for(;n20&&(e-=20),!(e in r))throw new Error("I don't know that shp type");var i;this.parseFunc=this[r[e]],this.parseCoord=(i=t)?function(t,e){const r=[t.readDoubleLE(e),t.readDoubleLE(e+8)];return i.inverse(r)}:function(t,e){return[t.readDoubleLE(e),t.readDoubleLE(e+8)]}},i.prototype.getShpCode=function(){return this.parseHeader().shpCode},i.prototype.parseHeader=function(){const t=this.buffer.slice(0,100);return{length:t.readInt32BE(24)<<1,version:t.readInt32LE(28),shpCode:t.readInt32LE(32),bbox:[t.readDoubleLE(36),t.readDoubleLE(44),t.readDoubleLE(52),t.readDoubleLE(52)]}},i.prototype.getRows=function(){let t=100;const e=this.buffer.byteLength,r=[];let i;for(;t{"use strict";const i=r(55733);t.exports=async t=>{const e=new i;await e.loadAsync(t);const r=e.file(/.+/),n={};return await Promise.all(r.map((async t=>{let e;e="shp"===t.name.slice(-3).toLowerCase()||"dbf"===t.name.slice(-3).toLowerCase()?await t.async("nodebuffer"):await t.async("text"),n[t.name]=e}))),n}},95079:t=>{!function(){function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function r(){return 1}t.exports?t.exports=s:this.LRUCache=s;var i=!1;function n(t){i||"string"==typeof t||"number"==typeof t||(i=!0,console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! "+typeof t).stack))}function s(t){if(!(this instanceof s))return new s(t);"number"==typeof t&&(t={max:t}),t||(t={}),this._max=t.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=t.length||r,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=r),this._allowStale=t.stale||!1,this._maxAge=t.maxAge||null,this._dispose=t.dispose,this.reset()}function o(t,e,r){n(e);var i=t._cache[e];return i&&(a(t,i)?(h(t,i),t._allowStale||(i=void 0)):r&&function(t,e){c(t,e),e.lu=t._mru++,t._lruList[e.lu]=e}(t,i),i&&(i=i.value)),i}function a(t,e){if(!e||!e.maxAge&&!t._maxAge)return!1;var r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t._maxAge&&r>t._maxAge}function l(t){for(;t._lrut._max;)h(t,t._lruList[t._lru])}function c(t,e){for(delete t._lruList[e.lu];t._lruthis._max&&l(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(s.prototype,"lengthCalculator",{set:function(t){if("function"!=typeof t)for(var e in this._lengthCalculator=r,this._length=this._itemCount,this._cache)this._cache[e].length=1;else for(var e in this._lengthCalculator=t,this._length=0,this._cache)this._cache[e].length=this._lengthCalculator(this._cache[e].value),this._length+=this._cache[e].length;this._length>this._max&&l(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(s.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),s.prototype.forEach=function(t,e){e=e||this;for(var r=0,i=this._itemCount,n=this._mru-1;n>=0&&r=0&&e=0&&e=0&&ethis._max?(h(this,this._cache[t]),!1):(this._dispose&&this._dispose(t,this._cache[t].value),this._cache[t].now=s,this._cache[t].maxAge=i,this._cache[t].value=r,this._length+=o-this._cache[t].length,this._cache[t].length=o,this.get(t),this._length>this._max&&l(this),!0);var a=new u(t,r,this._mru++,o,s,i);return a.length>this._max?(this._dispose&&this._dispose(t,r),!1):(this._length+=a.length,this._lruList[a.lu]=this._cache[t]=a,this._itemCount++,this._length>this._max&&l(this),!0)},s.prototype.has=function(t){return n(t),!!e(this._cache,t)&&!a(this,this._cache[t])},s.prototype.get=function(t){return n(t),o(this,t,!0)},s.prototype.peek=function(t){return n(t),o(this,t,!1)},s.prototype.pop=function(){var t=this._lruList[this._lru];return h(this,t),t||null},s.prototype.del=function(t){n(t),h(this,this._cache[t])},s.prototype.load=function(t){this.reset();for(var e=Date.now(),r=t.length-1;r>=0;r--){var i=t[r];n(i.k);var s=i.e||0;if(0===s)this.set(i.k,i.v);else{var o=s-e;o>0&&this.set(i.k,i.v,o)}}}}()},6941:(t,e,r)=>{var i=r(48764).lW,n=i.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},s=e.s=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!n(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=l;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(t){return t.toString(this.encoding)}function a(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function l(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}s.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i,n=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,(i=e.charCodeAt(n))>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),t.copy(this.charBuffer,0,0,s),e.substring(0,n)}return e},s.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},s.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;e+=i.slice(0,r).toString(n)}return e}},29718:(t,e,r)=>{t.exports=r(59141)},59141:function(t,e,r){!function(e){"use strict";function i(t,e,r){return e<=t&&t<=r}t.exports&&!e["encoding-indexes"]&&r(37597);var n=Math.floor;function s(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o(t){return 0<=t&&t<=127}var a=o,l=-1;function c(t){this.tokens=[].slice.call(t),this.tokens.reverse()}c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():l},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.pop());else this.tokens.push(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(t)}};var h=-1;function u(t,e){if(t)throw TypeError("Decoder error");return e||65533}function d(t){throw TypeError("The code point "+t+" could not be encoded.")}function p(t){return t=String(t).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(m,t)?m[t]:null}var f=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],m={};f.forEach((function(t){t.encodings.forEach((function(t){t.labels.forEach((function(e){m[e]=t}))}))}));var g,A,y={},v={};function x(t,e){return e&&e[t]||null}function b(t,e){var r=e.indexOf(t);return-1===r?null:r}function _(t){if(!("encoding-indexes"in e))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return e["encoding-indexes"][t]}var w="utf-8";function E(t,e){if(!(this instanceof E))throw TypeError("Called as a function. Did you forget 'new'?");t=void 0!==t?String(t):w,e=s(e),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=p(t);if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+t);if(!v[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=r,Boolean(e.fatal)&&(i._error_mode="fatal"),Boolean(e.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal="fatal"===i._error_mode,this.ignoreBOM=i._ignoreBOM),i}function M(t,r){if(!(this instanceof M))throw TypeError("Called as a function. Did you forget 'new'?");r=s(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var i=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){var n=p(t=void 0!==t?String(t):w);if(null===n||"replacement"===n.name)throw RangeError("Unknown encoding: "+t);if(!y[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");i._encoding=n}else i._encoding=p("utf-8"),void 0!==t&&"console"in e&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase()),i}function S(t){var e=t.fatal,r=0,n=0,s=0,o=128,a=191;this.handler=function(t,c){if(c===l&&0!==s)return s=0,u(e);if(c===l)return h;if(0===s){if(i(c,0,127))return c;if(i(c,194,223))s=1,r=31&c;else if(i(c,224,239))224===c&&(o=160),237===c&&(a=159),s=2,r=15&c;else{if(!i(c,240,244))return u(e);240===c&&(o=144),244===c&&(a=143),s=3,r=7&c}return null}if(!i(c,o,a))return r=s=n=0,o=128,a=191,t.prepend(c),u(e);if(o=128,a=191,r=r<<6|63&c,(n+=1)!==s)return null;var d=r;return r=s=n=0,d}}function C(t){t.fatal,this.handler=function(t,e){if(e===l)return h;if(a(e))return e;var r,n;i(e,128,2047)?(r=1,n=192):i(e,2048,65535)?(r=2,n=224):i(e,65536,1114111)&&(r=3,n=240);for(var s=[(e>>6*r)+n];r>0;){var o=e>>6*(r-1);s.push(128|63&o),r-=1}return s}}function T(t,e){var r=e.fatal;this.handler=function(e,i){if(i===l)return h;if(o(i))return i;var n=t[i-128];return null===n?u(r):n}}function I(t,e){e.fatal,this.handler=function(e,r){if(r===l)return h;if(a(r))return r;var i=b(r,t);return null===i&&d(r),i+128}}function R(t){var e=t.fatal,r=0,n=0,s=0;this.handler=function(t,a){if(a===l&&0===r&&0===n&&0===s)return h;var c;if(a!==l||0===r&&0===n&&0===s||(r=0,n=0,s=0,u(e)),0!==s){c=null,i(a,48,57)&&(c=function(t){if(t>39419&&t<189e3||t>1237575)return null;if(7457===t)return 59335;var e,r=0,i=0,n=_("gb18030-ranges");for(e=0;e>8,i=255&t;return e?[r,i]:[i,r]}function j(t,e){var r=e.fatal,n=null,s=null;this.handler=function(e,o){if(o===l&&(null!==n||null!==s))return u(r);if(o===l&&null===n&&null===s)return h;if(null===n)return n=o,null;var a;if(a=t?(n<<8)+o:(o<<8)+n,n=null,null!==s){var c=s;return s=null,i(a,56320,57343)?65536+1024*(c-55296)+(a-56320):(e.prepend(Q(a,t)),u(r))}return i(a,55296,56319)?(s=a,null):i(a,56320,57343)?u(r):a}}function V(t,e){e.fatal,this.handler=function(e,r){if(r===l)return h;if(i(r,0,65535))return Q(r,t);var n=Q(55296+(r-65536>>10),t),s=Q(56320+(r-65536&1023),t);return n.concat(s)}}function H(t){t.fatal,this.handler=function(t,e){return e===l?h:o(e)?e:63360+e-128}}function W(t){t.fatal,this.handler=function(t,e){return e===l?h:a(e)?e:i(e,63360,63487)?e-63360+128:d(e)}}Object.defineProperty&&(Object.defineProperty(E.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(E.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(E.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),E.prototype.decode=function(t,e){var r;r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=s(e),this._do_not_flush||(this._decoder=v[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(e.stream);for(var i,n=new c(r),o=[];;){var a=n.read();if(a===l)break;if((i=this._decoder.handler(n,a))===h)break;null!==i&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}if(!this._do_not_flush){do{if((i=this._decoder.handler(n,n.read()))===h)break;null!==i&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}while(!n.endOfStream());this._decoder=null}return function(t){var e,r;return e=["UTF-8","UTF-16LE","UTF-16BE"],r=this._encoding.name,-1===e.indexOf(r)||this._ignoreBOM||this._BOMseen||(t.length>0&&65279===t[0]?(this._BOMseen=!0,t.shift()):t.length>0&&(this._BOMseen=!0)),function(t){for(var e="",r=0;r>10),56320+(1023&i)))}return e}(t)}.call(this,o)},Object.defineProperty&&Object.defineProperty(M.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),M.prototype.encode=function(t,e){t=void 0===t?"":String(t),e=s(e),this._do_not_flush||(this._encoder=y[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(e.stream);for(var r,i=new c(function(t){for(var e=String(t),r=e.length,i=0,n=[];i57343)n.push(s);else if(56320<=s&&s<=57343)n.push(65533);else if(55296<=s&&s<=56319)if(i===r-1)n.push(65533);else{var o=e.charCodeAt(i+1);if(56320<=o&&o<=57343){var a=1023&s,l=1023&o;n.push(65536+(a<<10)+l),i+=1}else n.push(65533)}i+=1}return n}(t)),n=[];;){var o=i.read();if(o===l)break;if((r=this._encoder.handler(i,o))===h)break;Array.isArray(r)?n.push.apply(n,r):n.push(r)}if(!this._do_not_flush){for(;(r=this._encoder.handler(i,i.read()))!==h;)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)},y["UTF-8"]=function(t){return new C(t)},v["UTF-8"]=function(t){return new S(t)},"encoding-indexes"in e&&f.forEach((function(t){"Legacy single-byte encodings"===t.heading&&t.encodings.forEach((function(t){var e=t.name,r=_(e.toLowerCase());v[e]=function(t){return new T(r,t)},y[e]=function(t){return new I(r,t)}}))})),v.GBK=function(t){return new R(t)},y.GBK=function(t){return new B(t,!0)},y.gb18030=function(t){return new B(t)},v.gb18030=function(t){return new R(t)},y.Big5=function(t){return new P(t)},v.Big5=function(t){return new L(t)},y["EUC-JP"]=function(t){return new O(t)},v["EUC-JP"]=function(t){return new D(t)},y["ISO-2022-JP"]=function(t){return new U(t)},v["ISO-2022-JP"]=function(t){return new k(t)},y.Shift_JIS=function(t){return new F(t)},v.Shift_JIS=function(t){return new N(t)},y["EUC-KR"]=function(t){return new G(t)},v["EUC-KR"]=function(t){return new z(t)},y["UTF-16BE"]=function(t){return new V(!0,t)},v["UTF-16BE"]=function(t){return new j(!0,t)},y["UTF-16LE"]=function(t){return new V(!1,t)},v["UTF-16LE"]=function(t){return new j(!1,t)},y["x-user-defined"]=function(t){return new W(t)},v["x-user-defined"]=function(t){return new H(t)},e.TextEncoder||(e.TextEncoder=M),e.TextDecoder||(e.TextDecoder=E),t.exports&&(t.exports={TextEncoder:e.TextEncoder,TextDecoder:e.TextDecoder,EncodingIndexes:e["encoding-indexes"]})}(this||{})},37597:()=>{},42917:(t,e,r)=>{"use strict";r(59749),r(86544),r(58373),r(96157),r(82529),r(84254),r(64155),r(93531),r(95906),r(50549),r(96285),r(18200),r(69373),r(66793),r(44578),r(21057),r(68932),r(95879),r(54927),r(92176),r(34338),r(2966),r(55791),r(97895),r(38077),r(25728),r(39772),r(59867),r(93383),r(62795),r(54564),r(49693),r(77049),r(76801),r(97195),r(63975),r(752),r(6203),r(72410),r(50886),r(37593),r(70560),r(278),r(81386),r(93374),r(89730),r(98742),r(65137),r(21932),r(62506),r(29830),r(12894),r(93530),r(13383),r(90385),r(91719),r(21319),r(69365),r(33870),r(99211),r(18201),r(55635),r(42227),r(99679),r(24343),r(65007),r(78150),r(59903),r(30024),r(60428),r(41517),r(56269),r(34284),r(45398),r(48324),r(7629),r(56646),r(89348),r(6557),r(62428),r(45263),r(74712),r(54986),r(47221),r(94992),r(25499),r(59944),r(78527),r(75239),r(92076),r(68813),r(96976),r(62700),r(91554),r(77509),r(21416),r(79288),r(53584),r(82243),r(95765),r(45993),r(92547),r(7936),r(32704),r(52362),r(21552),r(10704),r(97389),r(25284),r(60429),r(51013),r(33994),r(35082),r(40739),r(47409),r(36585),r(41830),r(85415),r(81919),r(99474),r(79997),r(88052),r(44079),r(14566),r(76101),r(36446),r(35140),r(4179),r(69358),r(75450),r(54993),r(48115),r(19330),r(30658),r(5399),r(60228),r(86466),r(80939),r(32320),r(73964),r(41195),r(87609),r(36409),r(13505),r(54333),r(30050),r(99871),r(1049),r(32349),r(50149),r(43792),r(69707),r(63545),r(62087),r(51505),r(45247),r(22373),r(76034),r(52003),r(68518),r(64043),r(25847),r(13440),r(7409),r(12826),r(19649),r(7961),r(86239),r(2918),r(20283),r(43843),r(12281),r(21694),r(22462),r(79866),r(72940),r(8472),r(92404),r(59588),r(57267),r(56532),r(61514),r(9873),r(268),r(20372),r(35237),r(28436),r(16386),r(3255),r(90343),r(21444),r(25906),r(95682),r(98041),r(6364),r(82954),r(19162),r(37960),r(470),r(67446),r(47729),r(2e3),r(29068),r(70292),r(55304),r(89988),r(854),r(28607),r(30938),r(75679),r(18557),r(95194),r(36664),r(55980),r(79943),r(96089),r(18539),r(48690),r(20522),r(82),r(45385),r(59495),r(85552),r(31803),r(91565),r(67987),r(49365),r(80677),r(19038),r(18118),r(41165),r(71522),r(79976),r(4797),r(7300),r(93356),r(62533),r(99724),r(24224),r(61121),r(99901),r(37133),r(622),r(51090),r(50414),r(89503),r(26810),r(18073),r(4154),r(7802),r(54883),r(38197),r(20097),r(36208),r(22525),r(96882),r(32539),r(5082),r(98),r(32221),r(67890),r(47041),r(86322),r(92253),r(97554),r(86247),r(21412),r(43097),r(11070),r(64578),r(77299),r(15694),r(17815),r(19029),r(6237),r(81954),r(87152),r(89667),r(49118),r(32411),r(3256),r(85625),r(10914),r(14494),r(9468),r(24587),r(60779),r(65503),r(50236),r(89246),r(31186),r(9279),r(26725),r(26125),r(2820),r(62517),r(54947),r(74993),r(78832),r(67602),r(50647),r(82639),r(63986),r(16054),r(53476),r(70928),r(49411),r(30005),r(73494),r(94564),r(41792),r(5985),r(31107),r(28244),r(3645),r(58429),r(39569),r(74320),r(20691),r(82964),r(67444),r(97968),r(747),r(41099),r(26320),r(20876),r(6052),r(39879),r(76791),r(75341),r(40019),r(92343),r(51096),r(4314),r(63111),r(23346),r(64984),r(64078),r(24453),r(66190),r(25684),r(31789),r(8677),r(346),r(59151),r(91069),r(18886),r(88065),r(68172),r(60445),r(99457),r(613),r(835),r(926),r(82899),r(29977),r(53669),r(31927),r(77131),r(55174),r(3210),r(76314),r(218),r(40393),r(6616),r(90810),r(19959),r(73347),r(71913),r(70003),r(79955),r(7859),r(31138),r(28809),r(2946),r(32460),r(57282),r(5058),r(15716),r(36814),r(30349),r(96986),r(95681),r(13781),r(33442),r(98873),r(61964),r(50308),r(69878),r(18955),r(52915),r(65115),r(19490),r(95752),r(32789),r(27913),r(6831),r(98686),r(90243),r(22275),r(98030),r(86220),r(21917),r(95853),r(66084),r(2741),r(59012),r(38320),r(78988),r(80546),r(62586),r(46019),r(5010),r(45749),r(4835),r(58799),r(18134),r(27041),r(44767),r(92981),r(85044),r(76677),r(96256),r(18241),r(59359),r(54302),r(1274),r(30548),r(25298),r(11882),r(915),r(91238),r(17911),r(23579),r(91117),r(85723),r(68680),r(77225),r(99369),r(22983),r(90201),r(13466),r(23321),r(84930),r(92465),r(45738),r(52586),r(84645),r(47522),r(76265),r(97337),r(13429),r(37462),r(40088),r(10455),r(3650),r(25564),r(96869),r(78730),r(69822),r(19979),r(79307),r(98858),r(61318),r(33228),r(50496)},46108:(t,e,r)=>{"use strict";r(42917)},10509:(t,e,r)=>{"use strict";var i=r(69985),n=r(23691),s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not a function")}},52655:(t,e,r)=>{"use strict";var i=r(19429),n=r(23691),s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not a constructor")}},9945:(t,e,r)=>{"use strict";var i=r(83914).has;t.exports=function(t){return i(t),t}},23550:(t,e,r)=>{"use strict";var i=r(69985),n=String,s=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw new s("Can't set "+n(t)+" as a prototype")}},10029:(t,e,r)=>{"use strict";var i=r(61034).has;t.exports=function(t){return i(t),t}},51082:t=>{"use strict";var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},457:(t,e,r)=>{"use strict";var i=r(16803).has;t.exports=function(t){return i(t),t}},53499:(t,e,r)=>{"use strict";var i=r(78616).has;t.exports=function(t){return i(t),t}},29199:(t,e,r)=>{"use strict";var i=r(22615),n=r(68844),s=r(54071),o=r(85027),a=r(10509),l=r(981),c=r(54849),h=r(44201),u=h("asyncDispose"),d=h("dispose"),p=n([].push),f=function(t,e,r){return arguments.length<3&&!l(t)&&(r=a(function(t,e){if("async-dispose"===e){var r=c(t,u);return void 0!==r?r:(r=c(t,d),function(){i(r,this)})}return c(t,d)}(o(t),e))),void 0===r?function(){}:s(r,t)};t.exports=function(t,e,r,i){var n;if(arguments.length<4){if(l(e)&&"sync-dispose"===r)return;n=f(e,r)}else n=f(void 0,r,i);p(t.stack,n)}},87370:(t,e,r)=>{"use strict";var i=r(44201),n=r(25391),s=r(72560).f,o=i("unscopables"),a=Array.prototype;void 0===a[o]&&s(a,o,{configurable:!0,value:n(null)}),t.exports=function(t){a[o][t]=!0}},71514:(t,e,r)=>{"use strict";var i=r(10730).charAt;t.exports=function(t,e,r){return e+(r?i(t,e).length:1)}},767:(t,e,r)=>{"use strict";var i=r(23622),n=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw new n("Incorrect invocation")}},33425:(t,e,r)=>{"use strict";var i=r(48999),n=String,s=TypeError;t.exports=function(t){if(void 0===t||i(t))return t;throw new s(n(t)+" is not an object or undefined")}},85027:(t,e,r)=>{"use strict";var i=r(48999),n=String,s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not an object")}},95668:(t,e,r)=>{"use strict";var i=r(50926),n=TypeError;t.exports=function(t){if("Uint8Array"===i(t))return t;throw new n("Argument is not an Uint8Array")}},37075:t=>{"use strict";t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},33050:(t,e,r)=>{"use strict";var i=r(52743),n=r(6648),s=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==n(t))throw new s("ArrayBuffer expected");return t.byteLength}},22961:(t,e,r)=>{"use strict";var i=r(68844),n=r(33050),s=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==n(t))return!1;try{return s(t,0,0),!1}catch(t){return!0}}},11655:(t,e,r)=>{"use strict";var i=r(3689);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},29195:(t,e,r)=>{"use strict";var i=r(19037),n=r(68844),s=r(52743),o=r(19842),a=r(22961),l=r(33050),c=r(21420),h=r(63514),u=i.structuredClone,d=i.ArrayBuffer,p=i.DataView,f=i.TypeError,m=Math.min,g=d.prototype,A=p.prototype,y=n(g.slice),v=s(g,"resizable","get"),x=s(g,"maxByteLength","get"),b=n(A.getInt8),_=n(A.setInt8);t.exports=(h||c)&&function(t,e,r){var i,n=l(t),s=void 0===e?n:o(e),g=!v||!v(t);if(a(t))throw new f("ArrayBuffer is detached");if(h&&(t=u(t,{transfer:[t]}),n===s&&(r||g)))return t;if(n>=s&&(!r||g))i=y(t,0,s);else{var A=r&&!g&&x?{maxByteLength:x(t)}:void 0;i=new d(s,A);for(var w=new p(t),E=new p(i),M=m(s,n),S=0;S{"use strict";var i,n,s,o=r(37075),a=r(67697),l=r(19037),c=r(69985),h=r(48999),u=r(36812),d=r(50926),p=r(23691),f=r(75773),m=r(11880),g=r(62148),A=r(23622),y=r(61868),v=r(49385),x=r(44201),b=r(14630),_=r(618),w=_.enforce,E=_.get,M=l.Int8Array,S=M&&M.prototype,C=l.Uint8ClampedArray,T=C&&C.prototype,I=M&&y(M),R=S&&y(S),B=Object.prototype,L=l.TypeError,P=x("toStringTag"),D=b("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",k=o&&!!v&&"Opera"!==d(l.opera),U=!1,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},z=function(t){var e=y(t);if(h(e)){var r=E(e);return r&&u(r,O)?r[O]:z(e)}},G=function(t){if(!h(t))return!1;var e=d(t);return u(N,e)||u(F,e)};for(i in N)(s=(n=l[i])&&n.prototype)?w(s)[O]=n:k=!1;for(i in F)(s=(n=l[i])&&n.prototype)&&(w(s)[O]=n);if((!k||!c(I)||I===Function.prototype)&&(I=function(){throw new L("Incorrect invocation")},k))for(i in N)l[i]&&v(l[i],I);if((!k||!R||R===B)&&(R=I.prototype,k))for(i in N)l[i]&&v(l[i].prototype,R);if(k&&y(T)!==R&&v(T,R),a&&!u(R,P))for(i in U=!0,g(R,P,{configurable:!0,get:function(){return h(this)?this[D]:void 0}}),N)l[i]&&f(l[i],D,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:k,TYPED_ARRAY_TAG:U&&D,aTypedArray:function(t){if(G(t))return t;throw new L("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!v||A(I,t)))return t;throw new L(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,i){if(a){if(r)for(var n in N){var s=l[n];if(s&&u(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}R[t]&&!r||m(R,t,r?e:k&&S[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,r){var i,n;if(a){if(v){if(r)for(i in N)if((n=l[i])&&u(n,t))try{delete n[t]}catch(t){}if(I[t]&&!r)return;try{return m(I,t,r?e:k&&I[t]||e)}catch(t){}}for(i in N)!(n=l[i])||n[t]&&!r||m(n,t,e)}},getTypedArrayConstructor:z,isView:function(t){if(!h(t))return!1;var e=d(t);return"DataView"===e||u(N,e)||u(F,e)},isTypedArray:G,TypedArray:I,TypedArrayPrototype:R}},83999:(t,e,r)=>{"use strict";var i=r(19037),n=r(68844),s=r(67697),o=r(37075),a=r(41236),l=r(75773),c=r(62148),h=r(6045),u=r(3689),d=r(767),p=r(68700),f=r(43126),m=r(19842),g=r(37788),A=r(15477),y=r(61868),v=r(49385),x=r(72741).f,b=r(62872),_=r(9015),w=r(55997),E=r(618),M=a.PROPER,S=a.CONFIGURABLE,C="ArrayBuffer",T="DataView",I="prototype",R="Wrong index",B=E.getterFor(C),L=E.getterFor(T),P=E.set,D=i[C],O=D,k=O&&O[I],U=i[T],N=U&&U[I],F=Object.prototype,z=i.Array,G=i.RangeError,Q=n(b),j=n([].reverse),V=A.pack,H=A.unpack,W=function(t){return[255&t]},q=function(t){return[255&t,t>>8&255]},Z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},X=function(t){return V(g(t),23,4)},J=function(t){return V(t,52,8)},K=function(t,e,r){c(t[I],e,{configurable:!0,get:function(){return r(this)[e]}})},$=function(t,e,r,i){var n=L(t),s=m(r),o=!!i;if(s+e>n.byteLength)throw new G(R);var a=n.bytes,l=s+n.byteOffset,c=_(a,l,l+e);return o?c:j(c)},tt=function(t,e,r,i,n,s){var o=L(t),a=m(r),l=i(+n),c=!!s;if(a+e>o.byteLength)throw new G(R);for(var h=o.bytes,u=a+o.byteOffset,d=0;dnt;)(rt=it[nt++])in O||l(O,rt,D[rt]);k.constructor=O}v&&y(N)!==F&&v(N,F);var st=new U(new O(2)),ot=n(N.setInt8);st.setInt8(0,2147483648),st.setInt8(1,2147483649),!st.getInt8(0)&&st.getInt8(1)||h(N,{setInt8:function(t,e){ot(this,t,e<<24>>24)},setUint8:function(t,e){ot(this,t,e<<24>>24)}},{unsafe:!0})}else k=(O=function(t){d(this,k);var e=m(t);P(this,{type:C,bytes:Q(z(e),0),byteLength:e}),s||(this.byteLength=e,this.detached=!1)})[I],N=(U=function(t,e,r){d(this,N),d(t,k);var i=B(t),n=i.byteLength,o=p(e);if(o<0||o>n)throw new G("Wrong offset");if(o+(r=void 0===r?n-o:f(r))>n)throw new G("Wrong length");P(this,{type:T,buffer:t,byteLength:r,byteOffset:o,bytes:i.bytes}),s||(this.buffer=t,this.byteLength=r,this.byteOffset=o)})[I],s&&(K(O,"byteLength",B),K(U,"buffer",L),K(U,"byteLength",L),K(U,"byteOffset",L)),h(N,{getInt8:function(t){return $(this,1,t)[0]<<24>>24},getUint8:function(t){return $(this,1,t)[0]},getInt16:function(t){var e=$(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=$(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Y($(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Y($(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return H($(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return H($(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){tt(this,1,t,W,e)},setUint8:function(t,e){tt(this,1,t,W,e)},setInt16:function(t,e){tt(this,2,t,q,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){tt(this,2,t,q,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){tt(this,4,t,Z,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){tt(this,4,t,Z,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){tt(this,4,t,X,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){tt(this,8,t,J,e,arguments.length>2&&arguments[2])}});w(O,C),w(U,T),t.exports={ArrayBuffer:O,DataView:U}},70357:(t,e,r)=>{"use strict";var i=r(90690),n=r(27578),s=r(6310),o=r(98494),a=Math.min;t.exports=[].copyWithin||function(t,e){var r=i(this),l=s(r),c=n(t,l),h=n(e,l),u=arguments.length>2?arguments[2]:void 0,d=a((void 0===u?l:n(u,l))-h,l-c),p=1;for(h0;)h in r?r[c]=r[h]:o(r,c),c+=p,h+=p;return r}},62872:(t,e,r)=>{"use strict";var i=r(90690),n=r(27578),s=r(6310);t.exports=function(t){for(var e=i(this),r=s(e),o=arguments.length,a=n(o>1?arguments[1]:void 0,r),l=o>2?arguments[2]:void 0,c=void 0===l?r:n(l,r);c>a;)e[a++]=t;return e}},57612:(t,e,r)=>{"use strict";var i=r(2960).forEach,n=r(16834)("forEach");t.exports=n?[].forEach:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}},2231:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(90690),o=r(19429),a=r(13807),l=r(5185),c=r(22302),h=r(91664),u=r(54849),d=r(76058),p=r(88277),f=r(44201),m=r(29019),g=r(62489).toArray,A=f("asyncIterator"),y=n(p("Array","values")),v=n(y([]).next),x=function(){return new b(this)},b=function(t){this.iterator=y(t)};b.prototype.next=function(){return v(this.iterator)},t.exports=function(t){var e=this,r=arguments.length,n=r>1?arguments[1]:void 0,p=r>2?arguments[2]:void 0;return new(d("Promise"))((function(r){var d=s(t);void 0!==n&&(n=i(n,p));var f=u(d,A),y=f?void 0:h(d)||x,v=o(e)?new e:[],b=f?a(d,f):new m(c(l(d,y)));r(g(b,n,v))}))}},59976:(t,e,r)=>{"use strict";var i=r(6310);t.exports=function(t,e,r){for(var n=0,s=arguments.length>2?r:i(e),o=new t(s);s>n;)o[n]=e[n++];return o}},21055:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(90690),o=r(71228),a=r(93292),l=r(19429),c=r(6310),h=r(76522),u=r(5185),d=r(91664),p=Array;t.exports=function(t){var e=s(t),r=l(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=i(m,f>2?arguments[2]:void 0));var A,y,v,x,b,_,w=d(e),E=0;if(!w||this===p&&a(w))for(A=c(e),y=r?new this(A):p(A);A>E;E++)_=g?m(e[E],E):e[E],h(y,E,_);else for(b=(x=u(e,w)).next,y=r?new this:[];!(v=n(b,x)).done;E++)_=g?o(x,m,[v.value,E],!0):v.value,h(y,E,_);return y.length=E,y}},44416:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(6310),l=r(83914),c=l.Map,h=l.get,u=l.has,d=l.set,p=n([].push);t.exports=function(t){for(var e,r,n=o(this),l=s(n),f=i(t,arguments.length>1?arguments[1]:void 0),m=new c,g=a(l),A=0;g>A;A++)e=f(r=l[A],A,n),u(m,e)?p(h(m,e),r):d(m,e,[r]);return m}},64976:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(18360),l=r(6310),c=r(25391),h=r(59976),u=Array,d=n([].push);t.exports=function(t,e,r,n){for(var p,f,m,g=o(t),A=s(g),y=i(e,r),v=c(null),x=l(A),b=0;x>b;b++)m=A[b],(f=a(y(m,b,g)))in v?d(v[f],m):v[f]=[m];if(n&&(p=n(g))!==u)for(f in v)v[f]=h(p,v[f]);return v}},84328:(t,e,r)=>{"use strict";var i=r(65290),n=r(27578),s=r(6310),o=function(t){return function(e,r,o){var a,l=i(e),c=s(l),h=n(o,c);if(t&&r!=r){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===r)return t||h||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},61969:(t,e,r)=>{"use strict";var i=r(54071),n=r(94413),s=r(90690),o=r(6310),a=function(t){var e=1===t;return function(r,a,l){for(var c,h=s(r),u=n(h),d=o(u),p=i(a,l);d-- >0;)if(p(c=u[d],d,h))switch(t){case 0:return c;case 1:return d}return e?-1:void 0}};t.exports={findLast:a(0),findLastIndex:a(1)}},2960:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(6310),l=r(27120),c=n([].push),h=function(t){var e=1===t,r=2===t,n=3===t,h=4===t,u=6===t,d=7===t,p=5===t||u;return function(f,m,g,A){for(var y,v,x=o(f),b=s(x),_=a(b),w=i(m,g),E=0,M=A||l,S=e?M(f,_):r||d?M(f,0):void 0;_>E;E++)if((p||E in b)&&(v=w(y=b[E],E,x),t))if(e)S[E]=v;else if(v)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:c(S,y)}else switch(t){case 4:return!1;case 7:c(S,y)}return u?-1:n||h?h:S}};t.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6),filterReject:h(7)}},60953:(t,e,r)=>{"use strict";var i=r(61735),n=r(65290),s=r(68700),o=r(6310),a=r(16834),l=Math.min,c=[].lastIndexOf,h=!!c&&1/[1].lastIndexOf(1,-0)<0,u=a("lastIndexOf"),d=h||!u;t.exports=d?function(t){if(h)return i(c,this,arguments)||0;var e=n(this),r=o(e),a=r-1;for(arguments.length>1&&(a=l(a,s(arguments[1]))),a<0&&(a=r+a);a>=0;a--)if(a in e&&e[a]===t)return a||0;return-1}:c},29042:(t,e,r)=>{"use strict";var i=r(3689),n=r(44201),s=r(3615),o=n("species");t.exports=function(t){return s>=51||!i((function(){var e=[];return(e.constructor={})[o]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},16834:(t,e,r)=>{"use strict";var i=r(3689);t.exports=function(t,e){var r=[][t];return!!r&&i((function(){r.call(null,e||function(){return 1},1)}))}},88820:(t,e,r)=>{"use strict";var i=r(10509),n=r(90690),s=r(94413),o=r(6310),a=TypeError,l=function(t){return function(e,r,l,c){var h=n(e),u=s(h),d=o(h);i(r);var p=t?d-1:0,f=t?-1:1;if(l<2)for(;;){if(p in u){c=u[p],p+=f;break}if(p+=f,t?p<0:d<=p)throw new a("Reduce of empty array with no initial value")}for(;t?p>=0:d>p;p+=f)p in u&&(c=r(c,u[p],p,h));return c}};t.exports={left:l(!1),right:l(!0)}},5649:(t,e,r)=>{"use strict";var i=r(67697),n=r(92297),s=TypeError,o=Object.getOwnPropertyDescriptor,a=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=a?function(t,e){if(n(t)&&!o(t,"length").writable)throw new s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},9015:(t,e,r)=>{"use strict";var i=r(27578),n=r(6310),s=r(76522),o=Array,a=Math.max;t.exports=function(t,e,r){for(var l=n(t),c=i(e,l),h=i(void 0===r?l:r,l),u=o(a(h-c,0)),d=0;c{"use strict";var i=r(68844);t.exports=i([].slice)},50382:(t,e,r)=>{"use strict";var i=r(9015),n=Math.floor,s=function(t,e){var r=t.length,l=n(r/2);return r<8?o(t,e):a(t,s(i(t,0,l),e),s(i(t,l),e),e)},o=function(t,e){for(var r,i,n=t.length,s=1;s0;)t[i]=t[--i];i!==s++&&(t[i]=r)}return t},a=function(t,e,r,i){for(var n=e.length,s=r.length,o=0,a=0;o{"use strict";var i=r(92297),n=r(19429),s=r(48999),o=r(44201)("species"),a=Array;t.exports=function(t){var e;return i(t)&&(e=t.constructor,(n(e)&&(e===a||i(e.prototype))||s(e)&&null===(e=e[o]))&&(e=void 0)),void 0===e?a:e}},27120:(t,e,r)=>{"use strict";var i=r(25271);t.exports=function(t,e){return new(i(t))(0===e?0:e)}},26166:(t,e,r)=>{"use strict";var i=r(6310);t.exports=function(t,e){for(var r=i(t),n=new e(r),s=0;s{"use strict";var i=r(68844),n=r(10509),s=r(981),o=r(6310),a=r(90690),l=r(83914),c=r(10613),h=l.Map,u=l.has,d=l.set,p=i([].push);t.exports=function(t){var e,r,i,l=a(this),f=o(l),m=[],g=new h,A=s(t)?function(t){return t}:n(t);for(e=0;e{"use strict";var i=r(6310),n=r(68700),s=RangeError;t.exports=function(t,e,r,o){var a=i(t),l=n(r),c=l<0?a+l:l;if(c>=a||c<0)throw new s("Incorrect index");for(var h=new e(a),u=0;u{"use strict";var i=r(22615),n=r(85027),s=r(25391),o=r(54849),a=r(6045),l=r(618),c=r(76058),h=r(23070),u=r(27807),d=c("Promise"),p="AsyncFromSyncIterator",f=l.set,m=l.getterFor(p),g=function(t,e,r){var i=t.done;d.resolve(t.value).then((function(t){e(u(t,i))}),r)},A=function(t){t.type=p,f(this,t)};A.prototype=a(s(h),{next:function(){var t=m(this);return new d((function(e,r){var s=n(i(t.next,t.iterator));g(s,e,r)}))},return:function(){var t=m(this).iterator;return new d((function(e,r){var s=o(t,"return");if(void 0===s)return e(u(void 0,!0));var a=n(i(s,t));g(a,e,r)}))}}),t.exports=A},52399:(t,e,r)=>{"use strict";var i=r(22615),n=r(76058),s=r(54849);t.exports=function(t,e,r,o){try{var a=s(t,"return");if(a)return n("Promise").resolve(i(a,t)).then((function(){e(r)}),(function(t){o(t)}))}catch(t){return o(t)}e(r)}},17394:(t,e,r)=>{"use strict";var i=r(22615),n=r(9302),s=r(85027),o=r(25391),a=r(75773),l=r(6045),c=r(44201),h=r(618),u=r(76058),d=r(54849),p=r(23070),f=r(27807),m=r(72125),g=u("Promise"),A=c("toStringTag"),y="AsyncIteratorHelper",v="WrapForValidAsyncIterator",x=h.set,b=function(t){var e=!t,r=h.getterFor(t?v:y),a=function(t){var i=n((function(){return r(t)})),s=i.error,o=i.value;return s||e&&o.done?{exit:!0,value:s?g.reject(o):g.resolve(f(void 0,!0))}:{exit:!1,value:o}};return l(o(p),{next:function(){var t=a(this),e=t.value;if(t.exit)return e;var r=n((function(){return s(e.nextHandler(g))})),i=r.error,o=r.value;return i&&(e.done=!0),i?g.reject(o):g.resolve(o)},return:function(){var e=a(this),r=e.value;if(e.exit)return r;r.done=!0;var o,l,c=r.iterator,h=n((function(){if(r.inner)try{m(r.inner.iterator,"normal")}catch(t){return m(c,"throw",t)}return d(c,"return")}));return o=l=h.value,h.error?g.reject(l):void 0===o?g.resolve(f(void 0,!0)):(l=(h=n((function(){return i(o,c)}))).value,h.error?g.reject(l):t?g.resolve(l):g.resolve(l).then((function(t){return s(t),f(void 0,!0)})))}})},_=b(!0),w=b(!1);a(w,A,"Async Iterator Helper"),t.exports=function(t,e){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=e?v:y,i.nextHandler=t,i.counter=0,i.done=!1,x(this,i)};return r.prototype=e?_:w,r}},40164:(t,e,r)=>{"use strict";var i=r(22615),n=r(82412),s=function(t,e){return[e,t]};t.exports=function(){return i(n,this,s)}},62489:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(48999),a=r(55565),l=r(76058),c=r(22302),h=r(52399),u=function(t){var e=0===t,r=1===t,u=2===t,d=3===t;return function(t,p,f){s(t);var m=void 0!==p;!m&&e||n(p);var g=c(t),A=l("Promise"),y=g.iterator,v=g.next,x=0;return new A((function(t,n){var l=function(t){h(y,n,t,n)},c=function(){try{if(m)try{a(x)}catch(t){l(t)}A.resolve(s(i(v,y))).then((function(i){try{if(s(i).done)e?(f.length=x,t(f)):t(!d&&(u||void 0));else{var a=i.value;try{if(m){var g=p(a,x),v=function(i){if(r)c();else if(u)i?c():h(y,t,!1,n);else if(e)try{f[x++]=i,c()}catch(t){l(t)}else i?h(y,t,d||a,n):c()};o(g)?A.resolve(g).then(v,l):v(g)}else f[x++]=a,c()}catch(t){l(t)}}}catch(t){n(t)}}),n)}catch(t){n(t)}};c()}))}};t.exports={toArray:u(0),forEach:u(1),every:u(2),some:u(3),find:u(4)}},82412:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(48999),a=r(22302),l=r(17394),c=r(27807),h=r(52399),u=l((function(t){var e=this,r=e.iterator,n=e.mapper;return new t((function(a,l){var u=function(t){e.done=!0,l(t)},d=function(t){h(r,u,t,u)};t.resolve(s(i(e.next,r))).then((function(r){try{if(s(r).done)e.done=!0,a(c(void 0,!0));else{var i=r.value;try{var l=n(i,e.counter++),h=function(t){a(c(t,!1))};o(l)?t.resolve(l).then(h,d):h(l)}catch(t){d(t)}}}catch(t){u(t)}}),u)}))}));t.exports=function(t){return s(this),n(t),new u(a(this),{mapper:t})}},23070:(t,e,r)=>{"use strict";var i,n,s=r(19037),o=r(84091),a=r(69985),l=r(25391),c=r(61868),h=r(11880),u=r(44201),d=r(53931),p="USE_FUNCTION_CONSTRUCTOR",f=u("asyncIterator"),m=s.AsyncIterator,g=o.AsyncIteratorPrototype;if(g)i=g;else if(a(m))i=m.prototype;else if(o[p]||s[p])try{n=c(c(c(Function("return async function*(){}()")()))),c(n)===Object.prototype&&(i=n)}catch(t){}i?d&&(i=l(i)):i={},a(i[f])||h(i,f,(function(){return this})),t.exports=i},40219:(t,e,r)=>{"use strict";var i=r(22615),n=r(17394);t.exports=n((function(){return i(this.next,this.iterator)}),!0)},18368:t=>{"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=e+"+/",i=e+"-_",n=function(t){for(var e={},r=0;r<64;r++)e[t.charAt(r)]=r;return e};t.exports={i2c:r,c2i:n(r),i2cUrl:i,c2iUrl:n(i)}},71228:(t,e,r)=>{"use strict";var i=r(85027),n=r(72125);t.exports=function(t,e,r,s){try{return s?e(i(r)[0],r[1]):e(r)}catch(e){n(t,"throw",e)}}},86431:(t,e,r)=>{"use strict";var i=r(44201)("iterator"),n=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){n=!0}};o[i]=function(){return this},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){try{if(!e&&!n)return!1}catch(t){return!1}var r=!1;try{var s={};s[i]=function(){return{next:function(){return{done:r=!0}}}},t(s)}catch(t){}return r}},6648:(t,e,r)=>{"use strict";var i=r(68844),n=i({}.toString),s=i("".slice);t.exports=function(t){return s(n(t),8,-1)}},50926:(t,e,r)=>{"use strict";var i=r(23043),n=r(69985),s=r(6648),o=r(44201)("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());t.exports=i?s:function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=a(t),o))?r:l?s(e):"Object"===(i=s(e))&&n(e.callee)?"Arguments":i}},28737:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(10509),o=r(52655),a=r(981),l=r(18734),c=[].push;t.exports=function(t){var e,r,h,u,d=arguments.length,p=d>1?arguments[1]:void 0;return o(this),(e=void 0!==p)&&s(p),a(t)?new this:(r=[],e?(h=0,u=i(p,d>2?arguments[2]:void 0),l(t,(function(t){n(c,r,u(t,h++))}))):l(t,c,{that:r}),new this(r))}},1114:(t,e,r)=>{"use strict";var i=r(96004);t.exports=function(){return new this(i(arguments))}},70800:(t,e,r)=>{"use strict";var i=r(25391),n=r(62148),s=r(6045),o=r(54071),a=r(767),l=r(981),c=r(18734),h=r(91934),u=r(27807),d=r(14241),p=r(67697),f=r(45375).fastKey,m=r(618),g=m.set,A=m.getterFor;t.exports={getConstructor:function(t,e,r,h){var u=t((function(t,n){a(t,d),g(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),p||(t.size=0),l(n)||c(n,t[h],{that:t,AS_ENTRIES:r})})),d=u.prototype,m=A(e),y=function(t,e,r){var i,n,s=m(t),o=v(t,e);return o?o.value=r:(s.last=o={index:n=f(e,!0),key:e,value:r,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=o),i&&(i.next=o),p?s.size++:t.size++,"F"!==n&&(s.index[n]=o)),t},v=function(t,e){var r,i=m(t),n=f(e);if("F"!==n)return i.index[n];for(r=i.first;r;r=r.next)if(r.key===e)return r};return s(d,{clear:function(){for(var t=m(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,p?t.size=0:this.size=0},delete:function(t){var e=this,r=m(e),i=v(e,t);if(i){var n=i.next,s=i.previous;delete r.index[i.index],i.removed=!0,s&&(s.next=n),n&&(n.previous=s),r.first===i&&(r.first=n),r.last===i&&(r.last=s),p?r.size--:e.size--}return!!i},forEach:function(t){for(var e,r=m(this),i=o(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!v(this,t)}}),s(d,r?{get:function(t){var e=v(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),p&&n(d,"size",{configurable:!0,get:function(){return m(this).size}}),u},setStrong:function(t,e,r){var i=e+" Iterator",n=A(e),s=A(i);h(t,e,(function(t,e){g(this,{type:i,target:t,state:n(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?u("keys"===e?r.key:"values"===e?r.value:[r.key,r.value],!1):(t.target=void 0,u(void 0,!0))}),r?"entries":"values",!r,!0),d(e)}}},70637:(t,e,r)=>{"use strict";var i=r(68844),n=r(6045),s=r(45375).getWeakData,o=r(767),a=r(85027),l=r(981),c=r(48999),h=r(18734),u=r(2960),d=r(36812),p=r(618),f=p.set,m=p.getterFor,g=u.find,A=u.findIndex,y=i([].splice),v=0,x=function(t){return t.frozen||(t.frozen=new b)},b=function(){this.entries=[]},_=function(t,e){return g(t.entries,(function(t){return t[0]===e}))};b.prototype={get:function(t){var e=_(this,t);if(e)return e[1]},has:function(t){return!!_(this,t)},set:function(t,e){var r=_(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=A(this.entries,(function(e){return e[0]===t}));return~e&&y(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,r,i){var u=t((function(t,n){o(t,p),f(t,{type:e,id:v++,frozen:void 0}),l(n)||h(n,t[i],{that:t,AS_ENTRIES:r})})),p=u.prototype,g=m(e),A=function(t,e,r){var i=g(t),n=s(a(e),!0);return!0===n?x(i).set(e,r):n[i.id]=r,t};return n(p,{delete:function(t){var e=g(this);if(!c(t))return!1;var r=s(t);return!0===r?x(e).delete(t):r&&d(r,e.id)&&delete r[e.id]},has:function(t){var e=g(this);if(!c(t))return!1;var r=s(t);return!0===r?x(e).has(t):r&&d(r,e.id)}}),n(p,r?{get:function(t){var e=g(this);if(c(t)){var r=s(t);return!0===r?x(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return A(this,t,e)}}:{add:function(t){return A(this,t,!0)}}),u}}},20319:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(35266),a=r(11880),l=r(45375),c=r(18734),h=r(767),u=r(69985),d=r(981),p=r(48999),f=r(3689),m=r(86431),g=r(55997),A=r(33457);t.exports=function(t,e,r){var y=-1!==t.indexOf("Map"),v=-1!==t.indexOf("Weak"),x=y?"set":"add",b=n[t],_=b&&b.prototype,w=b,E={},M=function(t){var e=s(_[t]);a(_,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(v&&!p(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return v&&!p(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(v&&!p(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(o(t,!u(b)||!(v||_.forEach&&!f((function(){(new b).entries().next()})))))w=r.getConstructor(e,t,y,x),l.enable();else if(o(t,!0)){var S=new w,C=S[x](v?{}:-0,1)!==S,T=f((function(){S.has(1)})),I=m((function(t){new b(t)})),R=!v&&f((function(){for(var t=new b,e=5;e--;)t[x](e,e);return!t.has(-0)}));I||((w=e((function(t,e){h(t,_);var r=A(new b,t,w);return d(e)||c(e,r[x],{that:r,AS_ENTRIES:y}),r}))).prototype=_,_.constructor=w),(T||R)&&(M("delete"),M("has"),y&&M("get")),(R||C)&&M(x),v&&_.clear&&delete _.clear}return E[t]=w,i({global:!0,constructor:!0,forced:w!==b},E),g(w,t),v||r.setStrong(w,t,y),w}},41544:(t,e,r)=>{"use strict";r(56646),r(51090);var i=r(76058),n=r(25391),s=r(48999),o=Object,a=TypeError,l=i("Map"),c=i("WeakMap"),h=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=n(null)};h.prototype.get=function(t,e){return this[t]||(this[t]=e())},h.prototype.next=function(t,e,r){var i=r?this.objectsByIndex[t]||(this.objectsByIndex[t]=new c):this.primitives||(this.primitives=new l),n=i.get(e);return n||i.set(e,n=new h),n};var u=new h;t.exports=function(){var t,e,r=u,i=arguments.length;for(t=0;t{"use strict";var i=r(36812),n=r(19152),s=r(82474),o=r(72560);t.exports=function(t,e,r){for(var a=n(e),l=o.f,c=s.f,h=0;h{"use strict";var i=r(44201)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[i]=!1,"/./"[t](e)}catch(t){}}return!1}},81748:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},71568:(t,e,r)=>{"use strict";var i=r(68844),n=r(74684),s=r(34327),o=/"/g,a=i("".replace);t.exports=function(t,e,r,i){var l=s(n(t)),c="<"+e;return""!==r&&(c+=" "+r+'="'+a(s(i),o,""")+'"'),c+">"+l+""}},27807:t=>{"use strict";t.exports=function(t,e){return{value:t,done:e}}},75773:(t,e,r)=>{"use strict";var i=r(67697),n=r(72560),s=r(75684);t.exports=i?function(t,e,r){return n.f(t,e,s(1,r))}:function(t,e,r){return t[e]=r,t}},75684:t=>{"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},76522:(t,e,r)=>{"use strict";var i=r(18360),n=r(72560),s=r(75684);t.exports=function(t,e,r){var o=i(e);o in t?n.f(t,o,s(0,r)):t[o]=r}},99455:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(77254).start,o=RangeError,a=isFinite,l=Math.abs,c=Date.prototype,h=c.toISOString,u=i(c.getTime),d=i(c.getUTCDate),p=i(c.getUTCFullYear),f=i(c.getUTCHours),m=i(c.getUTCMilliseconds),g=i(c.getUTCMinutes),A=i(c.getUTCMonth),y=i(c.getUTCSeconds);t.exports=n((function(){return"0385-07-25T07:06:39.999Z"!==h.call(new Date(-50000000000001))}))||!n((function(){h.call(new Date(NaN))}))?function(){if(!a(u(this)))throw new o("Invalid time value");var t=this,e=p(t),r=m(t),i=e<0?"-":e>9999?"+":"";return i+s(l(e),i?6:4,0)+"-"+s(A(t)+1,2,0)+"-"+s(d(t),2,0)+"T"+s(f(t),2,0)+":"+s(g(t),2,0)+":"+s(y(t),2,0)+"."+s(r,3,0)+"Z"}:h},81797:(t,e,r)=>{"use strict";var i=r(85027),n=r(35899),s=TypeError;t.exports=function(t){if(i(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new s("Incorrect hint");return n(this,t)}},62148:(t,e,r)=>{"use strict";var i=r(98702),n=r(72560);t.exports=function(t,e,r){return r.get&&i(r.get,e,{getter:!0}),r.set&&i(r.set,e,{setter:!0}),n.f(t,e,r)}},11880:(t,e,r)=>{"use strict";var i=r(69985),n=r(72560),s=r(98702),o=r(95014);t.exports=function(t,e,r,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(i(r)&&s(r,c,a),a.global)l?t[e]=r:o(e,r);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=r:n.f(t,e,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},6045:(t,e,r)=>{"use strict";var i=r(11880);t.exports=function(t,e,r){for(var n in e)i(t,n,e[n],r);return t}},95014:(t,e,r)=>{"use strict";var i=r(19037),n=Object.defineProperty;t.exports=function(t,e){try{n(i,t,{value:e,configurable:!0,writable:!0})}catch(r){i[t]=e}return e}},98494:(t,e,r)=>{"use strict";var i=r(23691),n=TypeError;t.exports=function(t,e){if(!delete t[e])throw new n("Cannot delete property "+i(e)+" of "+i(t))}},67697:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},21420:(t,e,r)=>{"use strict";var i,n,s,o,a=r(19037),l=r(21905),c=r(63514),h=a.structuredClone,u=a.ArrayBuffer,d=a.MessageChannel,p=!1;if(c)p=function(t){h(t,{transfer:[t]})};else if(u)try{d||(i=l("worker_threads"))&&(d=i.MessageChannel),d&&(n=new d,s=new u(2),o=function(t){n.port1.postMessage(null,[t])},2===s.byteLength&&(o(s),0===s.byteLength&&(p=o)))}catch(t){}t.exports=p},22659:t=>{"use strict";var e="object"==typeof document&&document.all,r=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:r}},36420:(t,e,r)=>{"use strict";var i=r(19037),n=r(48999),s=i.document,o=n(s)&&n(s.createElement);t.exports=function(t){return o?s.createElement(t):{}}},55565:t=>{"use strict";var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},37136:t=>{"use strict";t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},66338:t=>{"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},33265:(t,e,r)=>{"use strict";var i=r(36420)("span").classList,n=i&&i.constructor&&i.constructor.prototype;t.exports=n===Object.prototype?void 0:n},97365:(t,e,r)=>{"use strict";var i=r(30071).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},72532:(t,e,r)=>{"use strict";var i=r(88563),n=r(50806);t.exports=!i&&!n&&"object"==typeof window&&"object"==typeof document},83127:t=>{"use strict";t.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},88563:t=>{"use strict";t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},37298:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/MSIE|Trident/.test(i)},63221:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/ipad|iphone|ipod/i.test(i)&&"undefined"!=typeof Pebble},4764:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},50806:(t,e,r)=>{"use strict";var i=r(19037),n=r(6648);t.exports="process"===n(i.process)},27486:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/web0s(?!.*chrome)/i.test(i)},30071:t=>{"use strict";t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3615:(t,e,r)=>{"use strict";var i,n,s=r(19037),o=r(30071),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,h=c&&c.v8;h&&(n=(i=h.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!n&&o&&(!(i=o.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=o.match(/Chrome\/(\d+)/))&&(n=+i[1]),t.exports=n},27922:(t,e,r)=>{"use strict";var i=r(30071).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},72739:t=>{"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},56610:(t,e,r)=>{"use strict";var i=r(68844),n=Error,s=i("".replace),o=String(new n("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(o);t.exports=function(t,e){if(l&&"string"==typeof t&&!n.prepareStackTrace)for(;e--;)t=s(t,a,"");return t}},65411:(t,e,r)=>{"use strict";var i=r(75773),n=r(56610),s=r(49599),o=Error.captureStackTrace;t.exports=function(t,e,r,a){s&&(o?o(t,e):i(t,"stack",n(r,a)))}},49599:(t,e,r)=>{"use strict";var i=r(3689),n=r(75684);t.exports=!i((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",n(1,7)),7!==t.stack)}))},20445:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(85027),o=r(13841),a=Error.prototype.toString,l=n((function(){if(i){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==a.call(t))return!0}return"2: 1"!==a.call({message:1,name:2})||"Error"!==a.call({})}));t.exports=l?function(){var t=s(this),e=o(t.name,"Error"),r=o(t.message);return e?r?e+": "+r:e:r}:a},79989:(t,e,r)=>{"use strict";var i=r(19037),n=r(82474).f,s=r(75773),o=r(11880),a=r(95014),l=r(8758),c=r(35266);t.exports=function(t,e){var r,h,u,d,p,f=t.target,m=t.global,g=t.stat;if(r=m?i:g?i[f]||a(f,{}):(i[f]||{}).prototype)for(h in e){if(d=e[h],u=t.dontCallGetSet?(p=n(r,h))&&p.value:r[h],!c(m?h:f+(g?".":"#")+h,t.forced)&&void 0!==u){if(typeof d==typeof u)continue;l(d,u)}(t.sham||u&&u.sham)&&s(d,"sham",!0),o(r,h,d,t)}}},3689:t=>{"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},65773:(t,e,r)=>{"use strict";r(64043);var i=r(46576),n=r(11880),s=r(56308),o=r(3689),a=r(44201),l=r(75773),c=a("species"),h=RegExp.prototype;t.exports=function(t,e,r,u){var d=a(t),p=!o((function(){var e={};return e[d]=function(){return 7},7!==""[t](e)})),f=p&&!o((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[d]=/./[d]),r.exec=function(){return e=!0,null},r[d](""),!e}));if(!p||!f||r){var m=i(/./[d]),g=e(d,""[t],(function(t,e,r,n,o){var a=i(t),l=e.exec;return l===s||l===h.exec?p&&!o?{done:!0,value:m(e,r,n)}:{done:!0,value:a(r,e,n)}:{done:!1}}));n(String.prototype,t,g[0]),n(h,d,g[1])}u&&l(h[d],"sham",!0)}},37809:(t,e,r)=>{"use strict";var i=r(92297),n=r(6310),s=r(55565),o=r(54071),a=function(t,e,r,l,c,h,u,d){for(var p,f,m=c,g=0,A=!!u&&o(u,d);g0&&i(p)?(f=n(p),m=a(t,e,p,f,m,h-1)-1):(s(m+1),t[m]=p),m++),g++;return m};t.exports=a},71594:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},61735:(t,e,r)=>{"use strict";var i=r(97215),n=Function.prototype,s=n.apply,o=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?o.bind(s):function(){return o.apply(s,arguments)})},54071:(t,e,r)=>{"use strict";var i=r(46576),n=r(10509),s=r(97215),o=i(i.bind);t.exports=function(t,e){return n(t),void 0===e?t:s?o(t,e):function(){return t.apply(e,arguments)}}},97215:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},86761:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509),s=r(48999),o=r(36812),a=r(96004),l=r(97215),c=Function,h=i([].concat),u=i([].join),d={};t.exports=l?c.bind:function(t){var e=n(this),r=e.prototype,i=a(arguments,1),l=function(){var r=h(i,a(arguments));return this instanceof l?function(t,e,r){if(!o(d,e)){for(var i=[],n=0;n{"use strict";var i=r(97215),n=Function.prototype.call;t.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},33505:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509);t.exports=function(){return i(n(this))}},41236:(t,e,r)=>{"use strict";var i=r(67697),n=r(36812),s=Function.prototype,o=i&&Object.getOwnPropertyDescriptor,a=n(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!i||i&&o(s,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},52743:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509);t.exports=function(t,e,r){try{return i(n(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},46576:(t,e,r)=>{"use strict";var i=r(6648),n=r(68844);t.exports=function(t){if("Function"===i(t))return n(t)}},68844:(t,e,r)=>{"use strict";var i=r(97215),n=Function.prototype,s=n.call,o=i&&n.bind.bind(s,s);t.exports=i?o:function(t){return function(){return s.apply(t,arguments)}}},9093:t=>{"use strict";var e=TypeError;t.exports=function(t){var r=t&&t.alphabet;if(void 0===r||"base64"===r||"base64url"===r)return r||"base64";throw new e("Incorrect `alphabet` option")}},11427:(t,e,r)=>{"use strict";var i=r(22615),n=r(69985),s=r(85027),o=r(22302),a=r(91664),l=r(54849),c=r(44201),h=r(29019),u=c("asyncIterator");t.exports=function(t){var e,r=s(t),c=!0,d=l(r,u);return n(d)||(d=a(r),c=!1),void 0!==d?e=i(d,r):(e=r,c=!0),s(e),o(c?e:new h(o(e)))}},13807:(t,e,r)=>{"use strict";var i=r(22615),n=r(29019),s=r(85027),o=r(5185),a=r(22302),l=r(54849),c=r(44201)("asyncIterator");t.exports=function(t,e){var r=arguments.length<2?l(t,c):e;return r?s(i(r,t)):new n(a(o(t)))}},88277:(t,e,r)=>{"use strict";var i=r(19037);t.exports=function(t,e){var r=i[t],n=r&&r.prototype;return n&&n[e]}},76058:(t,e,r)=>{"use strict";var i=r(19037),n=r(69985);t.exports=function(t,e){return arguments.length<2?(r=i[t],n(r)?r:void 0):i[t]&&i[t][e];var r}},22302:t=>{"use strict";t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},36752:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(22302),o=r(91664);t.exports=function(t,e){e&&"string"==typeof t||n(t);var r=o(t);return s(n(void 0!==r?i(r,t):t))}},91664:(t,e,r)=>{"use strict";var i=r(50926),n=r(54849),s=r(981),o=r(9478),a=r(44201)("iterator");t.exports=function(t){if(!s(t))return n(t,a)||n(t,"@@iterator")||o[i(t)]}},5185:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(23691),a=r(91664),l=TypeError;t.exports=function(t,e){var r=arguments.length<2?a(t):e;if(n(r))return s(i(r,t));throw new l(o(t)+" is not iterable")}},92643:(t,e,r)=>{"use strict";var i=r(68844),n=r(92297),s=r(69985),o=r(6648),a=r(34327),l=i([].push);t.exports=function(t){if(s(t))return t;if(n(t)){for(var e=t.length,r=[],i=0;i{"use strict";var i=r(10509),n=r(981);t.exports=function(t,e){var r=t[e];return n(r)?void 0:i(r)}},41074:(t,e,r)=>{"use strict";var i=r(10509),n=r(85027),s=r(22615),o=r(68700),a=r(22302),l="Invalid size",c=RangeError,h=TypeError,u=Math.max,d=function(t,e,r,i){this.set=t,this.size=e,this.has=r,this.keys=i};d.prototype={getIterator:function(){return a(n(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}},t.exports=function(t){n(t);var e=+t.size;if(e!=e)throw new h(l);var r=o(e);if(r<0)throw new c(l);return new d(t,u(r,0),i(t.has),i(t.keys))}},27017:(t,e,r)=>{"use strict";var i=r(68844),n=r(90690),s=Math.floor,o=i("".charAt),a=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,i,u,d){var p=r+t.length,f=i.length,m=h;return void 0!==u&&(u=n(u),m=c),a(d,m,(function(n,a){var c;switch(o(a,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,r);case"'":return l(e,p);case"<":c=u[l(a,1,-1)];break;default:var h=+a;if(0===h)return n;if(h>f){var d=s(h/10);return 0===d?n:d<=f?void 0===i[d-1]?o(a,1):i[d-1]+o(a,1):n}c=i[h-1]}return void 0===c?"":c}))}},19037:function(t,e,r){"use strict";var i=function(t){return t&&t.Math===Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r.g&&r.g)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},36812:(t,e,r)=>{"use strict";var i=r(68844),n=r(90690),s=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(n(t),e)}},57248:t=>{"use strict";t.exports={}},20920:t=>{"use strict";t.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}},2688:(t,e,r)=>{"use strict";var i=r(76058);t.exports=i("document","documentElement")},68506:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(36420);t.exports=!i&&!n((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},15477:t=>{"use strict";var e=Array,r=Math.abs,i=Math.pow,n=Math.floor,s=Math.log,o=Math.LN2;t.exports={pack:function(t,a,l){var c,h,u,d=e(l),p=8*l-a-1,f=(1<>1,g=23===a?i(2,-24)-i(2,-77):0,A=t<0||0===t&&1/t<0?1:0,y=0;for((t=r(t))!=t||t===1/0?(h=t!=t?1:0,c=f):(c=n(s(t)/o),t*(u=i(2,-c))<1&&(c--,u*=2),(t+=c+m>=1?g/u:g*i(2,1-m))*u>=2&&(c++,u/=2),c+m>=f?(h=0,c=f):c+m>=1?(h=(t*u-1)*i(2,a),c+=m):(h=t*i(2,m-1)*i(2,a),c=0));a>=8;)d[y++]=255&h,h/=256,a-=8;for(c=c<0;)d[y++]=255&c,c/=256,p-=8;return d[--y]|=128*A,d},unpack:function(t,e){var r,n=t.length,s=8*n-e-1,o=(1<>1,l=s-7,c=n-1,h=t[c--],u=127&h;for(h>>=7;l>0;)u=256*u+t[c--],l-=8;for(r=u&(1<<-l)-1,u>>=-l,l+=e;l>0;)r=256*r+t[c--],l-=8;if(0===u)u=1-a;else{if(u===o)return r?NaN:h?-1/0:1/0;r+=i(2,e),u-=a}return(h?-1:1)*r*i(2,u-e)}}},94413:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(6648),o=Object,a=i("".split);t.exports=n((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?a(t,""):o(t)}:o},33457:(t,e,r)=>{"use strict";var i=r(69985),n=r(48999),s=r(49385);t.exports=function(t,e,r){var o,a;return s&&i(o=e.constructor)&&o!==r&&n(a=o.prototype)&&a!==r.prototype&&s(t,a),t}},6738:(t,e,r)=>{"use strict";var i=r(68844),n=r(69985),s=r(84091),o=i(Function.toString);n(s.inspectSource)||(s.inspectSource=function(t){return o(t)}),t.exports=s.inspectSource},62570:(t,e,r)=>{"use strict";var i=r(48999),n=r(75773);t.exports=function(t,e){i(e)&&"cause"in e&&n(t,"cause",e.cause)}},45375:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(57248),o=r(48999),a=r(36812),l=r(72560).f,c=r(72741),h=r(26062),u=r(27049),d=r(14630),p=r(71594),f=!1,m=d("meta"),g=0,A=function(t){l(t,m,{value:{objectID:"O"+g++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},f=!0;var t=c.f,e=n([].splice),r={};r[m]=1,t(r).length&&(c.f=function(r){for(var i=t(r),n=0,s=i.length;n{"use strict";var i,n,s,o=r(59834),a=r(19037),l=r(48999),c=r(75773),h=r(36812),u=r(84091),d=r(2713),p=r(57248),f="Object already initialized",m=a.TypeError,g=a.WeakMap;if(o||u.state){var A=u.state||(u.state=new g);A.get=A.get,A.has=A.has,A.set=A.set,i=function(t,e){if(A.has(t))throw new m(f);return e.facade=t,A.set(t,e),e},n=function(t){return A.get(t)||{}},s=function(t){return A.has(t)}}else{var y=d("state");p[y]=!0,i=function(t,e){if(h(t,y))throw new m(f);return e.facade=t,c(t,y,e),e},n=function(t){return h(t,y)?t[y]:{}},s=function(t){return h(t,y)}}t.exports={set:i,get:n,has:s,enforce:function(t){return s(t)?n(t):i(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=n(e)).type!==t)throw new m("Incompatible receiver, "+t+" required");return r}}}},93292:(t,e,r)=>{"use strict";var i=r(44201),n=r(9478),s=i("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||o[s]===t)}},92297:(t,e,r)=>{"use strict";var i=r(6648);t.exports=Array.isArray||function(t){return"Array"===i(t)}},9401:(t,e,r)=>{"use strict";var i=r(50926);t.exports=function(t){var e=i(t);return"BigInt64Array"===e||"BigUint64Array"===e}},69985:(t,e,r)=>{"use strict";var i=r(22659),n=i.all;t.exports=i.IS_HTMLDDA?function(t){return"function"==typeof t||t===n}:function(t){return"function"==typeof t}},19429:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(69985),o=r(50926),a=r(76058),l=r(6738),c=function(){},h=[],u=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=i(d.exec),f=!d.test(c),m=function(t){if(!s(t))return!1;try{return u(c,h,t),!0}catch(t){return!1}},g=function(t){if(!s(t))return!1;switch(o(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(d,l(t))}catch(t){return!0}};g.sham=!0,t.exports=!u||n((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?g:m},76251:(t,e,r)=>{"use strict";var i=r(36812);t.exports=function(t){return void 0!==t&&(i(t,"value")||i(t,"writable"))}},35266:(t,e,r)=>{"use strict";var i=r(3689),n=r(69985),s=/#|\.prototype\./,o=function(t,e){var r=l[a(t)];return r===h||r!==c&&(n(e)?i(e):!!e)},a=o.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",h=o.POLYFILL="P";t.exports=o},71973:(t,e,r)=>{"use strict";var i=r(48999),n=Math.floor;t.exports=Number.isInteger||function(t){return!i(t)&&isFinite(t)&&n(t)===t}},9603:(t,e,r)=>{"use strict";var i=r(50926),n=r(36812),s=r(981),o=r(44201),a=r(9478),l=o("iterator"),c=Object;t.exports=function(t){if(s(t))return!1;var e=c(t);return void 0!==e[l]||"@@iterator"in e||n(a,i(e))}},981:t=>{"use strict";t.exports=function(t){return null==t}},48999:(t,e,r)=>{"use strict";var i=r(69985),n=r(22659),s=n.all;t.exports=n.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:i(t)||t===s}:function(t){return"object"==typeof t?null!==t:i(t)}},53931:t=>{"use strict";t.exports=!1},55670:(t,e,r)=>{"use strict";var i=r(48999),n=r(618).get;t.exports=function(t){if(!i(t))return!1;var e=n(t);return!!e&&"RawJSON"===e.type}},91245:(t,e,r)=>{"use strict";var i=r(48999),n=r(6648),s=r(44201)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[s])?!!e:"RegExp"===n(t))}},30734:(t,e,r)=>{"use strict";var i=r(76058),n=r(69985),s=r(23622),o=r(39525),a=Object;t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return n(e)&&s(e.prototype,a(t))}},96704:(t,e,r)=>{"use strict";var i=r(22615);t.exports=function(t,e,r){for(var n,s,o=r?t:t.iterator,a=t.next;!(n=i(a,o)).done;)if(void 0!==(s=e(n.value)))return s}},18734:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(85027),o=r(23691),a=r(93292),l=r(6310),c=r(23622),h=r(5185),u=r(91664),d=r(72125),p=TypeError,f=function(t,e){this.stopped=t,this.result=e},m=f.prototype;t.exports=function(t,e,r){var g,A,y,v,x,b,_,w=r&&r.that,E=!(!r||!r.AS_ENTRIES),M=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),T=i(e,w),I=function(t){return g&&d(g,"normal",t),new f(!0,t)},R=function(t){return E?(s(t),C?T(t[0],t[1],I):T(t[0],t[1])):C?T(t,I):T(t)};if(M)g=t.iterator;else if(S)g=t;else{if(!(A=u(t)))throw new p(o(t)+" is not iterable");if(a(A)){for(y=0,v=l(t);v>y;y++)if((x=R(t[y]))&&c(m,x))return x;return new f(!1)}g=h(t,A)}for(b=M?t.next:g.next;!(_=n(b,g)).done;){try{x=R(_.value)}catch(t){d(g,"throw",t)}if("object"==typeof x&&x&&c(m,x))return x}return new f(!1)}},72125:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(54849);t.exports=function(t,e,r){var o,a;n(t);try{if(!(o=s(t,"return"))){if("throw"===e)throw r;return r}o=i(o,t)}catch(t){a=!0,o=t}if("throw"===e)throw r;if(a)throw o;return n(o),r}},30974:(t,e,r)=>{"use strict";var i=r(12013).IteratorPrototype,n=r(25391),s=r(75684),o=r(55997),a=r(9478),l=function(){return this};t.exports=function(t,e,r,c){var h=e+" Iterator";return t.prototype=n(i,{next:s(+!c,r)}),o(t,h,!1,!0),a[h]=l,t}},65419:(t,e,r)=>{"use strict";var i=r(22615),n=r(25391),s=r(75773),o=r(6045),a=r(44201),l=r(618),c=r(54849),h=r(12013).IteratorPrototype,u=r(27807),d=r(72125),p=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",g=l.set,A=function(t){var e=l.getterFor(t?m:f);return o(n(h),{next:function(){var r=e(this);if(t)return r.nextHandler();try{var i=r.done?void 0:r.nextHandler();return u(i,r.done)}catch(t){throw r.done=!0,t}},return:function(){var r=e(this),n=r.iterator;if(r.done=!0,t){var s=c(n,"return");return s?i(s,n):u(void 0,!0)}if(r.inner)try{d(r.inner.iterator,"normal")}catch(t){return d(n,"throw",t)}return d(n,"normal"),u(void 0,!0)}})},y=A(!0),v=A(!1);s(v,p,"Iterator Helper"),t.exports=function(t,e){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=e?m:f,i.nextHandler=t,i.counter=0,i.done=!1,g(this,i)};return r.prototype=e?y:v,r}},91934:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(53931),o=r(41236),a=r(69985),l=r(30974),c=r(61868),h=r(49385),u=r(55997),d=r(75773),p=r(11880),f=r(44201),m=r(9478),g=r(12013),A=o.PROPER,y=o.CONFIGURABLE,v=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,b=f("iterator"),_="keys",w="values",E="entries",M=function(){return this};t.exports=function(t,e,r,o,f,g,S){l(r,e,o);var C,T,I,R=function(t){if(t===f&&O)return O;if(!x&&t&&t in P)return P[t];switch(t){case _:case w:case E:return function(){return new r(this,t)}}return function(){return new r(this)}},B=e+" Iterator",L=!1,P=t.prototype,D=P[b]||P["@@iterator"]||f&&P[f],O=!x&&D||R(f),k="Array"===e&&P.entries||D;if(k&&(C=c(k.call(new t)))!==Object.prototype&&C.next&&(s||c(C)===v||(h?h(C,v):a(C[b])||p(C,b,M)),u(C,B,!0,!0),s&&(m[B]=M)),A&&f===w&&D&&D.name!==w&&(!s&&y?d(P,"name",w):(L=!0,O=function(){return n(D,this)})),f)if(T={values:R(w),keys:g?O:R(_),entries:R(E)},S)for(I in T)(x||L||!(I in P))&&p(P,I,T[I]);else i({target:e,proto:!0,forced:x||L},T);return s&&!S||P[b]===O||p(P,b,O,{name:f}),m[e]=O,T}},47082:(t,e,r)=>{"use strict";var i=r(22615),n=r(88983),s=function(t,e){return[e,t]};t.exports=function(){return i(n,this,s)}},88983:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(22302),a=r(65419),l=r(71228),c=a((function(){var t=this.iterator,e=s(i(this.next,t));if(!(this.done=!!e.done))return l(t,this.mapper,[e.value,this.counter++],!0)}));t.exports=function(t){return s(this),n(t),new c(o(this),{mapper:t})}},12013:(t,e,r)=>{"use strict";var i,n,s,o=r(3689),a=r(69985),l=r(48999),c=r(25391),h=r(61868),u=r(11880),d=r(44201),p=r(53931),f=d("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(n=h(h(s)))!==Object.prototype&&(i=n):m=!0),!l(i)||o((function(){var t={};return i[f].call(t)!==t}))?i={}:p&&(i=c(i)),a(i[f])||u(i,f,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:m}},9478:t=>{"use strict";t.exports={}},6310:(t,e,r)=>{"use strict";var i=r(43126);t.exports=function(t){return i(t.length)}},98702:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(69985),o=r(36812),a=r(67697),l=r(41236).CONFIGURABLE,c=r(6738),h=r(618),u=h.enforce,d=h.get,p=String,f=Object.defineProperty,m=i("".slice),g=i("".replace),A=i([].join),y=a&&!n((function(){return 8!==f((function(){}),"length",{value:8}).length})),v=String(String).split("String"),x=t.exports=function(t,e,r){"Symbol("===m(p(e),0,7)&&(e="["+g(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!o(t,"name")||l&&t.name!==e)&&(a?f(t,"name",{value:e,configurable:!0}):t.name=e),y&&r&&o(r,"arity")&&t.length!==r.arity&&f(t,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=u(t);return o(i,"source")||(i.source=A(v,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return s(this)&&d(this).source||c(this)}),"toString")},83914:(t,e,r)=>{"use strict";var i=r(68844),n=Map.prototype;t.exports={Map,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete),proto:n}},10613:(t,e,r)=>{"use strict";var i=r(68844),n=r(96704),s=r(83914),o=s.Map,a=s.proto,l=i(a.forEach),c=i(a.entries),h=c(new o).next;t.exports=function(t,e,r){return r?n({iterator:c(t),next:h},(function(t){return e(t[1],t[0])})):l(t,e)}},41432:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(69985),o=r(85027),a=TypeError;t.exports=function(t,e){var r,l=o(this),c=n(l.get),h=n(l.has),u=n(l.set),d=arguments.length>2?arguments[2]:void 0;if(!s(e)&&!s(d))throw new a("At least one callback required");return i(h,l,t)?(r=i(c,l,t),s(e)&&(r=e(r),i(u,l,t,r))):s(d)&&(r=d(),i(u,l,t,r)),r}},21745:t=>{"use strict";var e=Math.expm1,r=Math.exp;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!==e(-2e-17)?function(t){var e=+t;return 0===e?e:e>-1e-6&&e<1e-6?e+e*e/2:r(e)-1}:e},76043:(t,e,r)=>{"use strict";var i=r(40134);t.exports=Math.f16round||function(t){return i(t,.0009765625,65504,6103515625e-14)}},40134:(t,e,r)=>{"use strict";var i=r(55680),n=Math.abs,s=2220446049250313e-31,o=1/s;t.exports=function(t,e,r,a){var l=+t,c=n(l),h=i(l);if(cr||d!=d?h*(1/0):h*d}},37788:(t,e,r)=>{"use strict";var i=r(40134);t.exports=Math.fround||function(t){return i(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},4736:t=>{"use strict";var e=Math.log,r=Math.LOG10E;t.exports=Math.log10||function(t){return e(t)*r}},93956:t=>{"use strict";var e=Math.log;t.exports=Math.log1p||function(t){var r=+t;return r>-1e-8&&r<1e-8?r-r*r/2:e(1+r)}},84463:t=>{"use strict";t.exports=Math.scale||function(t,e,r,i,n){var s=+t,o=+e,a=+r,l=+i,c=+n;return s!=s||o!=o||a!=a||l!=l||c!=c?NaN:s===1/0||s===-1/0?s:(s-o)*(c-l)/(a-o)+l}},55680:t=>{"use strict";t.exports=Math.sign||function(t){var e=+t;return 0===e||e!=e?e:e<0?-1:1}},58828:t=>{"use strict";var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?r:e)(i)}},80231:(t,e,r)=>{"use strict";var i,n,s,o,a,l=r(19037),c=r(54071),h=r(82474).f,u=r(99886).set,d=r(34410),p=r(4764),f=r(63221),m=r(27486),g=r(50806),A=l.MutationObserver||l.WebKitMutationObserver,y=l.document,v=l.process,x=l.Promise,b=h(l,"queueMicrotask"),_=b&&b.value;if(!_){var w=new d,E=function(){var t,e;for(g&&(t=v.domain)&&t.exit();e=w.get();)try{e()}catch(t){throw w.head&&i(),t}t&&t.enter()};p||g||m||!A||!y?!f&&x&&x.resolve?((o=x.resolve(void 0)).constructor=x,a=c(o.then,o),i=function(){a(E)}):g?i=function(){v.nextTick(E)}:(u=c(u,l),i=function(){u(E)}):(n=!0,s=y.createTextNode(""),new A(E).observe(s,{characterData:!0}),i=function(){s.data=n=!n}),_=function(t){w.head||i(),w.add(t)}}t.exports=_},22818:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t}))},48742:(t,e,r)=>{"use strict";var i=r(10509),n=TypeError,s=function(t){var e,r;this.promise=new t((function(t,i){if(void 0!==e||void 0!==r)throw new n("Bad Promise constructor");e=t,r=i})),this.resolve=i(e),this.reject=i(r)};t.exports.f=function(t){return new s(t)}},13841:(t,e,r)=>{"use strict";var i=r(34327);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},4654:t=>{"use strict";var e=RangeError;t.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},42124:(t,e,r)=>{"use strict";var i=r(91245),n=TypeError;t.exports=function(t){if(i(t))throw new n("The method doesn't accept regular expressions");return t}},70046:(t,e,r)=>{"use strict";var i=r(19037).isFinite;t.exports=Number.isFinite||function(t){return"number"==typeof t&&i(t)}},14818:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(34327),a=r(61435).trim,l=r(86350),c=s("".charAt),h=i.parseFloat,u=i.Symbol,d=u&&u.iterator,p=1/h(l+"-0")!=-1/0||d&&!n((function(){h(Object(d))}));t.exports=p?function(t){var e=a(o(t)),r=h(e);return 0===r&&"-"===c(e,0)?-0:r}:h},67897:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(34327),a=r(61435).trim,l=r(86350),c=i.parseInt,h=i.Symbol,u=h&&h.iterator,d=/^[+-]?0x/i,p=s(d.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||u&&!n((function(){c(Object(u))}));t.exports=f?function(t,e){var r=a(o(t));return c(r,e>>>0||(p(d,r)?16:10))}:c},98554:(t,e,r)=>{"use strict";var i=r(618),n=r(30974),s=r(27807),o=r(981),a=r(48999),l=r(62148),c=r(67697),h="Incorrect Iterator.range arguments",u="NumericRangeIterator",d=i.set,p=i.getterFor(u),f=RangeError,m=TypeError,g=n((function(t,e,r,i,n,s){if(typeof t!=i||e!==1/0&&e!==-1/0&&typeof e!=i)throw new m(h);if(t===1/0||t===-1/0)throw new f(h);var l,p=e>t,g=!1;if(void 0===r)l=void 0;else if(a(r))l=r.step,g=!!r.inclusive;else{if(typeof r!=i)throw new m(h);l=r}if(o(l)&&(l=p?s:-s),typeof l!=i)throw new m(h);if(l===1/0||l===-1/0||l===n&&t!==e)throw new f(h);d(this,{type:u,start:t,end:e,step:l,inclusive:g,hitsEnd:t!=t||e!=e||l!=l||e>t!=l>n,currentCount:n,zero:n}),c||(this.start=t,this.end=e,this.step=l,this.inclusive=g)}),u,(function(){var t=p(this);if(t.hitsEnd)return s(void 0,!0);var e=t.start,r=t.end,i=e+t.step*t.currentCount++;i===r&&(t.hitsEnd=!0);var n=t.inclusive;return(r>e?n?i>r:i>=r:n?r>i:r>=i)?(t.hitsEnd=!0,s(void 0,!0)):s(i,!1)})),A=function(t){l(g.prototype,t,{get:function(){return p(this)[t]},set:function(){},configurable:!0,enumerable:!1})};c&&(A("start"),A("end"),A("inclusive"),A("step")),t.exports=g},45394:(t,e,r)=>{"use strict";var i=r(67697),n=r(68844),s=r(22615),o=r(3689),a=r(20300),l=r(7518),c=r(49556),h=r(90690),u=r(94413),d=Object.assign,p=Object.defineProperty,f=n([].concat);t.exports=!d||o((function(){if(i&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!==d({},t)[r]||a(d({},e)).join("")!==n}))?function(t,e){for(var r=h(t),n=arguments.length,o=1,d=l.f,p=c.f;n>o;)for(var m,g=u(arguments[o++]),A=d?f(a(g),d(g)):a(g),y=A.length,v=0;y>v;)m=A[v++],i&&!s(p,g,m)||(r[m]=g[m]);return r}:d},25391:(t,e,r)=>{"use strict";var i,n=r(85027),s=r(98920),o=r(72739),a=r(57248),l=r(2688),c=r(36420),h=r(2713),u="prototype",d="script",p=h("IE_PROTO"),f=function(){},m=function(t){return"<"+d+">"+t+""},g=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},A=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;A="undefined"!=typeof document?document.domain&&i?g(i):(e=c("iframe"),r="java"+d+":",e.style.display="none",l.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F):g(i);for(var n=o.length;n--;)delete A[u][o[n]];return A()};a[p]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(f[u]=n(t),r=new f,f[u]=null,r[p]=t):r=A(),void 0===e?r:s.f(r,e)}},98920:(t,e,r)=>{"use strict";var i=r(67697),n=r(15648),s=r(72560),o=r(85027),a=r(65290),l=r(20300);e.f=i&&!n?Object.defineProperties:function(t,e){o(t);for(var r,i=a(e),n=l(e),c=n.length,h=0;c>h;)s.f(t,r=n[h++],i[r]);return t}},72560:(t,e,r)=>{"use strict";var i=r(67697),n=r(68506),s=r(15648),o=r(85027),a=r(18360),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",p="writable";e.f=i?s?function(t,e,r){if(o(t),e=a(e),o(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]){var i=h(t,e);i&&i[p]&&(t[e]=r.value,r={configurable:d in r?r[d]:i[d],enumerable:u in r?r[u]:i[u],writable:!1})}return c(t,e,r)}:c:function(t,e,r){if(o(t),e=a(e),o(r),n)try{return c(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},82474:(t,e,r)=>{"use strict";var i=r(67697),n=r(22615),s=r(49556),o=r(75684),a=r(65290),l=r(18360),c=r(36812),h=r(68506),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(t,e){if(t=a(t),e=l(e),h)try{return u(t,e)}catch(t){}if(c(t,e))return o(!n(s.f,t,e),t[e])}},26062:(t,e,r)=>{"use strict";var i=r(6648),n=r(65290),s=r(72741).f,o=r(9015),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"Window"===i(t)?function(t){try{return s(t)}catch(t){return o(a)}}(t):s(n(t))}},72741:(t,e,r)=>{"use strict";var i=r(54948),n=r(72739).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,n)}},7518:(t,e)=>{"use strict";e.f=Object.getOwnPropertySymbols},61868:(t,e,r)=>{"use strict";var i=r(36812),n=r(69985),s=r(90690),o=r(2713),a=r(81748),l=o("IE_PROTO"),c=Object,h=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=s(t);if(i(e,l))return e[l];var r=e.constructor;return n(r)&&e instanceof r?r.prototype:e instanceof c?h:null}},27049:(t,e,r)=>{"use strict";var i=r(3689),n=r(48999),s=r(6648),o=r(11655),a=Object.isExtensible,l=i((function(){a(1)}));t.exports=l||o?function(t){return!!n(t)&&(!o||"ArrayBuffer"!==s(t))&&(!a||a(t))}:a},23622:(t,e,r)=>{"use strict";var i=r(68844);t.exports=i({}.isPrototypeOf)},42351:(t,e,r)=>{"use strict";var i=r(618),n=r(30974),s=r(27807),o=r(36812),a=r(20300),l=r(90690),c="Object Iterator",h=i.set,u=i.getterFor(c);t.exports=n((function(t,e){var r=l(t);h(this,{type:c,mode:e,object:r,keys:a(r),index:0})}),"Object",(function(){for(var t=u(this),e=t.keys;;){if(null===e||t.index>=e.length)return t.object=t.keys=null,s(void 0,!0);var r=e[t.index++],i=t.object;if(o(i,r)){switch(t.mode){case"keys":return s(r,!1);case"values":return s(i[r],!1)}return s([r,i[r]],!1)}}}))},54948:(t,e,r)=>{"use strict";var i=r(68844),n=r(36812),s=r(65290),o=r(84328).indexOf,a=r(57248),l=i([].push);t.exports=function(t,e){var r,i=s(t),c=0,h=[];for(r in i)!n(a,r)&&n(i,r)&&l(h,r);for(;e.length>c;)n(i,r=e[c++])&&(~o(h,r)||l(h,r));return h}},20300:(t,e,r)=>{"use strict";var i=r(54948),n=r(72739);t.exports=Object.keys||function(t){return i(t,n)}},49556:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);e.f=n?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},90600:(t,e,r)=>{"use strict";var i=r(53931),n=r(19037),s=r(3689),o=r(27922);t.exports=i||!s((function(){if(!(o&&o<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete n[t]}}))},49385:(t,e,r)=>{"use strict";var i=r(52743),n=r(85027),s=r(23550);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=i(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return n(r),s(i),e?t(r,i):r.__proto__=i,r}}():void 0)},49419:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(68844),o=r(61868),a=r(20300),l=r(65290),c=s(r(49556).f),h=s([].push),u=i&&n((function(){var t=Object.create(null);return t[2]=2,!c(t,2)})),d=function(t){return function(e){for(var r,n=l(e),s=a(n),d=u&&null===o(n),p=s.length,f=0,m=[];p>f;)r=s[f++],i&&!(d?r in n:c(n,r))||h(m,t?[r,n[r]]:n[r]);return m}};t.exports={entries:d(!0),values:d(!1)}},65073:(t,e,r)=>{"use strict";var i=r(23043),n=r(50926);t.exports=i?{}.toString:function(){return"[object "+n(this)+"]"}},35899:(t,e,r)=>{"use strict";var i=r(22615),n=r(69985),s=r(48999),o=TypeError;t.exports=function(t,e){var r,a;if("string"===e&&n(r=t.toString)&&!s(a=i(r,t)))return a;if(n(r=t.valueOf)&&!s(a=i(r,t)))return a;if("string"!==e&&n(r=t.toString)&&!s(a=i(r,t)))return a;throw new o("Can't convert object to primitive value")}},19152:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=r(72741),o=r(7518),a=r(85027),l=n([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=s.f(a(t)),r=o.f;return r?l(e,r(t)):e}},46675:(t,e,r)=>{"use strict";var i=r(68844),n=r(36812),s=SyntaxError,o=parseInt,a=String.fromCharCode,l=i("".charAt),c=i("".slice),h=i(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var r=!0,i="";e{"use strict";var i=r(19037);t.exports=i},9302:t=>{"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},87073:(t,e,r)=>{"use strict";var i=r(19037),n=r(17919),s=r(69985),o=r(35266),a=r(6738),l=r(44201),c=r(72532),h=r(88563),u=r(53931),d=r(3615),p=n&&n.prototype,f=l("species"),m=!1,g=s(i.PromiseRejectionEvent),A=o("Promise",(function(){var t=a(n),e=t!==String(n);if(!e&&66===d)return!0;if(u&&(!p.catch||!p.finally))return!0;if(!d||d<51||!/native code/.test(t)){var r=new n((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};if((r.constructor={})[f]=i,!(m=r.then((function(){}))instanceof i))return!0}return!e&&(c||h)&&!g}));t.exports={CONSTRUCTOR:A,REJECTION_EVENT:g,SUBCLASSING:m}},17919:(t,e,r)=>{"use strict";var i=r(19037);t.exports=i.Promise},72945:(t,e,r)=>{"use strict";var i=r(85027),n=r(48999),s=r(48742);t.exports=function(t,e){if(i(t),n(e)&&e.constructor===t)return e;var r=s.f(t);return(0,r.resolve)(e),r.promise}},562:(t,e,r)=>{"use strict";var i=r(17919),n=r(86431),s=r(87073).CONSTRUCTOR;t.exports=s||!n((function(t){i.all(t).then(void 0,(function(){}))}))},38055:(t,e,r)=>{"use strict";var i=r(72560).f;t.exports=function(t,e,r){r in t||i(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},34410:t=>{"use strict";var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},33666:(t,e,r)=>{"use strict";r(56646),r(51090);var i=r(76058),n=r(68844),s=r(83430),o=i("Map"),a=i("WeakMap"),l=n([].push),c=s("metadata"),h=c.store||(c.store=new a),u=function(t,e,r){var i=h.get(t);if(!i){if(!r)return;h.set(t,i=new o)}var n=i.get(e);if(!n){if(!r)return;i.set(e,n=new o)}return n};t.exports={store:h,getMap:u,has:function(t,e,r){var i=u(e,r,!1);return void 0!==i&&i.has(t)},get:function(t,e,r){var i=u(e,r,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,r,i){u(r,i,!0).set(t,e)},keys:function(t,e){var r=u(t,e,!1),i=[];return r&&r.forEach((function(t,e){l(i,e)})),i},toKey:function(t){return void 0===t||"symbol"==typeof t?t:String(t)}}},66100:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(69985),o=r(6648),a=r(56308),l=TypeError;t.exports=function(t,e){var r=t.exec;if(s(r)){var c=i(r,t,e);return null!==c&&n(c),c}if("RegExp"===o(t))return i(a,t,e);throw new l("RegExp#exec called on incompatible receiver")}},56308:(t,e,r)=>{"use strict";var i,n,s=r(22615),o=r(68844),a=r(34327),l=r(69633),c=r(87901),h=r(83430),u=r(25391),d=r(618).get,p=r(62100),f=r(26738),m=h("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,A=g,y=o("".charAt),v=o("".indexOf),x=o("".replace),b=o("".slice),_=(n=/b*/g,s(g,i=/a/,"a"),s(g,n,"a"),0!==i.lastIndex||0!==n.lastIndex),w=c.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(_||E||w||p||f)&&(A=function(t){var e,r,i,n,o,c,h,p=this,f=d(p),M=a(t),S=f.raw;if(S)return S.lastIndex=p.lastIndex,e=s(A,S,M),p.lastIndex=S.lastIndex,e;var C=f.groups,T=w&&p.sticky,I=s(l,p),R=p.source,B=0,L=M;if(T&&(I=x(I,"y",""),-1===v(I,"g")&&(I+="g"),L=b(M,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(M,p.lastIndex-1))&&(R="(?: "+R+")",L=" "+L,B++),r=new RegExp("^(?:"+R+")",I)),E&&(r=new RegExp("^"+R+"$(?!\\s)",I)),_&&(i=p.lastIndex),n=s(g,T?r:p,L),T?n?(n.input=b(n.input,B),n[0]=b(n[0],B),n.index=p.lastIndex,p.lastIndex+=n[0].length):p.lastIndex=0:_&&n&&(p.lastIndex=p.global?n.index+n[0].length:i),E&&n&&n.length>1&&s(m,n[0],r,(function(){for(o=1;o{"use strict";var i=r(85027);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},63477:(t,e,r)=>{"use strict";var i=r(22615),n=r(36812),s=r(23622),o=r(69633),a=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in a||n(t,"flags")||!s(a,t)?e:i(o,t)}},87901:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp,s=i((function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),o=s||i((function(){return!n("a","y").sticky})),a=s||i((function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},62100:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp;t.exports=i((function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},26738:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp;t.exports=i((function(){var t=n("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},74684:(t,e,r)=>{"use strict";var i=r(981),n=TypeError;t.exports=function(t){if(i(t))throw new n("Can't call method on "+t);return t}},68600:t=>{"use strict";t.exports=function(t,e){return t===e||t!=t&&e!=e}},70953:t=>{"use strict";t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},8552:(t,e,r)=>{"use strict";var i,n=r(19037),s=r(61735),o=r(69985),a=r(83127),l=r(30071),c=r(96004),h=r(21500),u=n.Function,d=/MSIE .\./.test(l)||a&&((i=n.Bun.version.split(".")).length<3||"0"===i[0]&&(i[1]<3||"3"===i[1]&&"0"===i[2]));t.exports=function(t,e){var r=e?2:1;return d?function(i,n){var a=h(arguments.length,1)>r,l=o(i)?i:u(i),d=a?c(arguments,r):[],p=a?function(){s(l,this,d)}:l;return e?t(p,n):t(p)}:t}},3097:(t,e,r)=>{"use strict";var i=r(61034),n=r(48774),s=i.Set,o=i.add;t.exports=function(t){var e=new s;return n(t,(function(t){o(e,t)})),e}},27748:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(3097),o=r(17026),a=r(41074),l=r(48774),c=r(96704),h=n.has,u=n.remove;t.exports=function(t){var e=i(this),r=a(t),n=s(e);return o(e)<=r.size?l(e,(function(t){r.includes(t)&&u(n,t)})):c(r.getIterator(),(function(t){h(e,t)&&u(n,t)})),n}},61034:(t,e,r)=>{"use strict";var i=r(68844),n=Set.prototype;t.exports={Set,add:i(n.add),has:i(n.has),remove:i(n.delete),proto:n}},72948:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(17026),o=r(41074),a=r(48774),l=r(96704),c=n.Set,h=n.add,u=n.has;t.exports=function(t){var e=i(this),r=o(t),n=new c;return s(e)>r.size?l(r.getIterator(),(function(t){u(e,t)&&h(n,t)})):a(e,(function(t){r.includes(t)&&h(n,t)})),n}},97795:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).has,s=r(17026),o=r(41074),a=r(48774),l=r(96704),c=r(72125);t.exports=function(t){var e=i(this),r=o(t);if(s(e)<=r.size)return!1!==a(e,(function(t){if(r.includes(t))return!1}),!0);var h=r.getIterator();return!1!==l(h,(function(t){if(n(e,t))return c(h,"normal",!1)}))}},26951:(t,e,r)=>{"use strict";var i=r(10029),n=r(17026),s=r(48774),o=r(41074);t.exports=function(t){var e=i(this),r=o(t);return!(n(e)>r.size)&&!1!==s(e,(function(t){if(!r.includes(t))return!1}),!0)}},3894:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).has,s=r(17026),o=r(41074),a=r(96704),l=r(72125);t.exports=function(t){var e=i(this),r=o(t);if(s(e){"use strict";var i=r(68844),n=r(96704),s=r(61034),o=s.Set,a=s.proto,l=i(a.forEach),c=i(a.keys),h=c(new o).next;t.exports=function(t,e,r){return r?n({iterator:c(t),next:h},e):l(t,e)}},53234:(t,e,r)=>{"use strict";var i=r(76058),n=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var e=i("Set");try{(new e)[t](n(0));try{return(new e)[t](n(-1)),!1}catch(t){return!0}}catch(t){return!1}}},17026:(t,e,r)=>{"use strict";var i=r(52743),n=r(61034);t.exports=i(n.proto,"size","get")||function(t){return t.size}},14241:(t,e,r)=>{"use strict";var i=r(76058),n=r(62148),s=r(44201),o=r(67697),a=s("species");t.exports=function(t){var e=i(t);o&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},62289:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(3097),o=r(41074),a=r(96704),l=n.add,c=n.has,h=n.remove;t.exports=function(t){var e=i(this),r=o(t).getIterator(),n=s(e);return a(r,(function(t){c(e,t)?h(n,t):l(n,t)})),n}},55997:(t,e,r)=>{"use strict";var i=r(72560).f,n=r(36812),s=r(44201)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!n(t,s)&&i(t,s,{configurable:!0,value:e})}},75674:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).add,s=r(3097),o=r(41074),a=r(96704);t.exports=function(t){var e=i(this),r=o(t).getIterator(),l=s(e);return a(r,(function(t){n(l,t)})),l}},2713:(t,e,r)=>{"use strict";var i=r(83430),n=r(14630),s=i("keys");t.exports=function(t){return s[t]||(s[t]=n(t))}},84091:(t,e,r)=>{"use strict";var i=r(19037),n=r(95014),s="__core-js_shared__",o=i[s]||n(s,{});t.exports=o},83430:(t,e,r)=>{"use strict";var i=r(53931),n=r(84091);(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.34.0",mode:i?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE",source:"https://github.com/zloirock/core-js"})},76373:(t,e,r)=>{"use strict";var i=r(85027),n=r(52655),s=r(981),o=r(44201)("species");t.exports=function(t,e){var r,a=i(t).constructor;return void 0===a||s(r=i(a)[o])?e:n(r)}},8195:(t,e,r)=>{"use strict";var i=r(68844),n=r(65290),s=r(34327),o=r(6310),a=TypeError,l=i([].push),c=i([].join);t.exports=function(t){var e=n(t),r=o(e);if(!r)return"";for(var i=arguments.length,h=[],u=0;;){var d=e[u++];if(void 0===d)throw new a("Incorrect template");if(l(h,s(d)),u===r)return c(h,"");u{"use strict";var i=r(3689);t.exports=function(t){return i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},10730:(t,e,r)=>{"use strict";var i=r(68844),n=r(68700),s=r(34327),o=r(74684),a=i("".charAt),l=i("".charCodeAt),c=i("".slice),h=function(t){return function(e,r){var i,h,u=s(o(e)),d=n(r),p=u.length;return d<0||d>=p?t?"":void 0:(i=l(u,d))<55296||i>56319||d+1===p||(h=l(u,d+1))<56320||h>57343?t?a(u,d):i:t?c(u,d,d+2):h-56320+(i-55296<<10)+65536}};t.exports={codeAt:h(!1),charAt:h(!0)}},35947:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(i)},77254:(t,e,r)=>{"use strict";var i=r(68844),n=r(43126),s=r(34327),o=r(90534),a=r(74684),l=i(o),c=i("".slice),h=Math.ceil,u=function(t){return function(e,r,i){var o,u,d=s(a(e)),p=n(r),f=d.length,m=void 0===i?" ":s(i);return p<=f||""===m?d:((u=l(m,h((o=p-f)/m.length))).length>o&&(u=c(u,0,o)),t?d+u:u+d)}};t.exports={start:u(!1),end:u(!0)}},98985:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=String.fromCharCode,o=i("String","fromCodePoint"),a=n("".charAt),l=n("".charCodeAt),c=n("".indexOf),h=n("".slice),u=function(t,e){var r=l(t,e);return r>=48&&r<=57},d=function(t,e,r){if(r>=t.length)return-1;for(var i=0;e=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1};t.exports=function(t){for(var e,r="",i=0,n=0;(n=c(t,"\\",n))>-1;){if(r+=h(t,i,n),++n===t.length)return;var l=a(t,n++);switch(l){case"b":r+="\b";break;case"t":r+="\t";break;case"n":r+="\n";break;case"v":r+="\v";break;case"f":r+="\f";break;case"r":r+="\r";break;case"\r":n1114111)return;r+=o(e);break;default:if(u(l,0))return;r+=l}i=n}return r+h(t,i)}},6430:(t,e,r)=>{"use strict";var i=r(68844),n=2147483647,s=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",l=RangeError,c=i(o.exec),h=Math.floor,u=String.fromCharCode,d=i("".charCodeAt),p=i([].join),f=i([].push),m=i("".replace),g=i("".split),A=i("".toLowerCase),y=function(t){return t+22+75*(t<26)},v=function(t,e,r){var i=0;for(t=r?h(t/700):t>>1,t+=h(t/e);t>455;)t=h(t/35),i+=36;return h(i+36*t/(t+38))},x=function(t){var e=[];t=function(t){for(var e=[],r=0,i=t.length;r=55296&&n<=56319&&r=o&&ih((n-c)/b))throw new l(a);for(c+=(x-o)*b,o=x,r=0;rn)throw new l(a);if(i===o){for(var _=c,w=36;;){var E=w<=m?1:w>=m+26?26:w-m;if(_{"use strict";var i=r(68700),n=r(34327),s=r(74684),o=RangeError;t.exports=function(t){var e=n(s(this)),r="",a=i(t);if(a<0||a===1/0)throw new o("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(e+=e))1&a&&(r+=e);return r}},79558:(t,e,r)=>{"use strict";var i=r(61435).end,n=r(75984);t.exports=n("trimEnd")?function(){return i(this)}:"".trimEnd},75984:(t,e,r)=>{"use strict";var i=r(41236).PROPER,n=r(3689),s=r(86350);t.exports=function(t){return n((function(){return!!s[t]()||"​…᠎"!=="​…᠎"[t]()||i&&s[t].name!==t}))}},72291:(t,e,r)=>{"use strict";var i=r(61435).start,n=r(75984);t.exports=n("trimStart")?function(){return i(this)}:"".trimStart},61435:(t,e,r)=>{"use strict";var i=r(68844),n=r(74684),s=r(34327),o=r(86350),a=i("".replace),l=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),h=function(t){return function(e){var r=s(n(e));return 1&t&&(r=a(r,l,"")),2&t&&(r=a(r,c,"$1")),r}};t.exports={start:h(1),end:h(2),trim:h(3)}},63514:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(3615),o=r(72532),a=r(88563),l=r(50806),c=i.structuredClone;t.exports=!!c&&!n((function(){if(a&&s>92||l&&s>94||o&&s>97)return!1;var t=new ArrayBuffer(8),e=c(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength}))},50146:(t,e,r)=>{"use strict";var i=r(3615),n=r(3689),s=r(19037).String;t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},13032:(t,e,r)=>{"use strict";var i=r(22615),n=r(76058),s=r(44201),o=r(11880);t.exports=function(){var t=n("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,a=s("toPrimitive");e&&!e[a]&&o(e,a,(function(t){return i(r,this)}),{arity:1})}},18992:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=i("Symbol"),o=s.keyFor,a=n(s.prototype.valueOf);t.exports=s.isRegisteredSymbol||function(t){try{return void 0!==o(a(t))}catch(t){return!1}}},8957:(t,e,r)=>{"use strict";for(var i=r(83430),n=r(76058),s=r(68844),o=r(30734),a=r(44201),l=n("Symbol"),c=l.isWellKnownSymbol,h=n("Object","getOwnPropertyNames"),u=s(l.prototype.valueOf),d=i("wks"),p=0,f=h(l),m=f.length;p{"use strict";var i=r(50146);t.exports=i&&!!Symbol.for&&!!Symbol.keyFor},99886:(t,e,r)=>{"use strict";var i,n,s,o,a=r(19037),l=r(61735),c=r(54071),h=r(69985),u=r(36812),d=r(3689),p=r(2688),f=r(96004),m=r(36420),g=r(21500),A=r(4764),y=r(50806),v=a.setImmediate,x=a.clearImmediate,b=a.process,_=a.Dispatch,w=a.Function,E=a.MessageChannel,M=a.String,S=0,C={},T="onreadystatechange";d((function(){i=a.location}));var I=function(t){if(u(C,t)){var e=C[t];delete C[t],e()}},R=function(t){return function(){I(t)}},B=function(t){I(t.data)},L=function(t){a.postMessage(M(t),i.protocol+"//"+i.host)};v&&x||(v=function(t){g(arguments.length,1);var e=h(t)?t:w(t),r=f(arguments,1);return C[++S]=function(){l(e,void 0,r)},n(S),S},x=function(t){delete C[t]},y?n=function(t){b.nextTick(R(t))}:_&&_.now?n=function(t){_.now(R(t))}:E&&!A?(o=(s=new E).port2,s.port1.onmessage=B,n=c(o.postMessage,o)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&i&&"file:"!==i.protocol&&!d(L)?(n=L,a.addEventListener("message",B,!1)):n=T in m("script")?function(t){p.appendChild(m("script"))[T]=function(){p.removeChild(this),I(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:v,clear:x}},23648:(t,e,r)=>{"use strict";var i=r(68844);t.exports=i(1..valueOf)},27578:(t,e,r)=>{"use strict";var i=r(68700),n=Math.max,s=Math.min;t.exports=function(t,e){var r=i(t);return r<0?n(r+e,0):s(r,e)}},71530:(t,e,r)=>{"use strict";var i=r(88732),n=TypeError;t.exports=function(t){var e=i(t,"number");if("number"==typeof e)throw new n("Can't convert number to bigint");return BigInt(e)}},19842:(t,e,r)=>{"use strict";var i=r(68700),n=r(43126),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=i(t),r=n(e);if(e!==r)throw new s("Wrong length or index");return r}},65290:(t,e,r)=>{"use strict";var i=r(94413),n=r(74684);t.exports=function(t){return i(n(t))}},68700:(t,e,r)=>{"use strict";var i=r(58828);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},43126:(t,e,r)=>{"use strict";var i=r(68700),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},90690:(t,e,r)=>{"use strict";var i=r(74684),n=Object;t.exports=function(t){return n(i(t))}},83250:(t,e,r)=>{"use strict";var i=r(15904),n=RangeError;t.exports=function(t,e){var r=i(t);if(r%e)throw new n("Wrong offset");return r}},15904:(t,e,r)=>{"use strict";var i=r(68700),n=RangeError;t.exports=function(t){var e=i(t);if(e<0)throw new n("The argument can't be less than 0");return e}},88732:(t,e,r)=>{"use strict";var i=r(22615),n=r(48999),s=r(30734),o=r(54849),a=r(35899),l=r(44201),c=TypeError,h=l("toPrimitive");t.exports=function(t,e){if(!n(t)||s(t))return t;var r,l=o(t,h);if(l){if(void 0===e&&(e="default"),r=i(l,t,e),!n(r)||s(r))return r;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},18360:(t,e,r)=>{"use strict";var i=r(88732),n=r(30734);t.exports=function(t){var e=i(t,"string");return n(e)?e:e+""}},2939:(t,e,r)=>{"use strict";var i=r(76058),n=r(69985),s=r(9603),o=r(48999),a=i("Set");t.exports=function(t){return function(t){return o(t)&&"number"==typeof t.size&&n(t.has)&&n(t.keys)}(t)?t:s(t)?new a(t):t}},23043:(t,e,r)=>{"use strict";var i={};i[r(44201)("toStringTag")]="z",t.exports="[object z]"===String(i)},34327:(t,e,r)=>{"use strict";var i=r(50926),n=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}},87191:t=>{"use strict";var e=Math.round;t.exports=function(t){var r=e(t);return r<0?0:r>255?255:255&r}},21905:(t,e,r)=>{"use strict";var i=r(50806);t.exports=function(t){try{if(i)return Function('return require("'+t+'")')()}catch(t){}}},23691:t=>{"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},31158:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(22615),o=r(67697),a=r(39800),l=r(54872),c=r(83999),h=r(767),u=r(75684),d=r(75773),p=r(71973),f=r(43126),m=r(19842),g=r(83250),A=r(87191),y=r(18360),v=r(36812),x=r(50926),b=r(48999),_=r(30734),w=r(25391),E=r(23622),M=r(49385),S=r(72741).f,C=r(41304),T=r(2960).forEach,I=r(14241),R=r(62148),B=r(72560),L=r(82474),P=r(618),D=r(33457),O=P.get,k=P.set,U=P.enforce,N=B.f,F=L.f,z=n.RangeError,G=c.ArrayBuffer,Q=G.prototype,j=c.DataView,V=l.NATIVE_ARRAY_BUFFER_VIEWS,H=l.TYPED_ARRAY_TAG,W=l.TypedArray,q=l.TypedArrayPrototype,Z=l.aTypedArrayConstructor,Y=l.isTypedArray,X="BYTES_PER_ELEMENT",J="Wrong length",K=function(t,e){Z(t);for(var r=0,i=e.length,n=new t(i);i>r;)n[r]=e[r++];return n},$=function(t,e){R(t,e,{configurable:!0,get:function(){return O(this)[e]}})},tt=function(t){var e;return E(Q,t)||"ArrayBuffer"===(e=x(t))||"SharedArrayBuffer"===e},et=function(t,e){return Y(t)&&!_(e)&&e in t&&p(+e)&&e>=0},rt=function(t,e){return e=y(e),et(t,e)?u(2,t[e]):F(t,e)},it=function(t,e,r){return e=y(e),!(et(t,e)&&b(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?N(t,e,r):(t[e]=r.value,t)};o?(V||(L.f=rt,B.f=it,$(q,"buffer"),$(q,"byteOffset"),$(q,"byteLength"),$(q,"length")),i({target:"Object",stat:!0,forced:!V},{getOwnPropertyDescriptor:rt,defineProperty:it}),t.exports=function(t,e,r){var o=t.match(/\d+/)[0]/8,l=t+(r?"Clamped":"")+"Array",c="get"+t,u="set"+t,p=n[l],y=p,v=y&&y.prototype,x={},_=function(t,e){N(t,e,{get:function(){return function(t,e){var r=O(t);return r.view[c](e*o+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,i){var n=O(t);n.view[u](e*o+n.byteOffset,r?A(i):i,!0)}(this,e,t)},enumerable:!0})};V?a&&(y=e((function(t,e,r,i){return h(t,v),D(b(e)?tt(e)?void 0!==i?new p(e,g(r,o),i):void 0!==r?new p(e,g(r,o)):new p(e):Y(e)?K(y,e):s(C,y,e):new p(m(e)),t,y)})),M&&M(y,W),T(S(p),(function(t){t in y||d(y,t,p[t])})),y.prototype=v):(y=e((function(t,e,r,i){h(t,v);var n,a,l,c=0,u=0;if(b(e)){if(!tt(e))return Y(e)?K(y,e):s(C,y,e);n=e,u=g(r,o);var d=e.byteLength;if(void 0===i){if(d%o)throw new z(J);if((a=d-u)<0)throw new z(J)}else if((a=f(i)*o)+u>d)throw new z(J);l=a/o}else l=m(e),n=new G(a=l*o);for(k(t,{buffer:n,byteOffset:u,byteLength:a,length:l,view:new j(n)});c{"use strict";var i=r(19037),n=r(3689),s=r(86431),o=r(54872).NATIVE_ARRAY_BUFFER_VIEWS,a=i.ArrayBuffer,l=i.Int8Array;t.exports=!o||!n((function(){l(1)}))||!n((function(){new l(-1)}))||!s((function(t){new l,new l(null),new l(1.5),new l(t)}),!0)||n((function(){return 1!==new l(new a(2),1,void 0).length}))},20716:(t,e,r)=>{"use strict";var i=r(59976),n=r(47338);t.exports=function(t,e){return i(n(t),e)}},41304:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(52655),o=r(90690),a=r(6310),l=r(5185),c=r(91664),h=r(93292),u=r(9401),d=r(54872).aTypedArrayConstructor,p=r(71530);t.exports=function(t){var e,r,f,m,g,A,y,v,x=s(this),b=o(t),_=arguments.length,w=_>1?arguments[1]:void 0,E=void 0!==w,M=c(b);if(M&&!h(M))for(v=(y=l(b,M)).next,b=[];!(A=n(v,y)).done;)b.push(A.value);for(E&&_>2&&(w=i(w,arguments[2])),r=a(b),f=new(d(x))(r),m=u(f),e=0;r>e;e++)g=E?w(b[e],e):b[e],f[e]=m?p(g):+g;return f}},47338:(t,e,r)=>{"use strict";var i=r(54872),n=r(76373),s=i.aTypedArrayConstructor,o=i.getTypedArrayConstructor;t.exports=function(t){return s(n(t,o(t)))}},14630:(t,e,r)=>{"use strict";var i=r(68844),n=0,s=Math.random(),o=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++n+s,36)}},76837:(t,e,r)=>{"use strict";var i=r(3689),n=r(44201),s=r(67697),o=r(53931),a=n("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),i="";return t.pathname="c%20d",e.forEach((function(t,r){e.delete("b"),i+=r+t})),r.delete("a",2),r.delete("b",void 0),o&&(!t.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!e.size&&(o||!s)||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},39525:(t,e,r)=>{"use strict";var i=r(50146);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},15648:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689);t.exports=i&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},21500:t=>{"use strict";var e=TypeError;t.exports=function(t,r){if(t{"use strict";var i=r(19037),n=r(69985),s=i.WeakMap;t.exports=n(s)&&/native code/.test(String(s))},16803:(t,e,r)=>{"use strict";var i=r(68844),n=WeakMap.prototype;t.exports={WeakMap,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete)}},78616:(t,e,r)=>{"use strict";var i=r(68844),n=WeakSet.prototype;t.exports={WeakSet,add:i(n.add),has:i(n.has),remove:i(n.delete)}},35405:(t,e,r)=>{"use strict";var i=r(50496),n=r(36812),s=r(96145),o=r(72560).f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});n(e,t)||o(e,t,{value:s.f(t)})}},96145:(t,e,r)=>{"use strict";var i=r(44201);e.f=i},44201:(t,e,r)=>{"use strict";var i=r(19037),n=r(83430),s=r(36812),o=r(14630),a=r(50146),l=r(39525),c=i.Symbol,h=n("wks"),u=l?c.for||c:c&&c.withoutSetter||o;t.exports=function(t){return s(h,t)||(h[t]=a&&s(c,t)?c[t]:u("Symbol."+t)),h[t]}},86350:t=>{"use strict";t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},51064:(t,e,r)=>{"use strict";var i=r(76058),n=r(36812),s=r(75773),o=r(23622),a=r(49385),l=r(8758),c=r(38055),h=r(33457),u=r(13841),d=r(62570),p=r(65411),f=r(67697),m=r(53931);t.exports=function(t,e,r,g){var A="stackTraceLimit",y=g?2:1,v=t.split("."),x=v[v.length-1],b=i.apply(null,v);if(b){var _=b.prototype;if(!m&&n(_,"cause")&&delete _.cause,!r)return b;var w=i("Error"),E=e((function(t,e){var r=u(g?e:t,void 0),i=g?new b(t):new b;return void 0!==r&&s(i,"message",r),p(i,E,i.stack,2),this&&o(_,this)&&h(i,this,E),arguments.length>y&&d(i,arguments[y]),i}));if(E.prototype=_,"Error"!==x?a?a(E,w):l(E,w,{name:!0}):f&&A in b&&(c(E,b,A),c(E,b,"prepareStackTrace")),l(E,b),!m)try{_.name!==x&&s(_,"name",x),_.constructor=E}catch(t){}return E}}},54927:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(3689),a=r(51064),l="AggregateError",c=n(l),h=!o((function(){return 1!==c([1]).errors[0]}))&&o((function(){return 7!==c([1],l,{cause:7}).cause}));i({global:!0,constructor:!0,arity:2,forced:h},{AggregateError:a(l,(function(t){return function(e,r){return s(t,this,arguments)}}),h,!0)})},39382:(t,e,r)=>{"use strict";var i=r(79989),n=r(23622),s=r(61868),o=r(49385),a=r(8758),l=r(25391),c=r(75773),h=r(75684),u=r(62570),d=r(65411),p=r(18734),f=r(13841),m=r(44201)("toStringTag"),g=Error,A=[].push,y=function(t,e){var r,i=n(v,this);o?r=o(new g,i?s(this):v):(r=i?this:l(v),c(r,m,"Error")),void 0!==e&&c(r,"message",f(e)),d(r,y,r.stack,1),arguments.length>2&&u(r,arguments[2]);var a=[];return p(t,A,{that:a}),c(r,"errors",a),r};o?o(y,g):a(y,g,{name:!0});var v=y.prototype=l(g.prototype,{constructor:h(1,y),message:h(1,""),name:h(1,"AggregateError")});i({global:!0,constructor:!0,arity:2},{AggregateError:y})},95879:(t,e,r)=>{"use strict";r(39382)},69365:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(83999),o=r(14241),a="ArrayBuffer",l=s[a];i({global:!0,constructor:!0,forced:n[a]!==l},{ArrayBuffer:l}),o(a)},33870:(t,e,r)=>{"use strict";var i=r(79989),n=r(54872);i({target:"ArrayBuffer",stat:!0,forced:!n.NATIVE_ARRAY_BUFFER_VIEWS},{isView:n.isView})},99211:(t,e,r)=>{"use strict";var i=r(79989),n=r(46576),s=r(3689),o=r(83999),a=r(85027),l=r(27578),c=r(43126),h=r(76373),u=o.ArrayBuffer,d=o.DataView,p=d.prototype,f=n(u.prototype.slice),m=n(p.getUint8),g=n(p.setUint8);i({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:s((function(){return!new u(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(f&&void 0===e)return f(a(this),t);for(var r=a(this).byteLength,i=l(t,r),n=l(void 0===e?r:e,r),s=new(h(this,u))(c(n-i)),o=new d(this),p=new d(s),A=0;i{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(68700),a=r(87370);i({target:"Array",proto:!0},{at:function(t){var e=n(this),r=s(e),i=o(t),a=i>=0?i:r+i;return a<0||a>=r?void 0:e[a]}}),a("at")},34338:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(92297),o=r(48999),a=r(90690),l=r(6310),c=r(55565),h=r(76522),u=r(27120),d=r(29042),p=r(44201),f=r(3615),m=p("isConcatSpreadable"),g=f>=51||!n((function(){var t=[];return t[m]=!1,t.concat()[0]!==t})),A=function(t){if(!o(t))return!1;var e=t[m];return void 0!==e?!!e:s(t)};i({target:"Array",proto:!0,arity:1,forced:!g||!d("concat")},{concat:function(t){var e,r,i,n,s,o=a(this),d=u(o,0),p=0;for(e=-1,i=arguments.length;e{"use strict";var i=r(79989),n=r(70357),s=r(87370);i({target:"Array",proto:!0},{copyWithin:n}),s("copyWithin")},55791:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).every;i({target:"Array",proto:!0,forced:!r(16834)("every")},{every:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},97895:(t,e,r)=>{"use strict";var i=r(79989),n=r(62872),s=r(87370);i({target:"Array",proto:!0},{fill:n}),s("fill")},38077:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filter;i({target:"Array",proto:!0,forced:!r(29042)("filter")},{filter:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},39772:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).findIndex,s=r(87370),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{findIndex:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},93383:(t,e,r)=>{"use strict";var i=r(79989),n=r(61969).findLastIndex,s=r(87370);i({target:"Array",proto:!0},{findLastIndex:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLastIndex")},59867:(t,e,r)=>{"use strict";var i=r(79989),n=r(61969).findLast,s=r(87370);i({target:"Array",proto:!0},{findLast:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLast")},25728:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).find,s=r(87370),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},54564:(t,e,r)=>{"use strict";var i=r(79989),n=r(37809),s=r(10509),o=r(90690),a=r(6310),l=r(27120);i({target:"Array",proto:!0},{flatMap:function(t){var e,r=o(this),i=a(r);return s(t),(e=l(r,0)).length=n(e,r,r,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},62795:(t,e,r)=>{"use strict";var i=r(79989),n=r(37809),s=r(90690),o=r(6310),a=r(68700),l=r(27120);i({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=s(this),r=o(e),i=l(e,0);return i.length=n(i,e,e,r,0,void 0===t?1:a(t)),i}})},49693:(t,e,r)=>{"use strict";var i=r(79989),n=r(57612);i({target:"Array",proto:!0,forced:[].forEach!==n},{forEach:n})},77049:(t,e,r)=>{"use strict";var i=r(79989),n=r(21055);i({target:"Array",stat:!0,forced:!r(86431)((function(t){Array.from(t)}))},{from:n})},76801:(t,e,r)=>{"use strict";var i=r(79989),n=r(84328).includes,s=r(3689),o=r(87370);i({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},97195:(t,e,r)=>{"use strict";var i=r(79989),n=r(46576),s=r(84328).indexOf,o=r(16834),a=n([].indexOf),l=!!a&&1/a([1],1,-0)<0;i({target:"Array",proto:!0,forced:l||!o("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return l?a(this,t,e)||0:s(this,t,e)}})},63975:(t,e,r)=>{"use strict";r(79989)({target:"Array",stat:!0},{isArray:r(92297)})},752:(t,e,r)=>{"use strict";var i=r(65290),n=r(87370),s=r(9478),o=r(618),a=r(72560).f,l=r(91934),c=r(27807),h=r(53931),u=r(67697),d="Array Iterator",p=o.set,f=o.getterFor(d);t.exports=l(Array,"Array",(function(t,e){p(this,{type:d,target:i(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,c(void 0,!0);switch(t.kind){case"keys":return c(r,!1);case"values":return c(e[r],!1)}return c([r,e[r]],!1)}),"values");var m=s.Arguments=s.Array;if(n("keys"),n("values"),n("entries"),!h&&u&&"values"!==m.name)try{a(m,"name",{value:"values"})}catch(t){}},6203:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(94413),o=r(65290),a=r(16834),l=n([].join);i({target:"Array",proto:!0,forced:s!==Object||!a("join",",")},{join:function(t){return l(o(this),void 0===t?",":t)}})},72410:(t,e,r)=>{"use strict";var i=r(79989),n=r(60953);i({target:"Array",proto:!0,forced:n!==[].lastIndexOf},{lastIndexOf:n})},50886:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).map;i({target:"Array",proto:!0,forced:!r(29042)("map")},{map:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},37593:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(19429),o=r(76522),a=Array;i({target:"Array",stat:!0,forced:n((function(){function t(){}return!(a.of.call(t)instanceof t)}))},{of:function(){for(var t=0,e=arguments.length,r=new(s(this)?this:a)(e);e>t;)o(r,t,arguments[t++]);return r.length=e,r}})},70560:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(5649),a=r(55565);i({target:"Array",proto:!0,arity:1,forced:r(3689)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=n(this),r=s(e),i=arguments.length;a(r+i);for(var l=0;l{"use strict";var i=r(79989),n=r(88820).right,s=r(16834),o=r(3615);i({target:"Array",proto:!0,forced:!r(50806)&&o>79&&o<83||!s("reduceRight")},{reduceRight:function(t){return n(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},278:(t,e,r)=>{"use strict";var i=r(79989),n=r(88820).left,s=r(16834),o=r(3615);i({target:"Array",proto:!0,forced:!r(50806)&&o>79&&o<83||!s("reduce")},{reduce:function(t){var e=arguments.length;return n(this,t,e,e>1?arguments[1]:void 0)}})},93374:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(92297),o=n([].reverse),a=[1,2];i({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),o(this)}})},89730:(t,e,r)=>{"use strict";var i=r(79989),n=r(92297),s=r(19429),o=r(48999),a=r(27578),l=r(6310),c=r(65290),h=r(76522),u=r(44201),d=r(29042),p=r(96004),f=d("slice"),m=u("species"),g=Array,A=Math.max;i({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var r,i,u,d=c(this),f=l(d),y=a(t,f),v=a(void 0===e?f:e,f);if(n(d)&&(r=d.constructor,(s(r)&&(r===g||n(r.prototype))||o(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return p(d,y,v);for(i=new(void 0===r?g:r)(A(v-y,0)),u=0;y{"use strict";var i=r(79989),n=r(2960).some;i({target:"Array",proto:!0,forced:!r(16834)("some")},{some:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},65137:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(90690),a=r(6310),l=r(98494),c=r(34327),h=r(3689),u=r(50382),d=r(16834),p=r(97365),f=r(37298),m=r(3615),g=r(27922),A=[],y=n(A.sort),v=n(A.push),x=h((function(){A.sort(void 0)})),b=h((function(){A.sort(null)})),_=d("sort"),w=!h((function(){if(m)return m<70;if(!(p&&p>3)){if(f)return!0;if(g)return g<603;var t,e,r,i,n="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)A.push({k:e+i,v:r})}for(A.sort((function(t,e){return e.v-t.v})),i=0;ic(r)?1:-1}}(t)),r=a(n),i=0;i{"use strict";r(14241)("Array")},62506:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(27578),o=r(68700),a=r(6310),l=r(5649),c=r(55565),h=r(27120),u=r(76522),d=r(98494),p=r(29042)("splice"),f=Math.max,m=Math.min;i({target:"Array",proto:!0,forced:!p},{splice:function(t,e){var r,i,p,g,A,y,v=n(this),x=a(v),b=s(t,x),_=arguments.length;for(0===_?r=i=0:1===_?(r=0,i=x-b):(r=_-2,i=m(f(o(e),0),x-b)),c(x+r-i),p=h(v,i),g=0;gx-i+r;g--)d(v,g-1)}else if(r>i)for(g=x-i;g>b;g--)y=g+r-1,(A=g+i-1)in v?v[y]=v[A]:d(v,y);for(g=0;g{"use strict";var i=r(79989),n=r(26166),s=r(65290),o=r(87370),a=Array;i({target:"Array",proto:!0},{toReversed:function(){return n(s(this),a)}}),o("toReversed")},12894:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(65290),a=r(59976),l=r(88277),c=r(87370),h=Array,u=n(l("Array","sort"));i({target:"Array",proto:!0},{toSorted:function(t){void 0!==t&&s(t);var e=o(this),r=a(h,e);return u(r,t)}}),c("toSorted")},93530:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370),s=r(55565),o=r(6310),a=r(27578),l=r(65290),c=r(68700),h=Array,u=Math.max,d=Math.min;i({target:"Array",proto:!0},{toSpliced:function(t,e){var r,i,n,p,f=l(this),m=o(f),g=a(t,m),A=arguments.length,y=0;for(0===A?r=i=0:1===A?(r=0,i=m-g):(r=A-2,i=d(u(c(e),0),m-g)),n=s(m+r-i),p=h(n);y{"use strict";r(87370)("flatMap")},13383:(t,e,r)=>{"use strict";r(87370)("flat")},91719:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(5649),a=r(98494),l=r(55565);i({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}}()},{unshift:function(t){var e=n(this),r=s(e),i=arguments.length;if(i){l(r+i);for(var c=r;c--;){var h=c+i;c in e?e[h]=e[c]:a(e,h)}for(var u=0;u{"use strict";var i=r(79989),n=r(16134),s=r(65290),o=Array;i({target:"Array",proto:!0},{with:function(t,e){return n(s(this),o,t,e)}})},87347:(t,e,r)=>{"use strict";var i=r(79989),n=r(83999);i({global:!0,constructor:!0,forced:!r(37075)},{DataView:n.DataView})},18201:(t,e,r)=>{"use strict";r(87347)},55635:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(3689)((function(){return 120!==new Date(16e11).getYear()})),o=n(Date.prototype.getFullYear);i({target:"Date",proto:!0,forced:s},{getYear:function(){return o(this)-1900}})},42227:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=Date,o=n(s.prototype.getTime);i({target:"Date",stat:!0},{now:function(){return o(new s)}})},99679:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=Date.prototype,a=n(o.getTime),l=n(o.setFullYear);i({target:"Date",proto:!0},{setYear:function(t){a(this);var e=s(t);return l(this,e>=0&&e<=99?e+1900:e)}})},24343:(t,e,r)=>{"use strict";r(79989)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},65007:(t,e,r)=>{"use strict";var i=r(79989),n=r(99455);i({target:"Date",proto:!0,forced:Date.prototype.toISOString!==n},{toISOString:n})},78150:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(90690),o=r(88732);i({target:"Date",proto:!0,arity:1,forced:n((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=s(this),r=o(e,"number");return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},59903:(t,e,r)=>{"use strict";var i=r(36812),n=r(11880),s=r(81797),o=r(44201)("toPrimitive"),a=Date.prototype;i(a,o)||n(a,o,s)},30024:(t,e,r)=>{"use strict";var i=r(68844),n=r(11880),s=Date.prototype,o="Invalid Date",a="toString",l=i(s[a]),c=i(s.getTime);String(new Date(NaN))!==o&&n(s,a,(function(){var t=c(this);return t==t?l(this):o}))},21057:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(61735),o=r(51064),a="WebAssembly",l=n[a],c=7!==new Error("e",{cause:7}).cause,h=function(t,e){var r={};r[t]=o(t,e,c),i({global:!0,constructor:!0,arity:1,forced:c},r)},u=function(t,e){if(l&&l[t]){var r={};r[t]=o(a+"."+t,e,c),i({target:a,stat:!0,constructor:!0,arity:1,forced:c},r)}};h("Error",(function(t){return function(e){return s(t,this,arguments)}})),h("EvalError",(function(t){return function(e){return s(t,this,arguments)}})),h("RangeError",(function(t){return function(e){return s(t,this,arguments)}})),h("ReferenceError",(function(t){return function(e){return s(t,this,arguments)}})),h("SyntaxError",(function(t){return function(e){return s(t,this,arguments)}})),h("TypeError",(function(t){return function(e){return s(t,this,arguments)}})),h("URIError",(function(t){return function(e){return s(t,this,arguments)}})),u("CompileError",(function(t){return function(e){return s(t,this,arguments)}})),u("LinkError",(function(t){return function(e){return s(t,this,arguments)}})),u("RuntimeError",(function(t){return function(e){return s(t,this,arguments)}}))},68932:(t,e,r)=>{"use strict";var i=r(11880),n=r(20445),s=Error.prototype;s.toString!==n&&i(s,"toString",n)},60428:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=n("".charAt),a=n("".charCodeAt),l=n(/./.exec),c=n(1..toString),h=n("".toUpperCase),u=/[\w*+\-./@]/,d=function(t,e){for(var r=c(t,16);r.length{"use strict";var i=r(79989),n=r(86761);i({target:"Function",proto:!0,forced:Function.bind!==n},{bind:n})},56269:(t,e,r)=>{"use strict";var i=r(69985),n=r(48999),s=r(72560),o=r(61868),a=r(44201),l=r(98702),c=a("hasInstance"),h=Function.prototype;c in h||s.f(h,c,{value:l((function(t){if(!i(this)||!n(t))return!1;var e=this.prototype;if(!n(e))return t instanceof this;for(;t=o(t);)if(e===t)return!0;return!1}),c)})},34284:(t,e,r)=>{"use strict";var i=r(67697),n=r(41236).EXISTS,s=r(68844),o=r(62148),a=Function.prototype,l=s(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,h=s(c.exec);i&&!n&&o(a,"name",{configurable:!0,get:function(){try{return h(c,l(this))[1]}catch(t){return""}}})},45398:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037);i({global:!0,forced:n.globalThis!==n},{globalThis:n})},48324:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(22615),a=r(68844),l=r(3689),c=r(69985),h=r(30734),u=r(96004),d=r(92643),p=r(50146),f=String,m=n("JSON","stringify"),g=a(/./.exec),A=a("".charAt),y=a("".charCodeAt),v=a("".replace),x=a(1..toString),b=/[\uD800-\uDFFF]/g,_=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,E=!p||l((function(){var t=n("Symbol")("stringify detection");return"[null]"!==m([t])||"{}"!==m({a:t})||"{}"!==m(Object(t))})),M=l((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),S=function(t,e){var r=u(arguments),i=d(e);if(c(i)||void 0!==t&&!h(t))return r[1]=function(t,e){if(c(i)&&(e=o(i,this,f(t),e)),!h(e))return e},s(m,null,r)},C=function(t,e,r){var i=A(r,e-1),n=A(r,e+1);return g(_,t)&&!g(w,n)||g(w,t)&&!g(_,i)?"\\u"+x(y(t,0),16):t};m&&i({target:"JSON",stat:!0,arity:3,forced:E||M},{stringify:function(t,e,r){var i=u(arguments),n=s(E?S:m,null,i);return M&&"string"==typeof n?v(n,b,C):n}})},7629:(t,e,r)=>{"use strict";var i=r(19037);r(55997)(i.JSON,"JSON",!0)},9322:(t,e,r)=>{"use strict";r(20319)("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70800))},89348:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(74684),a=r(18734),l=r(83914),c=r(53931),h=l.Map,u=l.has,d=l.get,p=l.set,f=n([].push);i({target:"Map",stat:!0,forced:c},{groupBy:function(t,e){o(t),s(e);var r=new h,i=0;return a(t,(function(t){var n=e(t,i++);u(r,n)?f(d(r,n),t):p(r,n,[t])})),r}})},56646:(t,e,r)=>{"use strict";r(9322)},6557:(t,e,r)=>{"use strict";var i=r(79989),n=r(93956),s=Math.acosh,o=Math.log,a=Math.sqrt,l=Math.LN2;i({target:"Math",stat:!0,forced:!s||710!==Math.floor(s(Number.MAX_VALUE))||s(1/0)!==1/0},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?o(e)+l:n(e-1+a(e-1)*a(e+1))}})},62428:(t,e,r)=>{"use strict";var i=r(79989),n=Math.asinh,s=Math.log,o=Math.sqrt;i({target:"Math",stat:!0,forced:!(n&&1/n(0)>0)},{asinh:function t(e){var r=+e;return isFinite(r)&&0!==r?r<0?-t(-r):s(r+o(r*r+1)):r}})},45263:(t,e,r)=>{"use strict";var i=r(79989),n=Math.atanh,s=Math.log;i({target:"Math",stat:!0,forced:!(n&&1/n(-0)<0)},{atanh:function(t){var e=+t;return 0===e?e:s((1+e)/(1-e))/2}})},74712:(t,e,r)=>{"use strict";var i=r(79989),n=r(55680),s=Math.abs,o=Math.pow;i({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return n(e)*o(s(e),1/3)}})},54986:(t,e,r)=>{"use strict";var i=r(79989),n=Math.floor,s=Math.log,o=Math.LOG2E;i({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-n(s(e+.5)*o):32}})},47221:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745),s=Math.cosh,o=Math.abs,a=Math.E;i({target:"Math",stat:!0,forced:!s||s(710)===1/0},{cosh:function(t){var e=n(o(t)-1)+1;return(e+1/(e*a*a))*(a/2)}})},94992:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745);i({target:"Math",stat:!0,forced:n!==Math.expm1},{expm1:n})},25499:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{fround:r(37788)})},59944:(t,e,r)=>{"use strict";var i=r(79989),n=Math.hypot,s=Math.abs,o=Math.sqrt;i({target:"Math",stat:!0,arity:2,forced:!!n&&n(1/0,NaN)!==1/0},{hypot:function(t,e){for(var r,i,n=0,a=0,l=arguments.length,c=0;a0?(i=r/c)*i:r;return c===1/0?1/0:c*o(n)}})},78527:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=Math.imul;i({target:"Math",stat:!0,forced:n((function(){return-5!==s(4294967295,5)||2!==s.length}))},{imul:function(t,e){var r=65535,i=+t,n=+e,s=r&i,o=r&n;return 0|s*o+((r&i>>>16)*o+s*(r&n>>>16)<<16>>>0)}})},75239:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{log10:r(4736)})},92076:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{log1p:r(93956)})},68813:(t,e,r)=>{"use strict";var i=r(79989),n=Math.log,s=Math.LN2;i({target:"Math",stat:!0},{log2:function(t){return n(t)/s}})},96976:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{sign:r(55680)})},62700:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(21745),o=Math.abs,a=Math.exp,l=Math.E;i({target:"Math",stat:!0,forced:n((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(t){var e=+t;return o(e)<1?(s(e)-s(-e))/2:(a(e-1)-a(-e-1))*(l/2)}})},91554:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745),s=Math.exp;i({target:"Math",stat:!0},{tanh:function(t){var e=+t,r=n(e),i=n(-e);return r===1/0?1:i===1/0?-1:(r-i)/(s(e)+s(-e))}})},77509:(t,e,r)=>{"use strict";r(55997)(Math,"Math",!0)},21416:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{trunc:r(58828)})},79288:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(67697),o=r(19037),a=r(50496),l=r(68844),c=r(35266),h=r(36812),u=r(33457),d=r(23622),p=r(30734),f=r(88732),m=r(3689),g=r(72741).f,A=r(82474).f,y=r(72560).f,v=r(23648),x=r(61435).trim,b="Number",_=o[b],w=a[b],E=_.prototype,M=o.TypeError,S=l("".slice),C=l("".charCodeAt),T=c(b,!_(" 0o1")||!_("0b1")||_("+0x1")),I=function(t){var e,r=arguments.length<1?0:_(function(t){var e=f(t,"number");return"bigint"==typeof e?e:function(t){var e,r,i,n,s,o,a,l,c=f(t,"number");if(p(c))throw new M("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=x(c),43===(e=C(c,0))||45===e){if(88===(r=C(c,2))||120===r)return NaN}else if(48===e){switch(C(c,1)){case 66:case 98:i=2,n=49;break;case 79:case 111:i=8,n=55;break;default:return+c}for(o=(s=S(c,2)).length,a=0;an)return NaN;return parseInt(s,i)}return+c}(e)}(t));return d(E,e=this)&&m((function(){v(e)}))?u(Object(r),this,I):r};I.prototype=E,T&&!n&&(E.constructor=I),i({global:!0,constructor:!0,wrap:!0,forced:T},{Number:I});var R=function(t,e){for(var r,i=s?g(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),n=0;i.length>n;n++)h(e,r=i[n])&&!h(t,r)&&y(t,r,A(e,r))};n&&w&&R(a[b],w),(T||n)&&R(a[b],_)},53584:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},82243:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isFinite:r(70046)})},95765:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isInteger:r(71973)})},45993:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},92547:(t,e,r)=>{"use strict";var i=r(79989),n=r(71973),s=Math.abs;i({target:"Number",stat:!0},{isSafeInteger:function(t){return n(t)&&s(t)<=9007199254740991}})},7936:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},32704:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},52362:(t,e,r)=>{"use strict";var i=r(79989),n=r(14818);i({target:"Number",stat:!0,forced:Number.parseFloat!==n},{parseFloat:n})},21552:(t,e,r)=>{"use strict";var i=r(79989),n=r(67897);i({target:"Number",stat:!0,forced:Number.parseInt!==n},{parseInt:n})},10704:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=r(23648),a=r(90534),l=r(4736),c=r(3689),h=RangeError,u=String,d=isFinite,p=Math.abs,f=Math.floor,m=Math.pow,g=Math.round,A=n(1..toExponential),y=n(a),v=n("".slice),x="-6.9000e-11"===A(-69e-12,4)&&"1.25e+0"===A(1.255,2)&&"1.235e+4"===A(12345,3)&&"3e+1"===A(25,0);i({target:"Number",proto:!0,forced:!x||!(c((function(){A(1,1/0)}))&&c((function(){A(1,-1/0)})))||!!c((function(){A(1/0,1/0),A(NaN,1/0)}))},{toExponential:function(t){var e=o(this);if(void 0===t)return A(e);var r=s(t);if(!d(e))return String(e);if(r<0||r>20)throw new h("Incorrect fraction digits");if(x)return A(e,r);var i="",n="",a=0,c="",b="";if(e<0&&(i="-",e=-e),0===e)a=0,n=y("0",r+1);else{var _=l(e);a=f(_);var w=0,E=m(10,a-r);2*e>=(2*(w=g(e/E))+1)*E&&(w+=1),w>=m(10,r+1)&&(w/=10,a+=1),n=u(w)}return 0!==r&&(n=v(n,0,1)+"."+v(n,1)),0===a?(c="+",b="0"):(c=a>0?"+":"-",b=u(p(a))),i+(n+"e")+c+b}})},97389:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=r(23648),a=r(90534),l=r(3689),c=RangeError,h=String,u=Math.floor,d=n(a),p=n("".slice),f=n(1..toFixed),m=function(t,e,r){return 0===e?r:e%2==1?m(t,e-1,r*t):m(t*t,e/2,r)},g=function(t,e,r){for(var i=-1,n=r;++i<6;)n+=e*t[i],t[i]=n%1e7,n=u(n/1e7)},A=function(t,e){for(var r=6,i=0;--r>=0;)i+=t[r],t[r]=u(i/e),i=i%e*1e7},y=function(t){for(var e=6,r="";--e>=0;)if(""!==r||0===e||0!==t[e]){var i=h(t[e]);r=""===r?i:r+d("0",7-i.length)+i}return r};i({target:"Number",proto:!0,forced:l((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!l((function(){f({})}))},{toFixed:function(t){var e,r,i,n,a=o(this),l=s(t),u=[0,0,0,0,0,0],f="",v="0";if(l<0||l>20)throw new c("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return h(a);if(a<0&&(f="-",a=-a),a>1e-21)if(r=(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(a*m(2,69,1))-69)<0?a*m(2,-e,1):a/m(2,e,1),r*=4503599627370496,(e=52-e)>0){for(g(u,0,r),i=l;i>=7;)g(u,1e7,0),i-=7;for(g(u,m(10,i,1),0),i=e-1;i>=23;)A(u,1<<23),i-=23;A(u,1<0?f+((n=v.length)<=l?"0."+d("0",l-n)+v:p(v,0,n-l)+"."+p(v,n-l)):f+v}})},25284:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(3689),o=r(23648),a=n(1..toPrecision);i({target:"Number",proto:!0,forced:s((function(){return"1"!==a(1,void 0)}))||!s((function(){a({})}))},{toPrecision:function(t){return void 0===t?a(o(this)):a(o(this),t)}})},60429:(t,e,r)=>{"use strict";var i=r(79989),n=r(45394);i({target:"Object",stat:!0,arity:2,forced:Object.assign!==n},{assign:n})},51013:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0,sham:!r(67697)},{create:r(25391)})},33994:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(10509),a=r(90690),l=r(72560);n&&i({target:"Object",proto:!0,forced:s},{__defineGetter__:function(t,e){l.f(a(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},35082:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(98920).f;i({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!n},{defineProperties:s})},40739:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(72560).f;i({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!n},{defineProperty:s})},47409:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(10509),a=r(90690),l=r(72560);n&&i({target:"Object",proto:!0,forced:s},{__defineSetter__:function(t,e){l.f(a(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},36585:(t,e,r)=>{"use strict";var i=r(79989),n=r(49419).entries;i({target:"Object",stat:!0},{entries:function(t){return n(t)}})},41830:(t,e,r)=>{"use strict";var i=r(79989),n=r(71594),s=r(3689),o=r(48999),a=r(45375).onFreeze,l=Object.freeze;i({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!n},{freeze:function(t){return l&&o(t)?l(a(t)):t}})},85415:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(76522);i({target:"Object",stat:!0},{fromEntries:function(t){var e={};return n(t,(function(t,r){s(e,t,r)}),{AS_ENTRIES:!0}),e}})},81919:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(65290),o=r(82474).f,a=r(67697);i({target:"Object",stat:!0,forced:!a||n((function(){o(1)})),sham:!a},{getOwnPropertyDescriptor:function(t,e){return o(s(t),e)}})},99474:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19152),o=r(65290),a=r(82474),l=r(76522);i({target:"Object",stat:!0,sham:!n},{getOwnPropertyDescriptors:function(t){for(var e,r,i=o(t),n=a.f,c=s(i),h={},u=0;c.length>u;)void 0!==(r=n(i,e=c[u++]))&&l(h,e,r);return h}})},79997:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(26062).f;i({target:"Object",stat:!0,forced:n((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:s})},79434:(t,e,r)=>{"use strict";var i=r(79989),n=r(50146),s=r(3689),o=r(7518),a=r(90690);i({target:"Object",stat:!0,forced:!n||s((function(){o.f(1)}))},{getOwnPropertySymbols:function(t){var e=o.f;return e?e(a(t)):[]}})},88052:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(90690),o=r(61868),a=r(81748);i({target:"Object",stat:!0,forced:n((function(){o(1)})),sham:!a},{getPrototypeOf:function(t){return o(s(t))}})},44079:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(68844),o=r(10509),a=r(74684),l=r(18360),c=r(18734),h=n("Object","create"),u=s([].push);i({target:"Object",stat:!0},{groupBy:function(t,e){a(t),o(e);var r=h(null),i=0;return c(t,(function(t){var n=l(e(t,i++));n in r?u(r[n],t):r[n]=[t]})),r}})},14566:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{hasOwn:r(36812)})},36446:(t,e,r)=>{"use strict";var i=r(79989),n=r(27049);i({target:"Object",stat:!0,forced:Object.isExtensible!==n},{isExtensible:n})},35140:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(48999),o=r(6648),a=r(11655),l=Object.isFrozen;i({target:"Object",stat:!0,forced:a||n((function(){l(1)}))},{isFrozen:function(t){return!s(t)||!(!a||"ArrayBuffer"!==o(t))||!!l&&l(t)}})},4179:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(48999),o=r(6648),a=r(11655),l=Object.isSealed;i({target:"Object",stat:!0,forced:a||n((function(){l(1)}))},{isSealed:function(t){return!s(t)||!(!a||"ArrayBuffer"!==o(t))||!!l&&l(t)}})},76101:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{is:r(70953)})},69358:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(20300);i({target:"Object",stat:!0,forced:r(3689)((function(){s(1)}))},{keys:function(t){return s(n(t))}})},75450:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(90690),a=r(18360),l=r(61868),c=r(82474).f;n&&i({target:"Object",proto:!0,forced:s},{__lookupGetter__:function(t){var e,r=o(this),i=a(t);do{if(e=c(r,i))return e.get}while(r=l(r))}})},54993:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(90690),a=r(18360),l=r(61868),c=r(82474).f;n&&i({target:"Object",proto:!0,forced:s},{__lookupSetter__:function(t){var e,r=o(this),i=a(t);do{if(e=c(r,i))return e.set}while(r=l(r))}})},48115:(t,e,r)=>{"use strict";var i=r(79989),n=r(48999),s=r(45375).onFreeze,o=r(71594),a=r(3689),l=Object.preventExtensions;i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{preventExtensions:function(t){return l&&n(t)?l(s(t)):t}})},19330:(t,e,r)=>{"use strict";var i=r(67697),n=r(62148),s=r(48999),o=r(90690),a=r(74684),l=Object.getPrototypeOf,c=Object.setPrototypeOf,h=Object.prototype,u="__proto__";if(i&&l&&c&&!(u in h))try{n(h,u,{configurable:!0,get:function(){return l(o(this))},set:function(t){var e=a(this);(s(t)||null===t)&&s(e)&&c(e,t)}})}catch(t){}},30658:(t,e,r)=>{"use strict";var i=r(79989),n=r(48999),s=r(45375).onFreeze,o=r(71594),a=r(3689),l=Object.seal;i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{seal:function(t){return l&&n(t)?l(s(t)):t}})},5399:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{setPrototypeOf:r(49385)})},60228:(t,e,r)=>{"use strict";var i=r(23043),n=r(11880),s=r(65073);i||n(Object.prototype,"toString",s,{unsafe:!0})},86466:(t,e,r)=>{"use strict";var i=r(79989),n=r(49419).values;i({target:"Object",stat:!0},{values:function(t){return n(t)}})},80939:(t,e,r)=>{"use strict";var i=r(79989),n=r(14818);i({global:!0,forced:parseFloat!==n},{parseFloat:n})},32320:(t,e,r)=>{"use strict";var i=r(79989),n=r(67897);i({global:!0,forced:parseInt!==n},{parseInt:n})},41195:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{allSettled:function(t){var e=this,r=o.f(e),i=r.resolve,c=r.reject,h=a((function(){var r=s(e.resolve),o=[],a=0,c=1;l(t,(function(t){var s=a++,l=!1;c++,n(r,e,t).then((function(t){l||(l=!0,o[s]={status:"fulfilled",value:t},--c||i(o))}),(function(t){l||(l=!0,o[s]={status:"rejected",reason:t},--c||i(o))}))})),--c||i(o)}));return h.error&&c(h.value),r.promise}})},81692:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{all:function(t){var e=this,r=o.f(e),i=r.resolve,c=r.reject,h=a((function(){var r=s(e.resolve),o=[],a=0,h=1;l(t,(function(t){var s=a++,l=!1;h++,n(r,e,t).then((function(t){l||(l=!0,o[s]=t,--h||i(o))}),c)})),--h||i(o)}));return h.error&&c(h.value),r.promise}})},87609:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(76058),a=r(48742),l=r(9302),c=r(18734),h=r(562),u="No one promise resolved";i({target:"Promise",stat:!0,forced:h},{any:function(t){var e=this,r=o("AggregateError"),i=a.f(e),h=i.resolve,d=i.reject,p=l((function(){var i=s(e.resolve),o=[],a=0,l=1,p=!1;c(t,(function(t){var s=a++,c=!1;l++,n(i,e,t).then((function(t){c||p||(p=!0,h(t))}),(function(t){c||p||(c=!0,o[s]=t,--l||d(new r(o,u)))}))})),--l||d(new r(o,u))}));return p.error&&d(p.value),i.promise}})},75089:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(87073).CONSTRUCTOR,o=r(17919),a=r(76058),l=r(69985),c=r(11880),h=o&&o.prototype;if(i({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(t){return this.then(void 0,t)}}),!n&&l(o)){var u=a("Promise").prototype.catch;h.catch!==u&&c(h,"catch",u,{unsafe:!0})}},56697:(t,e,r)=>{"use strict";var i,n,s,o=r(79989),a=r(53931),l=r(50806),c=r(19037),h=r(22615),u=r(11880),d=r(49385),p=r(55997),f=r(14241),m=r(10509),g=r(69985),A=r(48999),y=r(767),v=r(76373),x=r(99886).set,b=r(80231),_=r(20920),w=r(9302),E=r(34410),M=r(618),S=r(17919),C=r(87073),T=r(48742),I="Promise",R=C.CONSTRUCTOR,B=C.REJECTION_EVENT,L=C.SUBCLASSING,P=M.getterFor(I),D=M.set,O=S&&S.prototype,k=S,U=O,N=c.TypeError,F=c.document,z=c.process,G=T.f,Q=G,j=!!(F&&F.createEvent&&c.dispatchEvent),V="unhandledrejection",H=function(t){var e;return!(!A(t)||!g(e=t.then))&&e},W=function(t,e){var r,i,n,s=e.value,o=1===e.state,a=o?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{a?(o||(2===e.rejection&&J(e),e.rejection=1),!0===a?r=s:(u&&u.enter(),r=a(s),u&&(u.exit(),n=!0)),r===t.promise?c(new N("Promise-chain cycle")):(i=H(r))?h(i,r,l,c):l(r)):c(s)}catch(t){u&&!n&&u.exit(),c(t)}},q=function(t,e){t.notified||(t.notified=!0,b((function(){for(var r,i=t.reactions;r=i.get();)W(r,t);t.notified=!1,e&&!t.rejection&&Y(t)})))},Z=function(t,e,r){var i,n;j?((i=F.createEvent("Event")).promise=e,i.reason=r,i.initEvent(t,!1,!0),c.dispatchEvent(i)):i={promise:e,reason:r},!B&&(n=c["on"+t])?n(i):t===V&&_("Unhandled promise rejection",r)},Y=function(t){h(x,c,(function(){var e,r=t.facade,i=t.value;if(X(t)&&(e=w((function(){l?z.emit("unhandledRejection",i,r):Z(V,r,i)})),t.rejection=l||X(t)?2:1,e.error))throw e.value}))},X=function(t){return 1!==t.rejection&&!t.parent},J=function(t){h(x,c,(function(){var e=t.facade;l?z.emit("rejectionHandled",e):Z("rejectionhandled",e,t.value)}))},K=function(t,e,r){return function(i){t(e,i,r)}},$=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,q(t,!0))},tt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new N("Promise can't be resolved itself");var i=H(e);i?b((function(){var r={done:!1};try{h(i,e,K(tt,r,t),K($,r,t))}catch(e){$(r,e,t)}})):(t.value=e,t.state=1,q(t,!1))}catch(e){$({done:!1},e,t)}}};if(R&&(U=(k=function(t){y(this,U),m(t),h(i,this);var e=P(this);try{t(K(tt,e),K($,e))}catch(t){$(e,t)}}).prototype,(i=function(t){D(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=u(U,"then",(function(t,e){var r=P(this),i=G(v(this,k));return r.parent=!0,i.ok=!g(t)||t,i.fail=g(e)&&e,i.domain=l?z.domain:void 0,0===r.state?r.reactions.add(i):b((function(){W(i,r)})),i.promise})),n=function(){var t=new i,e=P(t);this.promise=t,this.resolve=K(tt,e),this.reject=K($,e)},T.f=G=function(t){return t===k||void 0===t?new n(t):Q(t)},!a&&g(S)&&O!==Object.prototype)){s=O.then,L||u(O,"then",(function(t,e){var r=this;return new k((function(t,e){h(s,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete O.constructor}catch(t){}d&&d(O,U)}o({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:k}),p(k,I,!1,!0),f(I)},36409:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(17919),o=r(3689),a=r(76058),l=r(69985),c=r(76373),h=r(72945),u=r(11880),d=s&&s.prototype;if(i({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=c(this,a("Promise")),r=l(t);return this.then(r?function(r){return h(e,t()).then((function(){return r}))}:t,r?function(r){return h(e,t()).then((function(){throw r}))}:t)}}),!n&&l(s)){var p=a("Promise").prototype.finally;d.finally!==p&&u(d,"finally",p,{unsafe:!0})}},73964:(t,e,r)=>{"use strict";r(56697),r(81692),r(75089),r(58829),r(42092),r(57905)},58829:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{race:function(t){var e=this,r=o.f(e),i=r.reject,c=a((function(){var o=s(e.resolve);l(t,(function(t){n(o,e,t).then(r.resolve,i)}))}));return c.error&&i(c.value),r.promise}})},42092:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(48742);i({target:"Promise",stat:!0,forced:r(87073).CONSTRUCTOR},{reject:function(t){var e=s.f(this);return n(e.reject,void 0,t),e.promise}})},57905:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(53931),o=r(17919),a=r(87073).CONSTRUCTOR,l=r(72945),c=n("Promise"),h=s&&!a;i({target:"Promise",stat:!0,forced:s||a},{resolve:function(t){return l(h&&this===c?o:this,t)}})},13505:(t,e,r)=>{"use strict";var i=r(79989),n=r(48742);i({target:"Promise",stat:!0},{withResolvers:function(){var t=n.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},54333:(t,e,r)=>{"use strict";var i=r(79989),n=r(61735),s=r(10509),o=r(85027);i({target:"Reflect",stat:!0,forced:!r(3689)((function(){Reflect.apply((function(){}))}))},{apply:function(t,e,r){return n(s(t),e,o(r))}})},30050:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(86761),a=r(52655),l=r(85027),c=r(48999),h=r(25391),u=r(3689),d=n("Reflect","construct"),p=Object.prototype,f=[].push,m=u((function(){function t(){}return!(d((function(){}),[],t)instanceof t)})),g=!u((function(){d((function(){}))})),A=m||g;i({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(t,e){a(t),l(e);var r=arguments.length<3?t:a(arguments[2]);if(g&&!m)return d(t,e,r);if(t===r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return s(f,i,e),new(s(o,t,i))}var n=r.prototype,u=h(c(n)?n:p),A=s(t,u,e);return c(A)?A:u}})},99871:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(85027),o=r(18360),a=r(72560);i({target:"Reflect",stat:!0,forced:r(3689)((function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})})),sham:!n},{defineProperty:function(t,e,r){s(t);var i=o(e);s(r);try{return a.f(t,i,r),!0}catch(t){return!1}}})},1049:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(82474).f;i({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var r=s(n(t),e);return!(r&&!r.configurable)&&delete t[e]}})},50149:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(85027),o=r(82474);i({target:"Reflect",stat:!0,sham:!n},{getOwnPropertyDescriptor:function(t,e){return o.f(s(t),e)}})},43792:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(61868);i({target:"Reflect",stat:!0,sham:!r(81748)},{getPrototypeOf:function(t){return s(n(t))}})},32349:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(48999),o=r(85027),a=r(76251),l=r(82474),c=r(61868);i({target:"Reflect",stat:!0},{get:function t(e,r){var i,h,u=arguments.length<3?e:arguments[2];return o(e)===u?e[r]:(i=l.f(e,r))?a(i)?i.value:void 0===i.get?void 0:n(i.get,u):s(h=c(e))?t(h,r,u):void 0}})},69707:(t,e,r)=>{"use strict";r(79989)({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},63545:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(27049);i({target:"Reflect",stat:!0},{isExtensible:function(t){return n(t),s(t)}})},62087:(t,e,r)=>{"use strict";r(79989)({target:"Reflect",stat:!0},{ownKeys:r(19152)})},51505:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(85027);i({target:"Reflect",stat:!0,sham:!r(71594)},{preventExtensions:function(t){s(t);try{var e=n("Object","preventExtensions");return e&&e(t),!0}catch(t){return!1}}})},22373:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(23550),o=r(49385);o&&i({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){n(t),s(e);try{return o(t,e),!0}catch(t){return!1}}})},45247:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(48999),a=r(76251),l=r(3689),c=r(72560),h=r(82474),u=r(61868),d=r(75684);i({target:"Reflect",stat:!0,forced:l((function(){var t=function(){},e=c.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}))},{set:function t(e,r,i){var l,p,f,m=arguments.length<4?e:arguments[3],g=h.f(s(e),r);if(!g){if(o(p=u(e)))return t(p,r,i,m);g=d(0)}if(a(g)){if(!1===g.writable||!o(m))return!1;if(l=h.f(m,r)){if(l.get||l.set||!1===l.writable)return!1;l.value=i,c.f(m,r,l)}else c.f(m,r,d(0,i))}else{if(void 0===(f=g.set))return!1;n(f,m,i)}return!0}})},76034:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(55997);i({global:!0},{Reflect:{}}),s(n.Reflect,"Reflect",!0)},52003:(t,e,r)=>{"use strict";var i=r(67697),n=r(19037),s=r(68844),o=r(35266),a=r(33457),l=r(75773),c=r(25391),h=r(72741).f,u=r(23622),d=r(91245),p=r(34327),f=r(63477),m=r(87901),g=r(38055),A=r(11880),y=r(3689),v=r(36812),x=r(618).enforce,b=r(14241),_=r(44201),w=r(62100),E=r(26738),M=_("match"),S=n.RegExp,C=S.prototype,T=n.SyntaxError,I=s(C.exec),R=s("".charAt),B=s("".replace),L=s("".indexOf),P=s("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,O=/a/g,k=/a/g,U=new S(O)!==O,N=m.MISSED_STICKY,F=m.UNSUPPORTED_Y;if(o("RegExp",i&&(!U||N||w||E||y((function(){return k[M]=!1,S(O)!==O||S(k)===k||"/a/i"!==String(S(O,"i"))}))))){for(var z=function(t,e){var r,i,n,s,o,h,m=u(C,this),g=d(t),A=void 0===e,y=[],b=t;if(!m&&g&&A&&t.constructor===z)return t;if((g||u(C,t))&&(t=t.source,A&&(e=f(b))),t=void 0===t?"":p(t),e=void 0===e?"":p(e),b=t,w&&"dotAll"in O&&(i=!!e&&L(e,"s")>-1)&&(e=B(e,/s/g,"")),r=e,N&&"sticky"in O&&(n=!!e&&L(e,"y")>-1)&&F&&(e=B(e,/y/g,"")),E&&(s=function(t){for(var e,r=t.length,i=0,n="",s=[],o=c(null),a=!1,l=!1,h=0,u="";i<=r;i++){if("\\"===(e=R(t,i)))e+=R(t,++i);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:I(D,P(t,i+1))&&(i+=2,l=!0),n+=e,h++;continue;case">"===e&&l:if(""===u||v(o,u))throw new T("Invalid capture group name");o[u]=!0,s[s.length]=[u,h],l=!1,u="";continue}l?u+=e:n+=e}return[n,s]}(t),t=s[0],y=s[1]),o=a(S(t,e),m?this:C,z),(i||n||y.length)&&(h=x(o),i&&(h.dotAll=!0,h.raw=z(function(t){for(var e,r=t.length,i=0,n="",s=!1;i<=r;i++)"\\"!==(e=R(t,i))?s||"."!==e?("["===e?s=!0:"]"===e&&(s=!1),n+=e):n+="[\\s\\S]":n+=e+R(t,++i);return n}(t),r)),n&&(h.sticky=!0),y.length&&(h.groups=y)),t!==b)try{l(o,"source",""===b?"(?:)":b)}catch(t){}return o},G=h(S),Q=0;G.length>Q;)g(z,S,G[Q++]);C.constructor=z,z.prototype=C,A(n,"RegExp",z,{constructor:!0})}b("RegExp")},68518:(t,e,r)=>{"use strict";var i=r(67697),n=r(62100),s=r(6648),o=r(62148),a=r(618).get,l=RegExp.prototype,c=TypeError;i&&n&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},64043:(t,e,r)=>{"use strict";var i=r(79989),n=r(56308);i({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})},25847:(t,e,r)=>{"use strict";var i=r(19037),n=r(67697),s=r(62148),o=r(69633),a=r(3689),l=i.RegExp,c=l.prototype;n&&a((function(){var t=!0;try{l(".","d")}catch(e){t=!1}var e={},r="",i=t?"dgimsy":"gimsy",n=function(t,i){Object.defineProperty(e,t,{get:function(){return r+=i,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in t&&(s.hasIndices="d"),s)n(o,s[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(e)!==i||r!==i}))&&s(c,"flags",{configurable:!0,get:o})},13440:(t,e,r)=>{"use strict";var i=r(67697),n=r(87901).MISSED_STICKY,s=r(6648),o=r(62148),a=r(618).get,l=RegExp.prototype,c=TypeError;i&&n&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},7409:(t,e,r)=>{"use strict";r(64043);var i,n,s=r(79989),o=r(22615),a=r(69985),l=r(85027),c=r(34327),h=(i=!1,(n=/[ac]/).exec=function(){return i=!0,/./.exec.apply(this,arguments)},!0===n.test("abc")&&i),u=/./.test;s({target:"RegExp",proto:!0,forced:!h},{test:function(t){var e=l(this),r=c(t),i=e.exec;if(!a(i))return o(u,e,r);var n=o(i,e,r);return null!==n&&(l(n),!0)}})},12826:(t,e,r)=>{"use strict";var i=r(41236).PROPER,n=r(11880),s=r(85027),o=r(34327),a=r(3689),l=r(63477),c="toString",h=RegExp.prototype[c],u=a((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),d=i&&h.name!==c;(u||d)&&n(RegExp.prototype,c,(function(){var t=s(this);return"/"+o(t.source)+"/"+o(l(t))}),{unsafe:!0})},17985:(t,e,r)=>{"use strict";r(20319)("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70800))},19649:(t,e,r)=>{"use strict";r(17985)},90343:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("anchor")},{anchor:function(t){return n(this,"a","name",t)}})},7961:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(68700),a=r(34327),l=r(3689),c=n("".charAt);i({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(t){var e=a(s(this)),r=e.length,i=o(t),n=i>=0?i:r+i;return n<0||n>=r?void 0:c(e,n)}})},21444:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("big")},{big:function(){return n(this,"big","","")}})},25906:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("blink")},{blink:function(){return n(this,"blink","","")}})},95682:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("bold")},{bold:function(){return n(this,"b","","")}})},86239:(t,e,r)=>{"use strict";var i=r(79989),n=r(10730).codeAt;i({target:"String",proto:!0},{codePointAt:function(t){return n(this,t)}})},2918:(t,e,r)=>{"use strict";var i,n=r(79989),s=r(46576),o=r(82474).f,a=r(43126),l=r(34327),c=r(42124),h=r(74684),u=r(27413),d=r(53931),p=s("".endsWith),f=s("".slice),m=Math.min,g=u("endsWith");n({target:"String",proto:!0,forced:!(!d&&!g&&(i=o(String.prototype,"endsWith"),i&&!i.writable)||g)},{endsWith:function(t){var e=l(h(this));c(t);var r=arguments.length>1?arguments[1]:void 0,i=e.length,n=void 0===r?i:m(a(r),i),s=l(t);return p?p(e,s,n):f(e,n-s.length,n)===s}})},98041:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fixed")},{fixed:function(){return n(this,"tt","","")}})},6364:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fontcolor")},{fontcolor:function(t){return n(this,"font","color",t)}})},82954:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fontsize")},{fontsize:function(t){return n(this,"font","size",t)}})},20283:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(27578),o=RangeError,a=String.fromCharCode,l=String.fromCodePoint,c=n([].join);i({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(t){for(var e,r=[],i=arguments.length,n=0;i>n;){if(e=+arguments[n++],s(e,1114111)!==e)throw new o(e+" is not a valid code point");r[n]=e<65536?a(e):a(55296+((e-=65536)>>10),e%1024+56320)}return c(r,"")}})},43843:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(42124),o=r(74684),a=r(34327),l=r(27413),c=n("".indexOf);i({target:"String",proto:!0,forced:!l("includes")},{includes:function(t){return!!~c(a(o(this)),a(s(t)),arguments.length>1?arguments[1]:void 0)}})},12281:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(34327),a=n("".charCodeAt);i({target:"String",proto:!0},{isWellFormed:function(){for(var t=o(s(this)),e=t.length,r=0;r=56320||++r>=e||56320!=(64512&a(t,r))))return!1}return!0}})},19162:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("italics")},{italics:function(){return n(this,"i","","")}})},21694:(t,e,r)=>{"use strict";var i=r(10730).charAt,n=r(34327),s=r(618),o=r(91934),a=r(27807),l="String Iterator",c=s.set,h=s.getterFor(l);o(String,"String",(function(t){c(this,{type:l,string:n(t),index:0})}),(function(){var t,e=h(this),r=e.string,n=e.index;return n>=r.length?a(void 0,!0):(t=i(r,n),e.index+=t.length,a(t,!1))}))},37960:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("link")},{link:function(t){return n(this,"a","href",t)}})},79866:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(46576),o=r(30974),a=r(27807),l=r(74684),c=r(43126),h=r(34327),u=r(85027),d=r(981),p=r(6648),f=r(91245),m=r(63477),g=r(54849),A=r(11880),y=r(3689),v=r(44201),x=r(76373),b=r(71514),_=r(66100),w=r(618),E=r(53931),M=v("matchAll"),S="RegExp String",C=S+" Iterator",T=w.set,I=w.getterFor(C),R=RegExp.prototype,B=TypeError,L=s("".indexOf),P=s("".matchAll),D=!!P&&!y((function(){P("a",/./)})),O=o((function(t,e,r,i){T(this,{type:C,regexp:t,string:e,global:r,unicode:i,done:!1})}),S,(function(){var t=I(this);if(t.done)return a(void 0,!0);var e=t.regexp,r=t.string,i=_(e,r);return null===i?(t.done=!0,a(void 0,!0)):t.global?(""===h(i[0])&&(e.lastIndex=b(r,c(e.lastIndex),t.unicode)),a(i,!1)):(t.done=!0,a(i,!1))})),k=function(t){var e,r,i,n=u(this),s=h(t),o=x(n,RegExp),a=h(m(n));return e=new o(o===RegExp?n.source:n,a),r=!!~L(a,"g"),i=!!~L(a,"u"),e.lastIndex=c(n.lastIndex),new O(e,s,r,i)};i({target:"String",proto:!0,forced:D},{matchAll:function(t){var e,r,i,s,o=l(this);if(d(t)){if(D)return P(o,t)}else{if(f(t)&&(e=h(l(m(t))),!~L(e,"g")))throw new B("`.matchAll` does not allow non-global regexes");if(D)return P(o,t);if(void 0===(i=g(t,M))&&E&&"RegExp"===p(t)&&(i=k),i)return n(i,t,o)}return r=h(o),s=new RegExp(t,"g"),E?n(k,s,r):s[M](r)}}),E||M in R||A(R,M,k)},22462:(t,e,r)=>{"use strict";var i=r(22615),n=r(65773),s=r(85027),o=r(981),a=r(43126),l=r(34327),c=r(74684),h=r(54849),u=r(71514),d=r(66100);n("match",(function(t,e,r){return[function(e){var r=c(this),n=o(e)?void 0:h(e,t);return n?i(n,e,r):new RegExp(e)[t](l(r))},function(t){var i=s(this),n=l(t),o=r(e,i,n);if(o.done)return o.value;if(!i.global)return d(i,n);var c=i.unicode;i.lastIndex=0;for(var h,p=[],f=0;null!==(h=d(i,n));){var m=l(h[0]);p[f]=m,""===m&&(i.lastIndex=u(n,a(i.lastIndex),c)),f++}return 0===f?null:p}]}))},72940:(t,e,r)=>{"use strict";var i=r(79989),n=r(77254).end;i({target:"String",proto:!0,forced:r(35947)},{padEnd:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},8472:(t,e,r)=>{"use strict";var i=r(79989),n=r(77254).start;i({target:"String",proto:!0,forced:r(35947)},{padStart:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},92404:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(65290),o=r(90690),a=r(34327),l=r(6310),c=n([].push),h=n([].join);i({target:"String",stat:!0},{raw:function(t){var e=s(o(t).raw),r=l(e);if(!r)return"";for(var i=arguments.length,n=[],u=0;;){if(c(n,a(e[u++])),u===r)return h(n,"");u{"use strict";r(79989)({target:"String",proto:!0},{repeat:r(90534)})},56532:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(68844),o=r(74684),a=r(69985),l=r(981),c=r(91245),h=r(34327),u=r(54849),d=r(63477),p=r(27017),f=r(44201),m=r(53931),g=f("replace"),A=TypeError,y=s("".indexOf),v=s("".replace),x=s("".slice),b=Math.max,_=function(t,e,r){return r>t.length?-1:""===e?r:y(t,e,r)};i({target:"String",proto:!0},{replaceAll:function(t,e){var r,i,s,f,w,E,M,S,C,T=o(this),I=0,R=0,B="";if(!l(t)){if((r=c(t))&&(i=h(o(d(t))),!~y(i,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(s=u(t,g))return n(s,t,T,e);if(m&&r)return v(h(T),t,e)}for(f=h(T),w=h(t),(E=a(e))||(e=h(e)),M=w.length,S=b(1,M),I=_(f,w,0);-1!==I;)C=E?h(e(w,I,f)):p(w,f,I,[],void 0,e),B+=x(f,R,I)+C,R=I+M,I=_(f,w,I+S);return R{"use strict";var i=r(61735),n=r(22615),s=r(68844),o=r(65773),a=r(3689),l=r(85027),c=r(69985),h=r(981),u=r(68700),d=r(43126),p=r(34327),f=r(74684),m=r(71514),g=r(54849),A=r(27017),y=r(66100),v=r(44201)("replace"),x=Math.max,b=Math.min,_=s([].concat),w=s([].push),E=s("".indexOf),M=s("".slice),S="$0"==="a".replace(/./,"$0"),C=!!/./[v]&&""===/./[v]("a","$0");o("replace",(function(t,e,r){var s=C?"$":"$0";return[function(t,r){var i=f(this),s=h(t)?void 0:g(t,v);return s?n(s,t,i,r):n(e,p(i),t,r)},function(t,n){var o=l(this),a=p(t);if("string"==typeof n&&-1===E(n,s)&&-1===E(n,"$<")){var h=r(e,o,a,n);if(h.done)return h.value}var f=c(n);f||(n=p(n));var g,v=o.global;v&&(g=o.unicode,o.lastIndex=0);for(var S,C=[];null!==(S=y(o,a))&&(w(C,S),v);)""===p(S[0])&&(o.lastIndex=m(a,d(o.lastIndex),g));for(var T,I="",R=0,B=0;B=R&&(I+=M(a,R,D)+L,R=D+P.length)}return I+M(a,R)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!S||C)},61514:(t,e,r)=>{"use strict";var i=r(22615),n=r(65773),s=r(85027),o=r(981),a=r(74684),l=r(70953),c=r(34327),h=r(54849),u=r(66100);n("search",(function(t,e,r){return[function(e){var r=a(this),n=o(e)?void 0:h(e,t);return n?i(n,e,r):new RegExp(e)[t](c(r))},function(t){var i=s(this),n=c(t),o=r(e,i,n);if(o.done)return o.value;var a=i.lastIndex;l(a,0)||(i.lastIndex=0);var h=u(i,n);return l(i.lastIndex,a)||(i.lastIndex=a),null===h?-1:h.index}]}))},470:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("small")},{small:function(){return n(this,"small","","")}})},9873:(t,e,r)=>{"use strict";var i=r(61735),n=r(22615),s=r(68844),o=r(65773),a=r(85027),l=r(981),c=r(91245),h=r(74684),u=r(76373),d=r(71514),p=r(43126),f=r(34327),m=r(54849),g=r(9015),A=r(66100),y=r(56308),v=r(87901),x=r(3689),b=v.UNSUPPORTED_Y,_=4294967295,w=Math.min,E=[].push,M=s(/./.exec),S=s(E),C=s("".slice);o("split",(function(t,e,r){var s;return s="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var s=f(h(this)),o=void 0===r?_:r>>>0;if(0===o)return[];if(void 0===t)return[s];if(!c(t))return n(e,s,t,o);for(var a,l,u,d=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),m=0,A=new RegExp(t.source,p+"g");(a=n(y,A,s))&&!((l=A.lastIndex)>m&&(S(d,C(s,m,a.index)),a.length>1&&a.index=o));)A.lastIndex===a.index&&A.lastIndex++;return m===s.length?!u&&M(A,"")||S(d,""):S(d,C(s,m)),d.length>o?g(d,0,o):d}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:n(e,this,t,r)}:e,[function(e,r){var i=h(this),o=l(e)?void 0:m(e,t);return o?n(o,e,i,r):n(s,f(i),e,r)},function(t,i){var n=a(this),o=f(t),l=r(s,n,o,i,s!==e);if(l.done)return l.value;var c=u(n,RegExp),h=n.unicode,m=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(b?"g":"y"),g=new c(b?"^(?:"+n.source+")":n,m),y=void 0===i?_:i>>>0;if(0===y)return[];if(0===o.length)return null===A(g,o)?[o]:[];for(var v=0,x=0,E=[];x{"use strict";var i,n=r(79989),s=r(46576),o=r(82474).f,a=r(43126),l=r(34327),c=r(42124),h=r(74684),u=r(27413),d=r(53931),p=s("".startsWith),f=s("".slice),m=Math.min,g=u("startsWith");n({target:"String",proto:!0,forced:!(!d&&!g&&(i=o(String.prototype,"startsWith"),i&&!i.writable)||g)},{startsWith:function(t){var e=l(h(this));c(t);var r=a(m(arguments.length>1?arguments[1]:void 0,e.length)),i=l(t);return p?p(e,i,r):f(e,r,r+i.length)===i}})},67446:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("strike")},{strike:function(){return n(this,"strike","","")}})},47729:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("sub")},{sub:function(){return n(this,"sub","","")}})},20372:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(68700),a=r(34327),l=n("".slice),c=Math.max,h=Math.min;i({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,e){var r,i,n=a(s(this)),u=n.length,d=o(t);return d===1/0&&(d=0),d<0&&(d=c(u+d,0)),(r=void 0===e?u:o(e))<=0||r===1/0||d>=(i=h(d+r,u))?"":l(n,d,i)}})},2e3:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("sup")},{sup:function(){return n(this,"sup","","")}})},35237:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(68844),o=r(74684),a=r(34327),l=r(3689),c=Array,h=s("".charAt),u=s("".charCodeAt),d=s([].join),p="".toWellFormed,f=p&&l((function(){return"1"!==n(p,1)}));i({target:"String",proto:!0,forced:f},{toWellFormed:function(){var t=a(o(this));if(f)return n(p,t);for(var e=t.length,r=c(e),i=0;i=56320||i+1>=e||56320!=(64512&u(t,i+1))?r[i]="�":(r[i]=h(t,i),r[++i]=h(t,i))}return d(r,"")}})},16386:(t,e,r)=>{"use strict";r(61313);var i=r(79989),n=r(79558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==n},{trimEnd:n})},10974:(t,e,r)=>{"use strict";var i=r(79989),n=r(72291);i({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==n},{trimLeft:n})},61313:(t,e,r)=>{"use strict";var i=r(79989),n=r(79558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==n},{trimRight:n})},3255:(t,e,r)=>{"use strict";r(10974);var i=r(79989),n=r(72291);i({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==n},{trimStart:n})},28436:(t,e,r)=>{"use strict";var i=r(79989),n=r(61435).trim;i({target:"String",proto:!0,forced:r(75984)("trim")},{trim:function(){return n(this)}})},58373:(t,e,r)=>{"use strict";r(35405)("asyncIterator")},37855:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(22615),o=r(68844),a=r(53931),l=r(67697),c=r(50146),h=r(3689),u=r(36812),d=r(23622),p=r(85027),f=r(65290),m=r(18360),g=r(34327),A=r(75684),y=r(25391),v=r(20300),x=r(72741),b=r(26062),_=r(7518),w=r(82474),E=r(72560),M=r(98920),S=r(49556),C=r(11880),T=r(62148),I=r(83430),R=r(2713),B=r(57248),L=r(14630),P=r(44201),D=r(96145),O=r(35405),k=r(13032),U=r(55997),N=r(618),F=r(2960).forEach,z=R("hidden"),G="Symbol",Q="prototype",j=N.set,V=N.getterFor(G),H=Object[Q],W=n.Symbol,q=W&&W[Q],Z=n.RangeError,Y=n.TypeError,X=n.QObject,J=w.f,K=E.f,$=b.f,tt=S.f,et=o([].push),rt=I("symbols"),it=I("op-symbols"),nt=I("wks"),st=!X||!X[Q]||!X[Q].findChild,ot=function(t,e,r){var i=J(H,e);i&&delete H[e],K(t,e,r),i&&t!==H&&K(H,e,i)},at=l&&h((function(){return 7!==y(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?ot:K,lt=function(t,e){var r=rt[t]=y(q);return j(r,{type:G,tag:t,description:e}),l||(r.description=e),r},ct=function(t,e,r){t===H&&ct(it,e,r),p(t);var i=m(e);return p(r),u(rt,i)?(r.enumerable?(u(t,z)&&t[z][i]&&(t[z][i]=!1),r=y(r,{enumerable:A(0,!1)})):(u(t,z)||K(t,z,A(1,{})),t[z][i]=!0),at(t,i,r)):K(t,i,r)},ht=function(t,e){p(t);var r=f(e),i=v(r).concat(ft(r));return F(i,(function(e){l&&!s(ut,r,e)||ct(t,e,r[e])})),t},ut=function(t){var e=m(t),r=s(tt,this,e);return!(this===H&&u(rt,e)&&!u(it,e))&&(!(r||!u(this,e)||!u(rt,e)||u(this,z)&&this[z][e])||r)},dt=function(t,e){var r=f(t),i=m(e);if(r!==H||!u(rt,i)||u(it,i)){var n=J(r,i);return!n||!u(rt,i)||u(r,z)&&r[z][i]||(n.enumerable=!0),n}},pt=function(t){var e=$(f(t)),r=[];return F(e,(function(t){u(rt,t)||u(B,t)||et(r,t)})),r},ft=function(t){var e=t===H,r=$(e?it:f(t)),i=[];return F(r,(function(t){!u(rt,t)||e&&!u(H,t)||et(i,rt[t])})),i};c||(C(q=(W=function(){if(d(q,this))throw new Y("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,e=L(t),r=function(t){var i=void 0===this?n:this;i===H&&s(r,it,t),u(i,z)&&u(i[z],e)&&(i[z][e]=!1);var o=A(1,t);try{at(i,e,o)}catch(t){if(!(t instanceof Z))throw t;ot(i,e,o)}};return l&&st&&at(H,e,{configurable:!0,set:r}),lt(e,t)})[Q],"toString",(function(){return V(this).tag})),C(W,"withoutSetter",(function(t){return lt(L(t),t)})),S.f=ut,E.f=ct,M.f=ht,w.f=dt,x.f=b.f=pt,_.f=ft,D.f=function(t){return lt(P(t),t)},l&&(T(q,"description",{configurable:!0,get:function(){return V(this).description}}),a||C(H,"propertyIsEnumerable",ut,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:W}),F(v(nt),(function(t){O(t)})),i({target:G,stat:!0,forced:!c},{useSetter:function(){st=!0},useSimple:function(){st=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(t,e){return void 0===e?y(t):ht(y(t),e)},defineProperty:ct,defineProperties:ht,getOwnPropertyDescriptor:dt}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:pt}),k(),U(W,G),B[z]=!0},86544:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19037),o=r(68844),a=r(36812),l=r(69985),c=r(23622),h=r(34327),u=r(62148),d=r(8758),p=s.Symbol,f=p&&p.prototype;if(n&&l(p)&&(!("description"in f)||void 0!==p().description)){var m={},g=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:h(arguments[0]),e=c(f,this)?new p(t):void 0===t?p():p(t);return""===t&&(m[e]=!0),e};d(g,p),g.prototype=f,f.constructor=g;var A="Symbol(description detection)"===String(p("description detection")),y=o(f.valueOf),v=o(f.toString),x=/^Symbol\((.*)\)[^)]+$/,b=o("".replace),_=o("".slice);u(f,"description",{configurable:!0,get:function(){var t=y(this);if(a(m,t))return"";var e=v(t),r=A?_(e,7,-1):b(e,x,"$1");return""===r?void 0:r}}),i({global:!0,constructor:!0,forced:!0},{Symbol:g})}},43975:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(36812),o=r(34327),a=r(83430),l=r(46549),c=a("string-to-symbol-registry"),h=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{for:function(t){var e=o(t);if(s(c,e))return c[e];var r=n("Symbol")(e);return c[e]=r,h[r]=e,r}})},96157:(t,e,r)=>{"use strict";r(35405)("hasInstance")},82529:(t,e,r)=>{"use strict";r(35405)("isConcatSpreadable")},84254:(t,e,r)=>{"use strict";r(35405)("iterator")},59749:(t,e,r)=>{"use strict";r(37855),r(43975),r(81445),r(48324),r(79434)},81445:(t,e,r)=>{"use strict";var i=r(79989),n=r(36812),s=r(30734),o=r(23691),a=r(83430),l=r(46549),c=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{keyFor:function(t){if(!s(t))throw new TypeError(o(t)+" is not a symbol");if(n(c,t))return c[t]}})},93531:(t,e,r)=>{"use strict";r(35405)("matchAll")},64155:(t,e,r)=>{"use strict";r(35405)("match")},95906:(t,e,r)=>{"use strict";r(35405)("replace")},50549:(t,e,r)=>{"use strict";r(35405)("search")},96285:(t,e,r)=>{"use strict";r(35405)("species")},18200:(t,e,r)=>{"use strict";r(35405)("split")},69373:(t,e,r)=>{"use strict";var i=r(35405),n=r(13032);i("toPrimitive"),n()},66793:(t,e,r)=>{"use strict";var i=r(76058),n=r(35405),s=r(55997);n("toStringTag"),s(i("Symbol"),"Symbol")},44578:(t,e,r)=>{"use strict";r(35405)("unscopables")},95194:(t,e,r)=>{"use strict";var i=r(54872),n=r(6310),s=r(68700),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",(function(t){var e=o(this),r=n(e),i=s(t),a=i>=0?i:r+i;return a<0||a>=r?void 0:e[a]}))},36664:(t,e,r)=>{"use strict";var i=r(68844),n=r(54872),s=i(r(70357)),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("copyWithin",(function(t,e){return s(o(this),t,e,arguments.length>2?arguments[2]:void 0)}))},55980:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).every,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("every",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},79943:(t,e,r)=>{"use strict";var i=r(54872),n=r(62872),s=r(71530),o=r(50926),a=r(22615),l=r(68844),c=r(3689),h=i.aTypedArray,u=i.exportTypedArrayMethod,d=l("".slice);u("fill",(function(t){var e=arguments.length;h(this);var r="Big"===d(o(this),0,3)?s(t):+t;return a(n,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),c((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},96089:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filter,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filter",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}))},48690:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).findIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},82:(t,e,r)=>{"use strict";var i=r(54872),n=r(61969).findLastIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},20522:(t,e,r)=>{"use strict";var i=r(54872),n=r(61969).findLast,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},18539:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).find,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("find",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},29068:(t,e,r)=>{"use strict";r(31158)("Float32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},70292:(t,e,r)=>{"use strict";r(31158)("Float64",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},45385:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).forEach,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("forEach",(function(t){n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},59495:(t,e,r)=>{"use strict";var i=r(39800);(0,r(54872).exportTypedArrayStaticMethod)("from",r(41304),i)},85552:(t,e,r)=>{"use strict";var i=r(54872),n=r(84328).includes,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("includes",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},31803:(t,e,r)=>{"use strict";var i=r(54872),n=r(84328).indexOf,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("indexOf",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},89988:(t,e,r)=>{"use strict";r(31158)("Int16",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},854:(t,e,r)=>{"use strict";r(31158)("Int32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},55304:(t,e,r)=>{"use strict";r(31158)("Int8",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},91565:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(54872),a=r(752),l=r(44201)("iterator"),c=i.Uint8Array,h=s(a.values),u=s(a.keys),d=s(a.entries),p=o.aTypedArray,f=o.exportTypedArrayMethod,m=c&&c.prototype,g=!n((function(){m[l].call([1])})),A=!!m&&m.values&&m[l]===m.values&&"values"===m.values.name,y=function(){return h(p(this))};f("entries",(function(){return d(p(this))}),g),f("keys",(function(){return u(p(this))}),g),f("values",y,g||!A,{name:"values"}),f(l,y,g||!A,{name:"values"})},67987:(t,e,r)=>{"use strict";var i=r(54872),n=r(68844),s=i.aTypedArray,o=i.exportTypedArrayMethod,a=n([].join);o("join",(function(t){return a(s(this),t)}))},49365:(t,e,r)=>{"use strict";var i=r(54872),n=r(61735),s=r(60953),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return n(s,o(this),e>1?[t,arguments[1]]:[t])}))},80677:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).map,s=r(47338),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("map",(function(t){return n(o(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(s(t))(e)}))}))},19038:(t,e,r)=>{"use strict";var i=r(54872),n=r(39800),s=i.aTypedArrayConstructor;(0,i.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,e=arguments.length,r=new(s(this))(e);e>t;)r[t]=arguments[t++];return r}),n)},41165:(t,e,r)=>{"use strict";var i=r(54872),n=r(88820).right,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},18118:(t,e,r)=>{"use strict";var i=r(54872),n=r(88820).left,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},71522:(t,e,r)=>{"use strict";var i=r(54872),n=i.aTypedArray,s=i.exportTypedArrayMethod,o=Math.floor;s("reverse",(function(){for(var t,e=this,r=n(e).length,i=o(r/2),s=0;s{"use strict";var i=r(19037),n=r(22615),s=r(54872),o=r(6310),a=r(83250),l=r(90690),c=r(3689),h=i.RangeError,u=i.Int8Array,d=u&&u.prototype,p=d&&d.set,f=s.aTypedArray,m=s.exportTypedArrayMethod,g=!c((function(){var t=new Uint8ClampedArray(2);return n(p,t,{length:1,0:3},1),3!==t[1]})),A=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new u(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));m("set",(function(t){f(this);var e=a(arguments.length>1?arguments[1]:void 0,1),r=l(t);if(g)return n(p,this,r,e);var i=this.length,s=o(r),c=0;if(s+e>i)throw new h("Wrong length");for(;c{"use strict";var i=r(54872),n=r(47338),s=r(3689),o=r(96004),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("slice",(function(t,e){for(var r=o(a(this),t,e),i=n(this),s=0,l=r.length,c=new i(l);l>s;)c[s]=r[s++];return c}),s((function(){new Int8Array(1).slice()})))},7300:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).some,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("some",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},93356:(t,e,r)=>{"use strict";var i=r(19037),n=r(46576),s=r(3689),o=r(10509),a=r(50382),l=r(54872),c=r(97365),h=r(37298),u=r(3615),d=r(27922),p=l.aTypedArray,f=l.exportTypedArrayMethod,m=i.Uint16Array,g=m&&n(m.prototype.sort),A=!(!g||s((function(){g(new m(2),null)}))&&s((function(){g(new m(2),{})}))),y=!!g&&!s((function(){if(u)return u<74;if(c)return c<67;if(h)return!0;if(d)return d<602;var t,e,r=new m(516),i=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,i[t]=t-2*e+3;for(g(r,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==i[t])return!0}));f("sort",(function(t){return void 0!==t&&o(t),y?g(this,t):a(p(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!y||A)},62533:(t,e,r)=>{"use strict";var i=r(54872),n=r(43126),s=r(27578),o=r(47338),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("subarray",(function(t,e){var r=a(this),i=r.length,l=s(t,i);return new(o(r))(r.buffer,r.byteOffset+l*r.BYTES_PER_ELEMENT,n((void 0===e?i:s(e,i))-l))}))},99724:(t,e,r)=>{"use strict";var i=r(19037),n=r(61735),s=r(54872),o=r(3689),a=r(96004),l=i.Int8Array,c=s.aTypedArray,h=s.exportTypedArrayMethod,u=[].toLocaleString,d=!!l&&o((function(){u.call(new l(1))}));h("toLocaleString",(function(){return n(u,d?a(c(this)):c(this),a(arguments))}),o((function(){return[1,2].toLocaleString()!==new l([1,2]).toLocaleString()}))||!o((function(){l.prototype.toLocaleString.call([1,2])})))},24224:(t,e,r)=>{"use strict";var i=r(26166),n=r(54872),s=n.aTypedArray,o=n.exportTypedArrayMethod,a=n.getTypedArrayConstructor;o("toReversed",(function(){return i(s(this),a(this))}))},61121:(t,e,r)=>{"use strict";var i=r(54872),n=r(68844),s=r(10509),o=r(59976),a=i.aTypedArray,l=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,h=n(i.TypedArrayPrototype.sort);c("toSorted",(function(t){void 0!==t&&s(t);var e=a(this),r=o(l(e),e);return h(r,t)}))},99901:(t,e,r)=>{"use strict";var i=r(54872).exportTypedArrayMethod,n=r(3689),s=r(19037),o=r(68844),a=s.Uint8Array,l=a&&a.prototype||{},c=[].toString,h=o([].join);n((function(){c.call({})}))&&(c=function(){return h(this)});var u=l.toString!==c;i("toString",c,u)},75679:(t,e,r)=>{"use strict";r(31158)("Uint16",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},18557:(t,e,r)=>{"use strict";r(31158)("Uint32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},28607:(t,e,r)=>{"use strict";r(31158)("Uint8",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},30938:(t,e,r)=>{"use strict";r(31158)("Uint8",(function(t){return function(e,r,i){return t(this,e,r,i)}}),!0)},37133:(t,e,r)=>{"use strict";var i=r(16134),n=r(54872),s=r(9401),o=r(68700),a=r(71530),l=n.aTypedArray,c=n.getTypedArrayConstructor,h=n.exportTypedArrayMethod,u=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();h("with",{with:function(t,e){var r=l(this),n=o(t),h=s(r)?a(e):+e;return i(r,c(r),n,h)}}.with,!u)},622:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=String.fromCharCode,a=n("".charAt),l=n(/./.exec),c=n("".slice),h=/^[\da-f]{2}$/i,u=/^[\da-f]{4}$/i;i({global:!0},{unescape:function(t){for(var e,r,i=s(t),n="",d=i.length,p=0;p{"use strict";var i,n=r(71594),s=r(19037),o=r(68844),a=r(6045),l=r(45375),c=r(20319),h=r(70637),u=r(48999),d=r(618).enforce,p=r(3689),f=r(59834),m=Object,g=Array.isArray,A=m.isExtensible,y=m.isFrozen,v=m.isSealed,x=m.freeze,b=m.seal,_={},w={},E=!s.ActiveXObject&&"ActiveXObject"in s,M=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},S=c("WeakMap",M,h),C=S.prototype,T=o(C.set);if(f)if(E){i=h.getConstructor(M,"WeakMap",!0),l.enable();var I=o(C.delete),R=o(C.has),B=o(C.get);a(C,{delete:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),I(this,t)||e.frozen.delete(t)}return I(this,t)},has:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),R(this,t)||e.frozen.has(t)}return R(this,t)},get:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),R(this,t)?B(this,t):e.frozen.get(t)}return B(this,t)},set:function(t,e){if(u(t)&&!A(t)){var r=d(this);r.frozen||(r.frozen=new i),R(this,t)?T(this,t,e):r.frozen.set(t,e)}else T(this,t,e);return this}})}else n&&p((function(){var t=x([]);return T(new S,t,1),!y(t)}))&&a(C,{set:function(t,e){var r;return g(t)&&(y(t)?r=_:v(t)&&(r=w)),T(this,t,e),r===_&&x(t),r===w&&b(t),this}})},51090:(t,e,r)=>{"use strict";r(45164)},87884:(t,e,r)=>{"use strict";r(20319)("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70637))},50414:(t,e,r)=>{"use strict";r(87884)},89503:(t,e,r)=>{"use strict";r(95879)},86247:(t,e,r)=>{"use strict";var i=r(67697),n=r(62148),s=r(22961),o=ArrayBuffer.prototype;i&&!("detached"in o)&&n(o,"detached",{configurable:!0,get:function(){return s(this)}})},43097:(t,e,r)=>{"use strict";var i=r(79989),n=r(29195);n&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},21412:(t,e,r)=>{"use strict";var i=r(79989),n=r(29195);n&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},4154:(t,e,r)=>{"use strict";r(92176)},7802:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filterReject,s=r(87370);i({target:"Array",proto:!0,forced:!0},{filterOut:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("filterOut")},54883:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filterReject,s=r(87370);i({target:"Array",proto:!0,forced:!0},{filterReject:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("filterReject")},20097:(t,e,r)=>{"use strict";r(93383)},38197:(t,e,r)=>{"use strict";r(59867)},18073:(t,e,r)=>{"use strict";r(79989)({target:"Array",stat:!0},{fromAsync:r(2231)})},96882:(t,e,r)=>{"use strict";var i=r(79989),n=r(16834),s=r(87370),o=r(44416);i({target:"Array",proto:!0,name:"groupToMap",forced:r(53931)||!n("groupByToMap")},{groupByToMap:o}),s("groupByToMap")},22525:(t,e,r)=>{"use strict";var i=r(79989),n=r(64976),s=r(16834),o=r(87370);i({target:"Array",proto:!0,forced:!s("groupBy")},{groupBy:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),o("groupBy")},32539:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370),s=r(44416);i({target:"Array",proto:!0,forced:r(53931)},{groupToMap:s}),n("groupToMap")},36208:(t,e,r)=>{"use strict";var i=r(79989),n=r(64976),s=r(87370);i({target:"Array",proto:!0},{group:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("group")},5082:(t,e,r)=>{"use strict";var i=r(79989),n=r(92297),s=Object.isFrozen,o=function(t,e){if(!s||!n(t)||!s(t))return!1;for(var r,i=0,o=t.length;i{"use strict";var i=r(67697),n=r(87370),s=r(90690),o=r(6310),a=r(62148);i&&(a(Array.prototype,"lastIndex",{configurable:!0,get:function(){var t=s(this),e=o(t);return 0===e?0:e-1}}),n("lastIndex"))},32221:(t,e,r)=>{"use strict";var i=r(67697),n=r(87370),s=r(90690),o=r(6310),a=r(62148);i&&(a(Array.prototype,"lastItem",{configurable:!0,get:function(){var t=s(this),e=o(t);return 0===e?void 0:t[e-1]},set:function(t){var e=s(this),r=o(e);return e[0===r?0:r-1]=t}}),n("lastItem"))},67890:(t,e,r)=>{"use strict";r(29830)},47041:(t,e,r)=>{"use strict";r(12894)},86322:(t,e,r)=>{"use strict";r(93530)},92253:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370);i({target:"Array",proto:!0,forced:!0},{uniqueBy:r(12397)}),n("uniqueBy")},97554:(t,e,r)=>{"use strict";r(21319)},11070:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(76058),o=r(10509),a=r(767),l=r(11880),c=r(6045),h=r(62148),u=r(44201),d=r(618),p=r(29199),f=s("Promise"),m=s("SuppressedError"),g=ReferenceError,A=u("asyncDispose"),y=u("toStringTag"),v="AsyncDisposableStack",x=d.set,b=d.getterFor(v),_="async-dispose",w="disposed",E=function(t){var e=b(t);if(e.state===w)throw new g(v+" already disposed");return e},M=function(){x(a(this,S),{type:v,state:"pending",stack:[]}),n||(this.disposed=!1)},S=M.prototype;c(S,{disposeAsync:function(){var t=this;return new f((function(e,r){var i=b(t);if(i.state===w)return e(void 0);i.state=w,n||(t.disposed=!0);var s,o=i.stack,a=o.length,l=!1,c=function(t){l?s=new m(t,s):(l=!0,s=t),h()},h=function(){if(a){var t=o[--a];o[a]=null;try{f.resolve(t()).then(h,c)}catch(t){c(t)}}else i.stack=null,l?r(s):e(void 0)};h()}))},use:function(t){return p(E(this),t,_),t},adopt:function(t,e){var r=E(this);return o(e),p(r,void 0,_,(function(){return e(t)})),t},defer:function(t){var e=E(this);o(t),p(e,void 0,_,t)},move:function(){var t=E(this),e=new M;return b(e).stack=t.stack,t.stack=[],t.state=w,n||(this.disposed=!0),e}}),n&&h(S,"disposed",{configurable:!0,get:function(){return b(this).state===w}}),l(S,A,S.disposeAsync,{name:"disposeAsync"}),l(S,y,v,{nonWritable:!0}),i({global:!0,constructor:!0},{AsyncDisposableStack:M})},77299:(t,e,r)=>{"use strict";r(79989)({target:"AsyncIterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(40164)})},15694:(t,e,r)=>{"use strict";var i=r(22615),n=r(11880),s=r(76058),o=r(54849),a=r(36812),l=r(44201),c=r(23070),h=l("asyncDispose"),u=s("Promise");a(c,h)||n(c,h,(function(){var t=this;return new u((function(e,r){var n=o(t,"return");n?u.resolve(i(n,t)).then((function(){e(void 0)}),r):e(void 0)}))}))},64578:(t,e,r)=>{"use strict";var i=r(79989),n=r(767),s=r(61868),o=r(75773),a=r(36812),l=r(44201),c=r(23070),h=r(53931),u=l("toStringTag"),d=TypeError,p=function(){if(n(this,c),s(this)===c)throw new d("Abstract class AsyncIterator not directly constructable")};p.prototype=c,a(c,u)||o(c,u,"AsyncIterator"),!h&&a(c,"constructor")&&c.constructor!==Object||o(c,"constructor",p),i({global:!0,constructor:!0,forced:h},{AsyncIterator:p})},17815:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(17394),h=r(27807),u=r(53931),d=c((function(t){var e=this;return new t((function(r,i){var o=function(t){e.done=!0,i(t)},a=function(){try{t.resolve(s(n(e.next,e.iterator))).then((function(t){try{s(t).done?(e.done=!0,r(h(void 0,!0))):e.remaining?(e.remaining--,a()):r(h(t.value,!1))}catch(t){o(t)}}),o)}catch(t){o(t)}};a()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:u},{drop:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},19029:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).every;i({target:"AsyncIterator",proto:!0,real:!0},{every:function(t){return n(this,t)}})},6237:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(22302),c=r(17394),h=r(27807),u=r(52399),d=r(53931),p=c((function(t){var e=this,r=e.iterator,i=e.predicate;return new t((function(s,l){var c=function(t){e.done=!0,l(t)},d=function(t){u(r,c,t,c)},p=function(){try{t.resolve(o(n(e.next,r))).then((function(r){try{if(o(r).done)e.done=!0,s(h(void 0,!0));else{var n=r.value;try{var l=i(n,e.counter++),u=function(t){t?s(h(n,!1)):p()};a(l)?t.resolve(l).then(u,d):u(l)}catch(t){d(t)}}}catch(t){c(t)}}),c)}catch(t){c(t)}};p()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:d},{filter:function(t){return o(this),s(t),new p(l(this),{predicate:t})}})},81954:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).find;i({target:"AsyncIterator",proto:!0,real:!0},{find:function(t){return n(this,t)}})},87152:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(22302),c=r(17394),h=r(27807),u=r(11427),d=r(52399),p=r(53931),f=c((function(t){var e=this,r=e.iterator,i=e.mapper;return new t((function(s,l){var c=function(t){e.done=!0,l(t)},p=function(t){d(r,c,t,c)},f=function(){try{t.resolve(o(n(e.next,r))).then((function(r){try{if(o(r).done)e.done=!0,s(h(void 0,!0));else{var n=r.value;try{var l=i(n,e.counter++),d=function(t){try{e.inner=u(t),m()}catch(t){p(t)}};a(l)?t.resolve(l).then(d,p):d(l)}catch(t){p(t)}}}catch(t){c(t)}}),c)}catch(t){c(t)}},m=function(){var r=e.inner;if(r)try{t.resolve(o(n(r.next,r.iterator))).then((function(t){try{o(t).done?(e.inner=null,f()):s(h(t.value,!1))}catch(t){p(t)}}),p)}catch(t){p(t)}else f()};m()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:p},{flatMap:function(t){return o(this),s(t),new f(l(this),{mapper:t,inner:null})}})},89667:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).forEach;i({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(t){return n(this,t)}})},49118:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(23622),o=r(11427),a=r(23070),l=r(40219);i({target:"AsyncIterator",stat:!0,forced:r(53931)},{from:function(t){var e=o("string"==typeof t?n(t):t);return s(a,e.iterator)?e.iterator:new l(e)}})},32411:(t,e,r)=>{"use strict";r(79989)({target:"AsyncIterator",proto:!0,real:!0,forced:!0},{indexed:r(40164)})},3256:(t,e,r)=>{"use strict";var i=r(79989),n=r(82412);i({target:"AsyncIterator",proto:!0,real:!0,forced:r(53931)},{map:n})},85625:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(76058),c=r(22302),h=r(52399),u=l("Promise"),d=TypeError;i({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(t){o(this),s(t);var e=c(this),r=e.iterator,i=e.next,l=arguments.length<2,p=l?void 0:arguments[1],f=0;return new u((function(e,s){var c=function(t){h(r,s,t,s)},m=function(){try{u.resolve(o(n(i,r))).then((function(r){try{if(o(r).done)l?s(new d("Reduce of empty iterator with no initial value")):e(p);else{var i=r.value;if(l)l=!1,p=i,m();else try{var n=t(p,i,f),h=function(t){p=t,m()};a(n)?u.resolve(n).then(h,c):h(n)}catch(t){c(t)}}f++}catch(t){s(t)}}),s)}catch(t){s(t)}};m()}))}})},10914:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).some;i({target:"AsyncIterator",proto:!0,real:!0},{some:function(t){return n(this,t)}})},14494:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(17394),h=r(27807),u=r(53931),d=c((function(t){var e,r=this,i=r.iterator;if(!r.remaining--){var o=h(void 0,!0);return r.done=!0,void 0!==(e=i.return)?t.resolve(n(e,i,void 0)).then((function(){return o})):o}return t.resolve(n(r.next,i)).then((function(t){return s(t).done?(r.done=!0,h(void 0,!0)):h(t.value,!1)})).then(null,(function(t){throw r.done=!0,t}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:u},{take:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},9468:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).toArray;i({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return n(this,void 0,[])}})},24587:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554);"function"==typeof BigInt&&i({target:"BigInt",stat:!0,forced:!0},{range:function(t,e,r){return new n(t,e,r,"bigint",BigInt(0),BigInt(1))}})},60779:(t,e,r)=>{"use strict";var i=r(79989),n=r(61735),s=r(41544),o=r(76058),a=r(25391),l=Object,c=function(){var t=o("Object","freeze");return t?t(a(null)):a(null)};i({global:!0,forced:!0},{compositeKey:function(){return n(s,l,arguments).get("object",c)}})},65503:(t,e,r)=>{"use strict";var i=r(79989),n=r(41544),s=r(76058),o=r(61735);i({global:!0,forced:!0},{compositeSymbol:function(){return 1===arguments.length&&"string"==typeof arguments[0]?s("Symbol").for(arguments[0]):o(n,null,arguments).get("symbol",s("Symbol"))}})},50236:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(15477).unpack,o=n(DataView.prototype.getUint16);i({target:"DataView",proto:!0},{getFloat16:function(t){var e=o(this,t,arguments.length>1&&arguments[1]);return s([255&e,e>>8&255],10)}})},89246:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844)(DataView.prototype.getUint8);i({target:"DataView",proto:!0,forced:!0},{getUint8Clamped:function(t){return n(this,t)}})},31186:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(50926),o=r(19842),a=r(15477).pack,l=r(76043),c=TypeError,h=n(DataView.prototype.setUint16);i({target:"DataView",proto:!0},{setFloat16:function(t,e){if("DataView"!==s(this))throw new c("Incorrect receiver");var r=o(t),i=a(l(e),10,2);return h(this,r,i[1]<<8|i[0],arguments.length>2&&arguments[2])}})},9279:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(50926),o=r(19842),a=r(87191),l=TypeError,c=n(DataView.prototype.setUint8);i({target:"DataView",proto:!0,forced:!0},{setUint8Clamped:function(t,e){if("DataView"!==s(this))throw new l("Incorrect receiver");var r=o(t);return c(this,r,a(e))}})},26725:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(76058),o=r(10509),a=r(767),l=r(11880),c=r(6045),h=r(62148),u=r(44201),d=r(618),p=r(29199),f=s("SuppressedError"),m=ReferenceError,g=u("dispose"),A=u("toStringTag"),y="DisposableStack",v=d.set,x=d.getterFor(y),b="sync-dispose",_="disposed",w=function(t){var e=x(t);if(e.state===_)throw new m(y+" already disposed");return e},E=function(){v(a(this,M),{type:y,state:"pending",stack:[]}),n||(this.disposed=!1)},M=E.prototype;c(M,{dispose:function(){var t=x(this);if(t.state!==_){t.state=_,n||(this.disposed=!0);for(var e,r=t.stack,i=r.length,s=!1;i;){var o=r[--i];r[i]=null;try{o()}catch(t){s?e=new f(t,e):(s=!0,e=t)}}if(t.stack=null,s)throw e}},use:function(t){return p(w(this),t,b),t},adopt:function(t,e){var r=w(this);return o(e),p(r,void 0,b,(function(){e(t)})),t},defer:function(t){var e=w(this);o(t),p(e,void 0,b,t)},move:function(){var t=w(this),e=new E;return x(e).stack=t.stack,t.stack=[],t.state=_,n||(this.disposed=!0),e}}),n&&h(M,"disposed",{configurable:!0,get:function(){return x(this).state===_}}),l(M,g,M.dispose,{name:"dispose"}),l(M,A,y,{nonWritable:!0}),i({global:!0,constructor:!0},{DisposableStack:E})},26125:(t,e,r)=>{"use strict";r(79989)({target:"Function",proto:!0,forced:!0},{demethodize:r(33505)})},2820:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(69985),o=r(6738),a=r(36812),l=r(67697),c=Object.getOwnPropertyDescriptor,h=/^\s*class\b/,u=n(h.exec);i({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(t){return s(t)&&!function(t){try{if(!l||!u(h,o(t)))return!1}catch(t){}var e=c(t,"prototype");return!!e&&a(e,"writable")&&!e.writable}(t)}})},62517:(t,e,r)=>{"use strict";r(79989)({target:"Function",stat:!0,forced:!0},{isConstructor:r(19429)})},54947:(t,e,r)=>{"use strict";var i=r(44201),n=r(72560).f,s=i("metadata"),o=Function.prototype;void 0===o[s]&&n(o,s,{value:null})},74993:(t,e,r)=>{"use strict";r(79989)({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:r(33505)})},78832:(t,e,r)=>{"use strict";r(45398)},50647:(t,e,r)=>{"use strict";r(79989)({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(47082)})},67602:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(767),o=r(85027),a=r(69985),l=r(61868),c=r(62148),h=r(76522),u=r(3689),d=r(36812),p=r(44201),f=r(12013).IteratorPrototype,m=r(67697),g=r(53931),A="constructor",y="Iterator",v=p("toStringTag"),x=TypeError,b=n[y],_=g||!a(b)||b.prototype!==f||!u((function(){b({})})),w=function(){if(s(this,f),l(this)===f)throw new x("Abstract class Iterator not directly constructable")},E=function(t,e){m?c(f,t,{configurable:!0,get:function(){return e},set:function(e){if(o(this),this===f)throw new x("You can't redefine this property");d(this,t)?this[t]=e:h(this,t,e)}}):f[t]=e};d(f,v)||E(v,y),!_&&d(f,A)&&f[A]!==Object||E(A,w),w.prototype=f,i({global:!0,constructor:!0,forced:_},{Iterator:w})},82639:(t,e,r)=>{"use strict";var i=r(22615),n=r(11880),s=r(54849),o=r(36812),a=r(44201),l=r(12013).IteratorPrototype,c=a("dispose");o(l,c)||n(l,c,(function(){var t=s(this,"return");t&&i(t,this)}))},63986:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(65419),h=r(53931),u=c((function(){for(var t,e=this.iterator,r=this.next;this.remaining;)if(this.remaining--,t=s(n(r,e)),this.done=!!t.done)return;if(t=s(n(r,e)),!(this.done=!!t.done))return t.value}));i({target:"Iterator",proto:!0,real:!0,forced:h},{drop:function(t){s(this);var e=l(a(+t));return new u(o(this),{remaining:e})}})},16054:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{every:function(t){o(this),s(t);var e=a(this),r=0;return!n(e,(function(e,i){if(!t(e,r++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},53476:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(22302),l=r(65419),c=r(71228),h=r(53931),u=l((function(){for(var t,e,r=this.iterator,i=this.predicate,s=this.next;;){if(t=o(n(s,r)),this.done=!!t.done)return;if(e=t.value,c(r,i,[e,this.counter++],!0))return e}}));i({target:"Iterator",proto:!0,real:!0,forced:h},{filter:function(t){return o(this),s(t),new u(a(this),{predicate:t})}})},70928:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{find:function(t){o(this),s(t);var e=a(this),r=0;return n(e,(function(e,i){if(t(e,r++))return i(e)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},49411:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(22302),l=r(36752),c=r(65419),h=r(72125),u=r(53931),d=c((function(){for(var t,e,r=this.iterator,i=this.mapper;;){if(e=this.inner)try{if(!(t=o(n(e.next,e.iterator))).done)return t.value;this.inner=null}catch(t){h(r,"throw",t)}if(t=o(n(this.next,r)),this.done=!!t.done)return;try{this.inner=l(i(t.value,this.counter++),!1)}catch(t){h(r,"throw",t)}}}));i({target:"Iterator",proto:!0,real:!0,forced:u},{flatMap:function(t){return o(this),s(t),new d(a(this),{mapper:t,inner:null})}})},30005:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{forEach:function(t){o(this),s(t);var e=a(this),r=0;n(e,(function(e){t(e,r++)}),{IS_RECORD:!0})}})},73494:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(90690),o=r(23622),a=r(12013).IteratorPrototype,l=r(65419),c=r(36752),h=r(53931),u=l((function(){return n(this.next,this.iterator)}),!0);i({target:"Iterator",stat:!0,forced:h},{from:function(t){var e=c("string"==typeof t?s(t):t,!0);return o(a,e.iterator)?e.iterator:new u(e)}})},94564:(t,e,r)=>{"use strict";r(79989)({target:"Iterator",proto:!0,real:!0,forced:!0},{indexed:r(47082)})},41792:(t,e,r)=>{"use strict";var i=r(79989),n=r(88983);i({target:"Iterator",proto:!0,real:!0,forced:r(53931)},{map:n})},5985:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554),s=TypeError;i({target:"Iterator",stat:!0,forced:!0},{range:function(t,e,r){if("number"==typeof t)return new n(t,e,r,"number",0,1);if("bigint"==typeof t)return new n(t,e,r,"bigint",BigInt(0),BigInt(1));throw new s("Incorrect Iterator.range arguments")}})},31107:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302),l=TypeError;i({target:"Iterator",proto:!0,real:!0},{reduce:function(t){o(this),s(t);var e=a(this),r=arguments.length<2,i=r?void 0:arguments[1],c=0;if(n(e,(function(e){r?(r=!1,i=e):i=t(i,e,c),c++}),{IS_RECORD:!0}),r)throw new l("Reduce of empty iterator with no initial value");return i}})},28244:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{some:function(t){o(this),s(t);var e=a(this),r=0;return n(e,(function(e,i){if(t(e,r++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3645:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(65419),h=r(72125),u=r(53931),d=c((function(){var t=this.iterator;if(!this.remaining--)return this.done=!0,h(t,"normal",void 0);var e=s(n(this.next,t));return(this.done=!!e.done)?void 0:e.value}));i({target:"Iterator",proto:!0,real:!0,forced:u},{take:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},58429:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(18734),o=r(22302),a=[].push;i({target:"Iterator",proto:!0,real:!0},{toArray:function(){var t=[];return s(o(n(this)),a,{that:t,IS_RECORD:!0}),t}})},39569:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(29019),o=r(40219),a=r(22302);i({target:"Iterator",proto:!0,real:!0,forced:r(53931)},{toAsync:function(){return new o(a(new s(a(n(this)))))}})},74320:(t,e,r)=>{"use strict";r(79989)({target:"JSON",stat:!0,forced:!r(22818)},{isRawJSON:r(55670)})},20691:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19037),o=r(76058),a=r(68844),l=r(22615),c=r(69985),h=r(48999),u=r(92297),d=r(36812),p=r(34327),f=r(6310),m=r(76522),g=r(3689),A=r(46675),y=r(50146),v=s.JSON,x=s.Number,b=s.SyntaxError,_=v&&v.parse,w=o("Object","keys"),E=Object.getOwnPropertyDescriptor,M=a("".charAt),S=a("".slice),C=a(/./.exec),T=a([].push),I=/^\d$/,R=/^[1-9]$/,B=/^(?:-|\d)$/,L=/^[\t\n\r ]$/,P=function(t,e,r,i){var n,s,o,a,c,p=t[e],m=i&&p===i.value,g=m&&"string"==typeof i.source?{source:i.source}:{};if(h(p)){var A=u(p),y=m?i.nodes:A?[]:{};if(A)for(n=y.length,o=f(p),a=0;a{"use strict";var i=r(79989),n=r(71594),s=r(22818),o=r(76058),a=r(22615),l=r(68844),c=r(69985),h=r(55670),u=r(34327),d=r(76522),p=r(46675),f=r(92643),m=r(14630),g=r(618).set,A=String,y=SyntaxError,v=o("JSON","parse"),x=o("JSON","stringify"),b=o("Object","create"),_=o("Object","freeze"),w=l("".charAt),E=l("".slice),M=l(/./.exec),S=l([].push),C=m(),T=C.length,I="Unacceptable as raw JSON",R=/^[\t\n\r ]$/;i({target:"JSON",stat:!0,forced:!s},{rawJSON:function(t){var e=u(t);if(""===e||M(R,w(e,0))||M(R,w(e,e.length-1)))throw new y(I);var r=v(e);if("object"==typeof r&&null!==r)throw new y(I);var i=b(null);return g(i,{type:"RawJSON"}),d(i,"rawJSON",e),n?_(i):i}}),x&&i({target:"JSON",stat:!0,arity:3,forced:!s},{stringify:function(t,e,r){var i=f(e),n=[],s=x(t,(function(t,e){var r=c(i)?a(i,this,A(t),e):e;return h(r)?C+(S(n,r.rawJSON)-1):r}),r);if("string"!=typeof s)return s;for(var o="",l=s.length,u=0;u{"use strict";var i=r(79989),n=r(9945),s=r(83914).remove;i({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(9945),s=r(83914),o=s.get,a=s.has,l=s.set;i({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,i,s=n(this);return a(s,t)?(r=o(s,t),"update"in e&&(r=e.update(r,t,s),l(s,t,r)),r):(i=e.insert(t,s),l(s,t,i),i)}})},747:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!1!==o(e,(function(t,i){if(!r(t,i,e))return!1}),!0)}})},41099:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){r(t,n,e)&&c(i,n,t)})),i}})},20876:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t,i){if(r(t,i,e))return{key:i}}),!0);return i&&i.key}})},26320:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t,i){if(r(t,i,e))return{value:t}}),!0);return i&&i.value}})},6052:(t,e,r)=>{"use strict";r(79989)({target:"Map",stat:!0,forced:!0},{from:r(28737)})},39879:(t,e,r)=>{"use strict";r(89348)},76791:(t,e,r)=>{"use strict";var i=r(79989),n=r(68600),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(t){return!0===o(s(this),(function(e){if(n(e,t))return!0}),!0)}})},75341:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(18734),o=r(69985),a=r(10509),l=r(83914).Map;i({target:"Map",stat:!0,forced:!0},{keyBy:function(t,e){var r=new(o(this)?this:l);a(e);var i=a(r.set);return s(t,(function(t){n(i,r,e(t),t)})),r}})},40019:(t,e,r)=>{"use strict";var i=r(79989),n=r(9945),s=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(t){var e=s(n(this),(function(e,r){if(e===t)return{key:r}}),!0);return e&&e.key}})},92343:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){c(i,r(t,n,e),t)})),i}})},51096:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){c(i,n,r(t,n,e))})),i}})},4314:(t,e,r)=>{"use strict";var i=r(79989),n=r(9945),s=r(18734),o=r(83914).set;i({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(t){for(var e=n(this),r=arguments.length,i=0;i{"use strict";r(79989)({target:"Map",stat:!0,forced:!0},{of:r(1114)})},23346:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(9945),o=r(10613),a=TypeError;i({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),r=arguments.length<2,i=r?void 0:arguments[1];if(n(t),o(e,(function(n,s){r?(r=!1,i=n):i=t(i,n,s,e)})),r)throw new a("Reduce of empty map with no initial value");return i}})},64984:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!0===o(e,(function(t,i){if(r(t,i,e))return!0}),!0)}})},24453:(t,e,r)=>{"use strict";r(79989)({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:r(41432)})},64078:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(9945),o=r(83914),a=TypeError,l=o.get,c=o.has,h=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{update:function(t,e){var r=s(this),i=arguments.length;n(e);var o=c(r,t);if(!o&&i<3)throw new a("Updating absent value");var u=o?l(r,t):n(i>2?arguments[2]:void 0)(t,r);return h(r,t,e(u,t,r)),r}})},66190:(t,e,r)=>{"use strict";r(79989)({target:"Map",proto:!0,real:!0,forced:!0},{upsert:r(41432)})},25684:(t,e,r)=>{"use strict";var i=r(79989),n=Math.min,s=Math.max;i({target:"Math",stat:!0,forced:!0},{clamp:function(t,e,r){return n(r,s(e,t))}})},31789:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180})},8677:(t,e,r)=>{"use strict";var i=r(79989),n=180/Math.PI;i({target:"Math",stat:!0,forced:!0},{degrees:function(t){return t*n}})},59151:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{f16round:r(76043)})},346:(t,e,r)=>{"use strict";var i=r(79989),n=r(84463),s=r(37788);i({target:"Math",stat:!0,forced:!0},{fscale:function(t,e,r,i,o){return s(n(t,e,r,i,o))}})},91069:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{iaddh:function(t,e,r,i){var n=t>>>0,s=r>>>0;return(e>>>0)+(i>>>0)+((n&s|(n|s)&~(n+s>>>0))>>>31)|0}})},18886:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{imulh:function(t,e){var r=65535,i=+t,n=+e,s=i&r,o=n&r,a=i>>16,l=n>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>16)+((s*l>>>0)+(c&r)>>16)}})},88065:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{isubh:function(t,e,r,i){var n=t>>>0,s=r>>>0;return(e>>>0)-(i>>>0)-((~n&s|~(n^s)&n-s>>>0)>>>31)|0}})},68172:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},60445:(t,e,r)=>{"use strict";var i=r(79989),n=Math.PI/180;i({target:"Math",stat:!0,forced:!0},{radians:function(t){return t*n}})},99457:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{scale:r(84463)})},613:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(70046),o=r(30974),a=r(27807),l=r(618),c="Seeded Random",h=c+" Generator",u=l.set,d=l.getterFor(h),p=TypeError,f=o((function(t){u(this,{type:h,seed:t%2147483647})}),c,(function(){var t=d(this),e=t.seed=(1103515245*t.seed+12345)%2147483647;return a((1073741823&e)/1073741823,!1)}));i({target:"Math",stat:!0,forced:!0},{seededPRNG:function(t){var e=n(t).seed;if(!s(e))throw new p('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new f(e)}})},835:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{signbit:function(t){var e=+t;return e==e&&0===e?1/e==-1/0:e<0}})},926:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{umulh:function(t,e){var r=65535,i=+t,n=+e,s=i&r,o=n&r,a=i>>>16,l=n>>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>>16)+((s*l>>>0)+(c&r)>>>16)}})},82899:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o="Invalid number representation",a=RangeError,l=SyntaxError,c=TypeError,h=parseInt,u=Math.pow,d=/^[\d.a-z]+$/,p=n("".charAt),f=n(d.exec),m=n(1..toString),g=n("".slice),A=n("".split);i({target:"Number",stat:!0,forced:!0},{fromString:function(t,e){var r=1;if("string"!=typeof t)throw new c(o);if(!t.length)throw new l(o);if("-"===p(t,0)&&(r=-1,!(t=g(t,1)).length))throw new l(o);var i=void 0===e?10:s(e);if(i<2||i>36)throw new a("Invalid radix");if(!f(d,t))throw new l(o);var n=A(t,"."),y=h(n[0],i);if(n.length>1&&(y+=h(n[1],i)/u(i,n[1].length)),10===i&&m(y,i)!==t)throw new l(o);return r*y}})},29977:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554);i({target:"Number",stat:!0,forced:!0},{range:function(t,e,r){return new n(t,e,r,"number",0,1)}})},3210:(t,e,r)=>{"use strict";r(44079)},53669:(t,e,r)=>{"use strict";r(14566)},31927:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateEntries:function(t){return new n(t,"entries")}})},77131:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateKeys:function(t){return new n(t,"keys")}})},55174:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateValues:function(t){return new n(t,"values")}})},63503:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(67697),o=r(14241),a=r(10509),l=r(85027),c=r(767),h=r(69985),u=r(981),d=r(48999),p=r(54849),f=r(11880),m=r(6045),g=r(62148),A=r(20920),y=r(44201),v=r(618),x=y("observable"),b="Observable",_="Subscription",w="SubscriptionObserver",E=v.getterFor,M=v.set,S=E(b),C=E(_),T=E(w),I=function(t){this.observer=l(t),this.cleanup=void 0,this.subscriptionObserver=void 0};I.prototype={type:_,clean:function(){var t=this.cleanup;if(t){this.cleanup=void 0;try{t()}catch(t){A(t)}}},close:function(){if(!s){var t=this.facade,e=this.subscriptionObserver;t.closed=!0,e&&(e.closed=!0)}this.observer=void 0},isClosed:function(){return void 0===this.observer}};var R=function(t,e){var r,i=M(this,new I(t));s||(this.closed=!1);try{(r=p(t,"start"))&&n(r,t,this)}catch(t){A(t)}if(!i.isClosed()){var o=i.subscriptionObserver=new B(i);try{var l=e(o),c=l;u(l)||(i.cleanup=h(l.unsubscribe)?function(){c.unsubscribe()}:a(l))}catch(t){return void o.error(t)}i.isClosed()&&i.clean()}};R.prototype=m({},{unsubscribe:function(){var t=C(this);t.isClosed()||(t.close(),t.clean())}}),s&&g(R.prototype,"closed",{configurable:!0,get:function(){return C(this).isClosed()}});var B=function(t){M(this,{type:w,subscriptionState:t}),s||(this.closed=!1)};B.prototype=m({},{next:function(t){var e=T(this).subscriptionState;if(!e.isClosed()){var r=e.observer;try{var i=p(r,"next");i&&n(i,r,t)}catch(t){A(t)}}},error:function(t){var e=T(this).subscriptionState;if(!e.isClosed()){var r=e.observer;e.close();try{var i=p(r,"error");i?n(i,r,t):A(t)}catch(t){A(t)}e.clean()}},complete:function(){var t=T(this).subscriptionState;if(!t.isClosed()){var e=t.observer;t.close();try{var r=p(e,"complete");r&&n(r,e)}catch(t){A(t)}t.clean()}}}),s&&g(B.prototype,"closed",{configurable:!0,get:function(){return T(this).subscriptionState.isClosed()}});var L=function(t){c(this,P),M(this,{type:b,subscriber:a(t)})},P=L.prototype;m(P,{subscribe:function(t){var e=arguments.length;return new R(h(t)?{next:t,error:e>1?arguments[1]:void 0,complete:e>2?arguments[2]:void 0}:d(t)?t:{},S(this).subscriber)}}),f(P,x,(function(){return this})),i({global:!0,constructor:!0,forced:!0},{Observable:L}),o(b)},9818:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(22615),o=r(85027),a=r(19429),l=r(5185),c=r(54849),h=r(18734),u=r(44201)("observable");i({target:"Observable",stat:!0,forced:!0},{from:function(t){var e=a(this)?this:n("Observable"),r=c(o(t),u);if(r){var i=o(s(r,t));return i.constructor===e?i:new e((function(t){return i.subscribe(t)}))}var d=l(t);return new e((function(t){h(d,(function(e,r){if(t.next(e),t.closed)return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),t.complete()}))}})},76314:(t,e,r)=>{"use strict";r(63503),r(9818),r(38771)},38771:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(19429),o=n("Array");i({target:"Observable",stat:!0,forced:!0},{of:function(){for(var t=s(this)?this:n("Observable"),e=arguments.length,r=o(e),i=0;i{"use strict";r(41195)},40393:(t,e,r)=>{"use strict";r(87609)},6616:(t,e,r)=>{"use strict";var i=r(79989),n=r(48742),s=r(9302);i({target:"Promise",stat:!0,forced:!0},{try:function(t){var e=n.f(this),r=s(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}})},90810:(t,e,r)=>{"use strict";r(13505)},19959:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.set;i({target:"Reflect",stat:!0},{defineMetadata:function(t,e,r){var i=arguments.length<4?void 0:o(arguments[3]);a(t,e,s(r),i)}})},73347:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.getMap,l=n.store;i({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var r=arguments.length<3?void 0:o(arguments[2]),i=a(s(e),r,!1);if(void 0===i||!i.delete(t))return!1;if(i.size)return!0;var n=l.get(e);return n.delete(r),!!n.size||l.delete(e)}})},70003:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(33666),o=r(85027),a=r(61868),l=n(r(12397)),c=n([].concat),h=s.keys,u=s.toKey,d=function(t,e){var r=h(t,e),i=a(t);if(null===i)return r;var n=d(i,e);return n.length?r.length?l(c(r,n)):n:r};i({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:u(arguments[1]);return d(o(t),e)}})},71913:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=r(61868),a=n.has,l=n.get,c=n.toKey,h=function(t,e,r){if(a(t,e,r))return l(t,e,r);var i=o(e);return null!==i?h(t,i,r):void 0};i({target:"Reflect",stat:!0},{getMetadata:function(t,e){var r=arguments.length<3?void 0:c(arguments[2]);return h(t,s(e),r)}})},7859:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.keys,a=n.toKey;i({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:a(arguments[1]);return o(s(t),e)}})},79955:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.get,a=n.toKey;i({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var r=arguments.length<3?void 0:a(arguments[2]);return o(t,s(e),r)}})},31138:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=r(61868),a=n.has,l=n.toKey,c=function(t,e,r){if(a(t,e,r))return!0;var i=o(e);return null!==i&&c(t,i,r)};i({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var r=arguments.length<3?void 0:l(arguments[2]);return c(t,s(e),r)}})},28809:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.has,a=n.toKey;i({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var r=arguments.length<3?void 0:a(arguments[2]);return o(t,s(e),r)}})},2946:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.set;i({target:"Reflect",stat:!0},{metadata:function(t,e){return function(r,i){a(t,e,s(r),o(i))}}})},32460:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=r(86350),a=n("".charCodeAt),l=n("".replace),c=RegExp("[!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^`{|}~"+o+"]","g");i({target:"RegExp",stat:!0,forced:!0},{escape:function(t){var e=s(t),r=a(e,0);return(r>47&&r<58?"\\x3":"")+l(e,c,"\\$&")}})},57282:(t,e,r)=>{"use strict";var i=r(79989),n=r(10029),s=r(61034).add;i({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,r=arguments.length;e{"use strict";var i=r(79989),n=r(10029),s=r(61034).remove;i({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(27748);i({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(t){return n(o,this,s(t))}})},15716:(t,e,r)=>{"use strict";var i=r(79989),n=r(27748);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("difference")},{difference:n})},30349:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!1!==o(e,(function(t){if(!r(t,t,e))return!1}),!0)}})},96986:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(61034),a=r(48774),l=o.Set,c=o.add;i({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t){r(t,t,e)&&c(i,t)})),i}})},95681:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t){if(r(t,t,e))return{value:t}}),!0);return i&&i.value}})},13781:(t,e,r)=>{"use strict";r(79989)({target:"Set",stat:!0,forced:!0},{from:r(28737)})},98873:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(72948);i({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(t){return n(o,this,s(t))}})},33442:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(72948);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("intersection")||n((function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:s})},50308:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(97795);i({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(t){return n(o,this,s(t))}})},61964:(t,e,r)=>{"use strict";var i=r(79989),n=r(97795);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isDisjointFrom")},{isDisjointFrom:n})},18955:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(26951);i({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(t){return n(o,this,s(t))}})},69878:(t,e,r)=>{"use strict";var i=r(79989),n=r(26951);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isSubsetOf")},{isSubsetOf:n})},65115:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(3894);i({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(t){return n(o,this,s(t))}})},52915:(t,e,r)=>{"use strict";var i=r(79989),n=r(3894);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isSupersetOf")},{isSupersetOf:n})},19490:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10029),o=r(48774),a=r(34327),l=n([].join),c=n([].push);i({target:"Set",proto:!0,real:!0,forced:!0},{join:function(t){var e=s(this),r=void 0===t?",":a(t),i=[];return o(e,(function(t){c(i,t)})),l(i,r)}})},95752:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(61034),a=r(48774),l=o.Set,c=o.add;i({target:"Set",proto:!0,real:!0,forced:!0},{map:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t){c(i,r(t,t,e))})),i}})},32789:(t,e,r)=>{"use strict";r(79989)({target:"Set",stat:!0,forced:!0},{of:r(1114)})},27913:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(10029),o=r(48774),a=TypeError;i({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),r=arguments.length<2,i=r?void 0:arguments[1];if(n(t),o(e,(function(n){r?(r=!1,i=n):i=t(i,n,n,e)})),r)throw new a("Reduce of empty set with no initial value");return i}})},6831:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!0===o(e,(function(t){if(r(t,t,e))return!0}),!0)}})},90243:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(62289);i({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(t){return n(o,this,s(t))}})},98686:(t,e,r)=>{"use strict";var i=r(79989),n=r(62289);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("symmetricDifference")},{symmetricDifference:n})},98030:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(75674);i({target:"Set",proto:!0,real:!0,forced:!0},{union:function(t){return n(o,this,s(t))}})},22275:(t,e,r)=>{"use strict";var i=r(79989),n=r(75674);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("union")},{union:n})},86220:(t,e,r)=>{"use strict";var i=r(79989),n=r(10730).charAt,s=r(74684),o=r(68700),a=r(34327);i({target:"String",proto:!0,forced:!0},{at:function(t){var e=a(s(this)),r=e.length,i=o(t),l=i>=0?i:r+i;return l<0||l>=r?void 0:n(e,l)}})},95853:(t,e,r)=>{"use strict";var i=r(79989),n=r(30974),s=r(27807),o=r(74684),a=r(34327),l=r(618),c=r(10730),h=c.codeAt,u=c.charAt,d="String Iterator",p=l.set,f=l.getterFor(d),m=n((function(t){p(this,{type:d,string:t,index:0})}),"String",(function(){var t,e=f(this),r=e.string,i=e.index;return i>=r.length?s(void 0,!0):(t=u(r,i),e.index+=t.length,s({codePoint:h(t,0),position:i},!1))}));i({target:"String",proto:!0,forced:!0},{codePoints:function(){return new m(a(o(this)))}})},21917:(t,e,r)=>{"use strict";r(79989)({target:"String",stat:!0,forced:!0},{cooked:r(8195)})},66084:(t,e,r)=>{"use strict";var i=r(71594),n=r(79989),s=r(98702),o=r(68844),a=r(61735),l=r(85027),c=r(90690),h=r(69985),u=r(6310),d=r(72560).f,p=r(9015),f=r(16803),m=r(8195),g=r(98985),A=r(86350),y=new f.WeakMap,v=f.get,x=f.has,b=f.set,_=Array,w=TypeError,E=Object.freeze||Object,M=Object.isFrozen,S=Math.min,C=o("".charAt),T=o("".slice),I=o("".split),R=o(/./.exec),B=/([\n\u2028\u2029]|\r\n?)/g,L=RegExp("^["+A+"]*"),P=RegExp("[^"+A+"]"),D="Invalid tag",O=function(t,e){if(void 0===e||t===e)return t;for(var r=0,i=S(t.length,e.length);r0)throw new w("Invalid opening line");e[1]=""}if(p){if(1===e.length||R(P,e[e.length-1]))throw new w("Invalid closing line");e[e.length-2]="",e[e.length-1]=""}for(var f=2;f{"use strict";r(12281)},59012:(t,e,r)=>{"use strict";r(79866)},38320:(t,e,r)=>{"use strict";r(56532)},78988:(t,e,r)=>{"use strict";r(35237)},26810:(t,e,r)=>{"use strict";var i=r(79989),n=r(23622),s=r(61868),o=r(49385),a=r(8758),l=r(25391),c=r(75773),h=r(75684),u=r(65411),d=r(13841),p=r(44201)("toStringTag"),f=Error,m=function(t,e,r){var i,a=n(g,this);return o?i=o(new f,a?s(this):g):(i=a?this:l(g),c(i,p,"Error")),void 0!==r&&c(i,"message",d(r)),u(i,m,i.stack,1),c(i,"error",t),c(i,"suppressed",e),i};o?o(m,f):a(m,f,{name:!0});var g=m.prototype=l(f.prototype,{constructor:h(1,m),message:h(1,""),name:h(1,"SuppressedError")});i({global:!0,constructor:!0,arity:3},{SuppressedError:m})},80546:(t,e,r)=>{"use strict";var i=r(19037),n=r(35405),s=r(72560).f,o=r(82474).f,a=i.Symbol;if(n("asyncDispose"),a){var l=o(a,"asyncDispose");l.enumerable&&l.configurable&&l.writable&&s(a,"asyncDispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},62586:(t,e,r)=>{"use strict";var i=r(19037),n=r(35405),s=r(72560).f,o=r(82474).f,a=i.Symbol;if(n("dispose"),a){var l=o(a,"dispose");l.enumerable&&l.configurable&&l.writable&&s(a,"dispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},46019:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(18992)})},5010:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(18992)})},45749:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(8957)})},4835:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(8957)})},58799:(t,e,r)=>{"use strict";r(35405)("matcher")},27041:(t,e,r)=>{"use strict";r(35405)("metadataKey")},18134:(t,e,r)=>{"use strict";r(35405)("metadata")},44767:(t,e,r)=>{"use strict";r(35405)("observable")},92981:(t,e,r)=>{"use strict";r(35405)("patternMatch")},85044:(t,e,r)=>{"use strict";r(35405)("replaceAll")},96256:(t,e,r)=>{"use strict";r(95194)},18241:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filterReject,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filterOut",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},59359:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filterReject,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filterReject",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},1274:(t,e,r)=>{"use strict";r(82)},54302:(t,e,r)=>{"use strict";r(20522)},76677:(t,e,r)=>{"use strict";var i=r(76058),n=r(52655),s=r(2231),o=r(54872),a=r(59976),l=o.aTypedArrayConstructor;(0,o.exportTypedArrayStaticMethod)("fromAsync",(function(t){var e=this,r=arguments.length,o=r>1?arguments[1]:void 0,c=r>2?arguments[2]:void 0;return new(i("Promise"))((function(r){n(e),r(s(t,o,c))})).then((function(t){return a(l(e),t)}))}),!0)},30548:(t,e,r)=>{"use strict";var i=r(54872),n=r(64976),s=r(47338),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("groupBy",(function(t){var e=arguments.length>1?arguments[1]:void 0;return n(o(this),t,e,s)}),!0)},25298:(t,e,r)=>{"use strict";r(24224)},11882:(t,e,r)=>{"use strict";r(61121)},915:(t,e,r)=>{"use strict";var i=r(54872),n=r(6310),s=r(9401),o=r(27578),a=r(71530),l=r(68700),c=r(3689),h=i.aTypedArray,u=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,p=Math.max,f=Math.min;d("toSpliced",(function(t,e){var r,i,c,d,m,g,A,y=h(this),v=u(y),x=n(y),b=o(t,x),_=arguments.length,w=0;if(0===_)r=i=0;else if(1===_)r=0,i=x-b;else if(i=f(p(l(e),0),x-b),r=_-2){d=new v(r),c=s(d);for(var E=2;E<_;E++)m=arguments[E],d[E-2]=c?a(m):+m}for(A=new v(g=x+r-i);w{"use strict";var i=r(68844),n=r(54872),s=r(59976),o=r(12397),a=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,h=i(o);c("uniqueBy",(function(t){return a(this),s(l(this),h(this,t))}),!0)},17911:(t,e,r)=>{"use strict";r(37133)},23579:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(33425),a=r(51082),l=r(36812),c=r(59976),h=r(18368),u=r(9093),d=h.c2i,p=h.c2iUrl,f=n.Uint8Array,m=n.SyntaxError,g=s("".charAt),A=s("".replace),y=s("".slice),v=s([].push),x=/[\t\n\f\r ]/g,b="Extra bits";f&&i({target:"Uint8Array",stat:!0,forced:!0},{fromBase64:function(t){a(t);var e=arguments.length>1?o(arguments[1]):void 0,r="base64"===u(e)?d:p,i=!!e&&!!e.strict,n=i?t:A(t,x,"");if(n.length%4==0)"=="===y(n,-2)?n=y(n,0,-2):"="===y(n,-1)&&(n=y(n,0,-1));else if(i)throw new m("Input is not correctly padded");var s=n.length%4;switch(s){case 1:throw new m("Bad input length");case 2:n+="AA";break;case 3:n+="A"}for(var h=[],_=0,w=n.length,E=function(t){var e=g(n,_+t);if(!l(r,e))throw new m('Bad char in input: "'+e+'"');return r[e]<<18-6*t};_>16&255,M>>8&255,255&M)}var S=h.length;if(2===s){if(i&&0!==h[S-2])throw new m(b);S-=2}else if(3===s){if(i&&0!==h[S-1])throw new m(b);S--}return c(f,h,S)}})},91117:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(51082),a=n.Uint8Array,l=n.SyntaxError,c=n.parseInt,h=/[^\da-f]/i,u=s(h.exec),d=s("".slice);a&&i({target:"Uint8Array",stat:!0,forced:!0},{fromHex:function(t){o(t);var e=t.length;if(e%2)throw new l("String should have an even number of characters");if(u(h,t))throw new l("String should only contain hex characters");for(var r=new a(e/2),i=0;i{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(33425),a=r(95668),l=r(18368),c=r(9093),h=l.i2c,u=l.i2cUrl,d=n.Uint8Array,p=s("".charAt);d&&i({target:"Uint8Array",proto:!0,forced:!0},{toBase64:function(){for(var t,e=a(this),r=arguments.length?o(arguments[0]):void 0,i="base64"===c(r)?h:u,n="",s=0,l=e.length,d=function(e){return p(i,t>>6*e&63)};s+2{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(95668),a=n.Uint8Array,l=s(1..toString);a&&i({target:"Uint8Array",proto:!0,forced:!0},{toHex:function(){o(this);for(var t="",e=0,r=this.length;e{"use strict";var i=r(79989),n=r(457),s=r(16803).remove;i({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(457),s=r(16803),o=s.get,a=s.has,l=s.set;i({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,i,s=n(this);return a(s,t)?(r=o(s,t),"update"in e&&(r=e.update(r,t,s),l(s,t,r)),r):(i=e.insert(t,s),l(s,t,i),i)}})},99369:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",stat:!0,forced:!0},{from:r(28737)})},22983:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",stat:!0,forced:!0},{of:r(1114)})},13466:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",proto:!0,real:!0,forced:!0},{upsert:r(41432)})},23321:(t,e,r)=>{"use strict";var i=r(79989),n=r(53499),s=r(78616).add;i({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,r=arguments.length;e{"use strict";var i=r(79989),n=r(53499),s=r(78616).remove;i({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";r(79989)({target:"WeakSet",stat:!0,forced:!0},{from:r(28737)})},45738:(t,e,r)=>{"use strict";r(79989)({target:"WeakSet",stat:!0,forced:!0},{of:r(1114)})},52586:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(68844),a=r(22615),l=r(3689),c=r(34327),h=r(21500),u=r(18368).c2i,d=/[^\d+/a-z]/i,p=/[\t\n\f\r ]+/g,f=/[=]{1,2}$/,m=s("atob"),g=String.fromCharCode,A=o("".charAt),y=o("".replace),v=o(d.exec),x=!!m&&!l((function(){return"hi"!==m("aGk=")})),b=x&&l((function(){return""!==m(" ")})),_=x&&!l((function(){m("a")})),w=x&&!l((function(){m()})),E=x&&1!==m.length;i({global:!0,bind:!0,enumerable:!0,forced:!x||b||_||w||E},{atob:function(t){if(h(arguments.length,1),x&&!b&&!_)return a(m,n,t);var e,r,i,o=y(c(t),p,""),l="",w=0,E=0;if(o.length%4==0&&(o=y(o,f,"")),(e=o.length)%4==1||v(d,o))throw new(s("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;w>(-2*E&6)));return l}})},84645:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(68844),a=r(22615),l=r(3689),c=r(34327),h=r(21500),u=r(18368).i2c,d=s("btoa"),p=o("".charAt),f=o("".charCodeAt),m=!!d&&!l((function(){return"aGk="!==d("hi")})),g=m&&!l((function(){d()})),A=m&&l((function(){return"bnVsbA=="!==d(null)})),y=m&&1!==d.length;i({global:!0,bind:!0,enumerable:!0,forced:!m||g||A||y},{btoa:function(t){if(h(arguments.length,1),m)return a(d,n,c(t));for(var e,r,i=c(t),o="",l=0,g=u;p(i,l)||(g="=",l%1);){if((r=f(i,l+=3/4))>255)throw new(s("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=p(g,63&(e=e<<8|r)>>8-l%1*8)}return o}})},19742:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(99886).clear;i({global:!0,bind:!0,enumerable:!0,forced:n.clearImmediate!==s},{clearImmediate:s})},47522:(t,e,r)=>{"use strict";var i=r(19037),n=r(66338),s=r(33265),o=r(57612),a=r(75773),l=function(t){if(t&&t.forEach!==o)try{a(t,"forEach",o)}catch(e){t.forEach=o}};for(var c in n)n[c]&&l(i[c]&&i[c].prototype);l(s)},76265:(t,e,r)=>{"use strict";var i=r(19037),n=r(66338),s=r(33265),o=r(752),a=r(75773),l=r(55997),c=r(44201)("iterator"),h=o.values,u=function(t,e){if(t){if(t[c]!==h)try{a(t,c,h)}catch(e){t[c]=h}if(l(t,e,!0),n[e])for(var r in o)if(t[r]!==o[r])try{a(t,r,o[r])}catch(e){t[r]=o[r]}}};for(var d in n)u(i[d]&&i[d].prototype,d);u(s,"DOMTokenList")},97337:(t,e,r)=>{"use strict";var i=r(79989),n=r(21905),s=r(76058),o=r(3689),a=r(25391),l=r(75684),c=r(72560).f,h=r(11880),u=r(62148),d=r(36812),p=r(767),f=r(85027),m=r(20445),g=r(13841),A=r(37136),y=r(56610),v=r(618),x=r(67697),b=r(53931),_="DOMException",w="DATA_CLONE_ERR",E=s("Error"),M=s(_)||function(){try{(new(s("MessageChannel")||n("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name===w&&25===t.code)return t.constructor}}(),S=M&&M.prototype,C=E.prototype,T=v.set,I=v.getterFor(_),R="stack"in new E(_),B=function(t){return d(A,t)&&A[t].m?A[t].c:0},L=function(){p(this,P);var t=arguments.length,e=g(t<1?void 0:arguments[0]),r=g(t<2?void 0:arguments[1],"Error"),i=B(r);if(T(this,{type:_,name:r,message:e,code:i}),x||(this.name=r,this.message=e,this.code=i),R){var n=new E(e);n.name=_,c(this,"stack",l(1,y(n.stack,1)))}},P=L.prototype=a(C),D=function(t){return{enumerable:!0,configurable:!0,get:t}},O=function(t){return D((function(){return I(this)[t]}))};x&&(u(P,"code",O("code")),u(P,"message",O("message")),u(P,"name",O("name"))),c(P,"constructor",l(1,L));var k=o((function(){return!(new M instanceof E)})),U=k||o((function(){return C.toString!==m||"2: 1"!==String(new M(1,2))})),N=k||o((function(){return 25!==new M(1,"DataCloneError").code})),F=k||25!==M[w]||25!==S[w],z=b?U||N||F:k;i({global:!0,constructor:!0,forced:z},{DOMException:z?L:M});var G=s(_),Q=G.prototype;for(var j in U&&(b||M===G)&&h(Q,"toString",m),N&&x&&M===G&&u(Q,"code",D((function(){return B(f(this).name)}))),A)if(d(A,j)){var V=A[j],H=V.s,W=l(6,V.c);d(G,H)||c(G,H,W),d(Q,H)||c(Q,H,W)}},13429:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(75684),a=r(72560).f,l=r(36812),c=r(767),h=r(33457),u=r(13841),d=r(37136),p=r(56610),f=r(67697),m=r(53931),g="DOMException",A=s("Error"),y=s(g),v=function(){c(this,x);var t=arguments.length,e=u(t<1?void 0:arguments[0]),r=u(t<2?void 0:arguments[1],"Error"),i=new y(e,r),n=new A(e);return n.name=g,a(i,"stack",o(1,p(n.stack,1))),h(i,this,v),i},x=v.prototype=y.prototype,b="stack"in new A(g),_="stack"in new y(1,2),w=y&&f&&Object.getOwnPropertyDescriptor(n,g),E=!(!w||w.writable&&w.configurable),M=b&&!E&&!_;i({global:!0,constructor:!0,forced:m||M},{DOMException:M?v:y});var S=s(g),C=S.prototype;if(C.constructor!==S)for(var T in m||a(C,"constructor",o(1,S)),d)if(l(d,T)){var I=d[T],R=I.s;l(S,R)||a(S,R,o(6,I.c))}},37462:(t,e,r)=>{"use strict";var i=r(76058),n="DOMException";r(55997)(i(n),n)},40088:(t,e,r)=>{"use strict";r(19742),r(52731)},10455:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(80231),o=r(10509),a=r(21500),l=r(50806),c=n.process;i({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){a(arguments.length,1),o(t);var e=l&&c.domain;s(e?e.bind(t):t)}})},3650:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(62148),o=r(67697),a=TypeError,l=Object.defineProperty,c=n.self!==n;try{if(o){var h=Object.getOwnPropertyDescriptor(n,"self");!c&&h&&h.get&&h.enumerable||s(n,"self",{get:function(){return n},set:function(t){if(this!==n)throw new a("Illegal invocation");l(n,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:c},{self:n})}catch(t){}},52731:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(99886).set,o=r(8552),a=n.setImmediate?o(s,!1):s;i({global:!0,bind:!0,enumerable:!0,forced:n.setImmediate!==a},{setImmediate:a})},10209:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(8552)(n.setInterval,!0);i({global:!0,bind:!0,forced:n.setInterval!==s},{setInterval:s})},83509:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(8552)(n.setTimeout,!0);i({global:!0,bind:!0,forced:n.setTimeout!==s},{setTimeout:s})},25564:(t,e,r)=>{"use strict";var i,n=r(53931),s=r(79989),o=r(19037),a=r(76058),l=r(68844),c=r(3689),h=r(14630),u=r(69985),d=r(19429),p=r(981),f=r(48999),m=r(30734),g=r(18734),A=r(85027),y=r(50926),v=r(36812),x=r(76522),b=r(75773),_=r(6310),w=r(21500),E=r(63477),M=r(83914),S=r(61034),C=r(48774),T=r(21420),I=r(49599),R=r(63514),B=o.Object,L=o.Array,P=o.Date,D=o.Error,O=o.TypeError,k=o.PerformanceMark,U=a("DOMException"),N=M.Map,F=M.has,z=M.get,G=M.set,Q=S.Set,j=S.add,V=S.has,H=a("Object","keys"),W=l([].push),q=l((!0).valueOf),Z=l(1..valueOf),Y=l("".valueOf),X=l(P.prototype.getTime),J=h("structuredClone"),K="DataCloneError",$="Transferring",tt=function(t){return!c((function(){var e=new o.Set([7]),r=t(e),i=t(B(7));return r===e||!r.has(7)||!f(i)||7!=+i}))&&t},et=function(t,e){return!c((function(){var r=new e,i=t({a:r,b:r});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===r.stack)}))},rt=o.structuredClone,it=n||!et(rt,D)||!et(rt,U)||(i=rt,!!c((function(){var t=i(new o.AggregateError([1],J,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==J||3!==t.cause}))),nt=!rt&&tt((function(t){return new k(J,{detail:t}).detail})),st=tt(rt)||nt,ot=function(t){throw new U("Uncloneable type: "+t,K)},at=function(t,e){throw new U((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",K)},lt=function(t,e){return st||at(e),st(t)},ct=function(t,e,r){if(F(e,t))return z(e,t);var i,n,s,a,l,c;if("SharedArrayBuffer"===(r||y(t)))i=st?st(t):t;else{var h=o.DataView;h||u(t.slice)||at("ArrayBuffer");try{if(u(t.slice)&&!t.resizable)i=t.slice(0);else{n=t.byteLength,s="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0,i=new ArrayBuffer(n,s),a=new h(t),l=new h(i);for(c=0;c1&&!p(arguments[1])?A(arguments[1]):void 0,n=i?i.transfer:void 0;void 0!==n&&(r=function(t,e){if(!f(t))throw new O("Transfer option cannot be converted to a sequence");var r=[];g(t,(function(t){W(r,A(t))}));for(var i,n,s,a,l,c=0,h=_(r),p=new Q;c{"use strict";r(10209),r(83509)},2625:(t,e,r)=>{"use strict";r(752);var i=r(79989),n=r(19037),s=r(22615),o=r(68844),a=r(67697),l=r(76837),c=r(11880),h=r(62148),u=r(6045),d=r(55997),p=r(30974),f=r(618),m=r(767),g=r(69985),A=r(36812),y=r(54071),v=r(50926),x=r(85027),b=r(48999),_=r(34327),w=r(25391),E=r(75684),M=r(5185),S=r(91664),C=r(27807),T=r(21500),I=r(44201),R=r(50382),B=I("iterator"),L="URLSearchParams",P=L+"Iterator",D=f.set,O=f.getterFor(L),k=f.getterFor(P),U=Object.getOwnPropertyDescriptor,N=function(t){if(!a)return n[t];var e=U(n,t);return e&&e.value},F=N("fetch"),z=N("Request"),G=N("Headers"),Q=z&&z.prototype,j=G&&G.prototype,V=n.RegExp,H=n.TypeError,W=n.decodeURIComponent,q=n.encodeURIComponent,Z=o("".charAt),Y=o([].join),X=o([].push),J=o("".replace),K=o([].shift),$=o([].splice),tt=o("".split),et=o("".slice),rt=/\+/g,it=Array(4),nt=function(t){return it[t-1]||(it[t-1]=V("((?:%[\\da-f]{2}){"+t+"})","gi"))},st=function(t){try{return W(t)}catch(e){return t}},ot=function(t){var e=J(t,rt," "),r=4;try{return W(e)}catch(t){for(;r;)e=J(e,nt(r--),st);return e}},at=/[!'()~]|%20/g,lt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ct=function(t){return lt[t]},ht=function(t){return J(q(t),at,ct)},ut=p((function(t,e){D(this,{type:P,target:O(t).entries,index:0,kind:e})}),L,(function(){var t=k(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,C(void 0,!0);var i=e[r];switch(t.kind){case"keys":return C(i.key,!1);case"values":return C(i.value,!1)}return C([i.key,i.value],!1)}),!0),dt=function(t){this.entries=[],this.url=null,void 0!==t&&(b(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Z(t,0)?et(t,1):t:_(t)))};dt.prototype={type:L,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,i,n,o,a,l,c=this.entries,h=S(t);if(h)for(r=(e=M(t,h)).next;!(i=s(r,e)).done;){if(o=(n=M(x(i.value))).next,(a=s(o,n)).done||(l=s(o,n)).done||!s(o,n).done)throw new H("Expected sequence with length 2");X(c,{key:_(a.value),value:_(l.value)})}else for(var u in t)A(t,u)&&X(c,{key:u,value:_(t[u])})},parseQuery:function(t){if(t)for(var e,r,i=this.entries,n=tt(t,"&"),s=0;s0?arguments[0]:void 0));a||(this.size=t.entries.length)},ft=pt.prototype;if(u(ft,{append:function(t,e){var r=O(this);T(arguments.length,2),X(r.entries,{key:_(t),value:_(e)}),a||this.length++,r.updateURL()},delete:function(t){for(var e=O(this),r=T(arguments.length,1),i=e.entries,n=_(t),s=r<2?void 0:arguments[1],o=void 0===s?s:_(s),l=0;le.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=O(this).entries,i=y(t,arguments.length>1?arguments[1]:void 0),n=0;n1?At(arguments[1]):{})}}),g(z)){var yt=function(t){return m(this,Q),new z(t,arguments.length>1?At(arguments[1]):{})};Q.constructor=yt,yt.prototype=Q,i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:yt})}}t.exports={URLSearchParams:pt,getState:O}},98858:(t,e,r)=>{"use strict";var i=r(11880),n=r(68844),s=r(34327),o=r(21500),a=URLSearchParams,l=a.prototype,c=n(l.append),h=n(l.delete),u=n(l.forEach),d=n([].push),p=new a("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&i(l,"delete",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=[];u(this,(function(t,e){d(i,{key:e,value:t})})),o(e,1);for(var n,a=s(t),l=s(r),p=0,f=0,m=!1,g=i.length;p{"use strict";var i=r(11880),n=r(68844),s=r(34327),o=r(21500),a=URLSearchParams,l=a.prototype,c=n(l.getAll),h=n(l.has),u=new a("a=1");!u.has("a",2)&&u.has("a",void 0)||i(l,"has",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=c(this,t);o(e,1);for(var n=s(r),a=0;a{"use strict";r(2625)},33228:(t,e,r)=>{"use strict";var i=r(67697),n=r(68844),s=r(62148),o=URLSearchParams.prototype,a=n(o.forEach);i&&!("size"in o)&&s(o,"size",{get:function(){var t=0;return a(this,(function(){t++})),t},configurable:!0,enumerable:!0})},69822:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(3689),o=r(21500),a=r(34327),l=r(76837),c=n("URL");i({target:"URL",stat:!0,forced:!(l&&s((function(){c.canParse()})))},{canParse:function(t){var e=o(arguments.length,1),r=a(t),i=e<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return!!new c(r,i)}catch(t){return!1}}})},79391:(t,e,r)=>{"use strict";r(21694);var i,n=r(79989),s=r(67697),o=r(76837),a=r(19037),l=r(54071),c=r(68844),h=r(11880),u=r(62148),d=r(767),p=r(36812),f=r(45394),m=r(21055),g=r(9015),A=r(10730).codeAt,y=r(6430),v=r(34327),x=r(55997),b=r(21500),_=r(2625),w=r(618),E=w.set,M=w.getterFor("URL"),S=_.URLSearchParams,C=_.getState,T=a.URL,I=a.TypeError,R=a.parseInt,B=Math.floor,L=Math.pow,P=c("".charAt),D=c(/./.exec),O=c([].join),k=c(1..toString),U=c([].pop),N=c([].push),F=c("".replace),z=c([].shift),G=c("".split),Q=c("".slice),j=c("".toLowerCase),V=c([].unshift),H="Invalid scheme",W="Invalid host",q="Invalid port",Z=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,J=/^0x/i,K=/^[0-7]+$/,$=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,rt=/[\0\t\n\r #/:<>?@[\\\]^|]/,it=/^[\u0000-\u0020]+/,nt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,st=/[\t\n\r]/g,ot=function(t){var e,r,i,n;if("number"==typeof t){for(e=[],r=0;r<4;r++)V(e,t%256),t=B(t/256);return O(e,".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,r=1,i=null,n=0,s=0;s<8;s++)0!==t[s]?(n>r&&(e=i,r=n),i=null,n=0):(null===i&&(i=s),++n);return n>r&&(e=i,r=n),e}(t),r=0;r<8;r++)n&&0===t[r]||(n&&(n=!1),i===r?(e+=r?":":"::",n=!0):(e+=k(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},at={},lt=f({},at,{" ":1,'"':1,"<":1,">":1,"`":1}),ct=f({},lt,{"#":1,"?":1,"{":1,"}":1}),ht=f({},ct,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ut=function(t,e){var r=A(t,0);return r>32&&r<127&&!p(e,t)?t:encodeURIComponent(t)},dt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pt=function(t,e){var r;return 2===t.length&&D(Z,P(t,0))&&(":"===(r=P(t,1))||!e&&"|"===r)},ft=function(t){var e;return t.length>1&&pt(Q(t,0,2))&&(2===t.length||"/"===(e=P(t,2))||"\\"===e||"?"===e||"#"===e)},mt=function(t){return"."===t||"%2e"===j(t)},gt={},At={},yt={},vt={},xt={},bt={},_t={},wt={},Et={},Mt={},St={},Ct={},Tt={},It={},Rt={},Bt={},Lt={},Pt={},Dt={},Ot={},kt={},Ut=function(t,e,r){var i,n,s,o=v(t);if(e){if(n=this.parse(o))throw new I(n);this.searchParams=null}else{if(void 0!==r&&(i=new Ut(r,!0)),n=this.parse(o,null,i))throw new I(n);(s=C(new S)).bindURL(this),this.searchParams=s}};Ut.prototype={type:"URL",parse:function(t,e,r){var n,s,o,a,l,c=this,h=e||gt,u=0,d="",f=!1,A=!1,y=!1;for(t=v(t),e||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=F(t,it,""),t=F(t,nt,"$1")),t=F(t,st,""),n=m(t);u<=n.length;){switch(s=n[u],h){case gt:if(!s||!D(Z,s)){if(e)return H;h=yt;continue}d+=j(s),h=At;break;case At:if(s&&(D(Y,s)||"+"===s||"-"===s||"."===s))d+=j(s);else{if(":"!==s){if(e)return H;d="",h=yt,u=0;continue}if(e&&(c.isSpecial()!==p(dt,d)||"file"===d&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=d,e)return void(c.isSpecial()&&dt[c.scheme]===c.port&&(c.port=null));d="","file"===c.scheme?h=It:c.isSpecial()&&r&&r.scheme===c.scheme?h=vt:c.isSpecial()?h=wt:"/"===n[u+1]?(h=xt,u++):(c.cannotBeABaseURL=!0,N(c.path,""),h=Dt)}break;case yt:if(!r||r.cannotBeABaseURL&&"#"!==s)return H;if(r.cannotBeABaseURL&&"#"===s){c.scheme=r.scheme,c.path=g(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,h=kt;break}h="file"===r.scheme?It:bt;continue;case vt:if("/"!==s||"/"!==n[u+1]){h=bt;continue}h=Et,u++;break;case xt:if("/"===s){h=Mt;break}h=Pt;continue;case bt:if(c.scheme=r.scheme,s===i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query;else if("/"===s||"\\"===s&&c.isSpecial())h=_t;else if("?"===s)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query="",h=Ot;else{if("#"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.path.length--,h=Pt;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query,c.fragment="",h=kt}break;case _t:if(!c.isSpecial()||"/"!==s&&"\\"!==s){if("/"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,h=Pt;continue}h=Mt}else h=Et;break;case wt:if(h=Et,"/"!==s||"/"!==P(d,u+1))continue;u++;break;case Et:if("/"!==s&&"\\"!==s){h=Mt;continue}break;case Mt:if("@"===s){f&&(d="%40"+d),f=!0,o=m(d);for(var x=0;x65535)return q;c.port=c.isSpecial()&&w===dt[c.scheme]?null:w,d=""}if(e)return;h=Lt;continue}return q}d+=s;break;case It:if(c.scheme="file","/"===s||"\\"===s)h=Rt;else{if(!r||"file"!==r.scheme){h=Pt;continue}switch(s){case i:c.host=r.host,c.path=g(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=g(r.path),c.query="",h=Ot;break;case"#":c.host=r.host,c.path=g(r.path),c.query=r.query,c.fragment="",h=kt;break;default:ft(O(g(n,u),""))||(c.host=r.host,c.path=g(r.path),c.shortenPath()),h=Pt;continue}}break;case Rt:if("/"===s||"\\"===s){h=Bt;break}r&&"file"===r.scheme&&!ft(O(g(n,u),""))&&(pt(r.path[0],!0)?N(c.path,r.path[0]):c.host=r.host),h=Pt;continue;case Bt:if(s===i||"/"===s||"\\"===s||"?"===s||"#"===s){if(!e&&pt(d))h=Pt;else if(""===d){if(c.host="",e)return;h=Lt}else{if(a=c.parseHost(d))return a;if("localhost"===c.host&&(c.host=""),e)return;d="",h=Lt}continue}d+=s;break;case Lt:if(c.isSpecial()){if(h=Pt,"/"!==s&&"\\"!==s)continue}else if(e||"?"!==s)if(e||"#"!==s){if(s!==i&&(h=Pt,"/"!==s))continue}else c.fragment="",h=kt;else c.query="",h=Ot;break;case Pt:if(s===i||"/"===s||"\\"===s&&c.isSpecial()||!e&&("?"===s||"#"===s)){if(".."===(l=j(l=d))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===s||"\\"===s&&c.isSpecial()||N(c.path,"")):mt(d)?"/"===s||"\\"===s&&c.isSpecial()||N(c.path,""):("file"===c.scheme&&!c.path.length&&pt(d)&&(c.host&&(c.host=""),d=P(d,0)+":"),N(c.path,d)),d="","file"===c.scheme&&(s===i||"?"===s||"#"===s))for(;c.path.length>1&&""===c.path[0];)z(c.path);"?"===s?(c.query="",h=Ot):"#"===s&&(c.fragment="",h=kt)}else d+=ut(s,ct);break;case Dt:"?"===s?(c.query="",h=Ot):"#"===s?(c.fragment="",h=kt):s!==i&&(c.path[0]+=ut(s,at));break;case Ot:e||"#"!==s?s!==i&&("'"===s&&c.isSpecial()?c.query+="%27":c.query+="#"===s?"%23":ut(s,at)):(c.fragment="",h=kt);break;case kt:s!==i&&(c.fragment+=ut(s,lt))}u++}},parseHost:function(t){var e,r,i;if("["===P(t,0)){if("]"!==P(t,t.length-1))return W;if(e=function(t){var e,r,i,n,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,h=null,u=0,d=function(){return P(t,u)};if(":"===d()){if(":"!==P(t,1))return;u+=2,h=++c}for(;d();){if(8===c)return;if(":"!==d()){for(e=r=0;r<4&&D(tt,d());)e=16*e+R(d(),16),u++,r++;if("."===d()){if(0===r)return;if(u-=r,c>6)return;for(i=0;d();){if(n=null,i>0){if(!("."===d()&&i<4))return;u++}if(!D(X,d()))return;for(;D(X,d());){if(s=R(d(),10),null===n)n=s;else{if(0===n)return;n=10*n+s}if(n>255)return;u++}l[c]=256*l[c]+n,2!=++i&&4!==i||c++}if(4!==i)return;break}if(":"===d()){if(u++,!d())return}else if(d())return;l[c++]=e}else{if(null!==h)return;u++,h=++c}}if(null!==h)for(o=c-h,c=7;0!==c&&o>0;)a=l[c],l[c--]=l[h+o-1],l[h+--o]=a;else if(8!==c)return;return l}(Q(t,1,-1)),!e)return W;this.host=e}else if(this.isSpecial()){if(t=y(t),D(et,t))return W;if(e=function(t){var e,r,i,n,s,o,a,l=G(t,".");if(l.length&&""===l[l.length-1]&&l.length--,(e=l.length)>4)return t;for(r=[],i=0;i1&&"0"===P(n,0)&&(s=D(J,n)?16:8,n=Q(n,8===s?1:2)),""===n)o=0;else{if(!D(10===s?$:8===s?K:tt,n))return t;o=R(n,s)}N(r,o)}for(i=0;i=L(256,5-e))return null}else if(o>255)return null;for(a=U(r),i=0;i1?arguments[1]:void 0,i=E(e,new Ut(t,!1,r));s||(e.href=i.serialize(),e.origin=i.getOrigin(),e.protocol=i.getProtocol(),e.username=i.getUsername(),e.password=i.getPassword(),e.host=i.getHost(),e.hostname=i.getHostname(),e.port=i.getPort(),e.pathname=i.getPathname(),e.search=i.getSearch(),e.searchParams=i.getSearchParams(),e.hash=i.getHash())},Ft=Nt.prototype,zt=function(t,e){return{get:function(){return M(this)[t]()},set:e&&function(t){return M(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(u(Ft,"href",zt("serialize","setHref")),u(Ft,"origin",zt("getOrigin")),u(Ft,"protocol",zt("getProtocol","setProtocol")),u(Ft,"username",zt("getUsername","setUsername")),u(Ft,"password",zt("getPassword","setPassword")),u(Ft,"host",zt("getHost","setHost")),u(Ft,"hostname",zt("getHostname","setHostname")),u(Ft,"port",zt("getPort","setPort")),u(Ft,"pathname",zt("getPathname","setPathname")),u(Ft,"search",zt("getSearch","setSearch")),u(Ft,"searchParams",zt("getSearchParams")),u(Ft,"hash",zt("getHash","setHash"))),h(Ft,"toJSON",(function(){return M(this).serialize()}),{enumerable:!0}),h(Ft,"toString",(function(){return M(this).serialize()}),{enumerable:!0}),T){var Gt=T.createObjectURL,Qt=T.revokeObjectURL;Gt&&h(Nt,"createObjectURL",l(Gt,T)),Qt&&h(Nt,"revokeObjectURL",l(Qt,T))}x(Nt,"URL"),n({global:!0,constructor:!0,forced:!o,sham:!s},{URL:Nt})},78730:(t,e,r)=>{"use strict";r(79391)},19979:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615);i({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return n(URL.prototype.toString,this)}})},92294:(t,e,r)=>{"use strict";r.d(e,{TE:()=>Lr,th:()=>Hr});var i={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,doc:"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{js:"v2.10.0",android:"10.7.0",ios:"10.7.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0",android:"10.0.0",ios:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0",android:"10.0.0",ios:"10.0.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0",ios:"4.1.0",macos:"0.8.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."},globe:{doc:"A globe projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",requires:["source"],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{js:"2.10.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",requires:["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"2.10.0",android:"10.7.0",ios:"10.7.0"}}}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0",macos:"10.5.0"}},"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={},o={exports:{}};!function(t,e){!function(r){var i=e&&!e.nodeType&&e,s=t&&!t.nodeType&&t,o="object"==typeof n&&n;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var a,l,c=2147483647,h=36,u=26,d=38,p=700,f=/^xn--/,m=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=h-1,v=Math.floor,x=String.fromCharCode;function b(t){throw RangeError(A[t])}function _(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function w(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+_((t=t.replace(g,".")).split("."),e).join(".")}function E(t){for(var e,r,i=[],n=0,s=t.length;n=55296&&e<=56319&&n65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+x(t)})).join("")}function S(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,r){var i=0;for(t=r?v(t/p):t>>1,t+=v(t/e);t>y*u>>1;i+=h)t=v(t/y);return v(i+(y+1)*t/(t+d))}function T(t){var e,r,i,n,s,o,a,l,d,p,f,m=[],g=t.length,A=0,y=128,x=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&b("not-basic"),m.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=g&&b("invalid-input"),((l=(f=t.charCodeAt(n++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||l>v((c-A)/o))&&b("overflow"),A+=l*o,!(l<(d=a<=x?1:a>=x+u?u:a-x));a+=h)o>v(c/(p=h-d))&&b("overflow"),o*=p;x=C(A-s,e=m.length+1,0==s),v(A/e)>c-y&&b("overflow"),y+=v(A/e),A%=e,m.splice(A++,0,y)}return M(m)}function I(t){var e,r,i,n,s,o,a,l,d,p,f,m,g,A,y,_=[];for(m=(t=E(t)).length,e=128,r=0,s=72,o=0;o=e&&fv((c-r)/(g=i+1))&&b("overflow"),r+=(a-e)*g,e=a,o=0;oc&&b("overflow"),f==e){for(l=r,d=h;!(l<(p=d<=s?1:d>=s+u?u:d-s));d+=h)y=l-p,A=h-p,_.push(x(S(p+y%A,0))),l=v(y/A);_.push(x(S(l,0))),s=C(r,g,i==n),r=0,++i}++r,++e}return _.join("")}if(a={version:"1.3.2",ucs2:{decode:E,encode:M},decode:T,encode:I,toASCII:function(t){return w(t,(function(t){return m.test(t)?"xn--"+I(t):t}))},toUnicode:function(t){return w(t,(function(t){return f.test(t)?T(t.slice(4).toLowerCase()):t}))}},i&&s)if(t.exports==i)s.exports=a;else for(l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);else r.punycode=a}(n)}(o,o.exports);var a={};function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var c=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};a.decode=a.parse=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var s=/\+/g;t=t.split(e);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var a=t.length;o>0&&a>o&&(a=o);for(var c=0;c=0?(h=f.substr(0,m),u=f.substr(m+1)):(h=f,u=""),d=decodeURIComponent(h),p=decodeURIComponent(u),l(n,d)?Array.isArray(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n},a.encode=a.stringify=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(c(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(c(t))})).join(e):n+encodeURIComponent(c(t[i]))})).join(e):i?encodeURIComponent(c(i))+r+encodeURIComponent(c(t)):""};var h=o.exports,u=function(t){return"string"==typeof t},d=function(t){return"object"==typeof t&&null!==t},p=function(t){return null===t},f=function(t){return null==t};function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}s.parse=I,s.resolve=function(t,e){return I(t,!1,!0).resolve(e)},s.resolveObject=function(t,e){return t?I(t,!1,!0).resolveObject(e):e},s.format=function(t){return u(t)&&(t=I(t)),t instanceof m?t.format():m.prototype.format.call(t)},s.Url=m;var g=/^([a-z0-9.+-]+:)/i,A=/:[0-9]*$/,y=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,v=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),x=["'"].concat(v),b=["%","/","?",";","#"].concat(x),_=["/","?","#"],w=/^[+a-z0-9A-Z_-]{0,63}$/,E=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},C={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=a;function I(t,e,r){if(t&&d(t)&&t instanceof m)return t;var i=new m;return i.parse(t,e,r),i}function R(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}m.prototype.parse=function(t,e,r){if(!u(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?P+="x":P+=L[D];if(!P.match(w)){var k=R.slice(0,A),U=R.slice(A+1),N=L.match(E);N&&(k.push(N[1]),U.unshift(N[2])),U.length&&(o="/"+U.join(".")+o),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=h.toASCII(this.hostname));var F=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+F,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!M[c])for(A=0,B=x.length;A0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift())),r.search=t.search,r.query=t.query,p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=w.slice(-1)[0],T=(r.host||t.host||w.length>1)&&("."===M||".."===M)||""===M,I=0,R=w.length;R>=0;R--)"."===(M=w[R])?w.splice(R,1):".."===M?(w.splice(R,1),I++):I&&(w.splice(R,1),I--);if(!b&&!_)for(;I--;I)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),T&&"/"!==w.join("/").substr(-1)&&w.push("");var B,L=""===w[0]||w[0]&&"/"===w[0].charAt(0);return E&&(r.hostname=r.host=L?"":w.length?w.shift():"",(B=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift())),(b=b||r.host&&w.length)&&!L&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},m.prototype.parseHost=function(){var t=this.host,e=A.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};class B extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}var L=B;class P{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,r]of e)this.bindings[t]=r}concat(t){return new P(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var D=P;const O={kind:"null"},k={kind:"number"},U={kind:"string"},N={kind:"boolean"},F={kind:"color"},z={kind:"object"},G={kind:"value"},Q={kind:"collator"},j={kind:"formatted"},V={kind:"resolvedImage"};function H(t,e){return{kind:"array",itemType:t,N:e}}function W(t){if("array"===t.kind){const e=W(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const q=[O,k,U,N,F,j,z,H(G),V];function Z(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Z(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of q)if(!Z(t,e))return null}return`Expected ${W(t)} but found ${W(e)} instead.`}function Y(t,e){return e.some((e=>e.kind===t.kind))}function X(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var J,K={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 $(t){return(t=Math.round(t))<0?0:t>255?255:t}function tt(t){return t<0?0:t>1?1:t}function et(t){return"%"===t[t.length-1]?$(parseFloat(t)/100*255):$(parseInt(t))}function rt(t){return"%"===t[t.length-1]?tt(parseFloat(t)/100):tt(parseFloat(t))}function it(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{J={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in K)return K[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.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===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var s=r.substr(0,i),o=r.substr(i+1,n-(i+1)).split(","),a=1;switch(s){case"rgba":if(4!==o.length)return null;a=rt(o.pop());case"rgb":return 3!==o.length?null:[et(o[0]),et(o[1]),et(o[2]),a];case"hsla":if(4!==o.length)return null;a=rt(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,c=rt(o[1]),h=rt(o[2]),u=h<=.5?h*(c+1):h+c-h*c,d=2*h-u;return[$(255*it(d,u,l+1/3)),$(255*it(d,u,l)),$(255*it(d,u,l-1/3)),a];default:return null}}return null}}catch(t){}class nt{constructor(t,e,r,i=1){this.r=t,this.g=e,this.b=r,this.a=i}static parse(t){if(!t)return;if(t instanceof nt)return t;if("string"!=typeof t)return;const e=J(t);return e?new nt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,r,i]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(r)},${i})`}toArray(){const{r:t,g:e,b:r,a:i}=this;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*r/i,i]}toArray01(){const{r:t,g:e,b:r,a:i}=this;return 0===i?[0,0,0,0]:[t/i,e/i,r/i,i]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:r,a:i}=this;return[t,e,r,i]}}nt.black=new nt(0,0,0,1),nt.white=new nt(1,1,1,1),nt.transparent=new nt(0,0,0,0),nt.red=new nt(1,0,0,1),nt.blue=new nt(0,0,1,1);var st=nt;class ot{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class at{constructor(t,e,r,i,n){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n}}class lt{constructor(t){this.sections=t}static fromString(t){return new lt([new at(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof lt?t:lt.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const r={};e.fontStack&&(r["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(r["font-scale"]=e.scale),e.textColor&&(r["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(r)}return t}}class ct{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new ct({name:t,available:!1}):null}serialize(){return["image",this.name]}}function ht(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ut(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof st)return!0;if(t instanceof ot)return!0;if(t instanceof lt)return!0;if(t instanceof ct)return!0;if(Array.isArray(t)){for(const e of t)if(!ut(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!ut(t[e]))return!1;return!0}return!1}function dt(t){if(null===t)return O;if("string"==typeof t)return U;if("boolean"==typeof t)return N;if("number"==typeof t)return k;if(t instanceof st)return F;if(t instanceof ot)return Q;if(t instanceof lt)return j;if(t instanceof ct)return V;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=dt(e);if(r){if(r===t)continue;r=G;break}r=t}return H(r||G,e)}return z}function pt(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof st||t instanceof lt||t instanceof ct?t.toString():JSON.stringify(t)}class ft{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!ut(t[1]))return e.error("invalid value");const r=t[1];let i=dt(r);const n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new ft(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof st?["rgba"].concat(this.value.toArray()):this.value instanceof lt?this.value.serialize():this.value}}var mt=ft,gt=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const At={string:U,number:k,boolean:N,object:z};class yt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,i=1;const n=t[0];if("array"===n){let n,s;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in At)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=At[r],i++}else n=G;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],i++}r=H(n,s)}else r=At[n];const s=[];for(;it.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);const i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((t=>t.serialize())))}}var vt=yt;class xt{constructor(t){this.type=j,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const i=[];let n=!1;for(let r=1;r<=t.length-1;++r){const s=t[r];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;let t=null;if(s["font-scale"]&&(t=e.parse(s["font-scale"],1,k),!t))return null;let r=null;if(s["text-font"]&&(r=e.parse(s["text-font"],1,H(U)),!r))return null;let o=null;if(s["text-color"]&&(o=e.parse(s["text-color"],1,F),!o))return null;const a=i[i.length-1];a.scale=t,a.font=r,a.textColor=o}else{const s=e.parse(t[r],1,G);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:s,scale:null,font:null,textColor:null})}}return new xt(i)}evaluate(t){return new lt(this.sections.map((e=>{const r=e.content.evaluate(t);return dt(r)===V?new at("",r,null,null,null):new at(pt(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const r={};e.scale&&(r["font-scale"]=e.scale.serialize()),e.font&&(r["text-font"]=e.font.serialize()),e.textColor&&(r["text-color"]=e.textColor.serialize()),t.push(r)}return t}}class bt{constructor(t){this.type=V,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,U);return r?new bt(r):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),r=ct.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const _t={"to-boolean":N,"to-color":F,"to-number":k,"to-string":U};class wt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");const i=_t[r],n=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:ht(e[0],e[1],e[2],e[3]),!r))return new st(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gt(r||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const i=Number(e);if(!isNaN(i))return i}throw new gt(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?lt.fromString(pt(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ct.fromString(pt(this.args[0].evaluate(t))):pt(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new xt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new bt(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Et=wt;const Mt=["Unknown","Point","LineString","Polygon"];var St=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Mt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:r,y:i}=this.featureTileCoord,n=r*e-t[0],s=i*e-t[1];return this.featureDistanceData.bearing[0]*n+this.featureDistanceData.bearing[1]*s}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=st.parse(t)),e}};class Ct{constructor(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const r=t[0],i=Ct.definitions[r];if(!i)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(i)?i[0]:i.type,s=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,o=s.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[i,s]of o){a=new ee(e.registry,e.path,null,e.scope);const o=[];let l=!1;for(let e=1;e{return e=t,Array.isArray(e)?`(${e.map(W).join(", ")})`:`(${W(e.type)}...)`;var e})).join(" | "),i=[];for(let r=1;r=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Pt(t,e){const r=(180+t[0])/360,i=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const s=Math.pow(2,e.z);return[Math.round(r*s*Rt),Math.round(i*s*Rt)]}function Dt(t,e,r){const i=t[0]-e[0],n=t[1]-e[1],s=t[0]-r[0],o=t[1]-r[1];return i*o-s*n==0&&i*s<=0&&n*o<=0}function Ot(t,e){let r=!1;for(let o=0,a=e.length;oi[1]!=s[1]>i[1]&&i[0]<(s[0]-n[0])*(i[1]-n[1])/(s[1]-n[1])+n[0]&&(r=!r)}}var i,n,s;return r}function kt(t,e){for(let r=0;r0&&u<0||h<0&&u>0}function Nt(t,e,r,i){const n=[e[0]-t[0],e[1]-t[1]];return 0!=(s=[i[0]-r[0],i[1]-r[1]])[0]*(o=n)[1]-s[1]*o[0]&&!(!Ut(t,e,r,i)||!Ut(r,i,t,e));var s,o}function Ft(t,e,r){for(const i of r)for(let r=0;rr[2]){const e=.5*i;let n=t[0]-r[0]>e?-i:r[0]-t[0]>e?i:0;0===n&&(n=t[0]-r[2]>e?-i:r[2]-t[0]>e?i:0),t[0]+=n}Bt(e,t)}function Ht(t,e,r,i){const n=Math.pow(2,i.z)*Rt,s=[i.x*Rt,i.y*Rt],o=[];if(!t)return o;for(const i of t)for(const t of i){const i=[t.x+s[0],t.y+s[1]];Vt(i,e,r,n),o.push(i)}return o}function Wt(t,e,r,i){const n=Math.pow(2,i.z)*Rt,s=[i.x*Rt,i.y*Rt],o=[];if(!t)return o;for(const r of t){const t=[];for(const i of r){const r=[i.x+s[0],i.y+s[1]];Bt(e,r),t.push(r)}o.push(t)}if(e[2]-e[0]<=n/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of o)for(const i of t)Vt(i,e,r,n)}var a;return o}class qt{constructor(t,e){this.type=N,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(ut(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t{e&&!Yt(t)&&(e=!1)})),e}function Xt(t){if(t instanceof Tt&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Xt(t)&&(e=!1)})),e}function Jt(t,e){if(t instanceof Tt&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!Jt(t,e)&&(r=!1)})),r}class Kt{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const r=t[1];return e.scope.has(r)?new Kt(r,e.scope.get(r)):e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var $t=Kt;class te{constructor(t,e=[],r,i=new D,n=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=i,this.errors=n,this.expectedType=r}parse(t,e,r,i,n={}){return e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)}_parse(t,e){function r(t,e,r){return"assert"===r?new vt(e,[t]):"coerce"===r?new Et(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=t[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const n=this.registry[i];if(n){let i=n.parse(t,this);if(!i)return null;if(this.expectedType){const t=this.expectedType,n=i.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else i=r(i,t,e.typeAnnotation||"coerce");else i=r(i,t,e.typeAnnotation||"assert")}if(!(i instanceof mt)&&"resolvedImage"!==i.type.kind&&re(i)){const t=new St;try{i=new mt(i.type,i.evaluate(t))}catch(t){return this.error(t.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){const i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new te(this.registry,i,e||null,n,this.errors)}error(t,...e){const r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new L(r,t))}checkSubtype(t,e){const r=Z(t,e);return r&&this.error(r),r}}var ee=te;function re(t){if(t instanceof $t)return re(t.boundExpression);if(t instanceof Tt&&"error"===t.name)return!1;if(t instanceof It)return!1;if(t instanceof Zt)return!1;const e=t instanceof Et||t instanceof vt;let r=!0;return t.eachChild((t=>{r=e?r&&re(t):r&&t instanceof mt})),!!r&&Yt(t)&&Jt(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function ie(t,e){const r=t.length-1;let i,n,s=0,o=r,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),i=t[a],n=t[a+1],i<=e){if(a===r||ee))throw new gt("Input is not a number.");o=a-1}return 0}class ne{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,k);if(!r)return null;const i=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let r=1;r=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=e.parse(o,l,n);if(!c)return null;n=n||c.type,i.push([s,c])}return new ne(n,r,i)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);const n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[ie(e,i)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var se=ne,oe=ae;function ae(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=i}function le(t,e,r){return t*(1-r)+e*r}ae.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,i=0;i<8;i++){var n=this.sampleCurveX(r)-t;if(Math.abs(n)n?o=r:a=r,r=.5*(a-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var ce=Object.freeze({__proto__:null,number:le,color:function(t,e,r){return new st(le(t.r,e.r,r),le(t.g,e.g,r),le(t.b,e.b,r),le(t.a,e.a,r))},array:function(t,e,r){return t.map(((t,i)=>le(t,e[i],r)))}});const he=.95047,ue=1.08883,de=4/29,pe=6/29,fe=3*pe*pe,me=pe*pe*pe,ge=Math.PI/180,Ae=180/Math.PI;function ye(t){return t>me?Math.pow(t,1/3):t/fe+de}function ve(t){return t>pe?t*t*t:fe*(t-de)}function xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function be(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _e(t){const e=be(t.r),r=be(t.g),i=be(t.b),n=ye((.4124564*e+.3575761*r+.1804375*i)/he),s=ye((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*s-16,a:500*(n-s),b:200*(s-ye((.0193339*e+.119192*r+.9503041*i)/ue)),alpha:t.a}}function we(t){let e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*ve(e),r=he*ve(r),i=ue*ve(i),new st(xe(3.2404542*r-1.5371385*e-.4985314*i),xe(-.969266*r+1.8760108*e+.041556*i),xe(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function Ee(t,e,r){const i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}const Me={forward:_e,reverse:we,interpolate:function(t,e,r){return{l:le(t.l,e.l,r),a:le(t.a,e.a,r),b:le(t.b,e.b,r),alpha:le(t.alpha,e.alpha,r)}}},Se={forward:function(t){const{l:e,a:r,b:i}=_e(t),n=Math.atan2(i,r)*Ae;return{h:n<0?n+360:n,c:Math.sqrt(r*r+i*i),l:e,alpha:t.a}},reverse:function(t){const e=t.h*ge,r=t.c;return we({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Ee(t.h,e.h,r),c:le(t.c,e.c,r),l:le(t.l,e.l,r),alpha:le(t.alpha,e.alpha,r)}}};var Ce=Object.freeze({__proto__:null,lab:Me,hcl:Se});class Te{constructor(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[t,e]of n)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,r,i){let n=0;if("exponential"===t.name)n=Ie(e,t.base,r,i);else if("linear"===t.name)n=Ie(e,1,r,i);else if("cubic-bezier"===t.name){const s=t.controlPoints;n=new oe(s[0],s[1],s[2],s[3]).solve(Ie(e,1,r,i))}return n}static parse(t,e){let[r,i,n,...s]=t;if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const t=i[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:t}}else{if("cubic-bezier"!==i[0])return e.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const t=i.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,k),!n)return null;const o=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=F:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=e.parse(i,l,a);if(!c)return null;a=a||c.type,o.push([r,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Te(a,r,i,n,o):e.error(`Type ${W(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);const n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);const s=ie(e,i),o=e[s],a=e[s+1],l=Te.interpolationFactor(this.interpolation,i,o,a),c=r[s].evaluate(t),h=r[s+1].evaluate(t);return"interpolate"===this.operator?ce[this.type.kind.toLowerCase()](c,h,l):"interpolate-hcl"===this.operator?Se.reverse(Se.interpolate(Se.forward(c),Se.forward(h),l)):Me.reverse(Me.interpolate(Me.forward(c),Me.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;tZ(i,t.type)));return new Be(s?G:r,n)}evaluate(t){let e,r=null,i=0;for(const n of this.args){if(i++,r=n.evaluate(t),r&&r instanceof ct&&!r.available&&(e||(e=r),r=null,i===this.args.length))return e;if(null!==r)break}return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Le=Be;class Pe{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let i=1;i=r.length)throw new gt(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new gt(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var ke=Oe;class Ue{constructor(t,e){this.type=N,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,G);return r&&i?Y(r.type,[N,U,k,O,G])?new Ue(r,i):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!X(e,["boolean","string","number","null"]))throw new gt(`Expected first argument to be of type boolean, string, number or null, but found ${W(dt(e))} instead.`);if(!X(r,["string","array"]))throw new gt(`Expected second argument to be of type array or string, but found ${W(dt(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ne=Ue;class Fe{constructor(t,e,r){this.type=k,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,G);if(!r||!i)return null;if(!Y(r.type,[N,U,k,O,G]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(r.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,k);return n?new Fe(r,i,n):null}return new Fe(r,i)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!X(e,["boolean","string","number","null"]))throw new gt(`Expected first argument to be of type boolean, string, number or null, but found ${W(dt(e))} instead.`);if(!X(r,["string","array"]))throw new gt(`Expected second argument to be of type array or string, but found ${W(dt(r))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var ze=Fe;class Ge{constructor(t,e,r,i,n,s){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=s}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n={},s=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,dt(t)))return null}else r=dt(t);if(void 0!==n[String(t)])return c.error("Branch labels must be unique.");n[String(t)]=s.length}const h=e.parse(l,o,i);if(!h)return null;i=i||h.type,s.push(h)}const o=e.parse(t[1],1,G);if(!o)return null;const a=e.parse(t[t.length-1],t.length-1,i);return a?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new Ge(r,i,o,n,s,a):null}evaluate(t){const e=this.input.evaluate(t);return(dt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),r=[],i={};for(const t of e){const e=i[this.cases[t]];void 0===e?(i[this.cases[t]]=r.length,r.push([this.cases[t],[t]])):r[e][1].push(t)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,i]of r)1===i.length?t.push(n(i[0])):t.push(i.map(n)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}var Qe=Ge;class je{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const i=[];for(let n=1;ne.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Ve=je;class He{constructor(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,k);if(!r||!i)return null;if(!Y(r.type,[H(G),U,G]))return e.error(`Expected first argument to be of type array or string, but found ${W(r.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,k);return n?new He(r.type,r,i,n):null}return new He(r.type,r,i)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!X(e,["string","array"]))throw new gt(`Expected first argument to be of type array or string, but found ${W(dt(e))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var We=He;function qe(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ze(t,e,r,i){return 0===i.compare(e,r)}function Ye(t,e,r){const i="=="!==t&&"!="!==t;return class n{constructor(t,e,r){this.type=N,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let s=e.parse(t[1],1,G);if(!s)return null;if(!qe(r,s.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${W(s.type)}'.`);let o=e.parse(t[2],2,G);if(!o)return null;if(!qe(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${W(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${W(s.type)}' and '${W(o.type)}'.`);i&&("value"===s.type.kind&&"value"!==o.type.kind?s=new vt(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new vt(s.type,[o])));let a=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Q),!a)return null}return new n(s,o,a)}evaluate(n){const s=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){const e=dt(s),r=dt(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new gt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const t=dt(s),r=dt(o);if("string"!==t.kind||"string"!==r.kind)return e(n,s,o)}return this.collator?r(n,s,o,this.collator.evaluate(n)):e(n,s,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Xe=Ye("==",(function(t,e,r){return e===r}),Ze),Je=Ye("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!Ze(0,e,r,i)})),Ke=Ye("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),tr=Ye("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),er=Ye(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0}));class rr{constructor(t,e,r,i,n,s){this.type=U,this.number=t,this.locale=e,this.currency=r,this.unit=i,this.minFractionDigits=n,this.maxFractionDigits=s}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,k);if(!r)return null;const i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=e.parse(i.locale,1,U),!n))return null;let s=null;if(i.currency&&(s=e.parse(i.currency,1,U),!s))return null;let o=null;if(i.unit&&(o=e.parse(i.unit,1,U),!o))return null;let a=null;if(i["min-fraction-digits"]&&(a=e.parse(i["min-fraction-digits"],1,k),!a))return null;let l=null;return i["max-fraction-digits"]&&(l=e.parse(i["max-fraction-digits"],1,k),!l)?null:new rr(r,n,s,o,a,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class ir{constructor(t){this.type=k,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${W(r.type)} instead.`):new ir(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new gt(`Expected value to be of type string or array, but found ${W(dt(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const nr={"==":Xe,"!=":Je,">":$e,"<":Ke,">=":er,"<=":tr,array:vt,at:ke,boolean:vt,case:Ve,coalesce:Le,collator:It,format:xt,image:bt,in:Ne,"index-of":ze,interpolate:Re,"interpolate-hcl":Re,"interpolate-lab":Re,length:ir,let:De,literal:mt,match:Qe,number:vt,"number-format":rr,object:vt,slice:We,step:se,string:vt,"to-boolean":Et,"to-color":Et,"to-number":Et,"to-string":Et,var:$t,within:Zt};function sr(t,[e,r,i,n]){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);const s=n?n.evaluate(t):1,o=ht(e,r,i,s);if(o)throw new gt(o);return new st(e/255*s,r/255*s,i/255*s,s)}function or(t,e){return t in e}function ar(t,e){const r=e[t];return void 0===r?null:r}function lr(t){return{type:t}}Tt.register(nr,{error:[{kind:"error"},[U],(t,[e])=>{throw new gt(e.evaluate(t))}],typeof:[U,[G],(t,[e])=>W(dt(e.evaluate(t)))],"to-rgba":[H(k,4),[F],(t,[e])=>e.evaluate(t).toArray()],rgb:[F,[k,k,k],sr],rgba:[F,[k,k,k,k],sr],has:{type:N,overloads:[[[U],(t,[e])=>or(e.evaluate(t),t.properties())],[[U,z],(t,[e,r])=>or(e.evaluate(t),r.evaluate(t))]]},get:{type:G,overloads:[[[U],(t,[e])=>ar(e.evaluate(t),t.properties())],[[U,z],(t,[e,r])=>ar(e.evaluate(t),r.evaluate(t))]]},"feature-state":[G,[U],(t,[e])=>ar(e.evaluate(t),t.featureState||{})],properties:[z,[],t=>t.properties()],"geometry-type":[U,[],t=>t.geometryType()],id:[G,[],t=>t.id()],zoom:[k,[],t=>t.globals.zoom],pitch:[k,[],t=>t.globals.pitch||0],"distance-from-center":[k,[],t=>t.distanceFromCenter()],"heatmap-density":[k,[],t=>t.globals.heatmapDensity||0],"line-progress":[k,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[k,[],t=>t.globals.skyRadialProgress||0],accumulated:[G,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[k,lr(k),(t,e)=>{let r=0;for(const i of e)r+=i.evaluate(t);return r}],"*":[k,lr(k),(t,e)=>{let r=1;for(const i of e)r*=i.evaluate(t);return r}],"-":{type:k,overloads:[[[k,k],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[k],(t,[e])=>-e.evaluate(t)]]},"/":[k,[k,k],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[k,[k,k],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[k,[],()=>Math.LN2],pi:[k,[],()=>Math.PI],e:[k,[],()=>Math.E],"^":[k,[k,k],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[k,[k],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[k,[k],(t,[e])=>Math.log(e.evaluate(t))],log2:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[k,[k],(t,[e])=>Math.sin(e.evaluate(t))],cos:[k,[k],(t,[e])=>Math.cos(e.evaluate(t))],tan:[k,[k],(t,[e])=>Math.tan(e.evaluate(t))],asin:[k,[k],(t,[e])=>Math.asin(e.evaluate(t))],acos:[k,[k],(t,[e])=>Math.acos(e.evaluate(t))],atan:[k,[k],(t,[e])=>Math.atan(e.evaluate(t))],min:[k,lr(k),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[k,lr(k),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[k,[k],(t,[e])=>Math.abs(e.evaluate(t))],round:[k,[k],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[k,[k],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[k,[k],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[N,[U,G],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[N,[G],(t,[e])=>t.id()===e.value],"filter-type-==":[N,[U],(t,[e])=>t.geometryType()===e.value],"filter-<":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{const r=t.id(),i=e.value;return typeof r==typeof i&&r":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[N,[G],(t,[e])=>e.value in t.properties()],"filter-has-id":[N,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[N,[H(U)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[N,[H(G)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[N,[U,H(G)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[N,[U,H(G)],(t,[e,r])=>function(t,e,r,i){for(;r<=i;){const n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:N,overloads:[[[N,N],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[lr(N),(t,e)=>{for(const r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:N,overloads:[[[N,N],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[lr(N),(t,e)=>{for(const r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[N,[N],(t,[e])=>!e.evaluate(t)],"is-supported-script":[N,[U],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[U,[U],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[U,[U],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[U,lr(G),(t,e)=>e.map((e=>pt(e.evaluate(t)))).join("")],"resolved-locale":[U,[Q],(t,[e])=>e.evaluate(t).resolvedLocale()]});var cr=nr;function hr(t){return{result:"success",value:t}}function ur(t){return{result:"error",value:t}}function dr(t){return!!t.expression&&t.expression.interpolated}function pr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function fr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function mr(t){return t}function gr(t,e){const r="color"===e.type,i=t.stops&&"object"==typeof t.stops[0][0],n=i||void 0!==t.property,s=i||!n,o=t.type||(dr(e)?"exponential":"interval");if(r&&((t=R({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],st.parse(t[1])]))),t.default?t.default=st.parse(t.default):t.default=st.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!Ce[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let a,l,c;if("exponential"===o)a=xr;else if("interval"===o)a=vr;else if("categorical"===o){a=yr,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=br}if(i){const r={},i=[];for(let e=0;et[0])),evaluate:({zoom:r},i)=>xr({stops:n,base:t.base},e,r).evaluate(r,i)}}if(s){const r="exponential"===o?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Re.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>a(t,e,r,l,c)}}return{kind:"source",evaluate(r,i){const n=i&&i.properties?i.properties[t.property]:void 0;return void 0===n?Ar(t.default,e.default):a(t,e,n,l,c)}}}function Ar(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function yr(t,e,r,i,n){return Ar(typeof r===n?i[r]:void 0,t.default,e.default)}function vr(t,e,r){if("number"!==pr(r))return Ar(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const n=ie(t.stops.map((t=>t[0])),r);return t.stops[n][1]}function xr(t,e,r){const i=void 0!==t.base?t.base:1;if("number"!==pr(r))return Ar(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const s=ie(t.stops.map((t=>t[0])),r),o=function(t,e,r,i){const n=i-r,s=t-r;return 0===n?0:1===e?s/n:(Math.pow(e,s)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[s][0],t.stops[s+1][0]),a=t.stops[s][1],l=t.stops[s+1][1];let c=ce[e.type]||mr;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=Ce[t.colorSpace];c=(t,r)=>e.reverse(e.interpolate(e.forward(t),e.forward(r),o))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),r=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==r)return c(e,r,o)}}:c(a,l,o)}function br(t,e,r){return"color"===e.type?r=st.parse(r):"formatted"===e.type?r=lt.fromString(r.toString()):"resolvedImage"===e.type?r=ct.fromString(r.toString()):pr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Ar(r,t.default,e.default)}class _r{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new St,this._defaultValue=e?"color"===(r=e).type&&(fr(r.default)||Array.isArray(r.default))?new st(0,0,0,0):"color"===r.type?st.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,i,n,s,o,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,s,o,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s||null,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new gt(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function wr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in cr}function Er(t,e){const r=new ee(cr,[],e?function(t){const e={color:F,string:U,number:k,enum:U,boolean:N,formatted:j,resolvedImage:V};return"array"===t.type?H(e[t.value]||G,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?hr(new _r(i,e)):ur(r.errors)}class Mr{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Xt(e.expression)}evaluateWithoutErrorHandling(t,e,r,i,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,s)}evaluate(t,e,r,i,n,s){return this._styleExpression.evaluate(t,e,r,i,n,s)}}class Sr{constructor(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Xt(e.expression),this.interpolationType=i}evaluateWithoutErrorHandling(t,e,r,i,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,s)}evaluate(t,e,r,i,n,s){return this._styleExpression.evaluate(t,e,r,i,n,s)}interpolationFactor(t,e,r){return this.interpolationType?Re.interpolationFactor(this.interpolationType,t,e,r):0}}function Cr(t,e){if("error"===(t=Er(t,e)).result)return t;const r=t.value.expression,i=Yt(r);if(!i&&"data-driven"!==e["property-type"])return ur([new L("","data expressions not supported")]);const n=Jt(r,["zoom","pitch","distance-from-center"]);if(!n&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return ur([new L("","zoom expressions not supported")]);const s=Ir(r);if(!s&&!n)return ur([new L("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof L)return ur([s]);if(s instanceof Re&&!dr(e))return ur([new L("",'"interpolate" expressions cannot be used with this property')]);if(!s)return hr(new Mr(i?"constant":"source",t.value));const o=s instanceof Re?s.interpolation:void 0;return hr(new Sr(i?"camera":"composite",t.value,s.labels,o))}class Tr{constructor(t,e){this._parameters=t,this._specification=e,R(this,gr(this._parameters,this._specification))}static deserialize(t){return new Tr(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ir(t){let e=null;if(t instanceof De)e=Ir(t.result);else if(t instanceof Le){for(const r of t.args)if(e=Ir(r),e)break}else(t instanceof se||t instanceof Re)&&t.input instanceof Tt&&"zoom"===t.input.name&&(e=t);return e instanceof L||t.eachChild((t=>{const r=Ir(t);r instanceof L?e=r:!e&&r?e=new L("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new L("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Rr(t){if(Array.isArray(t))return t.map(Rr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const r in t)e[r]=Rr(t[r]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Br(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Br(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Lr(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Br(t)||(t=Fr(t));const r=t;let n=!0;try{n=function(t){if(!Or(t))return t;let e=Rr(t);return Dr(e),e=Pr(e),e}(r)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const s=i[`filter_${e}`],o=Er(n,s);let a=null;if("error"===o.result)throw new Error(o.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,r)=>o.value.evaluate(t,e,{},r);let l=null,c=null;if(n!==r){const t=Er(r,s);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));l=(e,r,i,n,s)=>t.value.evaluate(e,r,{},i,void 0,void 0,n,s),c=!Yt(t.value.expression)}return{filter:a,dynamicFilter:l||void 0,needGeometry:Nr(n),needFeature:!!c}}function Pr(t){if(!Array.isArray(t))return t;const e=function(t){if(kr.has(t[0]))for(let e=1;ePr(t)))}function Dr(t){let e=!1;const r=[];if("case"===t[0]){for(let i=1;i",">=","<","<=","to-boolean"]);function Ur(t,e){return te?1:0}function Nr(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?zr(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fr))):"all"===e?["all"].concat(t.slice(1).map(Fr)):"none"===e?["all"].concat(t.slice(1).map(Fr).map(jr)):"in"===e?Gr(t[1],t.slice(2)):"!in"===e?jr(Gr(t[1],t.slice(2))):"has"===e?Qr(t[1]):"!has"===e?jr(Qr(t[1])):"within"!==e||t;var r}function zr(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Gr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Ur)]]:["filter-in-small",t,["literal",e]]}}function Qr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function jr(t){return["!",t]}function Vr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}!function(t){var e=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,12],r=[1,13],i=[1,9],n=[1,10],s=[1,11],o=[1,14],a=[1,15],l=[14,18,22,24],c=[18,22],h=[22,24],u={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,r,i,n,s,o){var a=s.length-1;switch(n){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=s[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=s[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[s[a-2],s[a]];break;case 16:this.$={},this.$[s[a][0]]=s[a][1];break;case 17:this.$=s[a-2],s[a-2][s[a][0]]=s[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[s[a]];break;case 21:this.$=s[a-2],s[a-2].push(s[a])}},table:[{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,12:1,13:2,15:7,16:8,17:o,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:23,15:7,16:8,17:o,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(c,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:30,15:7,16:8,17:o,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:31,15:7,16:8,17:o,23:a},t(c,[2,17]),t(c,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=[0],r=[null],i=[],n=this.table,s="",o=0,a=0,l=i.slice.call(arguments,1),c=Object.create(this.lexer),h={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(h.yy[u]=this.yy[u]);c.setInput(t,h.yy),h.yy.lexer=c,h.yy.parser=this,void 0===c.yylloc&&(c.yylloc={});var d=c.yylloc;i.push(d);var p=c.options&&c.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,g,A,y,v,x,b,_,w={};;){if(m=e[e.length-1],this.defaultActions[m]?g=this.defaultActions[m]:(null==f&&(_=void 0,"number"!=typeof(_=c.lex()||1)&&(_=this.symbols_[_]||_),f=_),g=n[m]&&n[m][f]),void 0===g||!g.length||!g[0]){var E;for(y in b=[],n[m])this.terminals_[y]&&y>2&&b.push("'"+this.terminals_[y]+"'");E=c.showPosition?"Parse error on line "+(o+1)+":\n"+c.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(E,{text:c.match,token:this.terminals_[f]||f,line:c.yylineno,loc:d,expected:b})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(g[0]){case 1:e.push(f),r.push(c.yytext),i.push(c.yylloc),e.push(g[1]),f=null,a=c.yyleng,s=c.yytext,o=c.yylineno,d=c.yylloc;break;case 2:if(v=this.productions_[g[1]][1],w.$=r[r.length-v],w._$={first_line:i[i.length-(v||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(v||1)].first_column,last_column:i[i.length-1].last_column},p&&(w._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(A=this.performAction.apply(w,[s,a,o,h.yy,g[1],r,i].concat(l))))return A;v&&(e=e.slice(0,-1*v*2),r=r.slice(0,-1*v),i=i.slice(0,-1*v)),e.push(this.productions_[g[1]][0]),r.push(w.$),i.push(w._$),x=n[e[e.length-2]][e[e.length-1]],e.push(x);break;case 3:return!0}}return!0}},d={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=r,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,i){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function p(){this.yy={}}return u.lexer=d,p.prototype=u,u.Parser=p,new p}();void 0!==Vr&&(t.parser=e,t.Parser=e.Parser,t.parse=function(){return e.parse.apply(e,arguments)})}({}),new Set(["vector","raster","raster-dem"]);const Hr={StyleExpression:_r,isExpression:wr,isExpressionFilter:Br,createExpression:Er,createPropertyExpression:Cr,normalizePropertyExpression:function(t,e){if(fr(t))return new Tr(t,e);if(wr(t)){const r=Cr(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return"string"==typeof t&&"color"===e.type&&(r=st.parse(t)),{kind:"constant",evaluate:()=>r}}},ZoomConstantExpression:Mr,ZoomDependentExpression:Sr,StylePropertyFunction:Tr}},75153:(t,e,r)=>{"use strict";function i(t,e){return Array.from(t.getElementsByTagName(e))}function n(t){return"#"===t[0]?t:`#${t}`}function s(t){return t?.normalize(),t&&t.textContent||""}function o(t,e,r){const i=t.getElementsByTagName(e),n=i.length?i[0]:null;return n&&r&&r(n),n}function a(t,e,r){const i={};if(!t)return i;const n=t.getElementsByTagName(e),s=n.length?n[0]:null;return s&&r?r(s,i):i}function l(t,e,r){const i=s(o(t,e));return i&&r&&r(i)||{}}function c(t,e,r){const i=parseFloat(s(o(t,e)));if(!isNaN(i))return i&&r&&r(i)||{}}function h(t,e,r){const i=parseFloat(s(o(t,e)));if(!isNaN(i))return r&&r(i),i}function u(t,e){const r={};for(const i of e)l(t,i,(t=>{r[i]=t}));return r}function d(t){return 1===t?.nodeType}function p(t){return a(t,"line",(t=>Object.assign({},l(t,"color",(t=>({stroke:`#${t}`}))),c(t,"opacity",(t=>({"stroke-opacity":t}))),c(t,"width",(t=>({"stroke-width":96*t/25.4}))))))}function f(t){let e=[];if(null===t)return e;for(const r of Array.from(t.childNodes)){if(!d(r))continue;const t=m(r.nodeName);if("gpxtpx:TrackPointExtension"===t)e=e.concat(f(r));else{const i=s(r);e.push([t,g(i)])}}return e}function m(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function g(t){const e=parseFloat(t);return isNaN(e)?t:e}function A(t){const e=[parseFloat(t.getAttribute("lon")||""),parseFloat(t.getAttribute("lat")||"")];if(isNaN(e[0])||isNaN(e[1]))return null;h(t,"ele",(t=>{e.push(t)}));const r=o(t,"time");return{coordinates:e,time:r?s(r):null,extendedValues:f(o(t,"extensions"))}}function y(t){const e=u(t,["name","cmt","desc","type","time","keywords"]),r=Array.from(t.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const i of r)i.parentNode?.parentNode===t&&(e[i.tagName.replace(":","_")]=s(i));const n=i(t,"link");return n.length&&(e.links=n.map((t=>Object.assign({href:t.getAttribute("href")},u(t,["text","type"]))))),e}function v(t,e){const r=i(t,e),n=[],s=[],o={};for(let t=0;t1,l=Object.assign({_gpxType:"trk"},y(t),p(o(t,"extensions")),n.length?{coordinateProperties:{times:a?n:n[0]}}:{});for(const t of s){r.push(t.line),l.coordinateProperties||(l.coordinateProperties={});const e=l.coordinateProperties,i=Object.entries(t.extendedValues);for(let t=0;tnew Array(t.line.length).fill(null)))),e[r][t]=n):e[r]=n}}return{type:"Feature",properties:l,geometry:a?{type:"MultiLineString",coordinates:r}:{type:"LineString",coordinates:r[0]}}}function _(t){const e=Object.assign(y(t),u(t,["sym"])),r=A(t);return r?{type:"Feature",properties:e,geometry:{type:"Point",coordinates:r.coordinates}}:null}function*w(t){for(const e of i(t,"trk")){const t=b(e);t&&(yield t)}for(const e of i(t,"rte")){const t=x(e);t&&(yield t)}for(const e of i(t,"wpt")){const t=_(e);t&&(yield t)}}function E(t){return{type:"FeatureCollection",features:Array.from(w(t))}}function M(t,e){const r={},i="stroke"==e||"fill"===e?e:e+"-color";return"#"===t[0]&&(t=t.substring(1)),6===t.length||3===t.length?r[i]="#"+t:8===t.length&&(r[e+"-opacity"]=parseInt(t.substring(0,2),16)/255,r[i]="#"+t.substring(6,8)+t.substring(4,6)+t.substring(2,4)),r}function S(t,e,r){const i={};return h(t,e,(t=>{i[r]=t})),i}function C(t,e){return a(t,"color",(t=>M(s(t),e)))}function T(t){return a(t,"Icon",((t,e)=>(l(t,"href",(t=>{e.icon=t})),e)))}function I(t){return Object.assign({},function(t){return a(t,"PolyStyle",((t,e)=>Object.assign(e,a(t,"color",(t=>M(s(t),"fill"))),l(t,"fill",(t=>{if("0"===t)return{"fill-opacity":0}})),l(t,"outline",(t=>{if("0"===t)return{"stroke-opacity":0}})))))}(t),function(t){return a(t,"LineStyle",(t=>Object.assign(C(t,"stroke"),S(t,"width","stroke-width"))))}(t),function(t){return a(t,"LabelStyle",(t=>Object.assign(C(t,"label"),S(t,"scale","label-scale"))))}(t),function(t){return a(t,"IconStyle",(t=>Object.assign(C(t,"icon"),S(t,"scale","icon-scale"),S(t,"heading","icon-heading"),a(t,"hotSpot",(t=>{const e=parseFloat(t.getAttribute("x")||""),r=parseFloat(t.getAttribute("y")||""),i=t.getAttribute("xunits")||"",n=t.getAttribute("yunits")||"";return isNaN(e)||isNaN(r)?{}:{"icon-offset":[e,r],"icon-offset-units":[i,n]}})),T(t))))}(t))}r.d(e,{DS:()=>J,ng:()=>E});const R=t=>Number(t),B={string:t=>t,int:R,uint:R,short:R,ushort:R,float:R,double:R,bool:t=>Boolean(t)};function L(t,e){return a(t,"ExtendedData",((t,r)=>{for(const e of i(t,"Data"))r[e.getAttribute("name")||""]=s(o(e,"value"));for(const n of i(t,"SimpleData")){const t=n.getAttribute("name")||"",i=e[t]||B.string;r[t]=i(s(n))}return r}))}function P(t){const e=o(t,"description");for(const t of Array.from(e?.childNodes||[]))if(4===t.nodeType)return{description:{"@type":"html",value:s(t)}};return{}}function D(t){return a(t,"TimeSpan",(t=>({timespan:{begin:s(o(t,"begin")),end:s(o(t,"end"))}})))}function O(t){return a(t,"TimeStamp",(t=>({timestamp:s(o(t,"when"))})))}function k(t,e){return l(t,"styleUrl",(t=>(t=n(t),e[t]?Object.assign({styleUrl:t},e[t]):{styleUrl:t})))}const U=/\s*/g,N=/^\s*|\s*$/g,F=/\s+/;function z(t){return t.replace(U,"").split(",").map(parseFloat).filter((t=>!isNaN(t))).slice(0,3)}function G(t){return t.replace(N,"").split(F).map(z).filter((t=>t.length>=2))}function Q(t){let e=i(t,"coord");var r;0===e.length&&(r=t,"coord","*",e=Array.from(r.getElementsByTagNameNS("*","coord")));const n=e.map((t=>s(t).split(" ").map(parseFloat)));return 0===n.length?null:{geometry:n.length>2?{type:"LineString",coordinates:n}:{type:"Point",coordinates:n[0]},times:i(t,"when").map((t=>s(t)))}}function j(t){if(0===t.length)return t;const e=t[0],r=t[t.length-1];let i=!0;for(let t=0;t=2&&e.push({type:"Point",coordinates:t});break}case"LinearRing":case"LineString":{const t=G(V(s));t.length>=2&&e.push({type:"LineString",coordinates:t});break}case"Polygon":{const t=[];for(const e of i(s,"LinearRing")){const r=j(G(V(e)));r.length>=4&&t.push(r)}t.length&&e.push({type:"Polygon",coordinates:t});break}case"Track":case"gx:Track":{const t=Q(s);if(!t)break;const{times:i,geometry:n}=t;e.push(n),i.length&&r.push(i);break}}}return{geometries:e,coordTimes:r}}function W(t,e,r,i){const{coordTimes:n,geometries:s}=H(t),o=function(t){return 0===t.length?null:1===t.length?t[0]:{type:"GeometryCollection",geometries:t}}(s);if(!o&&i.skipNullGeometry)return null;const a={type:"Feature",geometry:o,properties:Object.assign(u(t,["name","address","visibility","open","phoneNumber","description"]),P(t),k(t,e),I(t),L(t,r),D(t),O(t),n.length?{coordinateProperties:{times:1===n.length?n[0]:n}}:{})};void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=t.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}const q=Math.PI/180;function Z(t,e,r,i){const n=function(t){return o(t,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[j(G(V(t)))]}}:function(t){const e=o(t,"LatLonBox");if(e){const t=h(e,"north"),r=h(e,"west"),i=h(e,"east"),n=h(e,"south"),s=h(e,"rotation");if("number"==typeof t&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i){const e=[r,n,i,t];let o=[[[r,t],[i,t],[i,n],[r,n],[r,t]]];return"number"==typeof s&&(o=function(t,e,r){const i=[(t[0]+t[2])/2,(t[1]+t[3])/2];return[e[0].map((t=>{const e=t[1]-i[1],n=t[0]-i[0],s=Math.sqrt(Math.pow(e,2)+Math.pow(n,2)),o=Math.atan2(e,n)+r*q;return[i[0]+Math.cos(o)*s,i[1]+Math.sin(o)*s]}))]}(e,o,s)),{bbox:e,geometry:{type:"Polygon",coordinates:o}}}}return null}(t)}(t),s=n?.geometry||null;if(!s&&i.skipNullGeometry)return null;const a={type:"Feature",geometry:s,properties:Object.assign({"@geometry-type":"groundoverlay"},u(t,["name","address","visibility","open","phoneNumber","description"]),P(t),k(t,e),I(t),T(t),L(t,r),D(t),O(t))};n?.bbox&&(a.bbox=n.bbox),void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=t.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}function Y(t){let e=t.getAttribute("id");const r=t.parentNode;return!e&&d(r)&&"CascadingStyle"===r.localName&&(e=r.getAttribute("kml:id")||r.getAttribute("id")),n(e||"")}function*X(t,e={skipNullGeometry:!1}){const r=function(t){const e={};for(const r of i(t,"Style"))e[Y(r)]=I(r);for(const r of i(t,"StyleMap")){const t=n(r.getAttribute("id")||"");l(r,"styleUrl",(r=>{r=n(r),e[r]&&(e[t]=e[r])}))}return e}(t),s=function(t){const e={};for(const r of i(t,"SimpleField"))e[r.getAttribute("name")||""]=B[r.getAttribute("type")||""]||B.string;return e}(t);for(const n of i(t,"Placemark")){const t=W(n,r,s,e);t&&(yield t)}for(const n of i(t,"GroundOverlay")){const t=Z(n,r,s,e);t&&(yield t)}}function J(t,e={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(X(t,e))}}},99477:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ACESFilmicToneMapping:()=>st,AddEquation:()=>E,AddOperation:()=>tt,AdditiveAnimationBlendMode:()=>Ne,AdditiveBlending:()=>x,AlphaFormat:()=>Ft,AlwaysCompare:()=>Sr,AlwaysDepth:()=>H,AlwaysStencilFunc:()=>yr,AmbientLight:()=>op,AnimationAction:()=>Yp,AnimationClip:()=>Rd,AnimationLoader:()=>Fd,AnimationMixer:()=>Jp,AnimationObjectGroup:()=>Zp,AnimationUtils:()=>Ad,ArcCurve:()=>kh,ArrayCamera:()=>jl,ArrowHelper:()=>jf,AttachedBindMode:()=>at,Audio:()=>Pp,AudioAnalyser:()=>Fp,AudioContext:()=>xp,AudioListener:()=>Lp,AudioLoader:()=>bp,AxesHelper:()=>Vf,BackSide:()=>m,BasicDepthPacking:()=>Ve,BasicShadowMap:()=>h,BatchedMesh:()=>ch,Bone:()=>Pc,BooleanKeyframeTrack:()=>wd,Box2:()=>hf,Box3:()=>Ui,Box3Helper:()=>Nf,BoxGeometry:()=>Ys,BoxHelper:()=>Uf,BufferAttribute:()=>us,BufferGeometry:()=>Is,BufferGeometryLoader:()=>pp,ByteType:()=>It,Cache:()=>Ld,Camera:()=>eo,CameraHelper:()=>Df,CanvasTexture:()=>Ph,CapsuleGeometry:()=>iu,CatmullRomCurve3:()=>Qh,CineonToneMapping:()=>nt,CircleGeometry:()=>nu,ClampToEdgeWrapping:()=>gt,Clock:()=>Sp,Color:()=>$n,ColorKeyframeTrack:()=>Ed,ColorManagement:()=>mi,CompressedArrayTexture:()=>Bh,CompressedCubeTexture:()=>Lh,CompressedTexture:()=>Rh,CompressedTextureLoader:()=>zd,ConeGeometry:()=>ou,ConstantAlphaFactor:()=>Q,ConstantColorFactor:()=>z,CubeCamera:()=>no,CubeReflectionMapping:()=>ht,CubeRefractionMapping:()=>ut,CubeTexture:()=>so,CubeTextureLoader:()=>Qd,CubeUVReflectionMapping:()=>ft,CubicBezierCurve:()=>Wh,CubicBezierCurve3:()=>qh,CubicInterpolant:()=>vd,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>o,Curve:()=>Dh,CurvePath:()=>tu,CustomBlending:()=>w,CustomToneMapping:()=>ot,CylinderGeometry:()=>su,Cylindrical:()=>lf,Data3DTexture:()=>Ri,DataArrayTexture:()=>Ti,DataTexture:()=>Dc,DataTextureLoader:()=>jd,DataUtils:()=>ls,DecrementStencilOp:()=>ar,DecrementWrapStencilOp:()=>cr,DefaultLoadingManager:()=>Dd,DepthFormat:()=>jt,DepthStencilFormat:()=>Vt,DepthTexture:()=>Ko,DetachedBindMode:()=>lt,DirectionalLight:()=>sp,DirectionalLightHelper:()=>Bf,DiscreteInterpolant:()=>bd,DisplayP3ColorSpace:()=>Je,DodecahedronGeometry:()=>lu,DoubleSide:()=>g,DstAlphaFactor:()=>O,DstColorFactor:()=>U,DynamicCopyUsage:()=>Dr,DynamicDrawUsage:()=>Tr,DynamicReadUsage:()=>Br,EdgesGeometry:()=>pu,EllipseCurve:()=>Oh,EqualCompare:()=>br,EqualDepth:()=>Z,EqualStencilFunc:()=>pr,EquirectangularReflectionMapping:()=>dt,EquirectangularRefractionMapping:()=>pt,Euler:()=>bn,EventDispatcher:()=>Gr,ExtrudeGeometry:()=>Qu,FileLoader:()=>Nd,Float16BufferAttribute:()=>vs,Float32BufferAttribute:()=>xs,Float64BufferAttribute:()=>bs,FloatType:()=>Dt,Fog:()=>$l,FogExp2:()=>Kl,FramebufferTexture:()=>Ih,FrontSide:()=>f,Frustum:()=>fo,GLBufferAttribute:()=>rf,GLSL1:()=>kr,GLSL3:()=>Ur,GreaterCompare:()=>wr,GreaterDepth:()=>X,GreaterEqualCompare:()=>Mr,GreaterEqualDepth:()=>Y,GreaterEqualStencilFunc:()=>Ar,GreaterStencilFunc:()=>mr,GridHelper:()=>Sf,Group:()=>Vl,HalfFloatType:()=>Ot,HemisphereLight:()=>Wd,HemisphereLightHelper:()=>Mf,IcosahedronGeometry:()=>Vu,ImageBitmapLoader:()=>yp,ImageLoader:()=>Gd,ImageUtils:()=>vi,IncrementStencilOp:()=>or,IncrementWrapStencilOp:()=>lr,InstancedBufferAttribute:()=>Nc,InstancedBufferGeometry:()=>dp,InstancedInterleavedBuffer:()=>ef,InstancedMesh:()=>Wc,Int16BufferAttribute:()=>ms,Int32BufferAttribute:()=>As,Int8BufferAttribute:()=>ds,IntType:()=>Lt,InterleavedBuffer:()=>ec,InterleavedBufferAttribute:()=>ic,Interpolant:()=>yd,InterpolateDiscrete:()=>Be,InterpolateLinear:()=>Le,InterpolateSmooth:()=>Pe,InvertStencilOp:()=>hr,KeepStencilOp:()=>nr,KeyframeTrack:()=>_d,LOD:()=>_c,LatheGeometry:()=>ru,Layers:()=>_n,LessCompare:()=>xr,LessDepth:()=>W,LessEqualCompare:()=>_r,LessEqualDepth:()=>q,LessEqualStencilFunc:()=>fr,LessStencilFunc:()=>dr,Light:()=>Hd,LightProbe:()=>cp,Line:()=>gh,Line3:()=>pf,LineBasicMaterial:()=>hh,LineCurve:()=>Zh,LineCurve3:()=>Yh,LineDashedMaterial:()=>ud,LineLoop:()=>xh,LineSegments:()=>vh,LinearDisplayP3ColorSpace:()=>Ke,LinearEncoding:()=>Qe,LinearFilter:()=>wt,LinearInterpolant:()=>xd,LinearMipMapLinearFilter:()=>Ct,LinearMipMapNearestFilter:()=>Mt,LinearMipmapLinearFilter:()=>St,LinearMipmapNearestFilter:()=>Et,LinearSRGBColorSpace:()=>Xe,LinearToneMapping:()=>rt,LinearTransfer:()=>$e,Loader:()=>Od,LoaderUtils:()=>up,LoadingManager:()=>Pd,LoopOnce:()=>Te,LoopPingPong:()=>Re,LoopRepeat:()=>Ie,LuminanceAlphaFormat:()=>Qt,LuminanceFormat:()=>Gt,MOUSE:()=>n,Material:()=>rs,MaterialLoader:()=>hp,MathUtils:()=>ti,Matrix3:()=>ri,Matrix4:()=>un,MaxEquation:()=>T,Mesh:()=>qs,MeshBasicMaterial:()=>is,MeshDepthMaterial:()=>Ul,MeshDistanceMaterial:()=>Nl,MeshLambertMaterial:()=>cd,MeshMatcapMaterial:()=>hd,MeshNormalMaterial:()=>ld,MeshPhongMaterial:()=>od,MeshPhysicalMaterial:()=>sd,MeshStandardMaterial:()=>nd,MeshToonMaterial:()=>ad,MinEquation:()=>C,MirroredRepeatWrapping:()=>At,MixOperation:()=>$,MultiplyBlending:()=>_,MultiplyOperation:()=>K,NearestFilter:()=>yt,NearestMipMapLinearFilter:()=>_t,NearestMipMapNearestFilter:()=>xt,NearestMipmapLinearFilter:()=>bt,NearestMipmapNearestFilter:()=>vt,NeverCompare:()=>vr,NeverDepth:()=>V,NeverStencilFunc:()=>ur,NoBlending:()=>y,NoColorSpace:()=>Ze,NoToneMapping:()=>et,NormalAnimationBlendMode:()=>Ue,NormalBlending:()=>v,NotEqualCompare:()=>Er,NotEqualDepth:()=>J,NotEqualStencilFunc:()=>gr,NumberKeyframeTrack:()=>Md,Object3D:()=>kn,ObjectLoader:()=>fp,ObjectSpaceNormalMap:()=>qe,OctahedronGeometry:()=>Hu,OneFactor:()=>R,OneMinusConstantAlphaFactor:()=>j,OneMinusConstantColorFactor:()=>G,OneMinusDstAlphaFactor:()=>k,OneMinusDstColorFactor:()=>N,OneMinusSrcAlphaFactor:()=>D,OneMinusSrcColorFactor:()=>L,OrthographicCamera:()=>To,P3Primaries:()=>rr,PCFShadowMap:()=>u,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>No,Path:()=>eu,PerspectiveCamera:()=>ro,Plane:()=>ho,PlaneGeometry:()=>Ao,PlaneHelper:()=>Ff,PointLight:()=>ip,PointLightHelper:()=>bf,Points:()=>Sh,PointsMaterial:()=>bh,PolarGridHelper:()=>Cf,PolyhedronGeometry:()=>au,PositionalAudio:()=>Np,PropertyBinding:()=>qp,PropertyMixer:()=>zp,QuadraticBezierCurve:()=>Xh,QuadraticBezierCurve3:()=>Jh,Quaternion:()=>Pi,QuaternionKeyframeTrack:()=>Cd,QuaternionLinearInterpolant:()=>Sd,RED_GREEN_RGTC2_Format:()=>Se,RED_RGTC1_Format:()=>Ee,REVISION:()=>i,RGBADepthPacking:()=>He,RGBAFormat:()=>zt,RGBAIntegerFormat:()=>Yt,RGBA_ASTC_10x10_Format:()=>ye,RGBA_ASTC_10x5_Format:()=>me,RGBA_ASTC_10x6_Format:()=>ge,RGBA_ASTC_10x8_Format:()=>Ae,RGBA_ASTC_12x10_Format:()=>ve,RGBA_ASTC_12x12_Format:()=>xe,RGBA_ASTC_4x4_Format:()=>ae,RGBA_ASTC_5x4_Format:()=>le,RGBA_ASTC_5x5_Format:()=>ce,RGBA_ASTC_6x5_Format:()=>he,RGBA_ASTC_6x6_Format:()=>ue,RGBA_ASTC_8x5_Format:()=>de,RGBA_ASTC_8x6_Format:()=>pe,RGBA_ASTC_8x8_Format:()=>fe,RGBA_BPTC_Format:()=>be,RGBA_ETC2_EAC_Format:()=>oe,RGBA_PVRTC_2BPPV1_Format:()=>ie,RGBA_PVRTC_4BPPV1_Format:()=>re,RGBA_S3TC_DXT1_Format:()=>Jt,RGBA_S3TC_DXT3_Format:()=>Kt,RGBA_S3TC_DXT5_Format:()=>$t,RGB_BPTC_SIGNED_Format:()=>_e,RGB_BPTC_UNSIGNED_Format:()=>we,RGB_ETC1_Format:()=>ne,RGB_ETC2_Format:()=>se,RGB_PVRTC_2BPPV1_Format:()=>ee,RGB_PVRTC_4BPPV1_Format:()=>te,RGB_S3TC_DXT1_Format:()=>Xt,RGFormat:()=>qt,RGIntegerFormat:()=>Zt,RawShaderMaterial:()=>id,Ray:()=>hn,Raycaster:()=>nf,Rec709Primaries:()=>er,RectAreaLight:()=>ap,RedFormat:()=>Ht,RedIntegerFormat:()=>Wt,ReinhardToneMapping:()=>it,RenderTarget:()=>Si,RepeatWrapping:()=>mt,ReplaceStencilOp:()=>sr,ReverseSubtractEquation:()=>S,RingGeometry:()=>Wu,SIGNED_RED_GREEN_RGTC2_Format:()=>Ce,SIGNED_RED_RGTC1_Format:()=>Me,SRGBColorSpace:()=>Ye,SRGBTransfer:()=>tr,Scene:()=>tc,ShaderChunk:()=>yo,ShaderLib:()=>xo,ShaderMaterial:()=>to,ShadowMaterial:()=>rd,Shape:()=>fu,ShapeGeometry:()=>qu,ShapePath:()=>Hf,ShapeUtils:()=>Fu,ShortType:()=>Rt,Skeleton:()=>Uc,SkeletonHelper:()=>vf,SkinnedMesh:()=>Lc,Source:()=>bi,Sphere:()=>en,SphereGeometry:()=>Zu,Spherical:()=>af,SphericalHarmonics3:()=>lp,SplineCurve:()=>Kh,SpotLight:()=>Kd,SpotLightHelper:()=>mf,Sprite:()=>yc,SpriteMaterial:()=>nc,SrcAlphaFactor:()=>P,SrcAlphaSaturateFactor:()=>F,SrcColorFactor:()=>B,StaticCopyUsage:()=>Pr,StaticDrawUsage:()=>Cr,StaticReadUsage:()=>Rr,StereoCamera:()=>Mp,StreamCopyUsage:()=>Or,StreamDrawUsage:()=>Ir,StreamReadUsage:()=>Lr,StringKeyframeTrack:()=>Td,SubtractEquation:()=>M,SubtractiveBlending:()=>b,TOUCH:()=>s,TangentSpaceNormalMap:()=>We,TetrahedronGeometry:()=>Yu,Texture:()=>Ei,TextureLoader:()=>Vd,TorusGeometry:()=>Xu,TorusKnotGeometry:()=>Ju,Triangle:()=>Zn,TriangleFanDrawMode:()=>Ge,TriangleStripDrawMode:()=>ze,TrianglesDrawMode:()=>Fe,TubeGeometry:()=>Ku,TwoPassDoubleSide:()=>A,UVMapping:()=>ct,Uint16BufferAttribute:()=>gs,Uint32BufferAttribute:()=>ys,Uint8BufferAttribute:()=>ps,Uint8ClampedBufferAttribute:()=>fs,Uniform:()=>Kp,UniformsGroup:()=>tf,UniformsLib:()=>vo,UniformsUtils:()=>$s,UnsignedByteType:()=>Tt,UnsignedInt248Type:()=>Nt,UnsignedIntType:()=>Pt,UnsignedShort4444Type:()=>kt,UnsignedShort5551Type:()=>Ut,UnsignedShortType:()=>Bt,VSMShadowMap:()=>p,Vector2:()=>ei,Vector3:()=>Di,Vector4:()=>Mi,VectorKeyframeTrack:()=>Id,VideoTexture:()=>Th,WebGL1Renderer:()=>Jl,WebGL3DRenderTarget:()=>Bi,WebGLArrayRenderTarget:()=>Ii,WebGLCoordinateSystem:()=>Fr,WebGLCubeRenderTarget:()=>oo,WebGLMultipleRenderTargets:()=>Li,WebGLRenderTarget:()=>Ci,WebGLRenderer:()=>Xl,WebGLUtils:()=>Ql,WebGPUCoordinateSystem:()=>zr,WireframeGeometry:()=>$u,WrapAroundEnding:()=>ke,ZeroCurvatureEnding:()=>De,ZeroFactor:()=>I,ZeroSlopeEnding:()=>Oe,ZeroStencilOp:()=>ir,_SRGBAFormat:()=>Nr,createCanvasElement:()=>li,sRGBEncoding:()=>je});const i="159",n={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,l=2,c=3,h=0,u=1,d=2,p=3,f=0,m=1,g=2,A=2,y=0,v=1,x=2,b=3,_=4,w=5,E=100,M=101,S=102,C=103,T=104,I=200,R=201,B=202,L=203,P=204,D=205,O=206,k=207,U=208,N=209,F=210,z=211,G=212,Q=213,j=214,V=0,H=1,W=2,q=3,Z=4,Y=5,X=6,J=7,K=0,$=1,tt=2,et=0,rt=1,it=2,nt=3,st=4,ot=5,at="attached",lt="detached",ct=300,ht=301,ut=302,dt=303,pt=304,ft=306,mt=1e3,gt=1001,At=1002,yt=1003,vt=1004,xt=1004,bt=1005,_t=1005,wt=1006,Et=1007,Mt=1007,St=1008,Ct=1008,Tt=1009,It=1010,Rt=1011,Bt=1012,Lt=1013,Pt=1014,Dt=1015,Ot=1016,kt=1017,Ut=1018,Nt=1020,Ft=1021,zt=1023,Gt=1024,Qt=1025,jt=1026,Vt=1027,Ht=1028,Wt=1029,qt=1030,Zt=1031,Yt=1033,Xt=33776,Jt=33777,Kt=33778,$t=33779,te=35840,ee=35841,re=35842,ie=35843,ne=36196,se=37492,oe=37496,ae=37808,le=37809,ce=37810,he=37811,ue=37812,de=37813,pe=37814,fe=37815,me=37816,ge=37817,Ae=37818,ye=37819,ve=37820,xe=37821,be=36492,_e=36494,we=36495,Ee=36283,Me=36284,Se=36285,Ce=36286,Te=2200,Ie=2201,Re=2202,Be=2300,Le=2301,Pe=2302,De=2400,Oe=2401,ke=2402,Ue=2500,Ne=2501,Fe=0,ze=1,Ge=2,Qe=3e3,je=3001,Ve=3200,He=3201,We=0,qe=1,Ze="",Ye="srgb",Xe="srgb-linear",Je="display-p3",Ke="display-p3-linear",$e="linear",tr="srgb",er="rec709",rr="p3",ir=0,nr=7680,sr=7681,or=7682,ar=7683,lr=34055,cr=34056,hr=5386,ur=512,dr=513,pr=514,fr=515,mr=516,gr=517,Ar=518,yr=519,vr=512,xr=513,br=514,_r=515,wr=516,Er=517,Mr=518,Sr=519,Cr=35044,Tr=35048,Ir=35040,Rr=35045,Br=35049,Lr=35041,Pr=35046,Dr=35050,Or=35042,kr="100",Ur="300 es",Nr=1035,Fr=2e3,zr=2001;class Gr{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>8&255]+Qr[t>>16&255]+Qr[t>>24&255]+"-"+Qr[255&e]+Qr[e>>8&255]+"-"+Qr[e>>16&15|64]+Qr[e>>24&255]+"-"+Qr[63&r|128]+Qr[r>>8&255]+"-"+Qr[r>>16&255]+Qr[r>>24&255]+Qr[255&i]+Qr[i>>8&255]+Qr[i>>16&255]+Qr[i>>24&255]).toLowerCase()}function qr(t,e,r){return Math.max(e,Math.min(r,t))}function Zr(t,e){return(t%e+e)%e}function Yr(t,e,r){return(1-r)*t+r*e}function Xr(t){return 0==(t&t-1)&&0!==t}function Jr(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Kr(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function $r(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const ti={DEG2RAD:Vr,RAD2DEG:Hr,generateUUID:Wr,clamp:qr,euclideanModulo:Zr,mapLinear:function(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)},inverseLerp:function(t,e,r){return t!==e?(r-t)/(e-t):0},lerp:Yr,damp:function(t,e,r,i){return Yr(t,e,1-Math.exp(-r*i))},pingpong:function(t,e=1){return e-Math.abs(Zr(t,2*e)-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(jr=t);let e=jr+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*Vr},radToDeg:function(t){return t*Hr},isPowerOfTwo:Xr,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Jr,setQuaternionFromProperEuler:function(t,e,r,i,n){const s=Math.cos,o=Math.sin,a=s(r/2),l=o(r/2),c=s((e+i)/2),h=o((e+i)/2),u=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,l*u,l*d,a*c);break;case"YZY":t.set(l*d,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*d,a*h,a*c);break;case"XZX":t.set(a*h,l*f,l*p,a*c);break;case"YXY":t.set(l*p,a*h,l*f,a*c);break;case"ZYZ":t.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}},normalize:$r,denormalize:Kr};class ei{constructor(t=0,e=0){ei.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}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(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(qr(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}}class ri{constructor(t,e,r,i,n,s,o,a,l){ri.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,l)}set(t,e,r,i,n,s,o,a,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=o,c[3]=e,c[4]=n,c[5]=a,c[6]=r,c[7]=s,c[8]=l,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],l=r[1],c=r[4],h=r[7],u=r[2],d=r[5],p=r[8],f=i[0],m=i[3],g=i[6],A=i[1],y=i[4],v=i[7],x=i[2],b=i[5],_=i[8];return n[0]=s*f+o*A+a*x,n[3]=s*m+o*y+a*b,n[6]=s*g+o*v+a*_,n[1]=l*f+c*A+h*x,n[4]=l*m+c*y+h*b,n[7]=l*g+c*v+h*_,n[2]=u*f+d*A+p*x,n[5]=u*m+d*y+p*b,n[8]=u*g+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],l=t[7],c=t[8];return e*s*c-e*o*l-r*n*c+r*o*a+i*n*l-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],l=t[7],c=t[8],h=c*s-o*l,u=o*a-c*n,d=l*n-s*a,p=e*h+r*u+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*l-c*r)*f,t[2]=(o*r-i*s)*f,t[3]=u*f,t[4]=(c*e-i*a)*f,t[5]=(i*n-o*e)*f,t[6]=d*f,t[7]=(r*a-l*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),l=Math.sin(n);return this.set(r*a,r*l,-r*(a*s+l*o)+s+t,-i*l,i*a,-i*(-l*s+a*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(ii.makeScale(t,e)),this}rotate(t){return this.premultiply(ii.makeRotation(-t)),this}translate(t,e){return this.premultiply(ii.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):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 ii=new ri;function ni(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const si={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oi(t,e){return new si[t](e)}function ai(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function li(){const t=ai("canvas");return t.style.display="block",t}const ci={};function hi(t){t in ci||(ci[t]=!0,console.warn(t))}const ui=(new ri).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),di=(new ri).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),pi={[Xe]:{transfer:$e,primaries:er,toReference:t=>t,fromReference:t=>t},[Ye]:{transfer:tr,primaries:er,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Ke]:{transfer:$e,primaries:rr,toReference:t=>t.applyMatrix3(di),fromReference:t=>t.applyMatrix3(ui)},[Je]:{transfer:tr,primaries:rr,toReference:t=>t.convertSRGBToLinear().applyMatrix3(di),fromReference:t=>t.applyMatrix3(ui).convertLinearToSRGB()}},fi=new Set([Xe,Ke]),mi={enabled:!0,_workingColorSpace:Xe,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 this._workingColorSpace},set workingColorSpace(t){if(!fi.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,r){if(!1===this.enabled||e===r||!e||!r)return t;const i=pi[e].toReference;return(0,pi[r].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return pi[t].primaries},getTransfer:function(t){return t===Ze?$e:pi[t].transfer}};function gi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ai(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let yi;class vi{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===yi&&(yi=ai("canvas")),yi.width=t.width,yi.height=t.height;const r=yi.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),e=yi}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=ai("canvas");e.width=t.width,e.height=t.height;const r=e.getContext("2d");r.drawImage(t,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height),n=i.data;for(let t=0;t0&&(r.userData=this.userData),e||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==ct)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case mt:t.x=t.x-Math.floor(t.x);break;case gt:t.x=t.x<0?0:1;break;case At: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 mt:t.y=t.y-Math.floor(t.y);break;case gt:t.y=t.y<0?0:1;break;case At: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 hi("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Ye?je:Qe}set encoding(t){hi("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===je?Ye:Ze}}Ei.DEFAULT_IMAGE=null,Ei.DEFAULT_MAPPING=ct,Ei.DEFAULT_ANISOTROPY=1;class Mi{constructor(t=0,e=0,r=0,i=1){Mi.prototype.isVector4=!0,this.x=t,this.y=e,this.z=r,this.w=i}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,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)a&&t>A?tA?a=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+u*n,l=l*t+d*n,c=c*t+p*n,h=h*t+f*n,t===1-o){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,r,i,n,s){const o=r[i],a=r[i+1],l=r[i+2],c=r[i+3],h=n[s],u=n[s+1],d=n[s+2],p=n[s+3];return t[e]=o*p+c*h+a*d-l*u,t[e+1]=a*p+c*u+l*h-o*d,t[e+2]=l*p+c*d+o*u-a*h,t[e+3]=c*p-o*h-a*u-l*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,l=o(r/2),c=o(i/2),h=o(n/2),u=a(r/2),d=a(i/2),p=a(n/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*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],l=e[2],c=e[6],h=e[10],u=r+o+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=(s-i)*t}else if(r>o&&r>h){const t=2*Math.sqrt(1+r-o-h);this._w=(c-a)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(n+l)/t}else if(o>h){const t=2*Math.sqrt(1+o-r-h);this._w=(n-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-r-o);this._w=(s-i)/t,this._x=(n+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let r=t.dot(e)+1;return rMath.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(qr(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()}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 r=t._x,i=t._y,n=t._z,s=t._w,o=e._x,a=e._y,l=e._z,c=e._w;return this._x=r*c+s*o+i*l-n*a,this._y=i*c+s*a+n*o-r*l,this._z=n*c+s*l+r*a-i*o,this._w=s*c-r*o-i*a-n*l,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 l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=r*h+this._x*u,this._y=i*h+this._y*u,this._z=n*h+this._z*u,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}}class Di{constructor(t=0,e=0,r=0){Di.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(ki.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ki.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,l=2*(s*i-o*r),c=2*(o*e-n*i),h=2*(n*r-s*e);return this.x=e+a*l+s*h-o*c,this.y=r+a*c+o*l-n*h,this.z=i+a*h+n*c-s*l,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(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 Oi.copy(this).projectOnVector(t),this.sub(Oi)}reflect(t){return this.sub(Oi.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(qr(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 Oi=new Di,ki=new Pi;class Ui{constructor(t=new Di(1/0,1/0,1/0),e=new Di(-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;ethis.max.x||t.ythis.max.y||t.zthis.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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Fi),Fi.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(qi),Zi.subVectors(this.max,qi),Gi.subVectors(t.a,qi),Qi.subVectors(t.b,qi),ji.subVectors(t.c,qi),Vi.subVectors(Qi,Gi),Hi.subVectors(ji,Qi),Wi.subVectors(Gi,ji);let e=[0,-Vi.z,Vi.y,0,-Hi.z,Hi.y,0,-Wi.z,Wi.y,Vi.z,0,-Vi.x,Hi.z,0,-Hi.x,Wi.z,0,-Wi.x,-Vi.y,Vi.x,0,-Hi.y,Hi.x,0,-Wi.y,Wi.x,0];return!!Ji(e,Gi,Qi,ji,Zi)&&(e=[1,0,0,0,1,0,0,0,1],!!Ji(e,Gi,Qi,ji,Zi)&&(Yi.crossVectors(Vi,Hi),e=[Yi.x,Yi.y,Yi.z],Ji(e,Gi,Qi,ji,Zi)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Fi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Fi).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()||(Ni[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ni[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ni[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ni[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ni[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ni[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ni[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ni[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ni)),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 Ni=[new Di,new Di,new Di,new Di,new Di,new Di,new Di,new Di],Fi=new Di,zi=new Ui,Gi=new Di,Qi=new Di,ji=new Di,Vi=new Di,Hi=new Di,Wi=new Di,qi=new Di,Zi=new Di,Yi=new Di,Xi=new Di;function Ji(t,e,r,i,n){for(let s=0,o=t.length-3;s<=o;s+=3){Xi.fromArray(t,s);const o=n.x*Math.abs(Xi.x)+n.y*Math.abs(Xi.y)+n.z*Math.abs(Xi.z),a=e.dot(Xi),l=r.dot(Xi),c=i.dot(Xi);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const Ki=new Ui,$i=new Di,tn=new Di;class en{constructor(t=new Di,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):Ki.setFromPoints(t).getCenter(r);let i=0;for(let e=0,n=t.length;ethis.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;$i.subVectors(t,this.center);const e=$i.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),r=.5*(t-this.radius);this.center.addScaledVector($i,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):(tn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint($i.copy(t.center).add(tn)),this.expandByPoint($i.copy(t.center).sub(tn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const rn=new Di,nn=new Di,sn=new Di,on=new Di,an=new Di,ln=new Di,cn=new Di;class hn{constructor(t=new Di,e=new Di(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,rn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const r=e.dot(this.direction);return r<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=rn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(rn.copy(this.origin).addScaledVector(this.direction,e),rn.distanceToSquared(t))}distanceSqToSegment(t,e,r,i){nn.copy(t).add(e).multiplyScalar(.5),sn.copy(e).sub(t).normalize(),on.copy(this.origin).sub(nn);const n=.5*t.distanceTo(e),s=-this.direction.dot(sn),o=on.dot(this.direction),a=-on.dot(sn),l=on.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*a-o,u=s*o-a,p=n*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-s*n+o)),u=h>0?-n:Math.min(Math.max(-n,-a),n),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-n,-a),n),d=u*(u+2*a)+l):(h=Math.max(0,-(s*n+o)),u=h>0?n:Math.min(Math.max(-n,-a),n),d=-h*h+u*(u+2*a)+l);else u=s>0?-n:n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(nn).addScaledVector(sn,u),d}intersectSphere(t,e){rn.subVectors(t.center,this.origin);const r=rn.dot(this.direction),i=rn.dot(rn)-r*r,n=t.radius*t.radius;if(i>n)return null;const s=Math.sqrt(n-i),o=r-s,a=r+s;return a<0?null:o<0?this.at(a,e):this.at(o,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 r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null}intersectPlane(t,e){const r=this.distanceToPlane(t);return null===r?null:this.at(r,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let r,i,n,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(r=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(r=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(n=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(n=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),r>s||n>i?null:((n>r||isNaN(r))&&(r=n),(s=0?(o=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(o=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),r>a||o>i?null:((o>r||r!=r)&&(r=o),(a=0?r:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,rn)}intersectTriangle(t,e,r,i,n){an.subVectors(e,t),ln.subVectors(r,t),cn.crossVectors(an,ln);let s,o=this.direction.dot(cn);if(o>0){if(i)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}on.subVectors(this.origin,t);const a=s*this.direction.dot(ln.crossVectors(on,ln));if(a<0)return null;const l=s*this.direction.dot(an.cross(on));if(l<0)return null;if(a+l>o)return null;const c=-s*on.dot(cn);return c<0?null:this.at(c/o,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)}}class un{constructor(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m){un.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m)}set(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=r,g[12]=i,g[1]=n,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new un).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/dn.setFromMatrixColumn(t,0).length(),n=1/dn.setFromMatrixColumn(t,1).length(),s=1/dn.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]*s,e[9]=r[9]*s,e[10]=r[10]*s,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),l=Math.sin(i),c=Math.cos(n),h=Math.sin(n);if("XYZ"===t.order){const t=s*c,r=s*h,i=o*c,n=o*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=r+i*l,e[5]=t-n*l,e[9]=-o*a,e[2]=n-t*l,e[6]=i+r*l,e[10]=s*a}else if("YXZ"===t.order){const t=a*c,r=a*h,i=l*c,n=l*h;e[0]=t+n*o,e[4]=i*o-r,e[8]=s*l,e[1]=s*h,e[5]=s*c,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*c,r=a*h,i=l*c,n=l*h;e[0]=t-n*o,e[4]=-s*h,e[8]=i+r*o,e[1]=r+i*o,e[5]=s*c,e[9]=n-t*o,e[2]=-s*l,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*c,r=s*h,i=o*c,n=o*h;e[0]=a*c,e[4]=i*l-r,e[8]=t*l+n,e[1]=a*h,e[5]=n*l+t,e[9]=r*l-i,e[2]=-l,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,r=s*l,i=o*a,n=o*l;e[0]=a*c,e[4]=n-t*h,e[8]=i*h+r,e[1]=h,e[5]=s*c,e[9]=-o*c,e[2]=-l*c,e[6]=r*h+i,e[10]=t-n*h}else if("XZY"===t.order){const t=s*a,r=s*l,i=o*a,n=o*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+n,e[5]=s*c,e[9]=r*h-i,e[2]=i*h-r,e[6]=o*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(fn,t,mn)}lookAt(t,e,r){const i=this.elements;return yn.subVectors(t,e),0===yn.lengthSq()&&(yn.z=1),yn.normalize(),gn.crossVectors(r,yn),0===gn.lengthSq()&&(1===Math.abs(r.z)?yn.x+=1e-4:yn.z+=1e-4,yn.normalize(),gn.crossVectors(r,yn)),gn.normalize(),An.crossVectors(yn,gn),i[0]=gn.x,i[4]=An.x,i[8]=yn.x,i[1]=gn.y,i[5]=An.y,i[9]=yn.y,i[2]=gn.z,i[6]=An.z,i[10]=yn.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],l=r[12],c=r[1],h=r[5],u=r[9],d=r[13],p=r[2],f=r[6],m=r[10],g=r[14],A=r[3],y=r[7],v=r[11],x=r[15],b=i[0],_=i[4],w=i[8],E=i[12],M=i[1],S=i[5],C=i[9],T=i[13],I=i[2],R=i[6],B=i[10],L=i[14],P=i[3],D=i[7],O=i[11],k=i[15];return n[0]=s*b+o*M+a*I+l*P,n[4]=s*_+o*S+a*R+l*D,n[8]=s*w+o*C+a*B+l*O,n[12]=s*E+o*T+a*L+l*k,n[1]=c*b+h*M+u*I+d*P,n[5]=c*_+h*S+u*R+d*D,n[9]=c*w+h*C+u*B+d*O,n[13]=c*E+h*T+u*L+d*k,n[2]=p*b+f*M+m*I+g*P,n[6]=p*_+f*S+m*R+g*D,n[10]=p*w+f*C+m*B+g*O,n[14]=p*E+f*T+m*L+g*k,n[3]=A*b+y*M+v*I+x*P,n[7]=A*_+y*S+v*R+x*D,n[11]=A*w+y*C+v*B+x*O,n[15]=A*E+y*T+v*L+x*k,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],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+n*a*h-i*l*h-n*o*u+r*l*u+i*o*d-r*a*d)+t[7]*(+e*a*d-e*l*u+n*s*u-i*s*d+i*l*c-n*a*c)+t[11]*(+e*l*h-e*o*d-n*s*h+r*s*d+n*o*c-r*l*c)+t[15]*(-i*o*c-e*a*h+e*o*u+i*s*h-r*s*u+r*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,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],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],A=h*m*l-f*u*l+f*a*d-o*m*d-h*a*g+o*u*g,y=p*u*l-c*m*l-p*a*d+s*m*d+c*a*g-s*u*g,v=c*f*l-p*h*l+p*o*d-s*f*d-c*o*g+s*h*g,x=p*h*a-c*f*a-p*o*u+s*f*u+c*o*m-s*h*m,b=e*A+r*y+i*v+n*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/b;return t[0]=A*_,t[1]=(f*u*n-h*m*n-f*i*d+r*m*d+h*i*g-r*u*g)*_,t[2]=(o*m*n-f*a*n+f*i*l-r*m*l-o*i*g+r*a*g)*_,t[3]=(h*a*n-o*u*n-h*i*l+r*u*l+o*i*d-r*a*d)*_,t[4]=y*_,t[5]=(c*m*n-p*u*n+p*i*d-e*m*d-c*i*g+e*u*g)*_,t[6]=(p*a*n-s*m*n-p*i*l+e*m*l+s*i*g-e*a*g)*_,t[7]=(s*u*n-c*a*n+c*i*l-e*u*l-s*i*d+e*a*d)*_,t[8]=v*_,t[9]=(p*h*n-c*f*n-p*r*d+e*f*d+c*r*g-e*h*g)*_,t[10]=(s*f*n-p*o*n+p*r*l-e*f*l-s*r*g+e*o*g)*_,t[11]=(c*o*n-s*h*n-c*r*l+e*h*l+s*r*d-e*o*d)*_,t[12]=x*_,t[13]=(c*f*i-p*h*i+p*r*u-e*f*u-c*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-c*o*i+c*r*a-e*h*a-s*r*u+e*o*u)*_,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 t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):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,l=n*s,c=n*o;return this.set(l*s+r,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+r,c*a-i*s,0,l*a-i*o,c*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,l=n+n,c=s+s,h=o+o,u=n*l,d=n*c,p=n*h,f=s*c,m=s*h,g=o*h,A=a*l,y=a*c,v=a*h,x=r.x,b=r.y,_=r.z;return i[0]=(1-(f+g))*x,i[1]=(d+v)*x,i[2]=(p-y)*x,i[3]=0,i[4]=(d-v)*b,i[5]=(1-(u+g))*b,i[6]=(m+A)*b,i[7]=0,i[8]=(p+y)*_,i[9]=(m-A)*_,i[10]=(1-(u+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=dn.set(i[0],i[1],i[2]).length();const s=dn.set(i[4],i[5],i[6]).length(),o=dn.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],pn.copy(this);const a=1/n,l=1/s,c=1/o;return pn.elements[0]*=a,pn.elements[1]*=a,pn.elements[2]*=a,pn.elements[4]*=l,pn.elements[5]*=l,pn.elements[6]*=l,pn.elements[8]*=c,pn.elements[9]*=c,pn.elements[10]*=c,e.setFromRotationMatrix(pn),r.x=n,r.y=s,r.z=o,this}makePerspective(t,e,r,i,n,s,o=Fr){const a=this.elements,l=2*n/(e-t),c=2*n/(r-i),h=(e+t)/(e-t),u=(r+i)/(r-i);let d,p;if(o===Fr)d=-(s+n)/(s-n),p=-2*s*n/(s-n);else{if(o!==zr)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);d=-s/(s-n),p=-s*n/(s-n)}return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,r,i,n,s,o=Fr){const a=this.elements,l=1/(e-t),c=1/(r-i),h=1/(s-n),u=(e+t)*l,d=(r+i)*c;let p,f;if(o===Fr)p=(s+n)*h,f=-2*h;else{if(o!==zr)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);p=n*h,f=-1*h}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=f,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[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 dn=new Di,pn=new un,fn=new Di(0,0,0),mn=new Di(1,1,1),gn=new Di,An=new Di,yn=new Di,vn=new un,xn=new Pi;class bn{constructor(t=0,e=0,r=0,i=bn.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],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(qr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,n)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-qr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-h,n),this._z=0);break;case"ZXY":this._x=Math.asin(qr(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-qr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(qr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,n)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-qr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-c,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 vn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(vn,e,r)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return xn.setFromEuler(this),this.setFromQuaternion(xn,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}}bn.DEFAULT_ORDER="XYZ";class _n{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(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.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),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;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(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),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),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.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,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.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(t,e,r,i,n){Un.subVectors(i,e),Nn.subVectors(r,e),Fn.subVectors(t,e);const s=Un.dot(Un),o=Un.dot(Nn),a=Un.dot(Fn),l=Nn.dot(Nn),c=Nn.dot(Fn),h=s*l-o*o;if(0===h)return n.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,p=(s*c-o*a)*u;return n.set(1-d-p,p,d)}static containsPoint(t,e,r,i){return this.getBarycoord(t,e,r,i,zn),zn.x>=0&&zn.y>=0&&zn.x+zn.y<=1}static getUV(t,e,r,i,n,s,o,a){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),this.getInterpolation(t,e,r,i,n,s,o,a)}static getInterpolation(t,e,r,i,n,s,o,a){return this.getBarycoord(t,e,r,i,zn),a.setScalar(0),a.addScaledVector(n,zn.x),a.addScaledVector(s,zn.y),a.addScaledVector(o,zn.z),a}static isFrontFacing(t,e,r,i){return Un.subVectors(r,e),Nn.subVectors(t,e),Un.cross(Nn).dot(i)<0}set(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this}setFromPointsAndIndices(t,e,r,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,r,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,i),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 Un.subVectors(this.c,this.b),Nn.subVectors(this.a,this.b),.5*Un.cross(Nn).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Zn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Zn.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,r,i,n){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),Zn.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}getInterpolation(t,e,r,i,n){return Zn.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}containsPoint(t){return Zn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Zn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const r=this.a,i=this.b,n=this.c;let s,o;Gn.subVectors(i,r),Qn.subVectors(n,r),Vn.subVectors(t,r);const a=Gn.dot(Vn),l=Qn.dot(Vn);if(a<=0&&l<=0)return e.copy(r);Hn.subVectors(t,i);const c=Gn.dot(Hn),h=Qn.dot(Hn);if(c>=0&&h<=c)return e.copy(i);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),e.copy(r).addScaledVector(Gn,s);Wn.subVectors(t,n);const d=Gn.dot(Wn),p=Qn.dot(Wn);if(p>=0&&d<=p)return e.copy(n);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(r).addScaledVector(Qn,o);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return jn.subVectors(n,i),o=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(jn,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(r).addScaledVector(Gn,s).addScaledVector(Qn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Yn={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},Xn={h:0,s:0,l:0},Jn={h:0,s:0,l:0};function Kn(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 $n{constructor(t,e,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,r)}set(t,e,r){if(void 0===e&&void 0===r){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,r);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ye){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,mi.toWorkingColorSpace(this,e),this}setRGB(t,e,r,i=mi.workingColorSpace){return this.r=t,this.g=e,this.b=r,mi.toWorkingColorSpace(this,i),this}setHSL(t,e,r,i=mi.workingColorSpace){if(t=Zr(t,1),e=qr(e,0,1),r=qr(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=Kn(n,i,t+1/3),this.g=Kn(n,i,t),this.b=Kn(n,i,t-1/3)}return mi.toWorkingColorSpace(this,i),this}setStyle(t,e=Ye){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=Ye){const r=Yn[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=gi(t.r),this.g=gi(t.g),this.b=gi(t.b),this}copyLinearToSRGB(t){return this.r=Ai(t.r),this.g=Ai(t.g),this.b=Ai(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ye){return mi.fromWorkingColorSpace(ts.copy(this),t),65536*Math.round(qr(255*ts.r,0,255))+256*Math.round(qr(255*ts.g,0,255))+Math.round(qr(255*ts.b,0,255))}getHexString(t=Ye){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=mi.workingColorSpace){mi.fromWorkingColorSpace(ts.copy(this),e);const r=ts.r,i=ts.g,n=ts.b,s=Math.max(r,i,n),o=Math.min(r,i,n);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const t=s-o;switch(l=c<=.5?t/(s+o):t/(2-s-o),s){case r:a=(i-n)/t+(i0!=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 r=t[e];if(void 0===r){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[e]=r: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 r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const r in t){const i=t[r];delete i.metadata,e.push(i)}return e}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==v&&(r.blending=this.blending),this.side!==f&&(r.side=this.side),!0===this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=!0),this.blendSrc!==P&&(r.blendSrc=this.blendSrc),this.blendDst!==D&&(r.blendDst=this.blendDst),this.blendEquation!==E&&(r.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(r.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(r.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==q&&(r.depthFunc=this.depthFunc),!1===this.depthTest&&(r.depthTest=this.depthTest),!1===this.depthWrite&&(r.depthWrite=this.depthWrite),!1===this.colorWrite&&(r.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yr&&(r.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(r.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==nr&&(r.stencilFail=this.stencilFail),this.stencilZFail!==nr&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==nr&&(r.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(r.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaHash&&(r.alphaHash=!0),!0===this.alphaToCoverage&&(r.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=!0),!0===this.forceSinglePass&&(r.forceSinglePass=!0),!0===this.wireframe&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),e){const e=i(t.textures),n=i(t.images);e.length>0&&(r.textures=e),n.length>0&&(r.images=n)}return r}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.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,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 r=null;if(null!==e){const t=e.length;r=new Array(t);for(let i=0;i!==t;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,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.alphaHash=t.alphaHash,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++}}class is extends rs{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new $n(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=K,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}}const ns=ss();function ss(){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(;0==(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;++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:r,baseTable:i,shiftTable:n,mantissaTable:s,exponentTable:o,offsetTable:a}}function os(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=qr(t,-65504,65504),ns.floatView[0]=t;const e=ns.uint32View[0],r=e>>23&511;return ns.baseTable[r]+((8388607&e)>>ns.shiftTable[r])}function as(t){const e=t>>10;return ns.uint32View[0]=ns.mantissaTable[ns.offsetTable[e]+(1023&t)]+ns.exponentTable[e],ns.floatView[0]}const ls={toHalfFloat:os,fromHalfFloat:as},cs=new Di,hs=new ei;class us{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=Cr,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Dt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=t.gpuType,this}copyAt(t,e,r){t*=this.itemSize,r*=e.itemSize;for(let i=0,n=this.itemSize;i0&&(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;e0&&(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;t0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t(t.far-t.near)**2)return}Rs.copy(n).invert(),Bs.copy(t.ray).applyMatrix4(Rs),null!==r.boundingBox&&!1===Bs.intersectsBox(r.boundingBox)||this._computeIntersections(t,e,Bs)}}_computeIntersections(t,e,r){let i;const n=this.geometry,s=this.material,o=n.index,a=n.attributes.position,l=n.attributes.uv,c=n.attributes.uv1,h=n.attributes.normal,u=n.groups,d=n.drawRange;if(null!==o)if(Array.isArray(s))for(let n=0,a=u.length;nr.far?null:{distance:c,point:Ws.clone(),object:t}}(t,e,r,i,Ds,Os,ks,Hs);if(h){n&&(Fs.fromBufferAttribute(n,a),zs.fromBufferAttribute(n,l),Gs.fromBufferAttribute(n,c),h.uv=Zn.getInterpolation(Hs,Ds,Os,ks,Fs,zs,Gs,new ei)),s&&(Fs.fromBufferAttribute(s,a),zs.fromBufferAttribute(s,l),Gs.fromBufferAttribute(s,c),h.uv1=Zn.getInterpolation(Hs,Ds,Os,ks,Fs,zs,Gs,new ei),h.uv2=h.uv1),o&&(Qs.fromBufferAttribute(o,a),js.fromBufferAttribute(o,l),Vs.fromBufferAttribute(o,c),h.normal=Zn.getInterpolation(Hs,Ds,Os,ks,Qs,js,Vs,new Di),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const t={a,b:l,c,normal:new Di,materialIndex:0};Zn.getNormal(Ds,Os,ks,t.normal),h.face=t}return h}class Ys extends Is{constructor(t=1,e=1,r=1,i=1,n=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:s};const o=this;i=Math.floor(i),n=Math.floor(n),s=Math.floor(s);const a=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,r,i,n,s,p,f,m,g,A){const y=s/m,v=p/g,x=s/2,b=p/2,_=f/2,w=m+1,E=g+1;let M=0,S=0;const C=new Di;for(let s=0;s0?1:-1,c.push(C.x,C.y,C.z),h.push(a/m),h.push(1-s/g),M+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const r={};for(const t in this.extensions)!0===this.extensions[t]&&(r[t]=!0);return Object.keys(r).length>0&&(e.extensions=r),e}}class eo extends kn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new un,this.projectionMatrix=new un,this.projectionMatrixInverse=new un,this.coordinateSystem=Fr}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}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)}}class ro extends eo{constructor(t=50,e=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=i,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*Hr*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Vr*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Hr*Math.atan(Math.tan(.5*Vr*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,r,i,n,s){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=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Vr*this.fov)/this.zoom,r=2*e,i=this.aspect*r,n=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;n+=s.offsetX*i/t,e-=s.offsetY*r/o,i*=s.width/t,r*=s.height/o}const o=this.filmOffset;0!==o&&(n+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,e,e-r,t,this.far,this.coordinateSystem),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}}const io=-90;class no extends kn{constructor(t,e,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ro(io,1,t,e);i.layers=this.layers,this.add(i);const n=new ro(io,1,t,e);n.layers=this.layers,this.add(n);const s=new ro(io,1,t,e);s.layers=this.layers,this.add(s);const o=new ro(io,1,t,e);o.layers=this.layers,this.add(o);const a=new ro(io,1,t,e);a.layers=this.layers,this.add(a);const l=new ro(io,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[r,i,n,s,o,a]=e;for(const t of e)this.remove(t);if(t===Fr)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(t!==zr)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[n,s,o,a,l,c]=this.children,h=t.getRenderTarget(),u=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;const f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0,i),t.render(e,n),t.setRenderTarget(r,1,i),t.render(e,s),t.setRenderTarget(r,2,i),t.render(e,o),t.setRenderTarget(r,3,i),t.render(e,a),t.setRenderTarget(r,4,i),t.render(e,l),r.texture.generateMipmaps=f,t.setRenderTarget(r,5,i),t.render(e,c),t.setRenderTarget(h,u,d),t.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class so extends Ei{constructor(t,e,r,i,n,s,o,a,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:ht,r,i,n,s,o,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class oo extends Ci{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const r={width:t,height:t,depth:1},i=[r,r,r,r,r,r];void 0!==e.encoding&&(hi("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===je?Ye:Ze),this.texture=new so(i,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:wt}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 r={tEquirect:{value:null}},i="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",n="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new Ys(5,5,5),o=new to({name:"CubemapFromEquirect",uniforms:Xs(r),vertexShader:i,fragmentShader:n,side:m,blending:y});o.uniforms.tEquirect.value=e;const a=new qs(s,o),l=e.minFilter;return e.minFilter===St&&(e.minFilter=wt),new no(1,10,this).update(t,a),e.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,r,i){const n=t.getRenderTarget();for(let n=0;n<6;n++)t.setRenderTarget(this,n),t.clear(e,r,i);t.setRenderTarget(n)}}const ao=new Di,lo=new Di,co=new ri;class ho{constructor(t=new Di(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,r,i){return this.normal.set(t,e,r),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,r){const i=ao.subVectors(r,e).cross(lo.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 r=t.delta(ao),i=this.normal.dot(r);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const n=-(t.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:e.copy(t.start).addScaledVector(r,n)}intersectsLine(t){const e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<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 r=e||co.getNormalMatrix(t),i=this.coplanarPoint(ao).applyMatrix4(t),n=this.normal.applyMatrix3(r).normalize();return this.constant=-i.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)}}const uo=new en,po=new Di;class fo{constructor(t=new ho,e=new ho,r=new ho,i=new ho,n=new ho,s=new ho){this.planes=[t,e,r,i,n,s]}set(t,e,r,i,n,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(r),o[3].copy(i),o[4].copy(n),o[5].copy(s),this}copy(t){const e=this.planes;for(let r=0;r<6;r++)e[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t,e=Fr){const r=this.planes,i=t.elements,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],A=i[13],y=i[14],v=i[15];if(r[0].setComponents(a-n,u-l,m-d,v-g).normalize(),r[1].setComponents(a+n,u+l,m+d,v+g).normalize(),r[2].setComponents(a+s,u+c,m+p,v+A).normalize(),r[3].setComponents(a-s,u-c,m-p,v-A).normalize(),r[4].setComponents(a-o,u-h,m-f,v-y).normalize(),e===Fr)r[5].setComponents(a+o,u+h,m+f,v+y).normalize();else{if(e!==zr)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);r[5].setComponents(o,h,f,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),uo.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),uo.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(uo)}intersectsSprite(t){return uo.center.set(0,0,0),uo.radius=.7071067811865476,uo.applyMatrix4(t.matrixWorld),this.intersectsSphere(uo)}intersectsSphere(t){const e=this.planes,r=t.center,i=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(r)0?t.max.x:t.min.x,po.y=i.normal.y>0?t.max.y:t.min.y,po.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(po)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function mo(){let t=null,e=!1,r=null,i=null;function n(e,s){r(e,s),i=t.requestAnimationFrame(n)}return{start:function(){!0!==e&&null!==r&&(i=t.requestAnimationFrame(n),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){r=t},setContext:function(e){t=e}}}function go(t,e){const r=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const r=i.get(e);r&&(t.deleteBuffer(r.buffer),i.delete(e))},update:function(e,n){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\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 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\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\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\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\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_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\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\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\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\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 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\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\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\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\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\t\t#undef SPOT_LIGHT_MAP_INDEX\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\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\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\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\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\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\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\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\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = 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\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\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\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\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\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\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\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\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\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},vo={common:{diffuse:{value:new $n(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ri},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ri}},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 ri}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ri}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ri},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ri},normalScale:{value:new ei(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ri},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ri}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ri}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ri}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new $n(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 $n(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0},uvTransform:{value:new ri}},sprite:{diffuse:{value:new $n(16777215)},opacity:{value:1},center:{value:new ei(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ri},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0}}},xo={basic:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.fog]),vertexShader:yo.meshbasic_vert,fragmentShader:yo.meshbasic_frag},lambert:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new $n(0)}}]),vertexShader:yo.meshlambert_vert,fragmentShader:yo.meshlambert_frag},phong:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new $n(0)},specular:{value:new $n(1118481)},shininess:{value:30}}]),vertexShader:yo.meshphong_vert,fragmentShader:yo.meshphong_frag},standard:{uniforms:Js([vo.common,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.roughnessmap,vo.metalnessmap,vo.fog,vo.lights,{emissive:{value:new $n(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yo.meshphysical_vert,fragmentShader:yo.meshphysical_frag},toon:{uniforms:Js([vo.common,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.gradientmap,vo.fog,vo.lights,{emissive:{value:new $n(0)}}]),vertexShader:yo.meshtoon_vert,fragmentShader:yo.meshtoon_frag},matcap:{uniforms:Js([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,{matcap:{value:null}}]),vertexShader:yo.meshmatcap_vert,fragmentShader:yo.meshmatcap_frag},points:{uniforms:Js([vo.points,vo.fog]),vertexShader:yo.points_vert,fragmentShader:yo.points_frag},dashed:{uniforms:Js([vo.common,vo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yo.linedashed_vert,fragmentShader:yo.linedashed_frag},depth:{uniforms:Js([vo.common,vo.displacementmap]),vertexShader:yo.depth_vert,fragmentShader:yo.depth_frag},normal:{uniforms:Js([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,{opacity:{value:1}}]),vertexShader:yo.meshnormal_vert,fragmentShader:yo.meshnormal_frag},sprite:{uniforms:Js([vo.sprite,vo.fog]),vertexShader:yo.sprite_vert,fragmentShader:yo.sprite_frag},background:{uniforms:{uvTransform:{value:new ri},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yo.background_vert,fragmentShader:yo.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:yo.backgroundCube_vert,fragmentShader:yo.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yo.cube_vert,fragmentShader:yo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yo.equirect_vert,fragmentShader:yo.equirect_frag},distanceRGBA:{uniforms:Js([vo.common,vo.displacementmap,{referencePosition:{value:new Di},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yo.distanceRGBA_vert,fragmentShader:yo.distanceRGBA_frag},shadow:{uniforms:Js([vo.lights,vo.fog,{color:{value:new $n(0)},opacity:{value:1}}]),vertexShader:yo.shadow_vert,fragmentShader:yo.shadow_frag}};xo.physical={uniforms:Js([xo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ri},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ri},clearcoatNormalScale:{value:new ei(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ri},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ri},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ri},sheen:{value:0},sheenColor:{value:new $n(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ri},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ri},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ri},transmissionSamplerSize:{value:new ei},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ri},attenuationDistance:{value:0},attenuationColor:{value:new $n(0)},specularColor:{value:new $n(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ri},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ri},anisotropyVector:{value:new ei},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ri}}]),vertexShader:yo.meshphysical_vert,fragmentShader:yo.meshphysical_frag};const bo={r:0,b:0,g:0};function _o(t,e,r,i,n,s,o){const a=new $n(0);let l,c,h=!0===s?0:1,u=null,d=0,p=null;function g(e,r){e.getRGB(bo,Ks(t)),i.buffers.color.setClear(bo.r,bo.g,bo.b,r,o)}return{getClearColor:function(){return a},setClearColor:function(t,e=1){a.set(t),h=e,g(a,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,g(a,h)},render:function(s,A){let y=!1,v=!0===A.isScene?A.background:null;v&&v.isTexture&&(v=(A.backgroundBlurriness>0?r:e).get(v)),null===v?g(a,h):v&&v.isColor&&(g(v,1),y=!0);const x=t.xr.getEnvironmentBlendMode();"additive"===x?i.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===x&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||y)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.mapping===ft)?(void 0===c&&(c=new qs(new Ys(1,1,1),new to({name:"BackgroundCubeMaterial",uniforms:Xs(xo.backgroundCube.uniforms),vertexShader:xo.backgroundCube.vertexShader,fragmentShader:xo.backgroundCube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,c.material.toneMapped=mi.getTransfer(v.colorSpace)!==tr,u===v&&d===v.version&&p===t.toneMapping||(c.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(void 0===l&&(l=new qs(new Ao(2,2),new to({name:"BackgroundMaterial",uniforms:Xs(xo.background.uniforms),vertexShader:xo.background.vertexShader,fragmentShader:xo.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=v,l.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,l.material.toneMapped=mi.getTransfer(v.colorSpace)!==tr,!0===v.matrixAutoUpdate&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),u===v&&d===v.version&&p===t.toneMapping||(l.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),l.layers.enableAll(),s.unshift(l,l.geometry,l.material,0,0,null))}}}function wo(t,e,r,i){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||null!==s,a={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],r=[],i=[];for(let t=0;t=0){const r=n[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===r)return!0;if(r.attribute!==i)return!0;if(i&&r.data!==i.data)return!0;o++}return c.attributesNum!==o||c.index!==i}(n,v,d,x),b&&function(t,e,r,i){const n={},s=e.attributes;let o=0;const a=r.getAttributes();for(const e in a)if(a[e].location>=0){let r=s[e];void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor));const i={};i.attribute=r,r&&r.data&&(i.data=r.data),n[e]=i,o++}c.attributes=n,c.attributesNum=o,c.index=i}(n,v,d,x)}else{const t=!0===l.wireframe;c.geometry===v.id&&c.program===d.id&&c.wireframe===t||(c.geometry=v.id,c.program=d.id,c.wireframe=t,b=!0)}null!==x&&r.update(x,t.ELEMENT_ARRAY_BUFFER),(b||h)&&(h=!1,function(n,s,o,a){if(!1===i.isWebGL2&&(n.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const l=a.attributes,c=o.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.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,l=o.itemSize,c=r.get(o);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||o.gpuType===Lt);if(o.isInterleavedBufferAttribute){const r=o.data,i=r.stride,c=o.offset;if(r.isInstancedInterleavedBuffer){for(let t=0;t0&&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 s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let o=void 0!==r.precision?r.precision:"highp";const a=n(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||e.has("WEBGL_draw_buffers"),c=!0===r.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),m=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),A=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),y=u>0,v=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const r=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:n,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:A,vertexTextures:y,floatFragmentTextures:v,floatVertexTextures:y&&v,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function So(t){const e=this;let r=null,i=0,n=!1,s=!1;const o=new ho,a=new ri,l={value:null,needsUpdate:!1};function c(t,r,i,n){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==n||null===c){const e=i+4*s,n=r.matrixWorldInverse;a.getNormalMatrix(n),(null===c||c.length0),e.numPlanes=i,e.numIntersection=0);else{const t=s?0:i,e=4*t;let n=f.clippingState||null;l.value=n,n=c(u,a,e,h);for(let t=0;t!==e;++t)n[t]=r[t];f.clippingState=n,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function Co(t){let e=new WeakMap;function r(t,e){return e===dt?t.mapping=ht:e===pt&&(t.mapping=ut),t}function i(t){const r=t.target;r.removeEventListener("dispose",i);const n=e.get(r);void 0!==n&&(e.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping;if(s===dt||s===pt){if(e.has(n))return r(e.get(n).texture,n.mapping);{const s=n.image;if(s&&s.height>0){const o=new oo(s.height/2);return o.fromEquirectangularTexture(t,n),e.set(n,o),n.addEventListener("dispose",i),r(o.texture,n.mapping)}return null}}}return n},dispose:function(){e=new WeakMap}}}class To extends eo{constructor(t=-1,e=1,r=1,i=-1,n=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=n,this.far=s,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,r,i,n,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,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),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let n=r-t,s=r+t,o=i+e,a=i-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,s=n+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(n,s,o,a,this.near,this.far,this.coordinateSystem),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}}const Io=[.125,.215,.35,.446,.526,.582],Ro=new To,Bo=new $n;let Lo=null,Po=0,Do=0;const Oo=(1+Math.sqrt(5))/2,ko=1/Oo,Uo=[new Di(1,1,1),new Di(-1,1,1),new Di(1,1,-1),new Di(-1,1,-1),new Di(0,Oo,ko),new Di(0,Oo,-ko),new Di(ko,0,Oo),new Di(-ko,0,Oo),new Di(Oo,ko,0),new Di(-Oo,ko,0)];class No{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,r=.1,i=100){Lo=this._renderer.getRenderTarget(),Po=this._renderer.getActiveCubeFace(),Do=this._renderer.getActiveMipmapLevel(),this._setSize(256);const n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(t,r,i,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=Qo(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Go(),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;tt-4?a=Io[o-t+4-1]:0===o&&(a=0),i.push(a);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,A=new Float32Array(f*p*d),y=new Float32Array(m*p*d),v=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,r,0,e+2/3,r,0,e+2/3,r+1,0,e,r,0,e+2/3,r+1,0,e,r+1,0];A.set(i,f*p*t),y.set(u,m*p*t);const n=[t,t,t,t,t,t];v.set(n,g*p*t)}const x=new Is;x.setAttribute("position",new us(A,f)),x.setAttribute("uv",new us(y,m)),x.setAttribute("faceIndex",new us(v,g)),e.push(x),n>4&&n--}return{lodPlanes:e,sizeLods:r,sigmas:i}}(i)),this._blurMaterial=function(t,e,r){const i=new Float32Array(20),n=new Di(0,1,0);return new to({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},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 \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:y,depthTest:!1,depthWrite:!1})}(i,t,e)}return i}_compileMaterial(t){const e=new qs(this._lodPlanes[0],t);this._renderer.compile(e,Ro)}_sceneToCubeUV(t,e,r,i){const n=new ro(90,1,e,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(Bo),a.toneMapping=et,a.autoClear=!1;const h=new is({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),u=new qs(new Ys,h);let d=!1;const p=t.background;p?p.isColor&&(h.color.copy(p),t.background=null,d=!0):(h.color.copy(Bo),d=!0);for(let e=0;e<6;e++){const r=e%3;0===r?(n.up.set(0,s[e],0),n.lookAt(o[e],0,0)):1===r?(n.up.set(0,0,s[e]),n.lookAt(0,o[e],0)):(n.up.set(0,s[e],0),n.lookAt(0,0,o[e]));const l=this._cubeSize;zo(i,r*l,e>2?l:0,l,l),a.setRenderTarget(i),d&&a.render(u,n),a.render(t,n)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=c,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const r=this._renderer,i=t.mapping===ht||t.mapping===ut;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Qo()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Go());const n=i?this._cubemapMaterial:this._equirectMaterial,s=new qs(this._lodPlanes[0],n);n.uniforms.envMap.value=t;const o=this._cubeSize;zo(e,0,0,3*o,2*o),r.setRenderTarget(e),r.render(s,Ro)}_applyPMREM(t){const e=this._renderer,r=e.autoClear;e.autoClear=!1;for(let e=1;e20&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,r=Math.exp(-e*e/2);m.push(r),0===t?g+=r:tA-4?i-A+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(e),a.render(c,Ro)}}function Fo(t,e,r){const i=new Ci(t,e,r);return i.texture.mapping=ft,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function zo(t,e,r,i,n){t.viewport.set(e,r,i,n),t.scissor.set(e,r,i,n)}function Go(){return new to({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 \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:y,depthTest:!1,depthWrite:!1})}function Qo(){return new to({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:y,depthTest:!1,depthWrite:!1})}function jo(t){let e=new WeakMap,r=null;function i(t){const r=t.target;r.removeEventListener("dispose",i);const n=e.get(r);void 0!==n&&(e.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping,o=s===dt||s===pt,a=s===ht||s===ut;if(o||a){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let i=e.get(n);return null===r&&(r=new No(t)),i=o?r.fromEquirectangular(n,i):r.fromCubemap(n,i),e.set(n,i),i.texture}if(e.has(n))return e.get(n).texture;{const s=n.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;for(let r=0;r<6;r++)void 0!==t[r]&&e++;return 6===e}(s)){null===r&&(r=new No(t));const s=o?r.fromEquirectangular(n):r.fromCubemap(n);return e.set(n,s),n.addEventListener("dispose",i),s.texture}return null}}}return n},dispose:function(){e=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function Vo(t){const e={};function r(r){if(void 0!==e[r])return e[r];let i;switch(r){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(r)}return e[r]=i,i}return{has:function(t){return null!==r(t)},init:function(t){t.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture")},get:function(t){const e=r(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Ho(t,e,r,i){const n={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);for(const t in a.morphAttributes){const r=a.morphAttributes[t];for(let t=0,i=r.length;te.maxTextureSize&&(M=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const S=new Float32Array(E*M*4*p),C=new Ti(S,E,M,p);C.type=Dt,C.needsUpdate=!0;const T=4*w;for(let R=0;R0)return t;const n=e*r;let s=na[n];if(void 0===s&&(s=new Float32Array(n),na[n]=s),0!==e){i.toArray(s,0);for(let i=1,n=0;i!==e;++i)n+=r,t[i].toArray(s,n)}return s}function ha(t,e){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r":" "} ${n}: ${r[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return n}function ll(t,e){const r=function(t){const e=mi.getPrimaries(mi.workingColorSpace),r=mi.getPrimaries(t);let i;switch(e===r?i="":e===rr&&r===er?i="LinearDisplayP3ToLinearSRGB":e===er&&r===rr&&(i="LinearSRGBToLinearDisplayP3"),t){case Xe:case Ke:return[i,"LinearTransferOETF"];case Ye:case Je:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${r[0]}( ${r[1]}( value ) ); }`}function cl(t,e){let r;switch(e){case rt:r="Linear";break;case it:r="Reinhard";break;case nt:r="OptimizedCineon";break;case st:r="ACESFilmic";break;case ot:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),r="Linear"}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function hl(t){return""!==t}function ul(t,e){const r=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,r).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 dl(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const pl=/^[ \t]*#include +<([\w\d./]+)>/gm;function fl(t){return t.replace(pl,gl)}const ml=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function gl(t,e){let r=yo[e];if(void 0===r){const t=ml.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");r=yo[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return fl(r)}const Al=/#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 yl(t){return t.replace(Al,vl)}function vl(t,e,r,i){let n="";for(let t=parseInt(e);t0&&(v+="\n"),x=[g,"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A].filter(hl).join("\n"),x.length>0&&(x+="\n")):(v=[xl(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.batching?"#define USE_BATCHING":"",r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.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(hl).join("\n"),x=[g,xl(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+h:"",r.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==et?"#define TONE_MAPPING":"",r.toneMapping!==et?yo.tonemapping_pars_fragment:"",r.toneMapping!==et?cl("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",yo.colorspace_pars_fragment,ll("linearToOutputTexel",r.outputColorSpace),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(hl).join("\n")),o=fl(o),o=ul(o,r),o=dl(o,r),a=fl(a),a=ul(a,r),a=dl(a,r),o=yl(o),a=yl(a),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(b="#version 300 es\n",v=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,x=["precision mediump sampler2DArray;","#define varying in",r.glslVersion===Ur?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===Ur?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const _=b+v+o,w=b+x+a,E=nl(n,n.VERTEX_SHADER,_),M=nl(n,n.FRAGMENT_SHADER,w);function S(e){if(t.debug.checkShaderErrors){const r=n.getProgramInfoLog(y).trim(),i=n.getShaderInfoLog(E).trim(),s=n.getShaderInfoLog(M).trim();let o=!0,a=!0;if(!1===n.getProgramParameter(y,n.LINK_STATUS))if(o=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(n,y,E,M);else{const t=al(n,E,"vertex"),e=al(n,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(y,n.VALIDATE_STATUS)+"\n\nProgram Info Log: "+r+"\n"+t+"\n"+e)}else""!==r?console.warn("THREE.WebGLProgram: Program Info Log:",r):""!==i&&""!==s||(a=!1);a&&(e.diagnostics={runnable:o,programLog:r,vertexShader:{log:i,prefix:v},fragmentShader:{log:s,prefix:x}})}n.deleteShader(E),n.deleteShader(M),C=new il(n,y),T=function(t,e){const r={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let n=0;n0,Y=s.clearcoat>0,X=s.iridescence>0,J=s.sheen>0,K=s.transmission>0,$=Z&&!!s.anisotropyMap,tt=Y&&!!s.clearcoatMap,rt=Y&&!!s.clearcoatNormalMap,it=Y&&!!s.clearcoatRoughnessMap,nt=X&&!!s.iridescenceMap,st=X&&!!s.iridescenceThicknessMap,ot=J&&!!s.sheenColorMap,at=J&&!!s.sheenRoughnessMap,lt=!!s.specularMap,ct=!!s.specularColorMap,ht=!!s.specularIntensityMap,ut=K&&!!s.transmissionMap,dt=K&&!!s.thicknessMap,pt=!!s.gradientMap,mt=!!s.alphaMap,gt=s.alphaTest>0,At=!!s.alphaHash,yt=!!s.extensions,vt=!!_.attributes.uv1,xt=!!_.attributes.uv2,bt=!!_.attributes.uv3;let _t=et;return s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(_t=t.toneMapping)),{isWebGL2:h,shaderID:S,shaderType:s.type,shaderName:s.name,vertexShader:I,fragmentShader:R,defines:s.defines,customVertexShaderID:B,customFragmentShaderID:L,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,batching:k,instancing:O,instancingColor:O&&null!==x.instanceColor,supportsVertexTextures:d,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Xe,map:U,matcap:N,envMap:F,envMapMode:F&&E.mapping,envMapCubeUVHeight:M,aoMap:z,lightMap:G,bumpMap:Q,normalMap:j,displacementMap:d&&V,emissiveMap:H,normalMapObjectSpace:j&&s.normalMapType===qe,normalMapTangentSpace:j&&s.normalMapType===We,metalnessMap:W,roughnessMap:q,anisotropy:Z,anisotropyMap:$,clearcoat:Y,clearcoatMap:tt,clearcoatNormalMap:rt,clearcoatRoughnessMap:it,iridescence:X,iridescenceMap:nt,iridescenceThicknessMap:st,sheen:J,sheenColorMap:ot,sheenRoughnessMap:at,specularMap:lt,specularColorMap:ct,specularIntensityMap:ht,transmission:K,transmissionMap:ut,thicknessMap:dt,gradientMap:pt,opaque:!1===s.transparent&&s.blending===v,alphaMap:mt,alphaTest:gt,alphaHash:At,combine:s.combine,mapUv:U&&A(s.map.channel),aoMapUv:z&&A(s.aoMap.channel),lightMapUv:G&&A(s.lightMap.channel),bumpMapUv:Q&&A(s.bumpMap.channel),normalMapUv:j&&A(s.normalMap.channel),displacementMapUv:V&&A(s.displacementMap.channel),emissiveMapUv:H&&A(s.emissiveMap.channel),metalnessMapUv:W&&A(s.metalnessMap.channel),roughnessMapUv:q&&A(s.roughnessMap.channel),anisotropyMapUv:$&&A(s.anisotropyMap.channel),clearcoatMapUv:tt&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:rt&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:it&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:st&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:ot&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:at&&A(s.sheenRoughnessMap.channel),specularMapUv:lt&&A(s.specularMap.channel),specularColorMapUv:ct&&A(s.specularColorMap.channel),specularIntensityMapUv:ht&&A(s.specularIntensityMap.channel),transmissionMapUv:ut&&A(s.transmissionMap.channel),thicknessMapUv:dt&&A(s.thicknessMap.channel),alphaMapUv:mt&&A(s.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(j||Z),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,vertexUv1s:vt,vertexUv2s:xt,vertexUv3s:bt,pointsUvs:!0===x.isPoints&&!!_.attributes.uv&&(U||mt),fog:!!b,useFog:!0===s.fog,fogExp2:b&&b.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:T,morphTextureStride:P,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:_t,useLegacyLights:t._useLegacyLights,decodeVideoTexture:U&&!0===s.map.isVideoTexture&&mi.getTransfer(s.map.colorSpace)===tr,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===m,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:yt&&!0===s.extensions.derivatives,extensionFragDepth:yt&&!0===s.extensions.fragDepth,extensionDrawBuffers:yt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:yt&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const r=[];if(e.shaderID?r.push(e.shaderID):(r.push(e.customVertexShaderID),r.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)r.push(t),r.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(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.anisotropyMapUv),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.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(r,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0),e.supportsVertexTextures&&a.enable(1),e.instancing&&a.enable(2),e.instancingColor&&a.enable(3),e.matcap&&a.enable(4),e.envMap&&a.enable(5),e.normalMapObjectSpace&&a.enable(6),e.normalMapTangentSpace&&a.enable(7),e.clearcoat&&a.enable(8),e.iridescence&&a.enable(9),e.alphaTest&&a.enable(10),e.vertexColors&&a.enable(11),e.vertexAlphas&&a.enable(12),e.vertexUv1s&&a.enable(13),e.vertexUv2s&&a.enable(14),e.vertexUv3s&&a.enable(15),e.vertexTangents&&a.enable(16),e.anisotropy&&a.enable(17),e.alphaHash&&a.enable(18),e.batching&&a.enable(19),t.push(a.mask),a.disableAll(),e.fog&&a.enable(0),e.useFog&&a.enable(1),e.flatShading&&a.enable(2),e.logarithmicDepthBuffer&&a.enable(3),e.skinning&&a.enable(4),e.morphTargets&&a.enable(5),e.morphNormals&&a.enable(6),e.morphColors&&a.enable(7),e.premultipliedAlpha&&a.enable(8),e.shadowMapEnabled&&a.enable(9),e.useLegacyLights&&a.enable(10),e.doubleSided&&a.enable(11),e.flipSided&&a.enable(12),e.useDepthPacking&&a.enable(13),e.dithering&&a.enable(14),e.transmission&&a.enable(15),e.sheen&&a.enable(16),e.opaque&&a.enable(17),e.pointsUvs&&a.enable(18),e.decodeVideoTexture&&a.enable(19),t.push(a.mask)}(r,e),r.push(t.outputColorSpace)),r.push(e.customProgramCacheKey),r.join()},getUniforms:function(t){const e=f[t.type];let r;if(e){const t=xo[e];r=$s.clone(t.uniforms)}else r=t.uniforms;return r},acquireProgram:function(e,r){let i;for(let t=0,e=c.length;t0?i.push(h):!0===o.transparent?n.push(h):r.push(h)},unshift:function(t,e,o,a,l,c){const h=s(t,e,o,a,l,c);o.transmission>0?i.unshift(h):!0===o.transparent?n.unshift(h):r.unshift(h)},finish:function(){for(let r=e,i=t.length;r1&&r.sort(t||Cl),i.length>1&&i.sort(e||Tl),n.length>1&&n.sort(e||Tl)}}}function Rl(){let t=new WeakMap;return{get:function(e,r){const i=t.get(e);let n;return void 0===i?(n=new Il,t.set(e,[n])):r>=i.length?(n=new Il,i.push(n)):n=i[r],n},dispose:function(){t=new WeakMap}}}function Bl(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let r;switch(e.type){case"DirectionalLight":r={direction:new Di,color:new $n};break;case"SpotLight":r={position:new Di,direction:new Di,color:new $n,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new Di,color:new $n,distance:0,decay:0};break;case"HemisphereLight":r={direction:new Di,skyColor:new $n,groundColor:new $n};break;case"RectAreaLight":r={color:new $n,position:new Di,halfWidth:new Di,halfHeight:new Di}}return t[e.id]=r,r}}}let Ll=0;function Pl(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Dl(t,e){const r=new Bl,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let r;switch(e.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ei};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ei,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=r,r}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-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,numLightProbes:0};for(let t=0;t<9;t++)n.probe.push(new Di);const s=new Di,o=new un,a=new un;return{setup:function(s,o){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,d=0,p=0,f=0,m=0,g=0,A=0,y=0,v=0,x=0;s.sort(Pl);const b=!0===o?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(n.rectAreaLTC1=vo.LTC_FLOAT_1,n.rectAreaLTC2=vo.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(n.rectAreaLTC1=vo.LTC_HALF_1,n.rectAreaLTC2=vo.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 _=n.hash;_.directionalLength===h&&_.pointLength===u&&_.spotLength===d&&_.rectAreaLength===p&&_.hemiLength===f&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===A&&_.numSpotMaps===y&&_.numLightProbes===x||(n.directional.length=h,n.spot.length=d,n.rectArea.length=p,n.point.length=u,n.hemi.length=f,n.directionalShadow.length=m,n.directionalShadowMap.length=m,n.pointShadow.length=g,n.pointShadowMap.length=g,n.spotShadow.length=A,n.spotShadowMap.length=A,n.directionalShadowMatrix.length=m,n.pointShadowMatrix.length=g,n.spotLightMatrix.length=A+y-v,n.spotLightMap.length=y,n.numSpotLightShadowsWithMaps=v,n.numLightProbes=x,_.directionalLength=h,_.pointLength=u,_.spotLength=d,_.rectAreaLength=p,_.hemiLength=f,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=A,_.numSpotMaps=y,_.numLightProbes=x,n.version=Ll++)},setupView:function(t,e){let r=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(o=new Ol(t,e),s.push(o)):o=s[n],o},dispose:function(){r=new WeakMap}}}class Ul extends rs{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ve,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}}class Nl extends rs{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 Fl(t,e,r){let i=new fo;const n=new ei,s=new ei,o=new Mi,a=new Ul({depthPacking:He}),l=new Nl,c={},h=r.maxTextureSize,d={[f]:m,[m]:f,[g]:g},A=new to({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ei},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=A.clone();v.defines.HORIZONTAL_PASS=1;const x=new Is;x.setAttribute("position",new us(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new qs(x,A),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=u;let w=this.type;function E(r,i){const s=e.update(b);A.defines.VSM_SAMPLES!==r.blurSamples&&(A.defines.VSM_SAMPLES=r.blurSamples,v.defines.VSM_SAMPLES=r.blurSamples,A.needsUpdate=!0,v.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new Ci(n.x,n.y)),A.uniforms.shadow_pass.value=r.map.texture,A.uniforms.resolution.value=r.mapSize,A.uniforms.radius.value=r.radius,t.setRenderTarget(r.mapPass),t.clear(),t.renderBufferDirect(i,null,s,A,b,null),v.uniforms.shadow_pass.value=r.mapPass.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,t.setRenderTarget(r.map),t.clear(),t.renderBufferDirect(i,null,s,v,b,null)}function M(e,r,i,n){let s=null;const o=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)s=o;else if(s=!0===i.isPointLight?l:a,t.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0){const t=s.uuid,e=r.uuid;let i=c[t];void 0===i&&(i={},c[t]=i);let n=i[e];void 0===n&&(n=s.clone(),i[e]=n),s=n}return s.visible=r.visible,s.wireframe=r.wireframe,s.side=n===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:d[r.side],s.alphaMap=r.alphaMap,s.alphaTest=r.alphaTest,s.map=r.map,s.clipShadows=r.clipShadows,s.clippingPlanes=r.clippingPlanes,s.clipIntersection=r.clipIntersection,s.displacementMap=r.displacementMap,s.displacementScale=r.displacementScale,s.displacementBias=r.displacementBias,s.wireframeLinewidth=r.wireframeLinewidth,s.linewidth=r.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial&&(t.properties.get(s).light=i),s}function S(r,n,s,o,a){if(!1===r.visible)return;if(r.layers.test(n.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&a===p)&&(!r.frustumCulled||i.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);const i=e.update(r),l=r.material;if(Array.isArray(l)){const e=i.groups;for(let c=0,h=e.length;ch||n.y>h)&&(n.x>h&&(s.x=Math.floor(h/g.x),n.x=s.x*g.x,u.mapSize.x=s.x),n.y>h&&(s.y=Math.floor(h/g.y),n.y=s.y*g.y,u.mapSize.y=s.y)),null===u.map||!0===f||!0===m){const t=this.type!==p?{minFilter:yt,magFilter:yt}:{};null!==u.map&&u.map.dispose(),u.map=new Ci(n.x,n.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const A=u.getViewportCount();for(let t=0;t=1):-1!==yt.indexOf("OpenGL ES")&&(At=parseFloat(/^OpenGL ES (\d)/.exec(yt)[1]),gt=At>=2);let vt=null,xt={};const bt=t.getParameter(t.SCISSOR_BOX),_t=t.getParameter(t.VIEWPORT),wt=(new Mi).fromArray(bt),Et=(new Mi).fromArray(_t);function Mt(e,r,n,s){const o=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;ai||t.height>i)&&(n=i/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 i=e?Jr:Math.floor,s=i(n*t.width),o=i(n*t.height);void 0===m&&(m=y(s,o));const a=r?y(s,o):m;return a.width=s,a.height=o,a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),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 Xr(t.width)&&Xr(t.height)}function b(t,e){return t.generateMipmaps&&e&&t.minFilter!==yt&&t.minFilter!==wt}function _(e){t.generateMipmap(e)}function w(r,i,n,s,o=!1){if(!1===a)return i;if(null!==r){if(void 0!==t[r])return t[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let l=i;if(i===t.RED&&(n===t.FLOAT&&(l=t.R32F),n===t.HALF_FLOAT&&(l=t.R16F),n===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RED_INTEGER&&(n===t.UNSIGNED_BYTE&&(l=t.R8UI),n===t.UNSIGNED_SHORT&&(l=t.R16UI),n===t.UNSIGNED_INT&&(l=t.R32UI),n===t.BYTE&&(l=t.R8I),n===t.SHORT&&(l=t.R16I),n===t.INT&&(l=t.R32I)),i===t.RG&&(n===t.FLOAT&&(l=t.RG32F),n===t.HALF_FLOAT&&(l=t.RG16F),n===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA){const e=o?$e:mi.getTransfer(s);n===t.FLOAT&&(l=t.RGBA32F),n===t.HALF_FLOAT&&(l=t.RGBA16F),n===t.UNSIGNED_BYTE&&(l=e===tr?t.SRGB8_ALPHA8:t.RGBA8),n===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),n===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)}return l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function E(t,e,r){return!0===b(t,r)||t.isFramebufferTexture&&t.minFilter!==yt&&t.minFilter!==wt?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===yt||e===vt||e===bt?t.NEAREST:t.LINEAR}function S(t){const e=t.target;e.removeEventListener("dispose",S),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const r=t.source,n=g.get(r);if(n){const i=n[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&T(t),0===Object.keys(n).length&&g.delete(r)}i.remove(t)}(e),e.isVideoTexture&&f.delete(e)}function C(e){const r=e.target;r.removeEventListener("dispose",C),function(e){const r=e.texture,n=i.get(e),s=i.get(r);if(void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let r=0;r0&&s.__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 k(s,e,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+n)}const B={[mt]:t.REPEAT,[gt]:t.CLAMP_TO_EDGE,[At]:t.MIRRORED_REPEAT},L={[yt]:t.NEAREST,[vt]:t.NEAREST_MIPMAP_NEAREST,[bt]:t.NEAREST_MIPMAP_LINEAR,[wt]:t.LINEAR,[Et]:t.LINEAR_MIPMAP_NEAREST,[St]:t.LINEAR_MIPMAP_LINEAR},P={[vr]:t.NEVER,[Sr]:t.ALWAYS,[xr]:t.LESS,[_r]:t.LEQUAL,[br]:t.EQUAL,[Mr]:t.GEQUAL,[wr]:t.GREATER,[Er]:t.NOTEQUAL};function D(r,s,o){if(o?(t.texParameteri(r,t.TEXTURE_WRAP_S,B[s.wrapS]),t.texParameteri(r,t.TEXTURE_WRAP_T,B[s.wrapT]),r!==t.TEXTURE_3D&&r!==t.TEXTURE_2D_ARRAY||t.texParameteri(r,t.TEXTURE_WRAP_R,B[s.wrapR]),t.texParameteri(r,t.TEXTURE_MAG_FILTER,L[s.magFilter]),t.texParameteri(r,t.TEXTURE_MIN_FILTER,L[s.minFilter])):(t.texParameteri(r,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(r,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r!==t.TEXTURE_3D&&r!==t.TEXTURE_2D_ARRAY||t.texParameteri(r,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===gt&&s.wrapT===gt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(r,t.TEXTURE_MAG_FILTER,M(s.magFilter)),t.texParameteri(r,t.TEXTURE_MIN_FILTER,M(s.minFilter)),s.minFilter!==yt&&s.minFilter!==wt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(r,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(r,t.TEXTURE_COMPARE_FUNC,P[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const o=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===yt)return;if(s.minFilter!==bt&&s.minFilter!==St)return;if(s.type===Dt&&!1===e.has("OES_texture_float_linear"))return;if(!1===a&&s.type===Ot&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(r,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,n.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function O(e,r){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",S));const n=r.source;let s=g.get(n);void 0===s&&(s={},g.set(n,s));const a=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()}(r);if(a!==e.__cacheKey){void 0===s[a]&&(s[a]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,i=!0),s[a].usedTimes++;const n=s[e.__cacheKey];void 0!==n&&(s[e.__cacheKey].usedTimes--,0===n.usedTimes&&T(r)),e.__cacheKey=a,e.__webglTexture=s[a].texture}return i}function k(e,n,o){let l=t.TEXTURE_2D;(n.isDataArrayTexture||n.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),n.isData3DTexture&&(l=t.TEXTURE_3D);const c=O(e,n),u=n.source;r.bindTexture(l,e.__webglTexture,t.TEXTURE0+o);const d=i.get(u);if(u.version!==d.__version||!0===c){r.activeTexture(t.TEXTURE0+o);const e=mi.getPrimaries(mi.workingColorSpace),i=n.colorSpace===Ze?null:mi.getPrimaries(n.colorSpace),p=n.colorSpace===Ze||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const f=function(t){return!a&&(t.wrapS!==gt||t.wrapT!==gt||t.minFilter!==yt&&t.minFilter!==wt)}(n)&&!1===x(n.image);let m=v(n.image,f,!1,h);m=Q(n,m);const g=x(m)||a,A=s.convert(n.format,n.colorSpace);let y,M=s.convert(n.type),S=w(n.internalFormat,A,M,n.colorSpace,n.isVideoTexture);D(l,n,g);const C=n.mipmaps,T=a&&!0!==n.isVideoTexture&&S!==ne,I=void 0===d.__version||!0===c,R=E(n,m,g);if(n.isDepthTexture)S=t.DEPTH_COMPONENT,a?S=n.type===Dt?t.DEPTH_COMPONENT32F:n.type===Pt?t.DEPTH_COMPONENT24:n.type===Nt?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:n.type===Dt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===jt&&S===t.DEPTH_COMPONENT&&n.type!==Bt&&n.type!==Pt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Pt,M=s.convert(n.type)),n.format===Vt&&S===t.DEPTH_COMPONENT&&(S=t.DEPTH_STENCIL,n.type!==Nt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Nt,M=s.convert(n.type))),I&&(T?r.texStorage2D(t.TEXTURE_2D,1,S,m.width,m.height):r.texImage2D(t.TEXTURE_2D,0,S,m.width,m.height,0,A,M,null));else if(n.isDataTexture)if(C.length>0&&g){T&&I&&r.texStorage2D(t.TEXTURE_2D,R,S,C[0].width,C[0].height);for(let e=0,i=C.length;e>=1,i>>=1}}else if(C.length>0&&g){T&&I&&r.texStorage2D(t.TEXTURE_2D,R,S,C[0].width,C[0].height);for(let e=0,i=C.length;e>c),i=Math.max(1,n.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?r.texImage3D(l,c,p,e,i,n.depth,0,h,u,null):r.texImage2D(l,c,p,e,i,0,h,u,null)}r.bindFramebuffer(t.FRAMEBUFFER,e),G(n)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,a,l,i.get(o).__webglTexture,0,z(n)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,a,l,i.get(o).__webglTexture,c),r.bindFramebuffer(t.FRAMEBUFFER,null)}function N(e,r,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),r.depthBuffer&&!r.stencilBuffer){let n=!0===a?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(i||G(r)){const e=r.depthTexture;e&&e.isDepthTexture&&(e.type===Dt?n=t.DEPTH_COMPONENT32F:e.type===Pt&&(n=t.DEPTH_COMPONENT24));const i=z(r);G(r)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,n,r.width,r.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,n,r.width,r.height)}else t.renderbufferStorage(t.RENDERBUFFER,n,r.width,r.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(r.depthBuffer&&r.stencilBuffer){const n=z(r);i&&!1===G(r)?t.renderbufferStorageMultisample(t.RENDERBUFFER,n,t.DEPTH24_STENCIL8,r.width,r.height):G(r)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,n,t.DEPTH24_STENCIL8,r.width,r.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,r.width,r.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===r.isWebGLMultipleRenderTargets?r.texture:[r.texture];for(let n=0;n0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function Q(t,r){const i=t.colorSpace,n=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Nr||i!==Xe&&i!==Ze&&(mi.getTransfer(i)===tr?!1===a?!0===e.has("EXT_sRGB")&&n===zt?(t.format=Nr,t.minFilter=wt,t.generateMipmaps=!1):r=vi.sRGBToLinear(r):n===zt&&s===Tt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),r}this.allocateTextureUnit=function(){const t=I;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),I+=1,t},this.resetTextureUnits=function(){I=0},this.setTexture2D=R,this.setTexture2DArray=function(e,n){const s=i.get(e);e.version>0&&s.__version!==e.version?k(s,e,n):r.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+n)},this.setTexture3D=function(e,n){const s=i.get(e);e.version>0&&s.__version!==e.version?k(s,e,n):r.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+n)},this.setTextureCube=function(e,n){const o=i.get(e);e.version>0&&o.__version!==e.version?function(e,n,o){if(6!==n.image.length)return;const l=O(e,n),h=n.source;r.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+o);const u=i.get(h);if(h.version!==u.__version||!0===l){r.activeTexture(t.TEXTURE0+o);const e=mi.getPrimaries(mi.workingColorSpace),i=n.colorSpace===Ze?null:mi.getPrimaries(n.colorSpace),d=n.colorSpace===Ze||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const p=n.isCompressedTexture||n.image[0].isCompressedTexture,f=n.image[0]&&n.image[0].isDataTexture,m=[];for(let t=0;t<6;t++)m[t]=p||f?f?n.image[t].image:n.image[t]:v(n.image[t],!1,!0,c),m[t]=Q(n,m[t]);const g=m[0],A=x(g)||a,y=s.convert(n.format,n.colorSpace),M=s.convert(n.type),S=w(n.internalFormat,y,M,n.colorSpace),C=a&&!0!==n.isVideoTexture,T=void 0===u.__version||!0===l;let I,R=E(n,g,A);if(D(t.TEXTURE_CUBE_MAP,n,A),p){C&&T&&r.texStorage2D(t.TEXTURE_CUBE_MAP,R,S,g.width,g.height);for(let e=0;e<6;e++){I=m[e].mipmaps;for(let i=0;i0&&R++,r.texStorage2D(t.TEXTURE_CUBE_MAP,R,S,m[0].width,m[0].height));for(let e=0;e<6;e++)if(f){C?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,m[e].width,m[e].height,y,M,m[e].data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,m[e].width,m[e].height,0,y,M,m[e].data);for(let i=0;i0){c.__webglFramebuffer[e]=[];for(let r=0;r0){c.__webglFramebuffer=[];for(let e=0;e0&&!1===G(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],r.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let r=0;r0)for(let i=0;i0)for(let r=0;r0&&!1===G(e)){const n=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,o=e.height;let a=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;ea+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&o<=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,r),null!==n&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,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!==o&&(i=e.getPose(t.targetRaySpace,r),null===i&&null!==n&&(i=n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Hl)))}return null!==o&&(o.visible=null!==i),null!==a&&(a.visible=null!==n),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const r=new Vl;r.matrixAutoUpdate=!1,r.visible=!1,t.joints[e.jointName]=r,t.add(r)}return t.joints[e.jointName]}}class ql extends Gr{constructor(t,e){super();const r=this;let i=null,n=1,s=null,o="local-floor",a=1,l=null,c=null,h=null,u=null,d=null,p=null;const f=e.getContextAttributes();let m=null,g=null;const A=[],y=[],v=new ei;let x=null;const b=new ro;b.layers.enable(1),b.viewport=new Mi;const _=new ro;_.layers.enable(2),_.viewport=new Mi;const w=[b,_],E=new jl;E.layers.enable(1),E.layers.enable(2);let M=null,S=null;function C(t){const e=y.indexOf(t.inputSource);if(-1===e)return;const r=A[e];void 0!==r&&(r.update(t.inputSource,t.frame,l||s),r.dispatchEvent({type:t.type,data:t.inputSource}))}function T(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",T),i.removeEventListener("inputsourceschange",I);for(let t=0;t=0&&(y[i]=null,A[i].disconnect(r))}for(let e=0;e=y.length){y.push(r),i=t;break}if(null===y[t]){y[t]=r,i=t;break}}if(-1===i)break}const n=A[i];n&&n.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getGripSpace()},this.getHand=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){n=t,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(m=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",T),i.addEventListener("inputsourceschange",I),!0!==f.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(v),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const r={antialias:void 0!==i.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:n};d=new XRWebGLLayer(i,e,r),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),g=new Ci(d.framebufferWidth,d.framebufferHeight,{format:zt,type:Tt,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil})}else{let r=null,s=null,o=null;f.depth&&(o=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,r=f.stencil?Vt:jt,s=f.stencil?Nt:Pt);const a={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:n};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(a),i.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),g=new Ci(u.textureWidth,u.textureHeight,{format:zt,type:Tt,depthTexture:new Ko(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0}),t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(a),l=null,s=await i.requestReferenceSpace(o),D.setContext(i),D.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const R=new Di,B=new Di;function L(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===i)return;E.near=_.near=b.near=t.near,E.far=_.far=b.far=t.far,M===E.near&&S===E.far||(i.updateRenderState({depthNear:E.near,depthFar:E.far}),M=E.near,S=E.far);const e=t.parent,r=E.cameras;L(E,e);for(let t=0;t0&&(i.alphaTest.value=n.alphaTest);const s=e.get(n).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*e,r(n.lightMap,i.lightMapTransform)}n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity,r(n.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,r){r.color.getRGB(e.fogColor.value,Ks(t)),r.isFog?(e.fogNear.value=r.near,e.fogFar.value=r.far):r.isFogExp2&&(e.fogDensity.value=r.density)},refreshMaterialUniforms:function(t,n,s,o,a){n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(t,n):n.isMeshToonMaterial?(i(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,n)):n.isMeshPhongMaterial?(i(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,n)):n.isMeshStandardMaterial?(i(t,n),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,r(i.metalnessMap,t.metalnessMapTransform)),t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,r(i.roughnessMap,t.roughnessMapTransform));e.get(i).envMap&&(t.envMapIntensity.value=i.envMapIntensity)}(t,n),n.isMeshPhysicalMaterial&&function(t,e,i){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,r(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,r(e.sheenRoughnessMap,t.sheenRoughnessMapTransform))),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,r(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,r(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,r(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===m&&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,r(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,r(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform))),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,r(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,r(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,r(e.anisotropyMap,t.anisotropyMapTransform))),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,r(e.specularColorMap,t.specularColorMapTransform)),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,r(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,n,a)):n.isMeshMatcapMaterial?(i(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,n)):n.isMeshDepthMaterial?i(t,n):n.isMeshDistanceMaterial?(i(t,n),function(t,r){const i=e.get(r).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,n)):n.isMeshNormalMaterial?i(t,n):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,r(e.map,t.mapTransform))}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map,r(e.map,t.uvTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap,r(e.alphaMap,t.alphaMapTransform)),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,n,s,o):n.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,r(e.map,t.mapTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap,r(e.alphaMap,t.alphaMapTransform)),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Yl(t,e,r,i){let n={},s={},o=[];const a=r.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,r){const i=t.value;if(void 0===r[e]){if("number"==typeof i)r[e]=i;else{const t=Array.isArray(i)?i:[i],n=[];for(let e=0;e0&&(i=r%16,0!==i&&16-i-s.boundary<0&&(r+=16-i,n.__offset=r)),r+=s.storage}i=r%16,i>0&&(r+=16-i),t.__size=r,t.__cache={}}(r),d=function(e){const r=function(){for(let t=0;t0),u=!!r.morphAttributes.position,d=!!r.morphAttributes.normal,p=!!r.morphAttributes.color;let f=et;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=_.toneMapping));const m=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,g=void 0!==m?m.length:0,A=rt.get(i),y=v.state.lights;if(!0===j&&(!0===V||t!==T)){const e=t===T&&i.id===C;pt.setState(i,t,e)}let x=!1;i.version===A.__version?A.needsLights&&A.lightsStateVersion!==y.state.version||A.outputColorSpace!==a||n.isBatchedMesh&&!1===A.batching?x=!0:n.isBatchedMesh||!0!==A.batching?n.isInstancedMesh&&!1===A.instancing?x=!0:n.isInstancedMesh||!0!==A.instancing?n.isSkinnedMesh&&!1===A.skinning?x=!0:n.isSkinnedMesh||!0!==A.skinning?n.isInstancedMesh&&!0===A.instancingColor&&null===n.instanceColor||n.isInstancedMesh&&!1===A.instancingColor&&null!==n.instanceColor||A.envMap!==l||!0===i.fog&&A.fog!==s?x=!0:void 0===A.numClippingPlanes||A.numClippingPlanes===pt.numPlanes&&A.numIntersection===pt.numIntersection?(A.vertexAlphas!==c||A.vertexTangents!==h||A.morphTargets!==u||A.morphNormals!==d||A.morphColors!==p||A.toneMapping!==f||!0===K.isWebGL2&&A.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,A.__version=i.version);let b=A.currentProgram;!0===x&&(b=Kt(i,e,n));let w=!1,E=!1,M=!1;const I=b.getUniforms(),R=A.uniforms;if($.useProgram(b.program)&&(w=!0,E=!0,M=!0),i.id!==C&&(C=i.id,E=!0),w||T!==t){I.setValue(_t,"projectionMatrix",t.projectionMatrix),I.setValue(_t,"viewMatrix",t.matrixWorldInverse);const e=I.map.cameraPosition;void 0!==e&&e.setValue(_t,Z.setFromMatrixPosition(t.matrixWorld)),K.logarithmicDepthBuffer&&I.setValue(_t,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&I.setValue(_t,"isOrthographic",!0===t.isOrthographicCamera),T!==t&&(T=t,E=!0,M=!0)}if(n.isSkinnedMesh){I.setOptional(_t,n,"bindMatrix"),I.setOptional(_t,n,"bindMatrixInverse");const t=n.skeleton;t&&(K.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),I.setValue(_t,"boneTexture",t.boneTexture,it)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}n.isBatchedMesh&&(I.setOptional(_t,n,"batchingTexture"),I.setValue(_t,"batchingTexture",n._matricesTexture,it));const B=r.morphAttributes;var L,P;if((void 0!==B.position||void 0!==B.normal||void 0!==B.color&&!0===K.isWebGL2)&>.update(n,r,b),(E||A.receiveShadow!==n.receiveShadow)&&(A.receiveShadow=n.receiveShadow,I.setValue(_t,"receiveShadow",n.receiveShadow)),i.isMeshGouraudMaterial&&null!==i.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),E&&(I.setValue(_t,"toneMappingExposure",_.toneMappingExposure),A.needsLights&&(P=M,(L=R).ambientLightColor.needsUpdate=P,L.lightProbe.needsUpdate=P,L.directionalLights.needsUpdate=P,L.directionalLightShadows.needsUpdate=P,L.pointLights.needsUpdate=P,L.pointLightShadows.needsUpdate=P,L.spotLights.needsUpdate=P,L.spotLightShadows.needsUpdate=P,L.rectAreaLights.needsUpdate=P,L.hemisphereLights.needsUpdate=P),s&&!0===i.fog&&ht.refreshFogUniforms(R,s),ht.refreshMaterialUniforms(R,i,k,O,H),il.upload(_t,$t(A),R,it)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(il.upload(_t,$t(A),R,it),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&I.setValue(_t,"center",n.center),I.setValue(_t,"modelViewMatrix",n.modelViewMatrix),I.setValue(_t,"normalMatrix",n.normalMatrix),I.setValue(_t,"modelMatrix",n.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,r=t.length;e{function r(){i.forEach((function(t){rt.get(t).currentProgram.isReady()&&i.delete(t)})),0!==i.size?setTimeout(r,10):e(t)}null!==J.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)}))};let Gt=null;function Qt(){Vt.stop()}function jt(){Vt.start()}const Vt=new mo;function Ht(t,e,r,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)r=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Q.intersectsSprite(t)){i&&Z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(W);const e=lt.update(t),n=t.material;n.visible&&y.push(t,e,n,r,Z.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Q.intersectsObject(t))){const e=lt.update(t),n=t.material;if(i&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),Z.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),Z.copy(e.boundingSphere.center)),Z.applyMatrix4(t.matrixWorld).applyMatrix4(W)),Array.isArray(n)){const i=e.groups;for(let s=0,o=i.length;s0&&function(t,e,r,i){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;const n=K.isWebGL2;null===H&&(H=new Ci(1,1,{generateMipmaps:!0,type:J.has("EXT_color_buffer_half_float")?Ot:Tt,minFilter:St,samples:n?4:0})),_.getDrawingBufferSize(q),n?H.setSize(q.x,q.y):H.setSize(Jr(q.x),Jr(q.y));const s=_.getRenderTarget();_.setRenderTarget(H),_.getClearColor(L),P=_.getClearAlpha(),P<1&&_.setClearColor(16777215,.5),_.clear();const o=_.toneMapping;_.toneMapping=et,Xt(t,r,i),it.updateMultisampleRenderTarget(H),it.updateRenderTargetMipmap(H);let a=!1;for(let t=0,n=e.length;t0&&Xt(n,e,r),s.length>0&&Xt(s,e,r),o.length>0&&Xt(o,e,r),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function Xt(t,e,r){const i=!0===e.isScene?e.overrideMaterial:null;for(let n=0,s=t.length;n0?b[b.length-1]:null,x.pop(),y=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,r){rt.get(t.texture).__webglTexture=e,rt.get(t.depthTexture).__webglTexture=r;const i=rt.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===r,i.__autoAllocateDepthBuffer||!0===J.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const r=rt.get(t);r.__webglFramebuffer=e,r.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,r=0){S=t,E=e,M=r;let i=!0,n=null,s=!1,o=!1;if(t){const a=rt.get(t);void 0!==a.__useDefaultFramebuffer?($.bindFramebuffer(_t.FRAMEBUFFER,null),i=!1):void 0===a.__webglFramebuffer?it.setupRenderTarget(t):a.__hasExternalTextures&&it.rebindTextures(t,rt.get(t.texture).__webglTexture,rt.get(t.depthTexture).__webglTexture);const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=rt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=Array.isArray(c[e])?c[e][r]:c[e],s=!0):n=K.isWebGL2&&t.samples>0&&!1===it.useMultisampledRTT(t)?rt.get(t).__webglMultisampledFramebuffer:Array.isArray(c)?c[r]:c,I.copy(t.viewport),R.copy(t.scissor),B=t.scissorTest}else I.copy(F).multiplyScalar(k).floor(),R.copy(z).multiplyScalar(k).floor(),B=G;if($.bindFramebuffer(_t.FRAMEBUFFER,n)&&K.drawBuffers&&i&&$.drawBuffers(t,n),$.viewport(I),$.scissor(R),$.setScissorTest(B),s){const i=rt.get(t.texture);_t.framebufferTexture2D(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,_t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,r)}else if(o){const i=rt.get(t.texture),n=e||0;_t.framebufferTextureLayer(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,i.__webglTexture,r||0,n)}C=-1},this.readRenderTargetPixels=function(t,e,r,i,n,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=rt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){$.bindFramebuffer(_t.FRAMEBUFFER,a);try{const o=t.texture,a=o.format,l=o.type;if(a!==zt&&vt.convert(a)!==_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Ot&&(J.has("EXT_color_buffer_half_float")||K.isWebGL2&&J.has("EXT_color_buffer_float"));if(!(l===Tt||vt.convert(l)===_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_TYPE)||l===Dt&&(K.isWebGL2||J.has("OES_texture_float")||J.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&r>=0&&r<=t.height-n&&_t.readPixels(e,r,i,n,vt.convert(a),vt.convert(l),s)}finally{const t=null!==S?rt.get(S).__webglFramebuffer:null;$.bindFramebuffer(_t.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,r=0){const i=Math.pow(2,-r),n=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);it.setTexture2D(e,0),_t.copyTexSubImage2D(_t.TEXTURE_2D,r,0,0,t.x,t.y,n,s),$.unbindTexture()},this.copyTextureToTexture=function(t,e,r,i=0){const n=e.image.width,s=e.image.height,o=vt.convert(r.format),a=vt.convert(r.type);it.setTexture2D(r,0),_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,r.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,r.unpackAlignment),e.isDataTexture?_t.texSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,n,s,o,a,e.image.data):e.isCompressedTexture?_t.compressedTexSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):_t.texSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,o,a,e.image),0===i&&r.generateMipmaps&&_t.generateMipmap(_t.TEXTURE_2D),$.unbindTexture()},this.copyTextureToTexture3D=function(t,e,r,i,n=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=vt.convert(i.format),c=vt.convert(i.type);let h;if(i.isData3DTexture)it.setTexture3D(i,0),h=_t.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");it.setTexture2DArray(i,0),h=_t.TEXTURE_2D_ARRAY}_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,i.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,i.unpackAlignment);const u=_t.getParameter(_t.UNPACK_ROW_LENGTH),d=_t.getParameter(_t.UNPACK_IMAGE_HEIGHT),p=_t.getParameter(_t.UNPACK_SKIP_PIXELS),f=_t.getParameter(_t.UNPACK_SKIP_ROWS),m=_t.getParameter(_t.UNPACK_SKIP_IMAGES),g=r.isCompressedTexture?r.mipmaps[0]:r.image;_t.pixelStorei(_t.UNPACK_ROW_LENGTH,g.width),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,g.height),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,t.min.x),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,t.min.y),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,t.min.z),r.isDataTexture||r.isData3DTexture?_t.texSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,c,g.data):r.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),_t.compressedTexSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,g.data)):_t.texSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,c,g),_t.pixelStorei(_t.UNPACK_ROW_LENGTH,u),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,d),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,p),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,f),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,m),0===n&&i.generateMipmaps&&_t.generateMipmap(h),$.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?it.setTextureCube(t,0):t.isData3DTexture?it.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?it.setTexture2DArray(t,0):it.setTexture2D(t,0),$.unbindTexture()},this.resetState=function(){E=0,M=0,S=null,$.reset(),xt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Fr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===Je?"display-p3":"srgb",e.unpackColorSpace=mi.workingColorSpace===Ke?"display-p3":"srgb"}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===Ye?je:Qe}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===je?Ye:Xe}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class Jl extends Xl{}Jl.prototype.isWebGL1Renderer=!0;class Kl{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new $n(t),this.density=e}clone(){return new Kl(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class $l{constructor(t,e=1,r=1e3){this.isFog=!0,this.name="",this.color=new $n(t),this.near=e,this.far=r}clone(){return new $l(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class tc extends kn{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}}class ec{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Cr,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Wr()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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;it.far||e.push({distance:a,point:oc.clone(),uv:Zn.getInterpolation(oc,dc,pc,fc,mc,gc,Ac,new ei),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function vc(t,e,r,i,n,s){cc.subVectors(t,r).addScalar(.5).multiply(i),void 0!==n?(hc.x=s*cc.x-n*cc.y,hc.y=n*cc.x+s*cc.y):hc.copy(cc),t.copy(e),t.x+=hc.x,t.y+=hc.y,t.applyMatrix4(uc)}const xc=new Di,bc=new Di;class _c extends kn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,r=e.length;t0){let r,i;for(r=1,i=e.length;r0){xc.setFromMatrixPosition(this.matrixWorld);const r=t.ray.origin.distanceTo(xc);this.getObjectForDistance(r).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){xc.setFromMatrixPosition(t.matrixWorld),bc.setFromMatrixPosition(this.matrixWorld);const r=xc.distanceTo(bc)/t.zoom;let i,n;for(e[0].object.visible=!0,i=1,n=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;i=r.length&&r.push({start:-1,count:-1,z:-1});const n=r[this.index];i.push(n),this.index++,n.start=t.start,n.count=t.count,n.z=e}reset(){this.list.length=0,this.index=0}}const Xc="batchId",Jc=new un,Kc=new un,$c=new un,th=new un,eh=new fo,rh=new Ui,ih=new en,nh=new Di,sh=new Yc,oh=new qs,ah=[];function lh(t,e,r=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const n=t.count;for(let s=0;s65536?new Uint32Array(n):new Uint16Array(n);e.setIndex(new us(t,1))}const s=i>65536?new Uint32Array(r):new Uint16Array(r);e.setAttribute(Xc,new us(s,1)),this._geometryInitialized=!0}}_validateGeometry(t){if(t.getAttribute(Xc))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Xc}"`);const e=this.geometry;if(Boolean(t.getIndex())!==Boolean(e.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in e.attributes){if(r===Xc)continue;if(!t.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=t.getAttribute(r),n=e.getAttribute(r);if(i.itemSize!==n.itemSize||i.normalized!==n.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ui);const t=this._geometryCount,e=this.boundingBox,r=this._active;e.makeEmpty();for(let i=0;i=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let n=null;const s=this._reservedRanges,o=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(n=s[s.length-1]),i.vertexCount=-1===e?t.getAttribute("position").count:e,i.vertexStart=null===n?0:n.vertexStart+n.vertexCount;const l=t.getIndex(),c=null!==l;if(c&&(i.indexCount=-1===r?l.count:r,i.indexStart=null===n?0:n.indexStart+n.indexCount),-1!==i.indexStart&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,u=this._active,d=this._matricesTexture,p=this._matricesTexture.image.data;h.push(!0),u.push(!0);const f=this._geometryCount;this._geometryCount++,$c.toArray(p,16*f),d.needsUpdate=!0,s.push(i),o.push({start:c?i.indexStart:i.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Ui,sphereInitialized:!1,sphere:new en});const m=this.geometry.getAttribute(Xc);for(let t=0;t=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const r=this.geometry,i=null!==r.getIndex(),n=r.getIndex(),s=e.getIndex(),o=this._reservedRanges[t];if(i&&s.count>o.indexCount||e.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=o.vertexStart,l=o.vertexCount;for(const t in r.attributes){if(t===Xc)continue;const i=e.getAttribute(t),n=r.getAttribute(t);lh(i,n,a);const s=i.itemSize;for(let t=i.count,e=l;t=e.length||!1===e[t]||(e[t]=!1,this._visibilityChanged=!0),this}getBoundingBoxAt(t,e){if(!1===this._active[t])return this;const r=this._bounds[t],i=r.box,n=this.geometry;if(!1===r.boxInitialized){i.makeEmpty();const e=n.index,s=n.attributes.position,o=this._drawRanges[t];for(let t=o.start,r=o.start+o.count;t=this._geometryCount||!1===r[t]||(e.toArray(n,16*t),i.needsUpdate=!0),this}getMatrixAt(t,e){const r=this._active,i=this._matricesTexture.image.data;return t>=this._geometryCount||!1===r[t]?null:e.fromArray(i,16*t)}setVisibleAt(t,e){const r=this._visibility,i=this._active;return t>=this._geometryCount||!1===i[t]||r[t]===e||(r[t]=e,this._visibilityChanged=!0),this}getVisibleAt(t){const e=this._visibility,r=this._active;return!(t>=this._geometryCount||!1===r[t])&&e[t]}raycast(t,e){const r=this._visibility,i=this._active,n=this._drawRanges,s=this._geometryCount,o=this.matrixWorld,a=this.geometry;oh.material=this.material,oh.geometry.index=a.index,oh.geometry.attributes=a.attributes,null===oh.geometry.boundingBox&&(oh.geometry.boundingBox=new Ui),null===oh.geometry.boundingSphere&&(oh.geometry.boundingSphere=new en);for(let a=0;a({...t}))),this._reservedRanges=t._reservedRanges.map((t=>({...t}))),this._visibility=t._visibility.slice(),this._active=t._active.slice(),this._bounds=t._bounds.map((t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()}))),this._maxGeometryCount=t._maxGeometryCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(t,e,r,i,n){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),o=null===s?1:s.array.BYTES_PER_ELEMENT,a=this._visibility,l=this._multiDrawStarts,c=this._multiDrawCounts,h=this._drawRanges,u=this.perObjectFrustumCulled;u&&(th.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),eh.setFromProjectionMatrix(th,t.isWebGPURenderer?zr:Fr));let d=0;if(this.sortObjects){Kc.copy(this.matrixWorld).invert(),nh.setFromMatrixPosition(r.matrixWorld).applyMatrix4(Kc);for(let t=0,e=a.length;ta)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}else for(let r=Math.max(0,s.start),i=Math.min(f.count,s.start+s.count)-1;ra)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;tn.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:r,index:e,face:null,object:o})}}class Th extends Ei{constructor(t,e,r,i,n,s,o,a,l){super(t,e,r,i,n,s,o,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:wt,this.magFilter=void 0!==n?n:wt,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Ih extends Ei{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=yt,this.minFilter=yt,this.generateMipmaps=!1,this.needsUpdate=!0}}class Rh extends Ei{constructor(t,e,r,i,n,s,o,a,l,c,h,u){super(null,s,o,a,l,c,i,n,h,u),this.isCompressedTexture=!0,this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Bh extends Rh{constructor(t,e,r,i,n,s){super(t,e,r,n,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=gt}}class Lh extends Rh{constructor(t,e,r){super(void 0,t[0].width,t[0].height,e,r,ht),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class Ph extends Ei{constructor(t,e,r,i,n,s,o,a,l){super(t,e,r,i,n,s,o,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Dh{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const r=this.getUtoTmapping(t);return this.getPoint(r,e)}getPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return e}getSpacedPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPointAt(r/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 r,i=this.getPoint(0),n=0;e.push(0);for(let s=1;s<=t;s++)r=this.getPoint(s/t),n+=r.distanceTo(i),e.push(n),i=r;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const r=this.getLengths();let i=0;const n=r.length;let s;s=e||t*r[n-1];let o,a=0,l=n-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),o=r[i]-s,o<0)a=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(i=l,r[i]===s)return i/(n-1);const c=r[i];return(i+(s-c)/(r[i+1]-c))/(n-1)}getTangent(t,e){const r=1e-4;let i=t-r,n=t+r;i<0&&(i=0),n>1&&(n=1);const s=this.getPoint(i),o=this.getPoint(n),a=e||(s.isVector2?new ei:new Di);return a.copy(o).sub(s).normalize(),a}getTangentAt(t,e){const r=this.getUtoTmapping(t);return this.getTangent(r,e)}computeFrenetFrames(t,e){const r=new Di,i=[],n=[],s=[],o=new Di,a=new un;for(let e=0;e<=t;e++){const r=e/t;i[e]=this.getTangentAt(r,new Di)}n[0]=new Di,s[0]=new Di;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,r.set(1,0,0)),h<=l&&(l=h,r.set(0,1,0)),u<=l&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),n[0].crossVectors(i[0],o),s[0].crossVectors(i[0],n[0]);for(let e=1;e<=t;e++){if(n[e]=n[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(i[e-1],i[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(qr(i[e-1].dot(i[e]),-1,1));n[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(i[e],n[e])}if(!0===e){let e=Math.acos(qr(n[0].dot(n[t]),-1,1));e/=t,i[0].dot(o.crossVectors(n[0],n[t]))>0&&(e=-e);for(let r=1;r<=t;r++)n[r].applyMatrix4(a.makeRotationAxis(i[r],e*r)),s[r].crossVectors(i[r],n[r])}return{tangents:i,normals:n,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Oh extends Dh{constructor(t=0,e=0,r=1,i=1,n=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const r=e||new ei,i=2*Math.PI;let n=this.aEndAngle-this.aStartAngle;const s=Math.abs(n)i;)n-=i;n0?0:(Math.floor(Math.abs(l)/n)+1)*n:0===c&&l===n-1&&(l=n-2,c=1),this.closed||l>0?o=i[(l-1)%n]:(Nh.subVectors(i[0],i[1]).add(i[0]),o=Nh);const h=i[l%n],u=i[(l+1)%n];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return r.set(jh(o,a.x,l.x,c.x,h.x),jh(o,a.y,l.y,c.y,h.y)),r}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e=r){const t=i[n]-r,s=this.curves[n],o=s.getLength(),a=0===o?0:1-t/o;return s.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 r=0,i=this.curves.length;r1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,r=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),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}}class ru extends Is{constructor(t=[new ei(0,-.5),new ei(.5,0),new ei(0,.5)],e=12,r=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=Math.floor(e),i=qr(i,0,2*Math.PI);const n=[],s=[],o=[],a=[],l=[],c=1/e,h=new Di,u=new ei,d=new Di,p=new Di,f=new Di;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case t.length-1:a.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let n=0;n<=e;n++){const d=r+n*c*i,p=Math.sin(d),f=Math.cos(d);for(let r=0;r<=t.length-1;r++){h.x=t[r].x*p,h.y=t[r].y,h.z=t[r].x*f,s.push(h.x,h.y,h.z),u.x=n/e,u.y=r/(t.length-1),o.push(u.x,u.y);const i=a[3*r+0]*p,c=a[3*r+1],d=a[3*r+0]*f;l.push(i,c,d)}}for(let r=0;r0&&A(!0),e>0&&A(!1)),this.setIndex(c),this.setAttribute("position",new xs(h,3)),this.setAttribute("normal",new xs(u,3)),this.setAttribute("uv",new xs(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new su(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ou extends su{constructor(t=1,e=1,r=32,i=1,n=!1,s=0,o=2*Math.PI){super(0,t,e,r,i,n,s,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:i,openEnded:n,thetaStart:s,thetaLength:o}}static fromJSON(t){return new ou(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class au extends Is{constructor(t=[],e=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i};const n=[],s=[];function o(t,e,r,i){const n=i+1,s=[];for(let i=0;i<=n;i++){s[i]=[];const o=t.clone().lerp(r,i/n),a=e.clone().lerp(r,i/n),l=n-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===n?o:o.clone().lerp(a,t/l)}for(let t=0;t.9&&o<.1&&(e<.2&&(s[t+0]+=1),r<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new xs(n,3)),this.setAttribute("normal",new xs(n.slice(),3)),this.setAttribute("uv",new xs(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new au(t.vertices,t.indices,t.radius,t.details)}}class lu extends au{constructor(t=1,e=0){const r=(1+Math.sqrt(5))/2,i=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new lu(t.radius,t.detail)}}const cu=new Di,hu=new Di,uu=new Di,du=new Zn;class pu extends Is{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const r=4,i=Math.pow(10,r),n=Math.cos(Vr*e),s=t.getIndex(),o=t.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t0)for(s=e;s=e;s-=i)o=ku(s,t[s],t[s+1],o);return o&&Ru(o,o.next)&&(Uu(o),o=o.next),o}function gu(t,e){if(!t)return t;e||(e=t);let r,i=t;do{if(r=!1,i.steiner||!Ru(i,i.next)&&0!==Iu(i.prev,i,i.next))i=i.next;else{if(Uu(i),i=e=i.prev,i===i.next)break;r=!0}}while(r||i!==e);return e}function Au(t,e,r,i,n,s,o){if(!t)return;!o&&s&&function(t,e,r,i){let n=t;do{0===n.z&&(n.z=Mu(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,l,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(o>1)}(n)}(t,i,n,s);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,s?vu(t,i,n,s):yu(t))e.push(a.i/r|0),e.push(t.i/r|0),e.push(l.i/r|0),Uu(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?Au(t=xu(gu(t),e,r),e,r,i,n,s,2):2===o&&bu(t,e,r,i,n,s):Au(gu(t),e,r,i,n,s,1);break}}function yu(t){const e=t.prev,r=t,i=t.next;if(Iu(e,r,i)>=0)return!1;const n=e.x,s=r.x,o=i.x,a=e.y,l=r.y,c=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=i.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Cu(n,a,s,l,o,c,f.x,f.y)&&Iu(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function vu(t,e,r,i){const n=t.prev,s=t,o=t.next;if(Iu(n,s,o)>=0)return!1;const a=n.x,l=s.x,c=o.x,h=n.y,u=s.y,d=o.y,p=al?a>c?a:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,A=Mu(p,f,e,r,i),y=Mu(m,g,e,r,i);let v=t.prevZ,x=t.nextZ;for(;v&&v.z>=A&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==o&&Cu(a,h,l,u,c,d,v.x,v.y)&&Iu(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==o&&Cu(a,h,l,u,c,d,x.x,x.y)&&Iu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==o&&Cu(a,h,l,u,c,d,v.x,v.y)&&Iu(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==o&&Cu(a,h,l,u,c,d,x.x,x.y)&&Iu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xu(t,e,r){let i=t;do{const n=i.prev,s=i.next.next;!Ru(n,s)&&Bu(n,i,i.next,s)&&Du(n,s)&&Du(s,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),Uu(i),Uu(i.next),i=t=s),i=i.next}while(i!==t);return gu(i)}function bu(t,e,r,i,n,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&Tu(o,t)){let a=Ou(o,t);return o=gu(o,o.next),a=gu(a,a.next),Au(o,e,r,i,n,s,0),void Au(a,e,r,i,n,s,0)}t=t.next}o=o.next}while(o!==t)}function _u(t,e){return t.x-e.x}function wu(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.x&&i.x>=l&&s!==i.x&&Cu(or.x||i.x===r.x&&Eu(r,i)))&&(r=i,u=h)),i=i.next}while(i!==a);return r}(t,e);if(!r)return e;const i=Ou(r,t);return gu(i,i.next),gu(r,r.next)}function Eu(t,e){return Iu(t.prev,t,e.prev)<0&&Iu(e.next,t,t.next)<0}function Mu(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 Su(t){let e=t,r=t;do{(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function Tu(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&&Bu(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Du(t,e)&&Du(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)&&(Iu(t.prev,t,e.prev)||Iu(t,e.prev,e))||Ru(t,e)&&Iu(t.prev,t,t.next)>0&&Iu(e.prev,e,e.next)>0)}function Iu(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ru(t,e){return t.x===e.x&&t.y===e.y}function Bu(t,e,r,i){const n=Pu(Iu(t,e,r)),s=Pu(Iu(t,e,i)),o=Pu(Iu(r,i,t)),a=Pu(Iu(r,i,e));return n!==s&&o!==a||!(0!==n||!Lu(t,r,e))||!(0!==s||!Lu(t,i,e))||!(0!==o||!Lu(r,t,i))||!(0!==a||!Lu(r,e,i))}function Lu(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 Pu(t){return t>0?1:t<0?-1:0}function Du(t,e){return Iu(t.prev,t,t.next)<0?Iu(t,e,t.next)>=0&&Iu(t,t.prev,e)>=0:Iu(t,e,t.prev)<0||Iu(t,t.next,e)<0}function Ou(t,e){const r=new Nu(t.i,t.x,t.y),i=new Nu(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 ku(t,e,r,i){const n=new Nu(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 Uu(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 Nu(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}class Fu{static area(t){const e=t.length;let r=0;for(let i=e-1,n=0;n80*r){a=c=t[0],l=h=t[1];for(let e=r;ec&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return Au(s,o,r,a,l,p,0),o}(r,i);for(let t=0;t2&&t[e-1].equals(t[0])&&t.pop()}function Gu(t,e){for(let r=0;rNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/u,f=e.y+o/u,m=((r.x-c/d-p)*c-(r.y+l/d-f)*l)/(o*c-a*l);i=p+o*m-t.x,n=f+a*m-t.y;const g=i*i+n*n;if(g<=2)return new ei(i,n);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?l>Number.EPSILON&&(t=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(i=-a,n=o,s=Math.sqrt(h)):(i=o,n=a,s=Math.sqrt(h/2))}return new ei(i/s,n/s)}const B=[];for(let t=0,e=S.length,r=e-1,i=t+1;t=0;t--){const e=t/p,r=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=S.length;t=0;){const i=r;let n=r-1;n<0&&(n=t.length-1);for(let t=0,r=a+2*p;t0)&&d.push(e,n,l),(t!==r-1||a0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class od extends rs{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new $n(16777215),this.specular=new $n(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K,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}}class ad extends rs{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new $n(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,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.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class ld extends rs{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),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.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class cd extends rs{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new $n(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K,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.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}}class hd extends rs{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new $n(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,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.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class ud extends hh{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}}function dd(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function pd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function fd(t){const e=t.length,r=new Array(e);for(let t=0;t!==e;++t)r[t]=t;return r.sort((function(e,r){return t[e]-t[r]})),r}function md(t,e,r){const i=t.length,n=new t.constructor(i);for(let s=0,o=0;o!==i;++s){const i=r[s]*e;for(let r=0;r!==e;++r)n[o++]=t[i+r]}return n}function gd(t,e,r,i){let n=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[n++];if(void 0===s)return;let o=s[i];if(void 0!==o)if(Array.isArray(o))do{o=s[i],void 0!==o&&(e.push(s.time),r.push.apply(r,o)),s=t[n++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[i],void 0!==o&&(e.push(s.time),o.toArray(r,r.length)),s=t[n++]}while(void 0!==s);else do{o=s[i],void 0!==o&&(e.push(s.time),r.push(o)),s=t[n++]}while(void 0!==s)}const Ad={convertArray:dd,isTypedArray:pd,getKeyframeOrder:fd,sortedArray:md,flattenJSON:gd,subclip:function(t,e,r,i,n=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t=i)){l.push(e.times[t]);for(let r=0;rs.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+a,e=t+l-a;d=i.values.slice(t,e)}else{const t=i.createInterpolant(),e=a,r=l-a;t.evaluate(s),d=t.resultBuffer.slice(e,r)}"quaternion"===n&&(new Pi).fromArray(d).normalize().conjugate().toArray(d);const p=o.times.length;for(let t=0;t=n)break t;{const o=e[1];t=n)break e}s=r,r=0}}for(;r>>1;te;)--s;if(++s,0!==n||s!==i){n>=s&&(s=Math.max(s,1),n=s-1);const t=this.getValueSize();this.times=r.slice(n,s),this.values=this.values.slice(n*t,s*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 r=this.times,i=this.values,n=r.length;0===n&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==n;e++){const i=r[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&pd(i))for(let e=0,r=i.length;e!==r;++e){const r=i[e];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,r),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Pe,n=t.length-1;let s=1;for(let o=1;o0){t[s]=t[n];for(let t=n*r,i=s*r,o=0;o!==r;++o)e[i+o]=e[t+o];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=e.slice(0,s*r)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),r=new(0,this.constructor)(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}_d.prototype.TimeBufferType=Float32Array,_d.prototype.ValueBufferType=Float32Array,_d.prototype.DefaultInterpolation=Le;class wd extends _d{}wd.prototype.ValueTypeName="bool",wd.prototype.ValueBufferType=Array,wd.prototype.DefaultInterpolation=Be,wd.prototype.InterpolantFactoryMethodLinear=void 0,wd.prototype.InterpolantFactoryMethodSmooth=void 0;class Ed extends _d{}Ed.prototype.ValueTypeName="color";class Md extends _d{}Md.prototype.ValueTypeName="number";class Sd extends yd{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){const n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(r-e)/(i-e);let l=t*o;for(let t=l+o;l!==t;l+=4)Pi.slerpFlat(n,0,s,l-o,s,l,a);return n}}class Cd extends _d{InterpolantFactoryMethodLinear(t){return new Sd(this.times,this.values,this.getValueSize(),t)}}Cd.prototype.ValueTypeName="quaternion",Cd.prototype.DefaultInterpolation=Le,Cd.prototype.InterpolantFactoryMethodSmooth=void 0;class Td extends _d{}Td.prototype.ValueTypeName="string",Td.prototype.ValueBufferType=Array,Td.prototype.DefaultInterpolation=Be,Td.prototype.InterpolantFactoryMethodLinear=void 0,Td.prototype.InterpolantFactoryMethodSmooth=void 0;class Id extends _d{}Id.prototype.ValueTypeName="vector";class Rd{constructor(t,e=-1,r,i=Ue){this.name=t,this.tracks=r,this.duration=e,this.blendMode=i,this.uuid=Wr(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],r=t.tracks,i=1/(t.fps||1);for(let t=0,n=r.length;t!==n;++t)e.push(Bd(r[t]).scale(i));const n=new this(t.name,t.duration,e,t.blendMode);return n.uuid=t.uuid,n}static toJSON(t){const e=[],r=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=r.length;t!==i;++t)e.push(_d.toJSON(r[t]));return i}static CreateFromMorphTargetSequence(t,e,r,i){const n=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(r)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,r));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(t,e,r,i,n){if(0!==r.length){const s=[],o=[];gd(r,s,o,i),0!==s.length&&n.push(new t(e,s,o))}},i=[],n=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(n),this.manager.itemEnd(t)}),0),n;if(void 0!==kd[t])return void kd[t].push({onLoad:e,onProgress:r,onError:i});kd[t]=[],kd[t].push({onLoad:e,onProgress:r,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const r=kd[t],i=e.body.getReader(),n=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=n?parseInt(n):0,o=0!==s;let a=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:n})=>{if(i)t.close();else{a+=n.byteLength;const i=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=r.length;t{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,o)));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),r=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(r);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{Ld.add(t,e);const r=kd[t];delete kd[t];for(let t=0,i=r.length;t{const r=kd[t];if(void 0===r)throw this.manager.itemError(t),e;delete kd[t];for(let t=0,i=r.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Fd extends Od{constructor(t){super(t)}load(t,e,r,i){const n=this,s=new Nd(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(r){try{e(n.parse(JSON.parse(r)))}catch(e){i?i(e):console.error(e),n.manager.itemError(t)}}),r,i)}parse(t){const e=[];for(let r=0;r0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const n=t.uniforms[e];switch(i.uniforms[e]={},n.type){case"t":i.uniforms[e].value=r(n.value);break;case"c":i.uniforms[e].value=(new $n).setHex(n.value);break;case"v2":i.uniforms[e].value=(new ei).fromArray(n.value);break;case"v3":i.uniforms[e].value=(new Di).fromArray(n.value);break;case"v4":i.uniforms[e].value=(new Mi).fromArray(n.value);break;case"m3":i.uniforms[e].value=(new ri).fromArray(n.value);break;case"m4":i.uniforms[e].value=(new un).fromArray(n.value);break;default:i.uniforms[e].value=n.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=r(t.map)),void 0!==t.matcap&&(i.matcap=r(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=r(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=r(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=r(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new ei).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=r(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=r(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=r(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=r(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=r(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=r(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=r(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=r(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=r(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=r(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=r(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=r(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=r(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=r(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new ei).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=r(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=r(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=r(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=r(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=r(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=r(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=r(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:rd,SpriteMaterial:nc,RawShaderMaterial:id,ShaderMaterial:to,PointsMaterial:bh,MeshPhysicalMaterial:sd,MeshStandardMaterial:nd,MeshPhongMaterial:od,MeshToonMaterial:ad,MeshNormalMaterial:ld,MeshLambertMaterial:cd,MeshDepthMaterial:Ul,MeshDistanceMaterial:Nl,MeshBasicMaterial:is,MeshMatcapMaterial:hd,LineDashedMaterial:ud,LineBasicMaterial:hh,Material:rs}[t]}}class up{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let r=0,i=t.length;r0){const r=new Pd(e);n=new Gd(r),n.setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e0){i=new Gd(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e{const e=new Ui;e.min.fromArray(t.boxMin),e.max.fromArray(t.boxMax);const r=new en;return r.radius=t.sphereRadius,r.center.fromArray(t.sphereCenter),{boxInitialized:t.boxInitialized,box:e,sphereInitialized:t.sphereInitialized,sphere:r}})),s._maxGeometryCount=t.maxGeometryCount,s._maxVertexCount=t.maxVertexCount,s._maxIndexCount=t.maxIndexCount,s._geometryInitialized=t.geometryInitialized,s._geometryCount=t.geometryCount,s._matricesTexture=h(t.matricesTexture.uuid);break;case"LOD":s=new _c;break;case"Line":s=new gh(l(t.geometry),c(t.material));break;case"LineLoop":s=new xh(l(t.geometry),c(t.material));break;case"LineSegments":s=new vh(l(t.geometry),c(t.material));break;case"PointCloud":case"Points":s=new Sh(l(t.geometry),c(t.material));break;case"Sprite":s=new yc(c(t.material));break;case"Group":s=new Vl;break;case"Bone":s=new Pc;break;default:s=new kn}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(s.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.quaternion&&s.quaternion.fromArray(t.quaternion),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.up&&s.up.fromArray(t.up),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(s.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(s.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(s.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&s.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(s.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.frustumCulled&&(s.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(s.renderOrder=t.renderOrder),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.layers&&(s.layers.mask=t.layers),void 0!==t.children){const o=t.children;for(let t=0;t0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(r,i,this._addIndex*e,1,e);for(let t=e,n=e+e;t!==n;++t)if(r[t]!==r[t+e]){o.setValue(r,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,r=this.valueSize,i=r*this._origIndex;t.getValue(e,i);for(let t=r,n=i;t!==n;++t)e[t]=e[i+t%r];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 r=t;r=.5)for(let i=0;i!==n;++i)t[e+i]=t[r+i]}_slerp(t,e,r,i){Pi.slerpFlat(t,e,t,e,t,r,i)}_slerpAdditive(t,e,r,i,n){const s=this._workIndex*n;Pi.multiplyQuaternionsFlat(t,s,t,e,t,r),Pi.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,r,i,n){const s=1-i;for(let o=0;o!==n;++o){const n=e+o;t[n]=t[n]*s+t[r+o]*i}}_lerpAdditive(t,e,r,i,n){for(let s=0;s!==n;++s){const n=e+s;t[n]=t[n]+t[r+s]*i}}}const Gp="\\[\\]\\.:\\/",Qp=new RegExp("["+Gp+"]","g"),jp="[^"+Gp+"]",Vp="[^"+Gp.replace("\\.","")+"]",Hp=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",jp)+/(WCOD+)?/.source.replace("WCOD",Vp)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",jp)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",jp)+"$"),Wp=["material","materials","bones","map"];class qp{constructor(t,e,r){this.path=e,this.parsedPath=r||qp.parseTrackName(e),this.node=qp.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,r){return t&&t.isAnimationObjectGroup?new qp.Composite(t,e,r):new qp(t,e,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Qp,"")}static parseTrackName(t){const e=Hp.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const r={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=r.nodeName.substring(i+1);-1!==Wp.indexOf(t)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=t)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const r=t.skeleton.getBoneByName(e);if(void 0!==r)return r}if(t.children){const r=function(t){for(let i=0;i=n){const s=n++,c=t[s];e[c.uuid]=l,t[l]=c,e[a]=s,t[s]=o;for(let t=0,e=i;t!==e;++t){const e=r[t],i=e[s],n=e[l];e[l]=i,e[s]=n}}}this.nCachedObjects_=n}uncache(){const t=this._objects,e=this._indicesByUUID,r=this._bindings,i=r.length;let n=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=e[a];if(void 0!==l)if(delete e[a],l0&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0,e=i;t!==e;++t){const e=r[t];e[l]=e[n],e.pop()}}}this.nCachedObjects_=n}subscribe_(t,e){const r=this._bindingsIndicesByPath;let i=r[t];const n=this._bindings;if(void 0!==i)return n[i];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);i=n.length,r[t]=i,s.push(t),o.push(e),n.push(h);for(let r=c,i=a.length;r!==i;++r){const i=a[r];h[r]=new qp(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){const i=this._paths,n=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=r,s[r]=a,s.pop(),n[r]=n[o],n.pop(),i[r]=i[o],i.pop()}}}class Yp{constructor(t,e,r=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=r,this.blendMode=i;const n=e.tracks,s=n.length,o=new Array(s),a={endingStart:De,endingEnd:De};for(let t=0;t!==s;++t){const e=n[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ie,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,r){if(t.fadeOut(e),this.fadeIn(e),r){const r=this._clip.duration,i=t._clip.duration,n=i/r,s=r/i;t.warp(1,n,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,r){return t.crossFadeFrom(this,e,r)}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,r){const i=this._mixer,n=i.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=n,a[1]=n+r,l[0]=t/s,l[1]=e/s,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,r,i){if(!this.enabled)return void this._updateWeight(t);const n=this._startTime;if(null!==n){const i=(t-n)*r;i<0||0===r?e=0:(this._startTime=null,e=r*i)}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===Ne)for(let r=0,i=t.length;r!==i;++r)t[r].evaluate(s),e[r].accumulateAdditive(o);else for(let r=0,n=t.length;r!==n;++r)t[r].evaluate(s),e[r].accumulate(i,o)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const r=this._weightInterpolant;if(null!==r){const i=r.evaluate(t)[0];e*=i,t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,r=this.loop;let i=this.time+t,n=this._loopCount;const s=r===Re;if(0===t)return-1===n?i:s&&1==(1&n)?e-i:i;if(r===Te){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===n&&(t>=0?(n=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const r=Math.floor(i/e);i-=e*r,n+=Math.abs(r);const o=this.repetitions-n;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=n,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=i;if(s&&1==(1&n))return e-i}return i}_setEndings(t,e,r){const i=this._interpolantSettings;r?(i.endingStart=Oe,i.endingEnd=Oe):(i.endingStart=t?this.zeroSlopeAtStart?Oe:De:ke,i.endingEnd=e?this.zeroSlopeAtEnd?Oe:De:ke)}_scheduleFading(t,e,r){const i=this._mixer,n=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=n,a[0]=e,o[1]=n+t,a[1]=r,this}}const Xp=new Float32Array(1);class Jp extends Gr{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,s=t._propertyBindings,o=t._interpolants,a=r.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==n;++t){const n=i[t],l=n.name;let h=c[l];if(void 0!==h)++h.referenceCount,s[t]=h;else{if(h=s[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;h=new zp(qp.create(r,l,i),n.ValueTypeName,n.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[t]=h}o[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,r=t._clip.uuid,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}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=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==r;++o)e[o]._update(i,t,n,s);const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.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.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,cf).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)}}const uf=new Di,df=new Di;class pf{constructor(t=new Di,e=new Di){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){uf.subVectors(t,this.start),df.subVectors(this.end,this.start);const r=df.dot(df);let i=df.dot(uf)/r;return e&&(i=qr(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)}}const ff=new Di;class mf extends kn{constructor(t,e){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const r=new Is,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,r=32;t1)for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{zf.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(zf,e)}}setLength(t,e=.2*t,r=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Vf extends vh{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],r=new Is;r.setAttribute("position",new xs(e,3)),r.setAttribute("color",new xs([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(r,new hh({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,r){const i=new $n,n=this.geometry.attributes.color.array;return i.set(t),i.toArray(n,0),i.toArray(n,3),i.set(e),i.toArray(n,6),i.toArray(n,9),i.set(r),i.toArray(n,12),i.toArray(n,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Hf{constructor(){this.type="ShapePath",this.color=new $n,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new eu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const r=e.length;let i=!1;for(let n=r-1,s=0;sNumber.EPSILON){if(l<0&&(r=e[s],a=-a,o=e[n],l=-l),t.yo.y)continue;if(t.y===r.y){if(t.x===r.x)return!0}else{const e=l*(t.x-r.x)-a*(t.y-r.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==r.y)continue;if(o.x<=t.x&&t.x<=r.x||r.x<=t.x&&t.x<=o.x)return!0}}return i}const r=Fu.isClockWise,i=this.subPaths;if(0===i.length)return[];let n,s,o;const a=[];if(1===i.length)return s=i[0],o=new fu,o.curves=s.curves,a.push(o),a;let l=!r(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let e=0,o=i.length;e1){let t=!1,r=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t{if(!r){var o=1/0;for(h=0;h=s)&&Object.keys(i.O).every((t=>i.O[t](r[l])))?r.splice(l--,1):(a=!1,s0&&t[h-1][2]>s;h--)t[h]=t[h-1];t[h]=[r,n,s]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={764:0};i.O.j=e=>0===t[e];var e=(e,r)=>{var n,s,[o,a,l]=r,c=0;if(o.some((e=>0!==t[e]))){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(l)var h=l(i)}for(e&&e(r);c(()=>{var t,e={75550:t=>{"use strict";function e(t,e){this.x=t,this.y=e}t.exports=e,e.prototype={clone:function(){return new e(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),i=e*this.x-r*this.y,n=r*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.x+r*(this.x-e.x)-i*(this.y-e.y),s=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=n,this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t}},38929:(t,e,r)=>{t.exports.VectorTile=r(22779),r(66024),r(59701)},22779:(t,e,r)=>{"use strict";var i=r(59701);function n(t,e,r){if(3===t){var n=new i(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}t.exports=function(t,e){this.layers=t.readFields(n,{},e)}},66024:(t,e,r)=>{"use strict";var i=r(75550);function n(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(s,this,e)}function s(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos>3}if(s--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new i(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,s=0,o=1/0,a=-1/0,l=1/0,c=-1/0;t.pos>3}if(i--,1===r||2===r)(n+=t.readSVarint())a&&(a=n),(s+=t.readSVarint())c&&(c=s);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,a,c]},n.prototype.toGeoJSON=function(t,e,r){var i,s,a=this.extent*Math.pow(2,r),l=this.extent*t,c=this.extent*e,h=this.loadGeometry(),u=n.types[this.type];function d(t){for(var e=0;e{"use strict";var i=r(66024);function n(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(s,this,e),this.length=this._features.length}function s(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(r))}t.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new i(this._pbf,e,this.extent,this._keys,this._values)}},36194:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>y});var i,n={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-n.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*n.Bounce.In(2*t):.5*n.Bounce.Out(2*t-1)+.5}}},s="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},o=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=s()),void 0===e&&(e=!1);var r=Object.keys(this._tweens);if(0===r.length)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i1?s(t[r],t[r-1],r-i):s(t[n],t[n+1>r?r:n+1],i-n)},Bezier:function(t,e){for(var r=0,i=t.length-1,n=Math.pow,s=a.Utils.Bernstein,o=0;o<=i;o++)r+=n(1-e,i-o)*n(e,o)*t[o]*s(i,o);return r},CatmullRom:function(t,e){var r=t.length-1,i=r*e,n=Math.floor(i),s=a.Utils.CatmullRom;return t[0]===t[r]?(e<0&&(n=Math.floor(i=r*(1+e))),s(t[(n-1+r)%r],t[n],t[(n+1)%r],t[(n+2)%r],i-n)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[r]-(s(t[r],t[r],t[r-1],t[r-1],i-r)-t[r]):s(t[n?n-1:0],t[n],t[r1;r--)e*=r;return i[t]=e,e}),CatmullRom:function(t,e,r,i,n){var s=.5*(r-t),o=.5*(i-e),a=n*n;return(2*e-2*r+s+o)*(n*a)+(-3*e+3*r-2*s-o)*a+s*n+e}}},l=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),c=new o,h=function(){function t(t,e){void 0===e&&(e=c),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=n.Linear.None,this._interpolationFunction=a.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=l.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?s()+parseFloat(t):t:s(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,r,i){for(var n in r){var s=t[n],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(r[n]);if("undefined"!==a&&"function"!==a){if(l){var c=r[n];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,s)),r[n]=[s].concat(c)}if("object"!==a&&!o||!s||l)void 0===e[n]&&(e[n]=s),o||(e[n]*=1),i[n]=l?r[n].slice().reverse():e[n]||0;else{for(var h in e[n]=o?[]:{},s)e[n][h]=s[h];i[n]=o?[]:{},this._setupProperties(s,e[n],r[n],i[n])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=s()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=s()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;tn)return!1;e&&this.start(t)}if(this._goToEnd=!1,t1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(r in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,l=this._chainedTweens.length;a{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],i=e[1];return 3*(r+i)/4-i},e.toByteArray=function(t){var e,r,s=a(t),o=s[0],l=s[1],c=new n(function(t,e,r){return 3*(e+r)/4-r}(0,o,l)),h=0,u=l>0?o-4:o;for(r=0;r>16&255,c[h++]=e>>8&255,c[h++]=255&e;return 2===l&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,c[h++]=255&e),1===l&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,c[h++]=e>>8&255,c[h++]=255&e),c},e.fromByteArray=function(t){for(var e,i=t.length,n=i%3,s=[],o=16383,a=0,c=i-n;ac?c:a+o));return 1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,i){for(var n,s,o=[],a=e;a>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},48764:(t,e,r)=>{"use strict";var i=r(79742),n=r(80645),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=l,e.h2=50;var o=2147483647;function a(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,l.prototype),e}function l(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return u(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|m(t,e),i=a(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}(t,e);if(ArrayBuffer.isView(t))return function(t){if(G(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(G(t,ArrayBuffer)||t&&G(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(G(t,SharedArrayBuffer)||t&&G(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return l.from(i,e,r);var n=function(t){if(l.isBuffer(t)){var e=0|f(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Q(t.length)?a(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return l.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function u(t){return h(t),a(t<0?0:0|f(t))}function d(t){for(var e=t.length<0?0:0|f(t.length),r=a(e),i=0;i=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function m(t,e){if(l.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||G(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(t).length;default:if(n)return i?-1:N(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function A(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function y(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=l.from(e,i)),l.isBuffer(e))return 0===e.length?-1:v(t,e,r,i,n);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,i,n){var s,o=1,a=t.length,l=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var h=-1;for(s=r;sa&&(r=a-l),s=r;s>=0;s--){for(var u=!0,d=0;dn&&(i=n):i=n;var s=e.length;i>s/2&&(i=s/2);for(var o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function M(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;n239?4:c>223?3:c>191?2:1;if(n+u<=r)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=t[n+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=u}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);for(var r="",i=0;ii.length?l.from(s).copy(i,n):Uint8Array.prototype.set.call(i,s,n);else{if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n)}n+=s.length}return i},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(t,e,r,i,n){if(G(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),e<0||r>t.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&e>=r)return 0;if(i>=n)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(i,n),h=t.slice(e,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(t,e,r){var i="";r=Math.min(t.length,r);for(var n=e;ni)&&(r=i);for(var n="",s=e;sr)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,i,n,s){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function D(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function k(t,e,r,i,s){return e=+e,r>>>=0,s||D(t,0,r,8),n.write(t,e,r,i,52,8),r+8}l.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t],n=1,s=0;++s>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t+--e],n=1;e>0&&(n*=256);)i+=this[t+--e]*n;return i},l.prototype.readUint8=l.prototype.readUInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),this[t]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(t,e){return t>>>=0,e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var i=this[t],n=1,s=0;++s=(n*=128)&&(i-=Math.pow(2,8*e)),i},l.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||L(t,e,this.length);for(var i=e,n=1,s=this[t+--i];i>0&&(n*=256);)s+=this[t+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},l.prototype.readInt8=function(t,e){return t>>>=0,e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(t,e){t>>>=0,e||L(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return t>>>=0,e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return t>>>=0,e||L(t,4,this.length),n.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return t>>>=0,e||L(t,8,this.length),n.read(this,t,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(t,e,r,i){t=+t,e>>>=0,r>>>=0,i||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[e]=255&t;++s>>=0,r>>>=0,i||P(this,t,e,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[e+n]=255&t;--n>=0&&(s*=256);)this[e+n]=t/s&255;return e+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeIntLE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,i){if(t=+t,e>>>=0,!i){var n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}var s=r-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},l.prototype.writeFloatLE=function(t,e,r){return O(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return O(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return k(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return k(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,i){if(!l.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function F(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,i){for(var n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function G(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Q(t){return t!=t}var j=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)e[i+n]=t[r]+t[n];return e}()},94629:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hierarchyItemLength=e.infoLength=void 0,e.infoLength=160,e.hierarchyItemLength=32},73156: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Copc=void 0;const o=s(r(81693)),a=r(26115),l=r(52277),c=r(53216);async function h(t,{pointDataRecordFormat:e,pointDataRecordLength:r},i,n){const s=await async function(t,{pointDataOffset:e,pointDataLength:r}){return a.Getter.create(t)(e,e+r)}(t,i),{pointCount:l}=i;return o.PointData.decompressChunk(s,{pointCount:l,pointDataRecordFormat:e,pointDataRecordLength:r},n)}e.Copc={create:async function(t){const e=a.Getter.create(t),r=e(0,65536);async function i(t,i){return i>=65536?e(t,i):(await r).slice(t,i)}const n=o.Header.parse(await i(0,o.Constants.minHeaderLength)),s=await o.Vlr.walk(i,n),l=o.Vlr.find(s,"copc",1);if(!l)throw new Error("COPC info VLR is required");const h=c.Info.parse(await o.Vlr.fetch(i,l));let u;const d=o.Vlr.find(s,"LASF_Projection",2112);d&&d.contentLength&&(u=a.Binary.toCString(await o.Vlr.fetch(i,d)),""===u&&(u=void 0));let p=[];const f=o.Vlr.find(s,"LASF_Spec",4);return f&&(p=o.ExtraBytes.parse(await o.Vlr.fetch(i,f))),{header:n,vlrs:s,info:h,wkt:u,eb:p}},loadHierarchyPage:async function(t,e){const r=a.Getter.create(t);return l.Hierarchy.load(r,e)},loadPointDataBuffer:h,loadPointDataView:async function(t,e,r,{lazPerf:i,include:n}={}){const s=await h(t,e.header,r,i);return o.View.create(s,e.header,e.eb,n)}}},52277:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hierarchy=void 0;const i=r(26115),n=r(94629);function s(t){const e=i.Binary.toDataView(t);if(e.byteLength%n.hierarchyItemLength!=0)throw new Error(`Invalid hierarchy page length: ${e.byteLength}`);const r={},s={};for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Info=void 0;const i=r(26115),n=r(94629);e.Info={parse:function(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.infoLength)throw new Error(`Invalid COPC info VLR length (should be ${n.infoLength}): ${e.byteLength}`);const r=[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)],s=e.getFloat64(24,!0);return{cube:[r[0]-s,r[1]-s,r[2]-s,r[0]+s,r[1]+s,r[2]+s],spacing:e.getFloat64(32,!0),rootHierarchyPage:{pageOffset:(0,i.parseBigInt)((0,i.getBigUint64)(e,40,!0)),pageLength:(0,i.parseBigInt)((0,i.getBigUint64)(e,48,!0))},gpsTimeRange:[e.getFloat64(56,!0),e.getFloat64(64,!0)]}}}},44975:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},98212:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hierarchy=void 0,e.Hierarchy={parse:function(t){return Object.entries(t).reduce(((t,[e,r])=>(-1===r?t.pages[e]={}:r&&(t.nodes[e]={pointCount:r}),t)),{nodes:{},pages:{}})}}},66329: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(44975),e),n(r(98212),e)},37830: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e},o=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.Las=e.Ept=void 0,e.Ept=s(r(66329)),o(r(68750),e),e.Las=s(r(81693)),o(r(26115),e)},50755:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.evlrHeaderLength=e.vlrHeaderLength=e.minHeaderLength=void 0,e.minHeaderLength=375,e.vlrHeaderLength=54,e.evlrHeaderLength=60},14953:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dimensions=void 0;const i=r(26115),n=r(6125);e.Dimensions={create:function(t,e=[]){return Object.keys(t).reduce(((t,r)=>{const i=o[r];if(i)return{...t,[r]:i};const s=e.find((t=>t.name===r)),a=s&&n.ExtraBytes.getDimension(s);if(a)return{...t,[r]:a};throw new Error(`Failed to look up LAS type: ${r}`)}),{})}};const{Type:s}=i.Dimension,o={X:s.float64,Y:s.float64,Z:s.float64,Intensity:s.uint16,ReturnNumber:s.uint8,NumberOfReturns:s.uint8,ScanDirectionFlag:s.boolean,EdgeOfFlightLine:s.boolean,Classification:s.uint8,Synthetic:s.boolean,KeyPoint:s.boolean,Withheld:s.boolean,Overlap:s.boolean,ScanAngle:s.float32,UserData:s.uint8,PointSourceId:s.uint16,GpsTime:s.float64,Red:s.uint16,Green:s.uint16,Blue:s.uint16,ScannerChannel:s.uint8,Infrared:s.uint16}},6125:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtraBytes=void 0;const i=r(26115);e.ExtraBytes={getDimension:function({type:t,length:e}){switch(t){case"signed":case"unsigned":switch(e){case 1:case 2:case 4:case 8:return{type:t,size:e}}case"float":switch(e){case 4:case 8:return{type:t,size:e}}}},parse:function(t){if(t.byteLength%n!=0)throw new Error(`Invalid extra bytes VLR length: ${t.byteLength}`);const e=[];for(let r=0;r=11)throw new Error(`Invalid extra bytes "type" value: ${o}`);if(0===o)return{name:r,description:s,length:a};const l=(c=a,{hasNodata:Boolean(1&c),hasMin:Boolean(c>>1&1),hasMax:Boolean(c>>2&1),hasScale:Boolean(c>>3&1),hasOffset:Boolean(c>>4&1)});var c;const h=function(t){switch(t){case 1:return i.Dimension.Type.uint8;case 2:return i.Dimension.Type.int8;case 3:return i.Dimension.Type.uint16;case 4:return i.Dimension.Type.int16;case 5:return i.Dimension.Type.uint32;case 6:return i.Dimension.Type.int32;case 7:return i.Dimension.Type.uint64;case 8:return i.Dimension.Type.int64;case 9:return i.Dimension.Type.float32;case 10:return i.Dimension.Type.float64}}(o);if(!h)throw new Error(`Failed to extract dimension type: ${o}`);const{type:u,size:d}=h;function p(t){switch(u){case"signed":return(0,i.parseBigInt)(e.getBigInt64(t,!0));case"unsigned":return(0,i.parseBigInt)((0,i.getBigUint64)(e,t,!0));case"float":return e.getFloat64(t,!0)}}const f={name:r,description:s,type:u,length:d};return l.hasNodata&&(f.nodata=p(40)),l.hasMin&&(f.min=p(64)),l.hasMax&&(f.max=p(88)),l.hasScale&&(f.scale=e.getFloat64(112)),l.hasOffset&&(f.offset=e.getFloat64(136)),f}},29032:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Extractor=void 0;const i=r(26115);function n(t){const{scale:e,offset:r}=t,n=a(t);function s(t,e){return t.getUint8(n(e)+14)}function o(t,e){return t.getUint8(n(e)+15)}function l(t,e){return 31&o(t,e)}return{X:(t,s)=>i.Scale.unapply(t.getInt32(n(s),!0),e[0],r[0]),Y:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+4,!0),e[1],r[1]),Z:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+8,!0),e[2],r[2]),Intensity:(t,e)=>t.getUint16(n(e)+12,!0),ReturnNumber:(t,e)=>7&s(t,e),NumberOfReturns:(t,e)=>(56&s(t,e))>>3,ScanDirectionFlag:(t,e)=>(64&s(t,e))>>6,EdgeOfFlightLine:(t,e)=>(128&s(t,e))>>7,Classification:(t,e)=>{const r=l(t,e);return 12===r?0:r},Synthetic:(t,e)=>(32&o(t,e))>>5,KeyPoint:(t,e)=>(64&o(t,e))>>6,Withheld:(t,e)=>(128&o(t,e))>>7,Overlap:(t,e)=>12===l(t,e)?1:0,ScanAngle:(t,e)=>t.getInt8(n(e)+16),UserData:(t,e)=>t.getUint8(n(e)+17),PointSourceId:(t,e)=>t.getUint16(n(e)+18,!0)}}function s(t){const{scale:e,offset:r}=t,n=a(t);function s(t,e){return t.getUint8(n(e)+15)}return{X:(t,s)=>i.Scale.unapply(t.getInt32(n(s),!0),e[0],r[0]),Y:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+4,!0),e[1],r[1]),Z:(t,s)=>i.Scale.unapply(t.getInt32(n(s)+8,!0),e[2],r[2]),Intensity:(t,e)=>t.getUint16(n(e)+12,!0),ReturnNumber:(t,e)=>15&t.getUint16(n(e)+14,!0),NumberOfReturns:(t,e)=>(240&t.getUint16(n(e)+14,!0))>>4,Synthetic:(t,e)=>1&s(t,e),KeyPoint:(t,e)=>(2&s(t,e))>>1,Withheld:(t,e)=>(4&s(t,e))>>2,Overlap:(t,e)=>(8&s(t,e))>>3,ScannerChannel:(t,e)=>(48&s(t,e))>>4,ScanDirectionFlag:(t,e)=>(64&s(t,e))>>6,EdgeOfFlightLine:(t,e)=>(128&s(t,e))>>7,Classification:(t,e)=>t.getUint8(n(e)+16),UserData:(t,e)=>t.getUint8(n(e)+17),ScanAngle:(t,e)=>.006*t.getInt16(n(e)+18,!0),PointSourceId:(t,e)=>t.getUint16(n(e)+20,!0),GpsTime:(t,e)=>t.getFloat64(n(e)+22,!0)}}function o(t){const e=a(t);return{...s(t),Red:(t,r)=>t.getUint16(e(r)+30,!0),Green:(t,r)=>t.getUint16(e(r)+32,!0),Blue:(t,r)=>t.getUint16(e(r)+34,!0)}}function a(t){const{pointDataRecordLength:e}=t;return function(t){return t*e}}e.Extractor={create:function(t,e=[]){const r=function(t,e){let r=function(t){switch(t){case 0:return 20;case 1:return 28;case 2:return 26;case 3:return 34;case 6:return 30;case 7:return 36;case 8:return 38;default:throw new Error(`Unsupported point data record format: ${t}`)}}(t.pointDataRecordFormat);return e.reduce(((e,n)=>{const s=r;r+=n.length;const o=function(t,e,{type:r,length:n}){const s=a(t);switch(r){case"signed":switch(n){case 1:return(t,r)=>t.getInt8(s(r)+e);case 2:return(t,r)=>t.getInt16(s(r)+e,!0);case 4:return(t,r)=>t.getInt32(s(r)+e,!0);case 8:return(t,r)=>(0,i.parseBigInt)(t.getBigInt64(s(r)+e,!0))}case"unsigned":switch(n){case 1:return(t,r)=>t.getUint8(s(r)+e);case 2:return(t,r)=>t.getUint16(s(r)+e,!0);case 4:return(t,r)=>t.getUint32(s(r)+e,!0);case 8:return(t,r)=>(0,i.parseBigInt)((0,i.getBigUint64)(t,s(r)+e,!0))}case"float":switch(n){case 4:return(t,r)=>t.getFloat32(s(r)+e,!0);case 8:return(t,r)=>t.getFloat64(s(r)+e,!0)}}}(t,s,n);if(!o)return e;return{...e,[n.name]:(t,e)=>i.Scale.unapply(o(t,e),n.scale,n.offset)}}),{})}(t,e);return{...(()=>{const{pointDataRecordFormat:e}=t;switch(e){case 0:return n(t);case 1:return function(t){const e=a(t);return{...n(t),GpsTime:(t,r)=>t.getFloat64(e(r)+20,!0)}}(t);case 2:return function(t){const e=a(t);return{...n(t),Red:(t,r)=>t.getUint16(e(r)+20,!0),Green:(t,r)=>t.getUint16(e(r)+22,!0),Blue:(t,r)=>t.getUint16(e(r)+24,!0)}}(t);case 3:return function(t){const e=a(t);return{...n(t),GpsTime:(t,r)=>t.getFloat64(e(r)+20,!0),Red:(t,r)=>t.getUint16(e(r)+28,!0),Green:(t,r)=>t.getUint16(e(r)+30,!0),Blue:(t,r)=>t.getUint16(e(r)+32,!0)}}(t);case 6:return s(t);case 7:return o(t);case 8:return function(t){const e=a(t);return{...o(t),Infrared:(t,r)=>t.getUint16(e(r)+36,!0)}}(t);default:throw new Error(`Unsupported point data record format: ${e}`)}})(),...r}}}},73651:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Header=void 0;const i=r(26115),n=r(50755),s=r(64267);function o(t){const e=i.Binary.toDataView(t),r=[];for(let t=0;t<120;t+=8)r.push((0,i.getBigUint64)(e,t,!0));return r.map((t=>(0,i.parseBigInt)(t)))}function a(t){const e=i.Binary.toDataView(t),r=[];for(let t=0;t<20;t+=4)r.push(e.getUint32(t,!0));return r}e.Header={parse:function(t){if(t.byteLength{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decompressFile=e.decompressChunk=e.PointData=void 0;const i=r(42622),n=r(73651);let s;async function o(t){return t||(s||(s=(0,i.createLazPerf)()),s)}async function a(t,{pointCount:e,pointDataRecordFormat:r,pointDataRecordLength:i},n){const s=await o(n),a=new Uint8Array(e*i),l=s._malloc(t.byteLength),c=s._malloc(i),h=new s.ChunkDecoder;try{s.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),l),h.open(r,i,l);for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatGuid=e.parsePoint=void 0;const i=r(26115);e.parsePoint=function(t){const e=i.Binary.toDataView(t);if(24!==e.byteLength)throw new Error(`Invalid tuple buffer length: ${e.byteLength}`);return[e.getFloat64(0,!0),e.getFloat64(8,!0),e.getFloat64(16,!0)]},e.formatGuid=function(t){const e=i.Binary.toDataView(t);if(16!==e.byteLength)throw new Error(`Invalid GUID buffer length: ${e.byteLength}`);let r="";for(let t=0;t{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.View=void 0;const i=r(26115),n=r(14953),s=r(29032);e.View={create:function(t,e,r=[],o){let a=s.Extractor.create(e,r);if(o){const t=new Set([...o]);a=Object.entries(a).reduce(((e,[r,i])=>(t.has(r)&&(e[r]=i),e)),{})}const l=n.Dimensions.create(a,r),c=i.Binary.toDataView(t),h=e.pointDataRecordLength;if(c.byteLength%h!=0)throw new Error(`Invalid buffer length (${c.byteLength}) for point length ${h}`);const u=c.byteLength/e.pointDataRecordLength;return{pointCount:u,dimensions:l,getter:function(t){const e=a[t];if(!e)throw new Error(`No extractor for dimension: ${t}`);return function(t){if(t>=u)throw new RangeError(`View index (${t}) out of range: ${u}`);return e(c,t)}}}}}},79687:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Vlr=void 0;const i=r(26115),n=r(50755);function s(t,e,r){return t.find((t=>t.userId===e&&t.recordId===r))}function o(t,e){return(e?l:a)(t)}function a(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.vlrHeaderLength)throw new Error(`Invalid VLR header length (must be ${n.vlrHeaderLength}): ${e.byteLength}`);return{userId:i.Binary.toCString(t.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:e.getUint16(20,!0),description:i.Binary.toCString(t.slice(22,54)),isExtended:!1}}function l(t){const e=i.Binary.toDataView(t);if(e.byteLength!==n.evlrHeaderLength)throw new Error(`Invalid EVLR header length (must be ${n.evlrHeaderLength}): ${e.byteLength}`);return{userId:i.Binary.toCString(t.slice(2,18)),recordId:e.getUint16(18,!0),contentLength:(0,i.parseBigInt)((0,i.getBigUint64)(e,20,!0)),description:i.Binary.toCString(t.slice(28,60)),isExtended:!0}}async function c({get:t,startOffset:e,count:r,isExtended:i}){const s=[];let a=e;const l=i?n.evlrHeaderLength:n.vlrHeaderLength;for(let e=0;e{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBigUint64=e.parseBigInt=void 0,e.parseBigInt=function(t){if(t>BigInt(Number.MAX_SAFE_INTEGER)||t{"use strict";function r(t){return new DataView(t.buffer,t.byteOffset,t.length)}function i(t){const e=r(t);let i="";for(let t=0;t{"use strict";function r([t,e,r,i,n,s]){return[t+(i-t)/2,e+(n-e)/2,r+(s-r)/2]}function i(t){return t[3]-t[0]}function n(t){return t[4]-t[1]}function s(t){return t[5]-t[2]}function o(t,[e,i,n]){const[s,o,a,l,c,h]=t,[u,d,p]=r(t);return[e?u:s,i?d:o,n?p:a,e?l:u,i?c:d,n?h:p]}Object.defineProperty(e,"__esModule",{value:!0}),e.Bounds=void 0,e.Bounds={min:function(t){return[t[0],t[1],t[2]]},max:function(t){return[t[3],t[4],t[5]]},mid:r,width:i,depth:n,height:s,cube:function(t){const e=r(t),o=Math.max(i(t),n(t),s(t))/2;return[e[0]-o,e[1]-o,e[2]-o,e[0]+o,e[1]+o,e[2]+o]},step:o,stepTo:function(t,[e,r,i,n]){for(let s=e-1;s>=0;--s)t=o(t,[r>>s&1,i>>s&1,n>>s&1]);return t},intersection:function(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1]),Math.max(t[2],e[2]),Math.min(t[3],e[3]),Math.min(t[4],e[4]),Math.min(t[5],e[5])]}}},15882:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dimension=void 0,e.Dimension={Type:{int8:{type:"signed",size:1},int16:{type:"signed",size:2},int32:{type:"signed",size:4},int64:{type:"signed",size:8},uint8:{type:"unsigned",size:1},uint16:{type:"unsigned",size:2},uint32:{type:"unsigned",size:4},uint64:{type:"unsigned",size:8},float32:{type:"float",size:4},float64:{type:"float",size:8},float:{type:"float",size:4},double:{type:"float",size:8},bool:{type:"unsigned",size:1},boolean:{type:"unsigned",size:1}},ctype:function({type:t,size:e}){switch(t){case"signed":switch(e){case 1:return"int8";case 2:return"int16";case 4:return"int32";case 8:return"int64"}case"unsigned":switch(e){case 1:return"uint8";case 2:return"uint16";case 4:return"uint32";case 8:return"uint64"}case"float":switch(e){case 4:return"float";case 8:return"double"}}throw new Error(`Invalid dimension type/size: ${t}/${e}`)}}},28732: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.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return n(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Getter=void 0;const a=o(r(86747));function l(t){return async function(e,r){if(e<0||r<0||e>r)throw new Error("Invalid range");const i=await(0,a.default)(t,{headers:{Range:`bytes=${e}-${r-1}`}}),n=await i.arrayBuffer();return new Uint8Array(n)}}function c(t){return async function(e,i){const n=await Promise.resolve().then((()=>s(r(78963))));return async function(e=0,r=1/0){if(e<0||r<0||e>r)throw new Error("Invalid range");return await n.promises.access(t),async function(t){return await new Promise(((e,r)=>{const i=[];t.on("data",(t=>i.push(t))),t.on("error",r),t.on("end",(()=>e(Buffer.concat(i))))}))}(n.createReadStream(t,{start:e,end:r-1,autoClose:!0}))}(e,i)}}e.Getter={create:function(t){return"function"==typeof t?t:t.startsWith("http://")||t.startsWith("https://")?l(t):c(t)},http:l,file:c}},26115: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.Step=e.Scale=e.Key=e.Getter=e.Dimension=e.Bounds=e.Binary=void 0,n(r(51877),e);var s=r(16467);Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return s.Binary}});var o=r(45314);Object.defineProperty(e,"Bounds",{enumerable:!0,get:function(){return o.Bounds}});var a=r(15882);Object.defineProperty(e,"Dimension",{enumerable:!0,get:function(){return a.Dimension}});var l=r(28732);Object.defineProperty(e,"Getter",{enumerable:!0,get:function(){return l.Getter}});var c=r(49479);Object.defineProperty(e,"Key",{enumerable:!0,get:function(){return c.Key}});var h=r(50350);Object.defineProperty(e,"Scale",{enumerable:!0,get:function(){return h.Scale}});var u=r(96784);Object.defineProperty(e,"Step",{enumerable:!0,get:function(){return u.Step}})},49479:(t,e)=>{"use strict";function r(t){if("string"!=typeof t)return t;const[e,r,i,n,...s]=t.split("-").map((t=>parseInt(t,10))),o=[e,r,i,n];if(0!==s.length||o.some((t=>"number"!=typeof t||Number.isNaN(t))))throw new Error(`Invalid key: ${t}`);return o}Object.defineProperty(e,"__esModule",{value:!0}),e.Key=void 0,e.Key={create:function(t,e=0,i=0,n=0){return"number"!=typeof t?r(t):[t,e,i,n]},parse:r,toString:function(t){return"string"==typeof t?t:t.join("-")},step:function(t,[r,i,n]){const[s,o,a,l]=e.Key.create(t);return[s+1,2*o+r,2*a+i,2*l+n]},up:function(t,r=1){const[i,n,s,o]=e.Key.create(t);return[i-r,n>>r,s>>r,o>>r]},compare:function(t,e){for(let r=0;re[r])return 1}return 0},depth:function(t){return t[0]}}},50350:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scale=void 0,e.Scale={apply:(t,e=1,r=0)=>(t-r)/e,unapply:(t,e=1,r=0)=>t*e+r}},96784:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Step=void 0,e.Step={fromIndex:function(t){if(t<0||t>=8)throw new Error(`Invalid step index: ${t}`);return[t>>0&1?1:0,t>>1&1?1:0,t>>2&1?1:0]},list:function(){return[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]}}},86747:function(t,e){var r="undefined"!=typeof self?self:this,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,i="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),s="FormData"in t,o="ArrayBuffer"in t;if(o)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function m(t){var e=new FileReader,r=f(e);return e.readAsArrayBuffer(t),r}function g(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:s&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o&&n&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=g(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=g(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var t,e,r,i=p(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,r=f(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),i=0;i-1?i:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function x(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(n))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},A.call(v.prototype),A.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];b.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function w(t,r){return new Promise((function(i,s){var o=new v(t,r);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();e.append(i,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new b(n,r))},a.onerror=function(){s(new TypeError("Network request failed"))},a.ontimeout=function(){s(new TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",l)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}w.polyfill=!0,t.fetch||(t.fetch=w,t.Headers=d,t.Request=v,t.Response=b),e.Headers=d,e.Request=v,e.Response=b,e.fetch=w,Object.defineProperty(e,"__esModule",{value:!0})}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e},9187:t=>{"use strict";function e(t,e,i){i=i||2;var s,o,a,l,u,d,f,m=e&&e.length,g=m?e[0]*i:t.length,A=r(t,0,g,i,!0),y=[];if(!A||A.next===A.prev)return y;if(m&&(A=function(t,e,i,n){var s,o,a,l=[];for(s=0,o=e.length;s80*i){s=a=t[0],o=l=t[1];for(var v=i;va&&(a=u),d>l&&(l=d);f=0!==(f=Math.max(a-s,l-o))?32767/f:0}return n(A,y,i,s,o,f,0),y}function r(t,e,r,i,n){var s,o;if(n===S(t,e,r,i)>0)for(s=e;s=e;s-=i)o=w(s,t[s],t[s+1],o);return o&&A(o,o.next)&&(E(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!A(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(E(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function n(t,e,r,c,h,u,p){if(t){!p&&u&&function(t,e,r,i){var n=t;do{0===n.z&&(n.z=d(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){var e,r,i,n,s,o,a,l,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(o>1)}(n)}(t,c,h,u);for(var f,m,g=t;t.prev!==t.next;)if(f=t.prev,m=t.next,u?o(t,c,h,u):s(t))e.push(f.i/r|0),e.push(t.i/r|0),e.push(m.i/r|0),E(t),t=m.next,g=m.next;else if((t=m)===g){p?1===p?n(t=a(i(t),e,r),e,r,c,h,u,2):2===p&&l(t,e,r,c,h,u):n(i(t),e,r,c,h,u,1);break}}}function s(t){var e=t.prev,r=t,i=t.next;if(g(e,r,i)>=0)return!1;for(var n=e.x,s=r.x,o=i.x,a=e.y,l=r.y,c=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c,m=i.next;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&f(n,a,s,l,o,c,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,r,i){var n=t.prev,s=t,o=t.next;if(g(n,s,o)>=0)return!1;for(var a=n.x,l=s.x,c=o.x,h=n.y,u=s.y,p=o.y,m=al?a>c?a:c:l>c?l:c,v=h>u?h>p?h:p:u>p?u:p,x=d(m,A,e,r,i),b=d(y,v,e,r,i),_=t.prevZ,w=t.nextZ;_&&_.z>=x&&w&&w.z<=b;){if(_.x>=m&&_.x<=y&&_.y>=A&&_.y<=v&&_!==n&&_!==o&&f(a,h,l,u,c,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,w.x>=m&&w.x<=y&&w.y>=A&&w.y<=v&&w!==n&&w!==o&&f(a,h,l,u,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;_&&_.z>=x;){if(_.x>=m&&_.x<=y&&_.y>=A&&_.y<=v&&_!==n&&_!==o&&f(a,h,l,u,c,p,_.x,_.y)&&g(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;w&&w.z<=b;){if(w.x>=m&&w.x<=y&&w.y>=A&&w.y<=v&&w!==n&&w!==o&&f(a,h,l,u,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function a(t,e,r){var n=t;do{var s=n.prev,o=n.next.next;!A(s,o)&&y(s,n,n.next,o)&&b(s,o)&&b(o,s)&&(e.push(s.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),E(n),E(n.next),n=t=o),n=n.next}while(n!==t);return i(n)}function l(t,e,r,s,o,a){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&m(l,c)){var h=_(l,c);return l=i(l,l.next),h=i(h,h.next),n(l,e,r,s,o,a,0),void n(h,e,r,s,o,a,0)}c=c.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function h(t,e){var r=function(t,e){var r,i=e,n=t.x,s=t.y,o=-1/0;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){var a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>o&&(o=a,r=i.x=i.x&&i.x>=h&&n!==i.x&&f(sr.x||i.x===r.x&&u(r,i)))&&(r=i,p=l)),i=i.next}while(i!==c);return r}(t,e);if(!r)return e;var n=_(r,t);return i(n,n.next),i(r,r.next)}function u(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(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 p(t){var e=t,r=t;do{(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&y(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var r=t,i=!1,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)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||A(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function A(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,r,i){var n=x(g(t,e,r)),s=x(g(t,e,i)),o=x(g(r,i,t)),a=x(g(r,i,e));return n!==s&&o!==a||!(0!==n||!v(t,r,e))||!(0!==s||!v(t,i,e))||!(0!==o||!v(r,t,i))||!(0!==a||!v(r,e,i))}function v(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 x(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function _(t,e){var r=new M(t.i,t.x,t.y),i=new M(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 w(t,e,r,i){var n=new M(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 E(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 M(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}function S(t,e,r,i){for(var n=0,s=e,o=r-i;s0&&(i+=t[n-1].length,r.holes.push(i))}return r}},80645:(t,e)=>{e.read=function(t,e,r,i,n){var s,o,a=8*n-i-1,l=(1<>1,h=-7,u=r?n-1:0,d=r?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=a;h>0;s=256*s+t[e+u],u+=d,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=i;h>0;o=256*o+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=c}return(p?-1:1)*o*Math.pow(2,s-i)},e.write=function(t,e,r,i,n,s){var o,a,l,c=8*s-n-1,h=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=h?(a=0,o=h):o+u>=1?(a=(e*l-1)*Math.pow(2,n),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,n),o=0));n>=8;t[r+p]=255&a,p+=f,a/=256,n-=8);for(o=o<0;t[r+p]=255&o,p+=f,o/=256,c-=8);t[r+p-f]|=128*m}},25705:(t,e,r)=>{"use strict";var i,n,s=r.g.MutationObserver||r.g.WebKitMutationObserver;if(s){var o=0,a=new s(u),l=r.g.document.createTextNode("");a.observe(l,{characterData:!0}),i=function(){l.data=o=++o%2}}else if(r.g.setImmediate||void 0===r.g.MessageChannel)i="document"in r.g&&"onreadystatechange"in r.g.document.createElement("script")?function(){var t=r.g.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},r.g.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new r.g.MessageChannel;c.port1.onmessage=u,i=function(){c.port2.postMessage(0)}}var h=[];function u(){var t,e;n=!0;for(var r=h.length;r;){for(e=h,h=[],t=-1;++t{t.exports=function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return n(e[o][1][t]||t)}),c,c.exports,t,e,r,i)}return r[o].exports}for(var s=void 0,o=0;o>>1],e)>=0?n=s+1:i=s;return n},e.exports=function(){function t(t){var e;this.options=t,this.comparator=this.options.comparator,this.data=(null!=(e=this.options.initialValues)?e.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return t.prototype.queue=function(t){var e;e=i(this.data,t,this.comparator),this.data.splice(e,0,t)},t.prototype.dequeue=function(){return this.data.pop()},t.prototype.peek=function(){return this.data[this.data.length-1]},t.prototype.clear=function(){this.data.length=0},t}()},{}],4:[function(t,e,r){e.exports=function(){function t(t){var e,r,i,n,s,o,a,l;for(this.comparator=(null!=t?t.comparator:void 0)||function(t,e){return t-e},this.pageSize=(null!=t?t.pageSize:void 0)||512,this.length=0,a=0;1<s;0<=s?++r:--r)e.push(null);if(this._memory=[],this._mask=this.pageSize-1,t.initialValues)for(i=0,n=(o=t.initialValues).length;i0&&(this._write(1,e),this._bubbleDown(1,e)),t},t.prototype.peek=function(){return this._read(1)},t.prototype.clear=function(){this.length=0,this._memory.length=0},t.prototype._write=function(t,e){var r;for(r=t>>this._shift;r>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[r][t&this._mask]=e},t.prototype._read=function(t){return this._memory[t>>this._shift][t&this._mask]},t.prototype._bubbleUp=function(t,e){var r,i,n,s;for(r=this.comparator;t>1&&(i=t&this._mask,t3?n=t&~this._mask|i>>1:i<2?(n=t-this.pageSize>>this._shift,n+=n&~(this._mask>>1),n|=this.pageSize>>1):n=t-2,!(r(s=this._read(n),e)<0));)this._write(n,e),this._write(t,s),t=n},t.prototype._bubbleDown=function(t,e){var r,i,n,s,o;for(o=this.comparator;tthis._mask&&!(t&this._mask-1)?r=i=t+2:t&this.pageSize>>1?(r=(t&~this._mask)>>1,i=1+(r=1+(r|=t&this._mask>>1)<0)for(t=e=1,r=this.data.length;1<=r?er;t=1<=r?++e:--e)this._bubbleUp(t)},t.prototype.queue=function(t){this.data.push(t),this._bubbleUp(this.data.length-1)},t.prototype.dequeue=function(){var t,e;return e=this.data[0],t=this.data.pop(),this.data.length>0&&(this.data[0]=t,this._bubbleDown(0)),e},t.prototype.peek=function(){return this.data[0]},t.prototype.clear=function(){this.length=0,this.data.length=0},t.prototype._bubbleUp=function(t){for(var e,r;t>0&&(e=t-1>>>1,this.comparator(this.data[t],this.data[e])<0);)r=this.data[e],this.data[e]=this.data[t],this.data[t]=r,t=e},t.prototype._bubbleDown=function(t){var e,r,i,n,s;for(e=this.data.length-1;n=1+(r=1+(t<<1)),i=t,r<=e&&this.comparator(this.data[r],this.data[i])<0&&(i=r),n<=e&&this.comparator(this.data[n],this.data[i])<0&&(i=n),i!==t;)s=this.data[i],this.data[i]=this.data[t],this.data[t]=s,t=i},t}()},{}]},{},[1])(1)},55733:(t,e,r)=>{t.exports=function t(e,r,i){function n(o,a){if(!r[o]){if(!e[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};e[o][0].call(c.exports,(function(t){return n(e[o][1][t]||t)}),c,c.exports,t,e,r,i)}return r[o].exports}for(var s=void 0,o=0;o>2,a=(3&e)<<4|r>>4,l=1>6:64,c=2>4,r=(15&o)<<4|(a=s.indexOf(t.charAt(c++)))>>2,i=(3&a)<<6|(l=s.indexOf(t.charAt(c++))),d[h++]=e,64!==a&&(d[h++]=r),64!==l&&(d[h++]=i);return d}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var i=t("./external"),n=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),o=t("./stream/DataLengthProbe");function a(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}a.prototype={getContentWorker:function(){var t=new n(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",(function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),t},getCompressedWorker:function(){return new n(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},e.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var i=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var i=t("./utils"),n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,r,i){var s=n,o=0+r;t^=-1;for(var a=0;a>>8^s[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,r,i){var s=n,o=0+r;t^=-1;for(var a=0;a>>8^s[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";var i;i="undefined"!=typeof Promise?Promise:t("lie"),e.exports={Promise:i}},{lie:37}],7:[function(t,e,r){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=t("pako"),s=t("./utils"),o=t("./stream/GenericWorker"),a=i?"uint8array":"array";function l(t,e){o.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,t.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},r.compressWorker=function(t){return new l("Deflate",t)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function i(t,e){var r,i="";for(r=0;r>>=8;return i}function n(t,e,r,n,o,h){var u,d,p=t.file,f=t.compression,m=h!==a.utf8encode,g=s.transformTo("string",h(p.name)),A=s.transformTo("string",a.utf8encode(p.name)),y=p.comment,v=s.transformTo("string",h(y)),x=s.transformTo("string",a.utf8encode(y)),b=A.length!==p.name.length,_=x.length!==y.length,w="",E="",M="",S=p.dir,C=p.date,T={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(T.crc32=t.crc32,T.compressedSize=t.compressedSize,T.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),m||!b&&!_||(I|=2048);var R=0,B=0;S&&(R|=16),"UNIX"===o?(B=798,R|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(p.unixPermissions,S)):(B=20,R|=function(t){return 63&(t||0)}(p.dosPermissions)),u=C.getUTCHours(),u<<=6,u|=C.getUTCMinutes(),u<<=5,u|=C.getUTCSeconds()/2,d=C.getUTCFullYear()-1980,d<<=4,d|=C.getUTCMonth()+1,d<<=5,d|=C.getUTCDate(),b&&(E=i(1,1)+i(l(g),4)+A,w+="up"+i(E.length,2)+E),_&&(M=i(1,1)+i(l(v),4)+x,w+="uc"+i(M.length,2)+M);var L="";return L+="\n\0",L+=i(I,2),L+=f.magic,L+=i(u,2),L+=i(d,2),L+=i(T.crc32,4),L+=i(T.compressedSize,4),L+=i(T.uncompressedSize,4),L+=i(g.length,2),L+=i(w.length,2),{fileRecord:c.LOCAL_FILE_HEADER+L+g+w,dirRecord:c.CENTRAL_FILE_HEADER+i(B,2)+L+i(v.length,2)+"\0\0\0\0"+i(R,4)+i(n,4)+g+w+v}}var s=t("../utils"),o=t("../stream/GenericWorker"),a=t("../utf8"),l=t("../crc32"),c=t("../signature");function h(t,e,r,i){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,o),h.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},h.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:function(t){return c.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},e.exports=n},{"../utils":32}],19:[function(t,e,r){"use strict";var i=t("./Uint8ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var i=t("./DataReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var i=t("./ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(t,e,r){"use strict";var i=t("../utils"),n=t("../support"),s=t("./ArrayReader"),o=t("./StringReader"),a=t("./NodeBufferReader"),l=t("./Uint8ArrayReader");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new a(t):n.uint8array?new l(i.transformTo("uint8array",t)):new s(i.transformTo("array",t)):new o(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../utils");function s(t){i.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../crc32");function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then((function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()}),(function(t){e.error(t)}))}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function i(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var r=0;r "+t:t}},e.exports=i},{}],29:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./ConvertWorker"),s=t("./GenericWorker"),o=t("../base64"),a=t("../support"),l=t("../external"),c=null;if(a.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function h(t,e,r){var o=e;switch(e){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=e,this._mimeType=r,i.checkSupport(o),this._worker=t.pipe(new n(o)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return function(t,e){return new l.Promise((function(r,n){var s=[],a=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",(function(t,r){s.push(t),e&&e(r)})).on("error",(function(t){s=[],n(t)})).on("end",(function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return o.encode(e);default:return i.transformTo(t,e)}}(l,function(t,e){var r,i=0,n=null,s=0;for(r=0;r>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e}(t)},r.utf8decode=function(t){return n.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,n,s,o=t.length,l=new Array(2*o);for(e=r=0;e>10&1023,l[r++]=56320|1023&n)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),i.applyFromCharCode(l)}(t=i.transformTo(n.uint8array?"uint8array":"array",t))},i.inherits(c,o),c.prototype.processChunk=function(t){var e=i.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var o=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}(e),l=e;o!==e.length&&(n.uint8array?(l=e.subarray(0,o),this.leftOver=e.subarray(o,e.length)):(l=e.slice(0,o),this.leftOver=e.slice(o,e.length))),this.push({data:r.utf8decode(l),meta:t.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,i.inherits(h,o),h.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var i=t("./support"),n=t("./base64"),s=t("./nodejsUtils"),o=t("./external");function a(t){return t}function l(t,e){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==t&&(this.dosPermissions=63&this.externalFileAttributes),3==t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4>>6:(r<65536?e[o++]=224|r>>>12:(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63),e[o++]=128|r>>>6&63),e[o++]=128|63&r);return e},r.buf2binstring=function(t){return l(t,t.length)},r.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r>10&1023,c[i++]=56320|1023&n)}return l(c,i)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){for(r-=o=2e3>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,n){var s=i,o=n+r;t^=-1;for(var a=n;a>>8^s[255&(t^e[a])];return-1^t}},{}],46:[function(t,e,r){"use strict";var i,n=t("../utils/common"),s=t("./trees"),o=t("./adler32"),a=t("./crc32"),l=t("./messages"),c=0,h=0,u=-2,d=2,p=8,f=286,m=30,g=19,A=2*f+1,y=15,v=3,x=258,b=x+v+1,_=42,w=113;function E(t,e){return t.msg=l[e],e}function M(t){return(t<<1)-(4t.avail_out&&(r=t.avail_out),0!==r&&(n.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function T(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,C(t.strm)}function I(t,e){t.pending_buf[t.pending++]=e}function R(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function B(t,e){var r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-b?t.strstart-(t.w_size-b):0,c=t.window,h=t.w_mask,u=t.prev,d=t.strstart+x,p=c[s+o-1],f=c[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(c[(r=e)+o]===f&&c[r+o-1]===p&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do{}while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&sl&&0!=--n);return o<=t.lookahead?o:t.lookahead}function L(t){var e,r,i,s,l,c,h,u,d,p,f=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-b)){for(n.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;i=t.head[--e],t.head[e]=f<=i?i-f:0,--r;);for(e=r=f;i=t.prev[--e],t.prev[e]=f<=i?i-f:0,--r;);s+=f}if(0===t.strm.avail_in)break;if(c=t.strm,h=t.window,u=t.strstart+t.lookahead,p=void 0,(d=s)<(p=c.avail_in)&&(p=d),r=0===p?0:(c.avail_in-=p,n.arraySet(h,c.input,c.next_in,p,u),1===c.state.wrap?c.adler=o(c.adler,h,p,u):2===c.state.wrap&&(c.adler=a(c.adler,h,p,u)),c.next_in+=p,c.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=v)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=v&&(t.ins_h=(t.ins_h<=v)if(i=s._tr_tally(t,t.strstart-t.match_start,t.match_length-v),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=v){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=v&&(t.ins_h=(t.ins_h<=v&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-v,i=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-v),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=n&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(L(t),0===t.lookahead&&e===c)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,T(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-b&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(T(t,!1),t.strm.avail_out),1)})),new O(4,4,8,4,P),new O(4,5,16,8,P),new O(4,6,32,32,P),new O(4,4,16,16,D),new O(8,16,32,32,D),new O(8,16,128,128,D),new O(8,32,128,256,D),new O(32,128,258,1024,D),new O(32,258,258,4096,D)],r.deflateInit=function(t,e){return F(t,e,p,15,8,0)},r.deflateInit2=F,r.deflateReset=N,r.deflateResetKeep=U,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,h):u},r.deflate=function(t,e){var r,n,o,l;if(!t||!t.state||5>8&255),I(n,n.gzhead.time>>16&255),I(n,n.gzhead.time>>24&255),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(I(n,255&n.gzhead.extra.length),I(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(I(n,0),I(n,0),I(n,0),I(n,0),I(n,0),I(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),I(n,3),n.status=w);else{var d=p+(n.w_bits-8<<4)<<8;d|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(d|=32),d+=31-d%31,n.status=w,R(n,d),0!==n.strstart&&(R(n,t.adler>>>16),R(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending!==n.pending_buf_size));)I(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),C(t),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(t.adler=a(t.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&C(t),n.pending+2<=n.pending_buf_size&&(I(n,255&t.adler),I(n,t.adler>>8&255),t.adler=0,n.status=w)):n.status=w),0!==n.pending){if(C(t),0===t.avail_out)return n.last_flush=-1,h}else if(0===t.avail_in&&M(e)<=M(r)&&4!==e)return E(t,-5);if(666===n.status&&0!==t.avail_in)return E(t,-5);if(0!==t.avail_in||0!==n.lookahead||e!==c&&666!==n.status){var f=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(L(t),0===t.lookahead)){if(e===c)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,i,n,o,a=t.window;;){if(t.lookahead<=x){if(L(t),t.lookahead<=x&&e===c)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=v&&0t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=v?(r=s._tr_tally(t,1,t.match_length-v),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(T(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(T(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(T(t,!1),0===t.strm.avail_out)?1:2}(n,e):i[n.level].func(n,e);if(3!==f&&4!==f||(n.status=666),1===f||3===f)return 0===t.avail_out&&(n.last_flush=-1),h;if(2===f&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(S(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),C(t),0===t.avail_out))return n.last_flush=-1,h}return 4!==e?h:n.wrap<=0?1:(2===n.wrap?(I(n,255&t.adler),I(n,t.adler>>8&255),I(n,t.adler>>16&255),I(n,t.adler>>24&255),I(n,255&t.total_in),I(n,t.total_in>>8&255),I(n,t.total_in>>16&255),I(n,t.total_in>>24&255)):(R(n,t.adler>>>16),R(n,65535&t.adler)),C(t),0=r.w_size&&(0===a&&(S(r.head),r.strstart=0,r.block_start=0,r.insert=0),p=new n.Buf8(r.w_size),n.arraySet(p,e,f-r.w_size,r.w_size,0),e=p,f=r.w_size),l=t.avail_in,c=t.next_in,d=t.input,t.avail_in=f,t.next_in=0,t.input=e,L(r);r.lookahead>=v;){for(i=r.strstart,s=r.lookahead-(v-1);r.ins_h=(r.ins_h<>>=x=v>>>24,f-=x,0==(x=v>>>16&255))S[s++]=65535&v;else{if(!(16&x)){if(0==(64&x)){v=m[(65535&v)+(p&(1<>>=x,f-=x),f<15&&(p+=M[i++]<>>=x=v>>>24,f-=x,!(16&(x=v>>>16&255))){if(0==(64&x)){v=g[(65535&v)+(p&(1<>>=x,f-=x,(x=s-o)<_){if(h<(x=_-x)&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(E=d,(w=0)===u){if(w+=c-x,x>3,p&=(1<<(f-=b<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=h,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(u),e.distcode=e.distdyn=new i.Buf32(d),e.sane=1,e.back=-1,l):c}function g(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,m(t)):c}function A(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||15=o.wsize?(i.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n<(s=o.wsize-o.wnext)&&(s=n),i.arraySet(o.window,e,r-n,s,o.wnext),(n-=s)?(i.arraySet(o.window,e,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=s(r.check,N,2,0),v=y=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&y)){t.msg="unknown compression method",r.mode=30;break}if(v-=4,P=8+(15&(y>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(N[0]=255&y,N[1]=y>>>8&255,r.check=s(r.check,N,2,0)),v=y=0,r.mode=3;case 3:for(;v<32;){if(0===g)break t;g--,y+=u[f++]<>>8&255,N[2]=y>>>16&255,N[3]=y>>>24&255,r.check=s(r.check,N,4,0)),v=y=0,r.mode=4;case 4:for(;v<16;){if(0===g)break t;g--,y+=u[f++]<>8),512&r.flags&&(N[0]=255&y,N[1]=y>>>8&255,r.check=s(r.check,N,2,0)),v=y=0,r.mode=5;case 5:if(1024&r.flags){for(;v<16;){if(0===g)break t;g--,y+=u[f++]<>>8&255,r.check=s(r.check,N,2,0)),v=y=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(g<(E=r.length)&&(E=g),E&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,u,f,E,P)),512&r.flags&&(r.check=s(r.check,u,E,f)),g-=E,f+=E,r.length-=E),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===g)break t;for(E=0;P=u[f+E++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P)),P&&E>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;v<32;){if(0===g)break t;g--,y+=u[f++]<>>=7&v,v-=7&v,r.mode=27;break}for(;v<3;){if(0===g)break t;g--,y+=u[f++]<>>=1)){case 0:r.mode=14;break;case 1:if(_(r),r.mode=20,6!==e)break;y>>>=2,v-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}y>>>=2,v-=2;break;case 14:for(y>>>=7&v,v-=7&v;v<32;){if(0===g)break t;g--,y+=u[f++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&y,v=y=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(E=r.length){if(g>>=5,v-=5,r.ndist=1+(31&y),y>>>=5,v-=5,r.ncode=4+(15&y),y>>>=4,v-=4,286>>=3,v-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},D=a(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,D){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=C,v-=C,r.lens[r.have++]=I;else{if(16===I){for(k=C+2;v>>=C,v-=C,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}P=r.lens[r.have-1],E=3+(3&y),y>>>=2,v-=2}else if(17===I){for(k=C+3;v>>=C)),y>>>=3,v-=3}else{for(k=C+7;v>>=C)),y>>>=7,v-=7}if(r.have+E>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;E--;)r.lens[r.have++]=P}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,O={bits:r.lenbits},D=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,D){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},D=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,D){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(6<=g&&258<=A){t.next_out=m,t.avail_out=A,t.next_in=f,t.avail_in=g,r.hold=y,r.bits=v,o(t,b),m=t.next_out,d=t.output,A=t.avail_out,f=t.next_in,u=t.input,g=t.avail_in,y=r.hold,v=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;T=(U=r.lencode[y&(1<>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>R)])>>>16&255,I=65535&U,!(R+(C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=R,v-=R,r.back+=R}if(y>>>=C,v-=C,r.back+=C,r.length=I,0===T){r.mode=26;break}if(32&T){r.back=-1,r.mode=12;break}if(64&T){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&T,r.mode=22;case 22:if(r.extra){for(k=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;T=(U=r.distcode[y&(1<>>16&255,I=65535&U,!((C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>R)])>>>16&255,I=65535&U,!(R+(C=U>>>24)<=v);){if(0===g)break t;g--,y+=u[f++]<>>=R,v-=R,r.back+=R}if(y>>>=C,v-=C,r.back+=C,64&T){t.msg="invalid distance code",r.mode=30;break}r.offset=I,r.extra=15&T,r.mode=24;case 24:if(r.extra){for(k=r.extra;v>>=r.extra,v-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===A)break t;if(E=b-A,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}M=E>r.wnext?(E-=r.wnext,r.wsize-E):r.wnext-E,E>r.length&&(E=r.length),S=r.window}else S=d,M=m-r.offset,E=r.length;for(Ay?(x=U[N+u[E]],P[D+u[E]]):(x=96,0),p=1<>I)+(f-=p)]=v<<24|x<<16|b|0,0!==f;);for(p=1<>=1;if(0!==p?(L&=p-1,L+=p):L=0,E++,0==--O[w]){if(w===S)break;w=e[r+u[E]]}if(C>>7)]}function S(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function C(t,e,r){t.bi_valid>c-r?(t.bi_buf|=e<>c-t.bi_valid,t.bi_valid+=r-c):(t.bi_buf|=e<>>=1,r<<=1,0<--e;);return r>>>1}function R(t,e,r){var i,n,s=new Array(l+1),o=0;for(i=1;i<=l;i++)s[i]=o=o+r[i-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=I(s[a]++,a))}}function B(t){var e;for(e=0;e>1;1<=r;r--)D(t,s,r);for(n=c;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],D(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,D(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,o,a,c=e.dyn_tree,h=e.max_code,u=e.stat_desc.static_tree,d=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,m=e.stat_desc.max_length,g=0;for(s=0;s<=l;s++)t.bl_count[s]=0;for(c[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)m<(s=c[2*c[2*(i=t.heap[r])+1]+1]+1)&&(s=m,g++),c[2*i+1]=s,h>=7;i>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e>>3,(o=t.static_len+3+7>>>3)<=n&&(n=o)):n=o=r+5,r+4<=n&&-1!==e?z(t,e,r,i):4===t.strategy||o===n?(C(t,2+(i?1:0),3),O(t,f,m)):(C(t,4+(i?1:0),3),function(t,e,r,i){var n;for(C(t,e-257,5),C(t,r-1,5),C(t,i-4,4),n=0;n>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(A[r]+s+1)]++,t.dyn_dtree[2*M(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){C(t,2,3),T(t,256,f),function(t){16===t.bi_valid?(S(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){(function(t){!function(t,e){"use strict";if(!t.setImmediate){var r,i,n,s,o=1,a={},l=!1,c=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,r="[object process]"==={}.toString.call(t.process)?function(t){process.nextTick((function(){d(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?(s="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",p,!1):t.attachEvent("onmessage",p),function(e){t.postMessage(s+e,"*")}):t.MessageChannel?((n=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){n.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(i=c.documentElement,function(t){var e=c.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):function(t){setTimeout(d,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i{var e,r=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var r,i,n=void 0!==(t=t||{})?t:{};n.ready=new Promise((function(t,e){r=t,i=e})),["_main","___getTypeName","__embind_initialize_bindings","_fflush","onRuntimeInitialized"].forEach((t=>{Object.getOwnPropertyDescriptor(n.ready,t)||Object.defineProperty(n.ready,t,{get:()=>W("You are getting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js"),set:()=>W("You are setting "+t+" on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")})}));var s=Object.assign({},n),o=[],a="./this.program";if(n.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var l,c="";if("undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),e&&(c=e),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var h,u,d,p=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);function m(t,e){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){W("Module."+t+" has been replaced with plain "+e+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function g(t){return"FS_createPath"===t||"FS_createDataFile"===t||"FS_createPreloadedFile"===t||"FS_unlink"===t||"addRunDependency"===t||"FS_createLazyFile"===t||"FS_createDevice"===t||"removeRunDependency"===t}Object.assign(n,s),s=null,h="fetchSettings",Object.getOwnPropertyDescriptor(n,h)&&W("`Module."+h+"` was supplied but `"+h+"` not included in INCOMING_MODULE_JS_API"),n.arguments&&(o=n.arguments),m("arguments","arguments_"),n.thisProgram&&(a=n.thisProgram),m("thisProgram","thisProgram"),n.quit&&n.quit,m("quit","quit_"),y(void 0===n.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),y(void 0===n.read,"Module.read option was removed (modify read_ in JS)"),y(void 0===n.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),y(void 0===n.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),y(void 0===n.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),y(void 0===n.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),m("read","read_"),m("readAsync","readAsync"),m("readBinary","readBinary"),m("setWindowTitle","setWindowTitle"),y(!0,"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable."),y(!0,"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable."),y(!0,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),n.wasmBinary&&(u=n.wasmBinary),m("wasmBinary","wasmBinary"),n.noExitRuntime,m("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&W("no native wasm support detected");var A=!1;function y(t,e){t||W("Assertion failed"+(e?": "+e:""))}var v,x,b,_,w,E,M,S,C,T="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(t,e,r){for(var i=e+r,n=e;t[n]&&!(n>=i);)++n;if(n-e>16&&t.buffer&&T)return T.decode(t.subarray(e,n));for(var s="";e>10,56320|1023&c)}}else s+=String.fromCharCode((31&o)<<6|a)}else s+=String.fromCharCode(o)}return s}function R(t,e){return t?I(b,t,e):""}function B(t,e,r,i){if(!(i>0))return 0;for(var n=r,s=r+i-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),a<=127){if(r>=s)break;e[r++]=a}else if(a<=2047){if(r+1>=s)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=s)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+3>=s)break;a>1114111&&tt("Invalid Unicode code point 0x"+a.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-n}function L(t){for(var e=0,r=0;r=55296&&i<=57343?(e+=4,++r):e+=3}return e}function P(t){v=t,n.HEAP8=x=new Int8Array(t),n.HEAP16=_=new Int16Array(t),n.HEAP32=E=new Int32Array(t),n.HEAPU8=b=new Uint8Array(t),n.HEAPU16=w=new Uint16Array(t),n.HEAPU32=M=new Uint32Array(t),n.HEAPF32=S=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}var D=65536;n.TOTAL_STACK&&y(D===n.TOTAL_STACK,"the stack size can no longer be determined at runtime");var O,k=n.INITIAL_MEMORY||262144;function U(){if(!A){var t=Ee(),e=M[t>>2],r=M[t+4>>2];34821223==e&&2310721022==r||W("Stack overflow! Stack cookie has been overwritten at 0x"+t.toString(16)+", expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+e.toString(16)),1668509029!==M[0]&&W("Runtime error: The application has corrupted its heap memory area (address zero)!")}}m("INITIAL_MEMORY","INITIAL_MEMORY"),y(k>=D,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+k+"! (TOTAL_STACK="+D+")"),y("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),y(!n.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),y(262144==k,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var t=new Int16Array(1),e=new Int8Array(t.buffer);if(t[0]=25459,115!==e[0]||99!==e[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var N=[],F=[],z=[],G=!1;y(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),y(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Q=0,j=null,V=null,H={};function W(t){n.onAbort&&n.onAbort(t),f(t="Aborted("+t+")"),A=!0;var e=new WebAssembly.RuntimeError(t);throw i(e),e}var q={error:function(){W("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM")},init:function(){q.error()},createDataFile:function(){q.error()},createPreloadedFile:function(){q.error()},createLazyFile:function(){q.error()},open:function(){q.error()},mkdev:function(){q.error()},registerDevice:function(){q.error()},analyzePath:function(){q.error()},loadFilesFromDB:function(){q.error()},ErrnoError:function(){q.error()}};n.FS_createDataFile=q.createDataFile,n.FS_createPreloadedFile=q.createPreloadedFile;var Z,Y;function X(t){return t.startsWith("data:application/octet-stream;base64,")}function J(t,e){return function(){var r=t,i=e;return e||(i=n.asm),y(G,"native function `"+r+"` called before runtime initialization"),i[t]||y(i[t],"exported native function `"+r+"` not found"),i[t].apply(null,arguments)}}function K(t){try{if(t==Z&&u)return new Uint8Array(u);if(l)return l(t);throw"both async and sync fetching of the wasm failed"}catch(t){W(t)}}function $(t){for(;t.length>0;)t.shift()(n)}function tt(t){tt.shown||(tt.shown={}),tt.shown[t]||(tt.shown[t]=1,f(t))}function et(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){M[this.ptr+4>>2]=t},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(t){M[this.ptr+8>>2]=t},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_refcount=function(t){E[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,x[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=x[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,x[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=x[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=E[this.ptr>>2];E[this.ptr>>2]=t+1},this.release_ref=function(){var t=E[this.ptr>>2];return E[this.ptr>>2]=t-1,y(t>0),1===t},this.set_adjusted_ptr=function(t){M[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Me(this.get_type()))return M[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}function rt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}X(Z="laz-perf.wasm")||(Y=Z,Z=n.locateFile?n.locateFile(Y,c):c+Y);var it=void 0;function nt(t){for(var e="",r=t;b[r];)e+=it[b[r++]];return e}var st={},ot={},at={},lt=48,ct=57;function ht(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=lt&&e<=ct?"_"+t:t}function ut(t,e){return t=ht(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function dt(t,e){var r=ut(e,(function(t){this.name=e,this.message=t;var r=new Error(t).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var pt=void 0;function ft(t){throw new pt(t)}var mt=void 0;function gt(t){throw new mt(t)}function At(t,e,r){function i(e){var i=r(e);i.length!==t.length&>("Mismatched type converter count");for(var n=0;n{ot.hasOwnProperty(t)?n[e]=ot[t]:(s.push(t),st.hasOwnProperty(t)||(st[t]=[]),st[t].push((()=>{n[e]=ot[t],++o===s.length&&i(n)})))})),0===s.length&&i(n)}function yt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var i=e.name;if(t||ft('type "'+i+'" must have a positive integer typeid pointer'),ot.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;ft("Cannot register type '"+i+"' twice")}if(ot[t]=e,delete at[t],st.hasOwnProperty(t)){var n=st[t];delete st[t],n.forEach((t=>t()))}}function vt(t){ft(t.$$.ptrType.registeredClass.name+" instance already deleted")}var xt=!1;function bt(t){}function _t(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function wt(t,e,r){if(e===r)return t;if(void 0===r.baseClass)return null;var i=wt(t,e,r.baseClass);return null===i?null:r.downcast(i)}var Et={};var Mt=[];function St(){for(;Mt.length;){var t=Mt.pop();t.$$.deleteScheduled=!1,t.delete()}}var Ct=void 0;var Tt={};function It(t,e){return e.ptrType&&e.ptr||gt("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&>("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Bt(Object.create(t,{$$:{value:e}}))}function Rt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=function(t,e){return e=function(t,e){for(void 0===e&&ft("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),Tt[e]}(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var i=r.clone();return this.destructor(t),i}function n(){return this.isSmartPointer?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var s,o=this.registeredClass.getActualType(e),a=Et[o];if(!a)return n.call(this);s=this.isConst?a.constPointerType:a.pointerType;var l=wt(e,this.registeredClass,s.registeredClass);return null===l?n.call(this):this.isSmartPointer?It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}function Bt(t){return"undefined"==typeof FinalizationRegistry?(Bt=t=>t,t):(xt=new FinalizationRegistry((t=>{console.warn(t.leakWarning.stack.replace(/^Error: /,"")),_t(t.$$)})),Bt=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e},i=e.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+i.name+" <0x"+e.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,Rt),xt.register(t,r,t)}return t},bt=t=>xt.unregister(t),Bt(t))}function Lt(){}function Pt(t,e,r){if(void 0===t[e].overloadTable){var i=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ft("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[i.argCount]=i}}function Dt(t,e,r,i,n,s,o,a){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=i,this.baseClass=n,this.getActualType=s,this.upcast=o,this.downcast=a,this.pureVirtualFunctions=[]}function Ot(t,e,r){for(;e!==r;)e.upcast||ft("Expected null or instance of "+r.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function kt(t,e){if(null===e)return this.isReference&&ft("null is not a valid "+this.name),0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name);var r=e.$$.ptrType.registeredClass;return Ot(e.$$.ptr,r,this.registeredClass)}function Ut(t,e){var r;if(null===e)return this.isReference&&ft("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&ft("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var i=e.$$.ptrType.registeredClass;if(r=Ot(e.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&ft("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:ft("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var n=e.clone();r=this.rawShare(r,Kt.toHandle((function(){n.delete()}))),null!==t&&t.push(this.rawDestructor,r)}break;default:ft("Unsupporting sharing policy")}return r}function Nt(t,e){if(null===e)return this.isReference&&ft("null is not a valid "+this.name),0;e.$$||ft('Cannot pass "'+$t(e)+'" as a '+this.name),e.$$.ptr||ft("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&ft("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;return Ot(e.$$.ptr,r,this.registeredClass)}function Ft(t){return this.fromWireType(E[t>>2])}function zt(t,e,r,i,n,s,o,a,l,c,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=i,this.isSmartPointer=n,this.pointeeType=s,this.sharingPolicy=o,this.rawGetPointee=a,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=h,n||void 0!==e.baseClass?this.toWireType=Ut:i?(this.toWireType=kt,this.destructorFunction=null):(this.toWireType=Nt,this.destructorFunction=null)}var Gt=[];function Qt(t){var e=Gt[t];return e||(t>=Gt.length&&(Gt.length=t+1),Gt[t]=e=O.get(t)),y(O.get(t)==e,"JavaScript-side Wasm function table mirror is out of date!"),e}function jt(t,e){var r=(t=nt(t)).includes("j")?function(t,e){y(t.includes("j")||t.includes("p"),"getDynCaller should only be called with i64 sigs");var r=[];return function(){return r.length=0,Object.assign(r,arguments),function(t,e,r){return t.includes("j")?function(t,e,r){y("dynCall_"+t in n,"bad function pointer type - no table for sig '"+t+"'"),r&&r.length?y(r.length===t.substring(1).replace(/j/g,"--").length):y(1==t.length);var i=n["dynCall_"+t];return r&&r.length?i.apply(null,[e].concat(r)):i.call(null,e)}(t,e,r):(y(Qt(e),"missing table entry in dynCall: "+e),Qt(e).apply(null,r))}(t,e,r)}}(t,e):Qt(e);return"function"!=typeof r&&ft("unknown function pointer with signature "+t+": "+e),r}var Vt=void 0;function Ht(t){var e=_e(t),r=nt(e);return be(e),r}function Wt(t,e){var r=[],i={};throw e.forEach((function t(e){i[e]||ot[e]||(at[e]?at[e].forEach(t):(r.push(e),i[e]=!0))})),new Vt(t+": "+r.map(Ht).join([", "]))}function qt(t,e){for(var r=[],i=0;i>2]);return r}function Zt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function Yt(t,e,r,i,n){var s=e.length;s<2&&ft("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var o=null!==e[1]&&null!==r,a=!1,l=1;l0?", ":"")+u),d+=(c?"var rv = ":"")+"invoker(fn"+(u.length>0?", ":"")+u+");\n",a)d+="runDestructors(destructors);\n";else for(l=o?1:2;l(t||ft("Cannot use deleted val. handle = "+t),Jt[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Xt.length?Xt.pop():Jt.length;return Jt[e]={refcount:1,value:t},e}}};function $t(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function te(t,e){switch(e){case 2:return function(t){return this.fromWireType(S[t>>2])};case 3:return function(t){return this.fromWireType(C[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function ee(t,e,r){switch(e){case 0:return r?function(t){return x[t]}:function(t){return b[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return w[t>>1]};case 2:return r?function(t){return E[t>>2]}:function(t){return M[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ie(t,e){y(t%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=t,i=r>>1,n=i+e/2;!(i>=n)&&w[i];)++i;if((r=i<<1)-t>32&&re)return re.decode(b.subarray(t,r));for(var s="",o=0;!(o>=e/2);++o){var a=_[t+2*o>>1];if(0==a)break;s+=String.fromCharCode(a)}return s}function ne(t,e,r){if(y(e%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),y("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var i=e,n=(r-=2)<2*t.length?r/2:t.length,s=0;s>1]=o,e+=2}return _[e>>1]=0,e-i}function se(t){return 2*t.length}function oe(t,e){y(t%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,i="";!(r>=e/4);){var n=E[t+4*r>>2];if(0==n)break;if(++r,n>=65536){var s=n-65536;i+=String.fromCharCode(55296|s>>10,56320|1023&s)}else i+=String.fromCharCode(n)}return i}function ae(t,e,r){if(y(e%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),y("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var i=e,n=i+r-4,s=0;s=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++s)),E[e>>2]=o,(e+=4)+4>n)break}return E[e>>2]=0,e-i}function le(t){for(var e=0,r=0;r=55296&&i<=57343&&++r,e+=4}return e}function ce(t){try{return d.grow(t-v.byteLength+65535>>>16),P(d.buffer),1}catch(e){f("emscripten_realloc_buffer: Attempted to grow heap from "+v.byteLength+" bytes to "+t+" bytes, but got error: "+e)}}var he={};function ue(){if(!ue.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(var e in he)void 0===he[e]?delete t[e]:t[e]=he[e];var r=[];for(var e in t)r.push(e+"="+t[e]);ue.strings=r}return ue.strings}var de=[null,[],[]];function pe(t,e){var r=de[t];y(r),0===e||10===e?((1===t?p:f)(I(r,0)),r.length=0):r.push(e)}function fe(t){return t%4==0&&(t%100!=0||t%400==0)}var me=[31,29,31,30,31,30,31,31,30,31,30,31],ge=[31,28,31,30,31,30,31,31,30,31,30,31];function Ae(t,e,r,i){var n=E[i+40>>2],s={tm_sec:E[i>>2],tm_min:E[i+4>>2],tm_hour:E[i+8>>2],tm_mday:E[i+12>>2],tm_mon:E[i+16>>2],tm_year:E[i+20>>2],tm_wday:E[i+24>>2],tm_yday:E[i+28>>2],tm_isdst:E[i+32>>2],tm_gmtoff:E[i+36>>2],tm_zone:n?R(n):""},o=R(r),a={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in a)o=o.replace(new RegExp(l,"g"),a[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function u(t,e,r){for(var i="number"==typeof t?t.toString():t||"";i.length0?1:0}var i;return 0===(i=r(t.getFullYear()-e.getFullYear()))&&0===(i=r(t.getMonth()-e.getMonth()))&&(i=r(t.getDate()-e.getDate())),i}function f(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function m(t){var e=function(t,e){for(var r=new Date(t.getTime());e>0;){var i=fe(r.getFullYear()),n=r.getMonth(),s=(i?me:ge)[n];if(!(e>s-r.getDate()))return r.setDate(r.getDate()+e),r;e-=s-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(t.tm_year+1900,0,1),t.tm_yday),r=new Date(e.getFullYear(),0,4),i=new Date(e.getFullYear()+1,0,4),n=f(r),s=f(i);return p(n,e)<=0?p(s,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var g={"%a":function(t){return c[t.tm_wday].substring(0,3)},"%A":function(t){return c[t.tm_wday]},"%b":function(t){return h[t.tm_mon].substring(0,3)},"%B":function(t){return h[t.tm_mon]},"%C":function(t){return d((t.tm_year+1900)/100|0,2)},"%d":function(t){return d(t.tm_mday,2)},"%e":function(t){return u(t.tm_mday,2," ")},"%g":function(t){return m(t).toString().substring(2)},"%G":function(t){return m(t)},"%H":function(t){return d(t.tm_hour,2)},"%I":function(t){var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),d(e,2)},"%j":function(t){return d(t.tm_mday+function(t,e){for(var r=0,i=0;i<=e;r+=t[i++]);return r}(fe(t.tm_year+1900)?me:ge,t.tm_mon-1),3)},"%m":function(t){return d(t.tm_mon+1,2)},"%M":function(t){return d(t.tm_min,2)},"%n":function(){return"\n"},"%p":function(t){return t.tm_hour>=0&&t.tm_hour<12?"AM":"PM"},"%S":function(t){return d(t.tm_sec,2)},"%t":function(){return"\t"},"%u":function(t){return t.tm_wday||7},"%U":function(t){var e=t.tm_yday+7-t.tm_wday;return d(Math.floor(e/7),2)},"%V":function(t){var e=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&e++,e){if(53==e){var r=(t.tm_wday+371-t.tm_yday)%7;4==r||3==r&&fe(t.tm_year)||(e=1)}}else{e=52;var i=(t.tm_wday+7-t.tm_yday-1)%7;(4==i||5==i&&fe(t.tm_year%400-1))&&e++}return d(e,2)},"%w":function(t){return t.tm_wday},"%W":function(t){var e=t.tm_yday+7-(t.tm_wday+6)%7;return d(Math.floor(e/7),2)},"%y":function(t){return(t.tm_year+1900).toString().substring(2)},"%Y":function(t){return t.tm_year+1900},"%z":function(t){var e=t.tm_gmtoff,r=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(r?"+":"-")+String("0000"+e).slice(-4)},"%Z":function(t){return t.tm_zone},"%%":function(){return"%"}};for(var l in o=o.replace(/%%/g,"\0\0"),g)o.includes(l)&&(o=o.replace(new RegExp(l,"g"),g[l](s)));var A,v,b,_=(!1,v=L(A=o=o.replace(/\0\0/g,"%"))+1,B(A,b=new Array(v),0,b.length),b);return _.length>e?0:(function(t,e){y(t.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),x.set(t,e)}(_,t),_.length-1)}!function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);it=t}(),pt=n.BindingError=dt(Error,"BindingError"),mt=n.InternalError=dt(Error,"InternalError"),Lt.prototype.isAliasOf=function(t){if(!(this instanceof Lt))return!1;if(!(t instanceof Lt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,i=t.$$.ptrType.registeredClass,n=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;i.baseClass;)n=i.upcast(n),i=i.baseClass;return e===i&&r===n},Lt.prototype.clone=function(){if(this.$$.ptr||vt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Bt(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},Lt.prototype.delete=function(){this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ft("Object already scheduled for deletion"),bt(this),_t(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},Lt.prototype.isDeleted=function(){return!this.$$.ptr},Lt.prototype.deleteLater=function(){return this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ft("Object already scheduled for deletion"),Mt.push(this),1===Mt.length&&Ct&&Ct(St),this.$$.deleteScheduled=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Tt).length},n.getLiveInheritedInstances=function(){var t=[];for(var e in Tt)Tt.hasOwnProperty(e)&&t.push(Tt[e]);return t},n.flushPendingDeletes=St,n.setDelayFunction=function(t){Ct=t,Mt.length&&Ct&&Ct(St)},zt.prototype.getPointee=function(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},zt.prototype.destructor=function(t){this.rawDestructor&&this.rawDestructor(t)},zt.prototype.argPackAdvance=8,zt.prototype.readValueFromPointer=Ft,zt.prototype.deleteObject=function(t){null!==t&&t.delete()},zt.prototype.fromWireType=Rt,Vt=n.UnboundTypeError=dt(Error,"UnboundTypeError"),n.count_emval_handles=function(){for(var t=0,e=5;e>s])},destructorFunction:null})},_embind_register_class:function(t,e,r,i,s,o,a,l,c,h,u,d,p){u=nt(u),o=jt(s,o),l&&(l=jt(a,l)),h&&(h=jt(c,h)),p=jt(d,p);var f=ht(u);!function(t,e,r){n.hasOwnProperty(t)?(ft("Cannot register public name '"+t+"' twice"),Pt(n,t,t),n.hasOwnProperty(r)&&ft("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),n[t].overloadTable[void 0]=e):n[t]=e}(f,(function(){Wt("Cannot construct "+u+" due to unbound types",[i])})),At([t,e,r],i?[i]:[],(function(e){var r,s;e=e[0],s=i?(r=e.registeredClass).instancePrototype:Lt.prototype;var a=ut(f,(function(){if(Object.getPrototypeOf(this)!==c)throw new pt("Use 'new' to construct "+u);if(void 0===d.constructor_body)throw new pt(u+" has no accessible constructor");var t=d.constructor_body[arguments.length];if(void 0===t)throw new pt("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(d.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),c=Object.create(s,{constructor:{value:a}});a.prototype=c;var d=new Dt(u,a,c,p,r,o,l,h),m=new zt(u,d,!0,!1,!1),g=new zt(u+"*",d,!1,!1,!1),A=new zt(u+" const*",d,!1,!0,!1);return Et[t]={pointerType:g,constPointerType:A},function(t,e,r){n.hasOwnProperty(t)||gt("Replacing nonexistant public symbol"),n[t].overloadTable,n[t]=e,n[t].argCount=r}(f,a),[m,g,A]}))},_embind_register_class_constructor:function(t,e,r,i,n,s){y(e>0);var o=qt(e,r);n=jt(i,n),At([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new pt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{Wt("Cannot construct "+t.name+" due to unbound types",o)},At([],o,(function(i){return i.splice(1,0,null),t.registeredClass.constructor_body[e-1]=Yt(r,i,null,n,s),[]})),[]}))},_embind_register_class_function:function(t,e,r,i,n,s,o,a){var l=qt(r,i);e=nt(e),s=jt(n,s),At([],[t],(function(t){var i=(t=t[0]).name+"."+e;function n(){Wt("Cannot call "+i+" due to unbound types",l)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),a&&t.registeredClass.pureVirtualFunctions.push(e);var c=t.registeredClass.instancePrototype,h=c[e];return void 0===h||void 0===h.overloadTable&&h.className!==t.name&&h.argCount===r-2?(n.argCount=r-2,n.className=t.name,c[e]=n):(Pt(c,e,i),c[e].overloadTable[r-2]=n),At([],l,(function(n){var a=Yt(i,n,t,s,o);return void 0===c[e].overloadTable?(a.argCount=r-2,c[e]=a):c[e].overloadTable[r-2]=a,[]})),[]}))},_embind_register_emval:function(t,e){yt(t,{name:e=nt(e),fromWireType:function(t){var e=Kt.toValue(t);return function(t){t>4&&0==--Jt[t].refcount&&(Jt[t]=void 0,Xt.push(t))}(t),e},toWireType:function(t,e){return Kt.toHandle(e)},argPackAdvance:8,readValueFromPointer:Ft,destructorFunction:null})},_embind_register_float:function(t,e,r){var i=rt(r);yt(t,{name:e=nt(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+$t(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:te(e,i),destructorFunction:null})},_embind_register_integer:function(t,e,r,i,n){e=nt(e),-1===n&&(n=4294967295);var s=rt(r),o=t=>t;if(0===i){var a=32-8*r;o=t=>t<>>a}var l=e.includes("unsigned"),c=(t,r)=>{if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+$t(t)+'" to '+r);if(tn)throw new TypeError('Passing a number "'+$t(t)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+i+", "+n+"]!")};yt(t,{name:e,fromWireType:o,toWireType:l?function(t,e){return c(e,this.name),e>>>0}:function(t,e){return c(e,this.name),e},argPackAdvance:8,readValueFromPointer:ee(e,s,0!==i),destructorFunction:null})},_embind_register_memory_view:function(t,e,r){var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function n(t){var e=M,r=e[t>>=2],n=e[t+1];return new i(v,n,r)}yt(t,{name:r=nt(r),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{ignoreDuplicateRegistrations:!0})},_embind_register_std_string:function(t,e){var r="std::string"===(e=nt(e));yt(t,{name:e,fromWireType:function(t){var e,i=M[t>>2],n=t+4;if(r)for(var s=n,o=0;o<=i;++o){var a=n+o;if(o==i||0==b[a]){var l=R(s,a-s);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),s=a+1}}else{var c=new Array(i);for(o=0;o>2]=i,r&&n)s=e,o=c,y("number"==typeof(a=i+1),"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),B(s,b,o,a);else if(n)for(var h=0;h255&&(be(c),ft("String has UTF-16 code units that do not fit in 8 bits")),b[c+h]=u}else for(h=0;hw,a=1):4===e&&(i=oe,n=ae,o=le,s=()=>M,a=2),yt(t,{name:r,fromWireType:function(t){for(var r,n=M[t>>2],o=s(),l=t+4,c=0;c<=n;++c){var h=t+4+c*e;if(c==n||0==o[h>>a]){var u=i(l,h-l);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),l=h+e}}return be(t),r},toWireType:function(t,i){"string"!=typeof i&&ft("Cannot pass non-string to C++ string type "+r);var s=o(i),l=xe(4+s+e);return M[l>>2]=s>>a,n(i,l+4,s+e),null!==t&&t.push(be,l),l},argPackAdvance:8,readValueFromPointer:Ft,destructorFunction:function(t){be(t)}})},_embind_register_void:function(t,e){yt(t,{isVoid:!0,name:e=nt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},abort:function(){W("native code called abort()")},emscripten_memcpy_big:function(t,e,r){b.copyWithin(t,e,e+r)},emscripten_resize_heap:function(t){var e=b.length;y((t>>>=0)>e);var r,i=2147483648;if(t>i)return f("Cannot enlarge memory, asked to go up to "+t+" bytes, but the limit is "+i+" bytes!"),!1;for(var n=1;n<=4;n*=2){var s=e*(1+.2/n);s=Math.min(s,t+100663296);var o=Math.min(i,(r=Math.max(t,s))+(65536-r%65536)%65536);if(ce(o))return!0}return f("Failed to grow the heap from "+e+" bytes to "+o+" bytes, not enough memory!"),!1},environ_get:function(t,e){var r=0;return ue().forEach((function(i,n){var s=e+r;M[t+4*n>>2]=s,function(t,e,r){for(var i=0;i>0]=t.charCodeAt(i);x[e>>0]=0}(i,s),r+=i.length+1})),0},environ_sizes_get:function(t,e){var r=ue();M[t>>2]=r.length;var i=0;return r.forEach((function(t){i+=t.length+1})),M[e>>2]=i,0},fd_close:function(t){W("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM")},fd_seek:function(t,e,r,i,n){return 70},fd_write:function(t,e,r,i){for(var n=0,s=0;s>2],a=M[e+4>>2];e+=8;for(var l=0;l>2]=n,0},strftime_l:function(t,e,r,i){return Ae(t,e,r,i)}},xe=(function(){var t,e={env:ve,wasi_snapshot_preview1:ve};function r(t,e){var r,i=t.exports;n.asm=i,y(d=n.asm.memory,"memory not found in wasm exports"),P(d.buffer),y(O=n.asm.__indirect_function_table,"table not found in wasm exports"),r=n.asm.__wasm_call_ctors,F.unshift(r),function(t){if(Q--,n.monitorRunDependencies&&n.monitorRunDependencies(Q),t?(y(H[t]),delete H[t]):f("warning: run dependency removed without ID"),0==Q&&(null!==j&&(clearInterval(j),j=null),V)){var e=V;V=null,e()}}("wasm-instantiate")}t="wasm-instantiate",Q++,n.monitorRunDependencies&&n.monitorRunDependencies(Q),t?(y(!H[t]),H[t]=1,null===j&&"undefined"!=typeof setInterval&&(j=setInterval((function(){if(A)return clearInterval(j),void(j=null);var t=!1;for(var e in H)t||(t=!0,f("still waiting on run dependencies:")),f("dependency: "+e);t&&f("(end of list)")}),1e4))):f("warning: run dependency added without ID");var s=n;function o(t){y(n===s,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),s=null,r(t.instance)}function a(t){return(u||"function"!=typeof fetch?Promise.resolve().then((function(){return K(Z)})):fetch(Z,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+Z+"'";return t.arrayBuffer()})).catch((function(){return K(Z)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),Z.startsWith("file://")&&f("warning: Loading from a file URI ("+Z+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),W(t)}))}if(n.instantiateWasm)try{return n.instantiateWasm(e,r)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(u||"function"!=typeof WebAssembly.instantiateStreaming||X(Z)||"function"!=typeof fetch?a(o):fetch(Z,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(i)}(),n.___wasm_call_ctors=J("__wasm_call_ctors"),n._malloc=J("malloc")),be=n._free=J("free"),_e=n.___getTypeName=J("__getTypeName"),we=(n.__embind_initialize_bindings=J("_embind_initialize_bindings"),n.___errno_location=J("__errno_location"),n._fflush=J("fflush"),n._emscripten_stack_init=function(){return(we=n._emscripten_stack_init=n.asm.emscripten_stack_init).apply(null,arguments)}),Ee=(n._emscripten_stack_get_free=function(){return(n._emscripten_stack_get_free=n.asm.emscripten_stack_get_free).apply(null,arguments)},n._emscripten_stack_get_base=function(){return(n._emscripten_stack_get_base=n.asm.emscripten_stack_get_base).apply(null,arguments)},n._emscripten_stack_get_end=function(){return(Ee=n._emscripten_stack_get_end=n.asm.emscripten_stack_get_end).apply(null,arguments)}),Me=(n.stackSave=J("stackSave"),n.stackRestore=J("stackRestore"),n.stackAlloc=J("stackAlloc"),n.___cxa_is_pointer_type=J("__cxa_is_pointer_type"));function Se(t){function e(){ye||(ye=!0,n.calledRun=!0,A||(y(!G),G=!0,U(),$(F),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),y(!n._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),function(){if(U(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),z.unshift(t);var t;$(z)}()))}var i;t=t||o,Q>0||(we(),y(0==(3&(i=Ee()))),M[i>>2]=34821223,M[i+4>>2]=2310721022,M[0]=1668509029,function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),N.unshift(t);var t;$(N)}(),Q>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e(),U()))}if(n.dynCall_viijii=J("dynCall_viijii"),n.dynCall_ji=J("dynCall_ji"),n.dynCall_jiji=J("dynCall_jiji"),n.dynCall_iiiiij=J("dynCall_iiiiij"),n.dynCall_iiiiijj=J("dynCall_iiiiijj"),n.dynCall_iiiiiijj=J("dynCall_iiiiiijj"),["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","print","printErr","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readAsmConstArgsArray","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","ccall","cwrap","uleb128Encode","sigToWasmTypes","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","flush_NO_FILESYSTEM","dlopenMissingError","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate","InternalError","BindingError","UnboundTypeError","PureVirtualError","init_embind","throwInternalError","throwBindingError","throwUnboundTypeError","ensureOverloadTable","exposePublicSymbol","replacePublicSymbol","extendError","createNamedFunction","embindRepr","registeredInstances","getBasestPointer","registerInheritedInstance","unregisterInheritedInstance","getInheritedInstance","getInheritedInstanceCount","getLiveInheritedInstances","registeredTypes","awaitingDependencies","typeDependencies","registeredPointers","registerType","whenDependentTypesAreResolved","embind_charCodes","embind_init_charCodes","readLatin1String","getTypeName","heap32VectorToArray","requireRegisteredType","getShiftFromSize","integerReadValueFromPointer","enumReadValueFromPointer","floatReadValueFromPointer","simpleReadValueFromPointer","runDestructors","new_","craftInvokerFunction","embind__requireFunction","tupleRegistrations","structRegistrations","genericPointerToWireType","constNoSmartPtrRawPointerToWireType","nonConstNoSmartPtrRawPointerToWireType","init_RegisteredPointer","RegisteredPointer","RegisteredPointer_getPointee","RegisteredPointer_destructor","RegisteredPointer_deleteObject","RegisteredPointer_fromWireType","runDestructor","releaseClassHandle","finalizationRegistry","detachFinalizer_deps","detachFinalizer","attachFinalizer","makeClassHandle","init_ClassHandle","ClassHandle","ClassHandle_isAliasOf","throwInstanceAlreadyDeleted","ClassHandle_clone","ClassHandle_delete","deletionQueue","ClassHandle_isDeleted","ClassHandle_deleteLater","flushPendingDeletes","delayFunction","setDelayFunction","RegisteredClass","shallowCopyInternalPointer","downcastPointer","upcastPointer","validateThis","char_0","char_9","makeLegalFunctionName","emval_handle_array","emval_free_list","emval_symbols","init_emval","count_emval_handles","get_first_emval","getStringOrSymbol","Emval","emval_newers","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_methodCallers","emval_addMethodCaller","emval_registeredMethods"].forEach((function(t){Object.getOwnPropertyDescriptor(n,t)||Object.defineProperty(n,t,{configurable:!0,get:function(){var e="'"+t+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";g(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),W(e)}})})),["ptrToString","zeroMemory","stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","getRandomDevice","traverseStack","convertPCtoSourceLocation","readAsmConstArgs","mainThreadEM_ASM","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertU32PairToI53","reallyNegative","unSign","strLen","reSign","formatString","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","checkWasiClock","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","registerInheritedInstance","unregisterInheritedInstance","requireRegisteredType","enumReadValueFromPointer","validateThis","getStringOrSymbol","craftEmvalAllocator","emval_get_global","emval_lookupTypes","emval_allocateDestructors","emval_addMethodCaller"].forEach((function(t){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,t)||Object.defineProperty(globalThis,t,{configurable:!0,get:function(){var e="`"+t+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line";g(t)&&(e+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),tt(e)}})})),V=function t(){ye||Se(),ye||(V=t)},n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return Se(),t.ready});t.exports=r},43389:(t,e,r)=>{"use strict";var i=r(25705);function n(){}var s={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function c(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,t!==n&&p(this,t)}function h(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function u(t,e,r){i((function(){var i;try{i=e(r)}catch(e){return s.reject(t,e)}i===t?s.reject(t,new TypeError("Cannot resolve promise with itself")):s.resolve(t,i)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function p(t,e){var r=!1;function i(e){r||(r=!0,s.reject(t,e))}function n(e){r||(r=!0,s.resolve(t,e))}var o=f((function(){e(n,i)}));"error"===o.status&&i(o.value)}function f(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}t.exports=c,c.prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then((function(r){return e.resolve(t()).then((function(){return r}))}),(function(r){return e.resolve(t()).then((function(){throw r}))}))},c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===o)return this;var r=new this.constructor(n);return this.state!==l?u(r,this.state===a?t:e,this.outcome):this.queue.push(new h(r,t,e)),r},h.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},h.prototype.otherCallFulfilled=function(t){u(this.promise,this.onFulfilled,t)},h.prototype.callRejected=function(t){s.reject(this.promise,t)},h.prototype.otherCallRejected=function(t){u(this.promise,this.onRejected,t)},s.resolve=function(t,e){var r=f(d,e);if("error"===r.status)return s.reject(t,r.value);var i=r.value;if(i)p(t,i);else{t.state=a,t.outcome=e;for(var n=-1,o=t.queue.length;++n{r(29718);var i=r(6941).s;function n(t){var e=new i;return(e.write(t)+e.end()).replace(/\0/g,"").trim()}t.exports=function t(e,r){if(!e)return n;try{new TextDecoder(e.trim())}catch(o){var i=s.exec(e);return i&&!r?t("windows-"+i[1],!0):n}return function(t){var r=new TextDecoder(e);return(r.decode(t,{stream:!0})+r.decode()).replace(/\0/g,"").trim()}};var s=/^(?:ANSI\s)?(\d+)$/m},9462:(t,e,r)=>{var i=r(11392);function n(t,e,r,i,n){var s=n(t.slice(e,e+r));switch(i){case"N":case"F":case"O":return parseFloat(s,10);case"D":return new Date(s.slice(0,4),parseInt(s.slice(4,6),10)-1,s.slice(6,8));case"L":return"y"===s.toLowerCase()||"t"===s.toLowerCase();default:return s}}function s(t,e,r,i){for(var s,o,a={},l=0,c=r.length;l{"use strict";t.exports=n;var i=r(80645);function n(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5;var s=4294967296,o=1/s,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===n.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function h(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n]}function u(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}n.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,s=this.pos;this.type=7&i,t(n,e,this),this.pos===s&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=x(this.buf,this.pos)+x(this.buf,this.pos+4)*s;return this.pos+=8,t},readSFixed64:function(){var t=x(this.buf,this.pos)+_(this.buf,this.pos+4)*s;return this.pos+=8,t},readFloat:function(){var t=i.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=i.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,s=r.buf;if(i=(112&(n=s[r.pos++]))>>4,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<3,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<10,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<17,n<128)return c(t,i,e);if(i|=(127&(n=s[r.pos++]))<<24,n<128)return c(t,i,e);if(i|=(1&(n=s[r.pos++]))<<31,n<128)return c(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,r){return a.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n239?4:l>223?3:l>191?2:1;if(n+h>r)break;1===h?l<128&&(c=l):2===h?128==(192&(s=t[n+1]))&&(c=(31&l)<<6|63&s)<=127&&(c=null):3===h?(s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&((c=(15&l)<<12|(63&s)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((c=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),n+=h}return i}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==n.Bytes)return t.push(this.readVarint(e));var r=l(this);for(t=t||[];this.pos127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,s=0;s55295&&i<57344){if(!n){i>56319||s+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&h(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),i.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),i.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&h(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},24472:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>rr});var i=1,n=2,s=3,o=5,a=6378137,l=6356752.314,c=.0066943799901413165,h=484813681109536e-20,u=Math.PI/2,d=1e-10,p=.017453292519943295,f=57.29577951308232,m=Math.PI/4,g=2*Math.PI,A=3.14159265359,y={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};const v={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var x=/[\s_\-\/\(\)]/g;function b(t,e){if(t[e])return t[e];for(var r,i=Object.keys(t),n=e.toLowerCase().replace(x,""),s=-1;++s=this.text.length)return;t=this.text[this.place++]}switch(this.state){case E:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},R.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(T.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},R.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=E)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=E,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},R.prototype.number=function(t){if(!I.test(t)){if(T.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},R.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},R.prototype.keyword=function(t){if(C.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=E)}if(!T.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},R.prototype.neutral=function(t){if(S.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(I.test(t))return this.word=t,void(this.state=3);if(!T.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},R.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=D(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(n),n}function k(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?k[t]=_(arguments[1]):k[t]=O(arguments[1]):k[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?k.apply(e,t):k(t)}));if("string"==typeof t){if(t in k)return k[t]}else"EPSG"in t?k["EPSG:"+t.EPSG]=t:"ESRI"in t?k["ESRI:"+t.ESRI]=t:"IAU2000"in t?k["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(k);const U=k;var N=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],F=["3857","900913","3785","102113"];function z(t,e){var r,i;if(t=t||{},!e)return t;for(i in e)void 0!==(r=e[i])&&(t[i]=r);return t}function G(t,e,r){var i=t*e;return r/Math.sqrt(1-i*i)}function Q(t){return t<0?-1:1}function j(t){return Math.abs(t)<=A?t:t-Q(t)*g}function V(t,e,r){var i=t*r,n=.5*t;return i=Math.pow((1-i)/(1+i),n),Math.tan(.5*(u-e))/i}function H(t,e){for(var r,i,n=.5*t,s=u-2*Math.atan(e),o=0;o<=15;o++)if(r=t*Math.sin(s),s+=i=u-2*Math.atan(e*Math.pow((1-r)/(1+r),n))-s,Math.abs(i)<=1e-10)return s;return-9999}function W(t){return t}var q=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,i=t.x,n=t.y;if(n*f>90&&n*f<-90&&i*f>180&&i*f<-180)return null;if(Math.abs(Math.abs(n)-u)<=d)return null;if(this.sphere)e=this.x0+this.a*this.k0*j(i-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(m+.5*n));else{var s=Math.sin(n),o=V(this.e,n,s);e=this.x0+this.a*this.k0*j(i-this.long0),r=this.y0-this.a*this.k0*Math.log(o)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,i=t.x-this.x0,n=t.y-this.y0;if(this.sphere)r=u-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var s=Math.exp(-n/(this.a*this.k0));if(-9999===(r=H(this.e,s)))return null}return e=j(this.long0+i/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:W,inverse:W,names:["longlat","identity"]}],Z={},Y=[];function X(t,e){var r=Y.length;return t.names?(Y[r]=t,t.names.forEach((function(t){Z[t.toLowerCase()]=r})),this):(console.log(e),!0)}const J={start:function(){q.forEach(X)},add:X,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Z[e]&&Y[Z[e]]?Y[Z[e]]:void 0}};var K={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},$=K.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};K.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var tt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};var et={};function rt(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:et[t]||null,isNull:!1}}function it(t){return t/3600*Math.PI/180}function nt(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function st(t){return t.map((function(t){return[it(t.longitudeShift),it(t.latitudeShift)]}))}function ot(t,e,r){return{name:nt(t,e+8,e+16).trim(),parent:nt(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function at(t,e,r,i){for(var n=e+176,s=[],o=0;o-1}))}(t)){var e=O(t);if(function(t){var e=b(t,"authority");if(e){var r=b(e,"epsg");return r&&F.indexOf(r)>-1}}(e))return U["EPSG:3857"];var r=function(t){var e=b(t,"extension");if(e)return b(e,"proj4")}(e);return r?_(r):e}return function(t){return"+"===t[0]}(t)?_(t):void 0}(t);if("object"==typeof r){var a=lt.projections.get(r.projName);if(a){if(r.datumCode&&"none"!==r.datumCode){var l=b(tt,r.datumCode);l&&(r.datum_params=r.datum_params||(l.towgs84?l.towgs84.split(","):null),r.ellps=l.ellipse,r.datumName=l.datumName?l.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var c,u,p,f,m,g,A=function(t,e,r,i,n){if(!t){var s=b(K,i);s||(s=$),t=s.a,e=s.b,r=s.rf}return r&&!e&&(e=(1-1/r)*t),(0===r||Math.abs(t-e)3&&(0===d.datum_params[3]&&0===d.datum_params[4]&&0===d.datum_params[5]&&0===d.datum_params[6]||(d.datum_type=n,d.datum_params[3]*=h,d.datum_params[4]*=h,d.datum_params[5]*=h,d.datum_params[6]=d.datum_params[6]/1e6+1))),u&&(d.datum_type=s,d.grids=u),d.a=r,d.b=a,d.es=l,d.ep2=c,d}(r.datumCode,r.datum_params,A.a,A.b,y.es,y.ep2,v);z(this,r),z(this,a),this.a=A.a,this.b=A.b,this.rf=A.rf,this.sphere=A.sphere,this.es=y.es,this.e=y.e,this.ep2=y.ep2,this.datum=x,this.init(),e(null,this)}else e(t)}else e(t)}lt.projections=J,lt.projections.start();const ct=lt;function ht(t,e,r){var i,n,s,o,a=t.x,l=t.y,c=t.z?t.z:0;if(l<-u&&l>-1.001*u)l=-u;else if(l>u&&l<1.001*u)l=u;else{if(l<-u)return{x:-1/0,y:-1/0,z:t.z};if(l>u)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(l),o=Math.cos(l),s=n*n,{x:((i=r/Math.sqrt(1-e*s))+c)*o*Math.cos(a),y:(i+c)*o*Math.sin(a),z:(i*(1-e)+c)*n}}function ut(t,e,r,i){var n,s,o,a,l,c,h,u,d,p,f,m,g,A,y,v=t.x,x=t.y,b=t.z?t.z:0;if(n=Math.sqrt(v*v+x*x),s=Math.sqrt(v*v+x*x+b*b),n/r<1e-12){if(A=0,s/r<1e-12)return y=-i,{x:t.x,y:t.y,z:t.z}}else A=Math.atan2(x,v);o=b/s,u=(a=n/s)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*a*a)),d=o*l,g=0;do{g++,c=e*(h=r/Math.sqrt(1-e*d*d))/(h+(y=n*u+b*d-h*(1-e*d*d))),m=(f=o*(l=1/Math.sqrt(1-c*(2-c)*a*a)))*u-(p=a*(1-c)*l)*d,u=p,d=f}while(m*m>1e-24&&g<30);return{x:A,y:Math.atan(f/Math.abs(p)),z:y}}function dt(t){return t===i||t===n}function pt(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var i={x:-r.x,y:r.y},n={x:Number.NaN,y:Number.NaN},s=[];t:for(var o=0;oi.y||p>i.x||A1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=j(s.x+r.ll[0]),i.y=s.y+r.ll[1]}else isNaN(s.x)||(i.x=t.x+s.x,i.y=t.y+s.y);return i}function mt(t,e){var r,i={x:t.x/e.del[0],y:t.y/e.del[1]},n=Math.floor(i.x),s=Math.floor(i.y),o=i.x-1*n,a=i.y-1*s,l={x:Number.NaN,y:Number.NaN};if(n<0||n>=e.lim[0])return l;if(s<0||s>=e.lim[1])return l;r=s*e.lim[0]+n;var c=e.cvs[r][0],h=e.cvs[r][1];r++;var u=e.cvs[r][0],d=e.cvs[r][1];r+=e.lim[0];var p=e.cvs[r][0],f=e.cvs[r][1];r--;var m=e.cvs[r][0],g=e.cvs[r][1],A=o*a,y=o*(1-a),v=(1-o)*(1-a),x=(1-o)*a;return l.x=v*c+y*u+x*m+A*p,l.y=v*h+y*d+x*g+A*f,l}function gt(t,e,r){var i,n,s,o=r.x,a=r.y,l=r.z||0,c={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==r.z)switch(0===s?(i=o,n=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(i=a,n=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(i=l,n="z"),t.axis[s]){case"e":case"n":c[n]=i;break;case"w":case"s":c[n]=-i;break;case"u":void 0!==r[n]&&(c.z=i);break;case"d":void 0!==r[n]&&(c.z=-i);break;default:return null}return c}function At(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function yt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function vt(t,e,r,h){var u,d=void 0!==(r=Array.isArray(r)?At(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){yt(t.x),yt(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===i||t.datum.datum_type===n||t.datum.datum_type===s)&&"WGS84"!==e.datumCode||(e.datum.datum_type===i||e.datum.datum_type===n||e.datum.datum_type===s)&&"WGS84"!==t.datumCode}(t,e)&&(r=vt(t,u=new ct("WGS84"),r,h),t=u),h&&"enu"!==t.axis&&(r=gt(t,!1,r)),"longlat"===t.projName)r={x:r.x*p,y:r.y*p,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===i?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==n||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===o||e.datum_type===o)return r;var h=t.a,u=t.es;if(t.datum_type===s){if(0!==pt(t,!1,r))return;h=a,u=c}var d=e.a,p=e.b,f=e.es;return e.datum_type===s&&(d=a,p=l,f=c),u!==f||h!==d||dt(t.datum_type)||dt(e.datum_type)?(r=ht(r,u,h),dt(t.datum_type)&&(r=function(t,e,r){if(e===i)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===n){var s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6];return{x:u*(t.x-h*t.y+c*t.z)+s,y:u*(h*t.x+t.y-l*t.z)+o,z:u*(-c*t.x+l*t.y+t.z)+a}}}(r,t.datum_type,t.datum_params)),dt(e.datum_type)&&(r=function(t,e,r){if(e===i)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===n){var s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],d=(t.x-s)/u,p=(t.y-o)/u,f=(t.z-a)/u;return{x:d+h*p-c*f,y:-h*d+p+l*f,z:c*d-l*p+f}}}(r,e.datum_type,e.datum_params)),r=ut(r,f,d,p),e.datum_type!==s||0===pt(e,!0,r)?r:void 0):r}(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*f,y:r.y*f,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),h&&"enu"!==e.axis?gt(e,!0,r):(r&&!d&&delete r.z,r)}var xt=ct("WGS84");function bt(t,e,r,i){var n,s,o;return Array.isArray(r)?(n=vt(t,e,r,i)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(r.splice(3)):[n.x,n.y,r[2]].concat(r.splice(3)):[n.x,n.y].concat(r.splice(2)):[n.x,n.y]):(s=vt(t,e,r,i),2===(o=Object.keys(r)).length||o.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;s[i]=r[i]})),s)}function _t(t){return t instanceof ct?t:t.oProj?t.oProj:ct(t)}const wt=function(t,e,r){t=_t(t);var i,n=!1;return void 0===e?(e=t,t=xt,n=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=xt,n=!0),e=_t(e),r?bt(t,e,r):(i={forward:function(r,i){return bt(t,e,r,i)},inverse:function(r,i){return bt(e,t,r,i)}},n&&(i.oProj=e),i)};var Et=6,Mt="AJSAJS",St="AFAFAF",Ct=65,Tt=73,It=79,Rt=86,Bt=90;const Lt={forward:Pt,inverse:function(t){var e=Ut(Ft(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:Dt};function Pt(t,e){return e=e||5,function(t,e){var r,i,n,s,o,a,l,c,h,u,d,p="00000"+t.easting,f="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(h=t.easting,u=t.northing,d=Nt(t.zoneNumber),r=Math.floor(h/1e5),i=Math.floor(u/1e5)%20,n=d-1,s=Mt.charCodeAt(n),o=St.charCodeAt(n),c=!1,(a=s+r-1)>Bt&&(a=a-Bt+Ct-1,c=!0),(a===Tt||sTt||(a>Tt||sIt||(a>It||sBt&&(a=a-Bt+Ct-1),(l=o+i)>Rt?(l=l-Rt+Ct-1,c=!0):c=!1,(l===Tt||oTt||(l>Tt||oIt||(l>It||oRt&&(l=l-Rt+Ct-1),String.fromCharCode(a)+String.fromCharCode(l))+p.substr(p.length-5,e)+f.substr(f.length-5,e)}(function(t){var e,r,i,n,s,o,a,l=t.lat,c=t.lon,h=6378137,u=.00669438,d=.9996,p=Ot(l),f=Ot(c);a=Math.floor((c+180)/6)+1,180===c&&(a=60),l>=56&&l<64&&c>=3&&c<12&&(a=32),l>=72&&l<84&&(c>=0&&c<9?a=31:c>=9&&c<21?a=33:c>=21&&c<33?a=35:c>=33&&c<42&&(a=37)),o=Ot(6*(a-1)-180+3),e=.006739496752268451,r=h/Math.sqrt(1-u*Math.sin(p)*Math.sin(p)),i=Math.tan(p)*Math.tan(p),n=e*Math.cos(p)*Math.cos(p);var m,g,A=d*r*((s=Math.cos(p)*(f-o))+(1-i+n)*s*s*s/6+(5-18*i+i*i+72*n-58*e)*s*s*s*s*s/120)+5e5,y=d*(h*(.9983242984503243*p-.002514607064228144*Math.sin(2*p)+2639046602129982e-21*Math.sin(4*p)-3.418046101696858e-9*Math.sin(6*p))+r*Math.tan(p)*(s*s/2+(5-i+9*n+4*n*n)*s*s*s*s/24+(61-58*i+i*i+600*n-2.2240339282485886)*s*s*s*s*s*s/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(A),zoneNumber:a,zoneLetter:(m=l,g="Z",84>=m&&m>=72?g="X":72>m&&m>=64?g="W":64>m&&m>=56?g="V":56>m&&m>=48?g="U":48>m&&m>=40?g="T":40>m&&m>=32?g="S":32>m&&m>=24?g="R":24>m&&m>=16?g="Q":16>m&&m>=8?g="P":8>m&&m>=0?g="N":0>m&&m>=-8?g="M":-8>m&&m>=-16?g="L":-16>m&&m>=-24?g="K":-24>m&&m>=-32?g="J":-32>m&&m>=-40?g="H":-40>m&&m>=-48?g="G":-48>m&&m>=-56?g="F":-56>m&&m>=-64?g="E":-64>m&&m>=-72?g="D":-72>m&&m>=-80&&(g="C"),g)}}({lat:t[1],lon:t[0]}),e)}function Dt(t){var e=Ut(Ft(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Ot(t){return t*(Math.PI/180)}function kt(t){return t/Math.PI*180}function Ut(t){var e=t.northing,r=t.easting,i=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var s,o,a,l,c,h,u,d,p,f=.9996,m=6378137,g=.00669438,A=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,v=e;i<"N"&&(v-=1e7),u=6*(n-1)-180+3,s=.006739496752268451,p=(d=v/f/6367449.145945056)+(3*A/2-27*A*A*A/32)*Math.sin(2*d)+(21*A*A/16-55*A*A*A*A/32)*Math.sin(4*d)+151*A*A*A/96*Math.sin(6*d),o=m/Math.sqrt(1-g*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),l=s*Math.cos(p)*Math.cos(p),c=.99330562*m/Math.pow(1-g*Math.sin(p)*Math.sin(p),1.5),h=y/(o*f);var x=p-o*Math.tan(p)/c*(h*h/2-(5+3*a+10*l-4*l*l-9*s)*h*h*h*h/24+(61+90*a+298*l+45*a*a-1.6983531815716497-3*l*l)*h*h*h*h*h*h/720);x=kt(x);var b,_=(h-(1+2*a+l)*h*h*h/6+(5-2*l+28*a-3*l*l+8*s+24*a*a)*h*h*h*h*h/120)/Math.cos(p);if(_=u+kt(_),t.accuracy){var w=Ut({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:w.lat,right:w.lon,bottom:x,left:_}}else b={lat:x,lon:_};return b}function Nt(t){var e=t%Et;return 0===e&&(e=Et),e}function Ft(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,i=null,n="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;n+=e,s++}var o=parseInt(n,10);if(0===s||s+3>r)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(s++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;i=t.substring(s,s+=2);for(var l=Nt(o),c=function(t,e){for(var r=Mt.charCodeAt(e-1),i=1e5,n=!1;r!==t.charCodeAt(0);){if(++r===Tt&&r++,r===It&&r++,r>Bt){if(n)throw"Bad character: "+t;r=Ct,n=!0}i+=1e5}return i}(i.charAt(0),l),h=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=St.charCodeAt(e-1),i=0,n=!1;r!==t.charCodeAt(0);){if(++r===Tt&&r++,r===It&&r++,r>Rt){if(n)throw"Bad character: "+t;r=Ct,n=!0}i+=1e5}return i}(i.charAt(1),l);h0&&(d=1e5/Math.pow(10,m),p=t.substring(s,s+m),g=parseFloat(p)*d,f=t.substring(s+m),A=parseFloat(f)*d),{easting:g+c,northing:A+h,zoneLetter:a,zoneNumber:o,accuracy:d}}function zt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Gt(t,e,r){if(!(this instanceof Gt))return new Gt(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Gt.fromMGRS=function(t){return new Gt(Dt(t))},Gt.prototype.toMGRS=function(t){return Pt([this.x,this.y],t)};const Qt=Gt;var jt=.046875,Vt=.01953125,Ht=.01068115234375;function Wt(t){var e=[];e[0]=1-t*(.25+t*(jt+t*(Vt+t*Ht))),e[1]=t*(.75-t*(jt+t*(Vt+t*Ht)));var r=t*t;return e[2]=r*(.46875-t*(.013020833333333334+.007120768229166667*t)),r*=t,e[3]=r*(.3645833333333333-.005696614583333333*t),e[4]=r*t*.3076171875,e}function qt(t,e,r,i){return r*=e,e*=e,i[0]*t-r*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))}function Zt(t,e,r){for(var i=1/(1-e),n=t,s=20;s;--s){var o=Math.sin(n),a=1-e*o*o;if(n-=a=(qt(n,o,Math.cos(n),r)-t)*(a*Math.sqrt(a))*i,Math.abs(a)d?Math.tan(s):0,m=Math.pow(f,2),g=Math.pow(m,2);e=1-this.es*Math.pow(a,2),c/=Math.sqrt(e);var A=qt(s,a,l,this.en);r=this.a*(this.k0*c*(1+h/6*(1-m+u+h/20*(5-18*m+g+14*u-58*m*u+h/42*(61+179*g-g*m-479*m)))))+this.x0,i=this.a*(this.k0*(A-this.ml0+a*o*c/2*(1+h/12*(5-m+9*u+4*p+h/30*(61+g-58*m+270*u-330*m*u+h/56*(1385+543*g-g*m-3111*m))))))+this.y0}else{var y=l*Math.sin(o);if(Math.abs(Math.abs(y)-1)=1){if(y-1>d)return 93;i=0}else i=Math.acos(i);s<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=r,t.y=i,t},inverse:function(t){var e,r,i,n,s=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(r=Zt(e=this.ml0+o/this.k0,this.es,this.en),Math.abs(r)d?Math.tan(r):0,h=this.ep2*Math.pow(l,2),p=Math.pow(h,2),f=Math.pow(c,2),m=Math.pow(f,2);e=1-this.es*Math.pow(a,2);var g=s*Math.sqrt(e)/this.k0,A=Math.pow(g,2);i=r-(e*=c)*A/(1-this.es)*.5*(1-A/12*(5+3*f-9*h*f+h-4*p-A/30*(61+90*f-252*h*f+45*m+46*h-A/56*(1385+3633*f+4095*m+1574*m*f)))),n=j(this.long0+g*(1-A/6*(1+2*f+h-A/20*(5+28*f+24*m+8*h*f+6*h-A/42*(61+662*f+1320*m+720*m*f))))/l)}else i=u*Q(o),n=0;else{var y=Math.exp(s/this.k0),v=.5*(y-1/y),x=this.lat0+o/this.k0,b=Math.cos(x);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(v,2))),i=Math.asin(e),o<0&&(i=-i),n=0===v&&0===b?0:j(Math.atan2(v,b)+this.long0)}return t.x=n,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Xt(t){var e=Math.exp(t);return(e-1/e)/2}function Jt(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),i=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function Kt(t,e){for(var r,i=2*Math.cos(2*e),n=t.length-1,s=t[n],o=0;--n>=0;)r=i*s-o+t[n],o=s,s=r;return e+r*Math.sin(2*e)}function $t(t,e,r){for(var i,n,s=Math.sin(e),o=Math.cos(e),a=Xt(r),l=function(t){var e=Math.exp(t);return(e+1/e)/2}(r),c=2*o*l,h=-2*s*a,u=t.length-1,d=t[u],p=0,f=0,m=0;--u>=0;)i=f,n=p,d=c*(f=d)-i-h*(p=m)+t[u],m=h*f-n+c*p;return[(c=s*l)*d-(h=o*a)*m,c*m+h*d]}const te={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Yt.init.apply(this),this.forward=Yt.forward,this.inverse=Yt.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var i=Kt(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var r,i=2*Math.cos(e),n=t.length-1,s=t[n],o=0;--n>=0;)r=i*s-o+t[n],o=s,s=r;return Math.sin(e)*r}(this.gtu,2*i))},forward:function(t){var e=j(t.x-this.long0),r=t.y;r=Kt(this.cbg,r);var i=Math.sin(r),n=Math.cos(r),s=Math.sin(e),o=Math.cos(e);r=Math.atan2(i,o*n),e=Math.atan2(s*n,Jt(i,n*o)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(Jt(1,e)+1))),t<0?-e:e}(Math.tan(e));var a,l,c=$t(this.gtu,2*r,2*e);return r+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(a=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(a=1/0,l=1/0),t.x=a,t.y=l,t},inverse:function(t){var e,r,i=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var s=$t(this.utg,2*n,2*i);n+=s[0],i+=s[1],i=Math.atan(Xt(i));var o=Math.sin(n),a=Math.cos(n),l=Math.sin(i),c=Math.cos(i);n=Math.atan2(o*c,Jt(l,c*a)),e=j((i=Math.atan2(l,c*a))+this.long0),r=Kt(this.cgb,n)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},ee={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(j(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*p,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,te.init.apply(this),this.forward=te.forward,this.inverse=te.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function re(t,e){return Math.pow((1-t)/(1+t),e)}const ie={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+m)/(Math.pow(Math.tan(.5*this.lat0+m),this.C)*re(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+m),this.C)*re(this.e*Math.sin(r),this.ratexp))-u,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,i=Math.pow(Math.tan(.5*r+m)/this.K,1/this.C),n=20;n>0&&(r=2*Math.atan(i*re(this.e*Math.sin(t.y),-.5*this.e))-u,!(Math.abs(r-t.y)<1e-14));--n)t.y=r;return n?(t.x=e,t.y=r,t):null},names:["gauss"]},ne={init:function(){ie.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,i,n;return t.x=j(t.x-this.long0),ie.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),i=Math.cos(t.x),n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*i),t.x=n*r*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*r*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,i,n,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var o=2*Math.atan2(s,this.R2);e=Math.sin(o),r=Math.cos(o),n=Math.asin(r*this.sinc0+t.y*e*this.cosc0/s),i=Math.atan2(t.x*e,s*this.cosc0*r-t.y*this.sinc0*e)}else n=this.phic0,i=0;return t.x=i,t.y=n,ie.inverse.apply(this,[t]),t.x=j(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},se={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=d&&(this.k0=.5*(1+Q(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=d&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=d&&Math.abs(Math.cos(this.lat_ts))>d&&(this.k0=.5*this.cons*G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/V(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=G(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-u,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,i,n,s,o,a=t.x,l=t.y,c=Math.sin(l),h=Math.cos(l),p=j(a-this.long0);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=d&&Math.abs(l+this.lat0)<=d?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*h*Math.cos(p)),t.x=this.a*e*h*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*h*Math.cos(p))+this.y0,t):(r=2*Math.atan(this.ssfn_(l,c,this.e))-u,n=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=d?(s=V(this.e,l*this.con,this.con*c),o=2*this.a*this.k0*s/this.cons,t.x=this.x0+o*Math.sin(a-this.long0),t.y=this.y0-this.con*o*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)0?j(this.long0+Math.atan2(t.x,-1*t.y)):j(this.long0+Math.atan2(t.x,t.y)):j(this.long0+Math.atan2(t.x*Math.sin(a),o*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=d){if(o<=d)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,i=o*this.cons/(2*this.a*this.k0),r=this.con*H(this.e,i),e=this.con*j(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else n=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=d?s=this.X0:(s=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/o),e=j(this.long0+Math.atan2(t.x*Math.sin(n),o*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))),r=-1*H(this.e,Math.tan(.5*(u+s)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(u+t))*Math.pow((1-e)/(1+e),.5*r)}},oe={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,i=1/this.rf,n=2*i-Math.pow(i,2),s=this.e=Math.sqrt(n);this.R=this.k0*r*Math.sqrt(1-n)/(1-n*Math.pow(e,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+s*e)/(1-s*e));this.K=o-this.alpha*a+this.alpha*s/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=-this.alpha*(e+r)+this.K,n=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*o+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,i=e/this.R,n=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(i)),o=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(n))),a=this.lambda0+o/this.alpha,l=0,c=s,h=-1e3,u=0;Math.abs(c-h)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),h=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=c,t},names:["somerc"]};var ae=1e-7;const le={init:function(){var t,e,r,i,n,s,o,a,l,c,h,f,A,y=0,v=0,x=0,b=0,_=0,w=0,E=0;this.no_off=(A="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(A)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),M&&(E=this.alpha),S&&(y=this.rectified_grid_angle*p),M||S)v=this.longc;else if(x=this.long1,_=this.lat1,b=this.long2,w=this.lat2,Math.abs(_-w)<=ae||(t=Math.abs(_))<=ae||Math.abs(t-u)<=ae||Math.abs(Math.abs(this.lat0)-u)<=ae||Math.abs(Math.abs(w)-u)<=ae)throw new Error;var C=1-this.es;e=Math.sqrt(C),Math.abs(this.lat0)>d?(a=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*a*a,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/C),this.A=this.B*this.k0*e/t,(n=(i=this.B*e/(r*Math.sqrt(t)))*i-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(V(this.e,this.lat0,a),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=n=1),M||S?(M?(h=Math.asin(Math.sin(E)/i),S||(y=E)):(h=y,E=Math.asin(i*Math.sin(h))),this.lam0=v-Math.asin(.5*(n-1/n)*Math.tan(h))/this.B):(s=Math.pow(V(this.e,_,Math.sin(_)),this.B),o=Math.pow(V(this.e,w,Math.sin(w)),this.B),n=this.E/s,l=(o-s)/(o+s),c=((c=this.E*this.E)-o*s)/(c+o*s),(t=x-b)<-Math.pi?b-=g:t>Math.pi&&(b+=g),this.lam0=j(.5*(x+b)-Math.atan(c*Math.tan(.5*this.B*(x-b))/l)/this.B),h=Math.atan(2*Math.sin(this.B*j(x-this.lam0))/(n-1/n)),y=E=Math.asin(i*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(E))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(m-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(m+n))},forward:function(t){var e,r,i,n,s,o,a,l,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-u)>d){if(e=.5*((s=this.E/Math.pow(V(this.e,t.y,Math.sin(t.y)),this.B))-(o=1/s)),r=.5*(s+o),n=Math.sin(this.B*t.x),i=(e*this.singam-n*this.cosgam)/r,Math.abs(Math.abs(i)-1)0?this.v_pole_n:this.v_pole_s,a=this.ArB*t.y;return this.no_rot?(c.x=a,c.y=l):(a-=this.u_0,c.x=l*this.cosrot+a*this.sinrot,c.y=a*this.cosrot-l*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,r,i,n,s,o,a,l={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((i=Math.exp(-this.BrA*r))-1/i),s=.5*(i+1/i),a=((o=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/s,Math.abs(Math.abs(a)-1)d?this.ns=Math.log(i/a)/Math.log(n/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=d&&(r=Q(r)*(u-2e-10));var i,n,s=Math.abs(Math.abs(r)-u);if(s>d)i=V(this.e,r,Math.sin(r)),n=this.a*this.f0*Math.pow(i,this.ns);else{if((s=r*this.ns)<=0)return null;n=0}var o=this.ns*j(e-this.long0);return t.x=this.k0*(n*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(o))+this.y0,t},inverse:function(t){var e,r,i,n,s,o=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+a*a),r=1):(e=-Math.sqrt(o*o+a*a),r=-1);var l=0;if(0!==e&&(l=Math.atan2(r*o,r*a)),0!==e||this.ns>0){if(r=1/this.ns,i=Math.pow(e/(this.a*this.f0),r),-9999===(n=H(this.e,i)))return null}else n=-u;return s=j(l/this.ns+this.long0),t.x=s,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},he={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,i,n,s,o,a,l=t.x,c=t.y,h=j(l-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),i=-h*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),s=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(n)),o=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=a*Math.cos(o)/1,t.x=a*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,i,n,s,o,a,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(e)),t.x=this.long0-r/this.alfa,o=e,a=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-t.y)<1e-10&&(a=1),o=t.y,c+=1}while(0===a&&c<15);return c>=15?null:t},names:["Krovak","krovak"]};function ue(t,e,r,i,n){return t*n-e*Math.sin(2*n)+r*Math.sin(4*n)-i*Math.sin(6*n)}function de(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function pe(t){return.375*t*(1+.25*t*(1+.46875*t))}function fe(t){return.05859375*t*t*(1+.75*t)}function me(t){return t*t*t*(35/3072)}function ge(t,e,r){var i=e*r;return t/Math.sqrt(1-i*i)}function Ae(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}const be={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-u)0)switch(this.qp=xe(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,e=t*t,r[0]+=.17222222222222222*e,r[1]=.06388888888888888*e,e*=t,r[0]+=.10257936507936508*e,r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=xe(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,i,n,s,o,a,l,c,h,p=t.x,f=t.y;if(p=j(p-this.long0),this.sphere){if(s=Math.sin(f),h=Math.cos(f),i=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+h*i:1+this.sinph0*s+this.cosph0*h*i)<=d)return null;e=(r=Math.sqrt(2/r))*h*Math.sin(p),r*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*h*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(f+this.lat0)=0?(e=(c=Math.sqrt(o))*n,r=i*(this.mode===this.S_POLE?c:-c)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,i,n,s,o,a,l,c,h,p=t.x/this.a,f=t.y/this.a;if(this.sphere){var m,g=0,A=0;if((r=.5*(m=Math.sqrt(p*p+f*f)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(A=Math.sin(r),g=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(m)<=d?0:Math.asin(f*A/m),p*=A,f=g*m;break;case this.OBLIQ:r=Math.abs(m)<=d?this.lat0:Math.asin(g*this.sinph0+f*A*this.cosph0/m),p*=A*this.cosph0,f=(g-Math.sin(r)*this.sinph0)*m;break;case this.N_POLE:f=-f,r=u-r;break;case this.S_POLE:r-=u}e=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(o=Math.sqrt(p*p+f*f))1&&(t=t>1?1:-1),Math.asin(t)}const we={init:function(){Math.abs(this.lat1+this.lat2)d?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=xe(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*j(e-this.long0),o=n*Math.sin(s)+this.x0,a=this.rh-n*Math.cos(s)+this.y0;return t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),n=0,0!==e&&(n=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-i*i)/(2*this.ns0)):(r=(this.c-i*i)/this.ns0,o=this.phi1z(this.e3,r)),s=j(n/this.ns0+this.long0),t.x=s,t.y=o,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,i,n,s,o=_e(.5*e);if(t0||Math.abs(s)<=d?(o=this.x0+1*this.a*r*Math.sin(i)/s,a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)/s):(o=this.x0+this.infinity_dist*r*Math.sin(i),a=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*n)),t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),r=Math.sin(n),o=_e((i=Math.cos(n))*this.sin_p14+t.y*r*this.cos_p14/e),s=Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r),s=j(this.long0+s)):(o=this.phic0,s=0),t.x=s,t.y=o,t},names:["gnom"]},Me={init:function(){this.sphere||(this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,i=t.x,n=t.y,s=j(i-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var o=xe(this.e,Math.sin(n));e=this.x0+this.a*this.k0*s,r=this.y0+this.a*o*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=j(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*u:u;for(var i,n,s,o,a=Math.asin(.5*e),l=0;l<30;l++)if(n=Math.sin(a),s=Math.cos(a),o=t*n,a+=i=Math.pow(1-o*o,2)/(2*s)*(e/(1-t*t)-n/(1-o*o)+.5/t*Math.log((1-o)/(1+o))),Math.abs(i)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),e=j(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]},Se={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,i=j(e-this.long0),n=Ae(r-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*n,t},inverse:function(t){var e=t.x,r=t.y;return t.x=j(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Ae(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Ce={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=de(this.es),this.e1=pe(this.es),this.e2=fe(this.es),this.e3=me(this.es),this.ml0=this.a*ue(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,i,n=t.x,s=t.y,o=j(n-this.long0);if(i=o*Math.sin(s),this.sphere)Math.abs(s)<=d?(e=this.a*o,r=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(s),r=this.a*(Ae(s-this.lat0)+(1-Math.cos(i))/Math.tan(s)));else if(Math.abs(s)<=d)e=this.a*o,r=-1*this.ml0;else{var a=ge(this.a,this.e,Math.sin(s))/Math.tan(s);e=a*Math.sin(i),r=this.a*ue(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+a*(1-Math.cos(i))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,i,n,s,o,a,l,c;if(i=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=d)e=j(i/this.a+this.long0),r=0;else{var h;for(o=this.lat0+n/this.a,a=i*i/this.a/this.a+o*o,l=o,s=20;s;--s)if(l+=c=-1*(o*(l*(h=Math.tan(l))+1)-l-.5*(l*l+a)*h)/((l-o)/h-1),Math.abs(c)<=d){r=l;break}e=j(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(n+this.ml0)<=d)r=0,e=j(this.long0+i/this.a);else{var u,p,f,m,g;for(o=(this.ml0+n)/this.a,a=i*i/this.a/this.a+o*o,l=o,s=20;s;--s)if(g=this.e*Math.sin(l),u=Math.sqrt(1-g*g)*Math.tan(l),p=this.a*ue(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=c=(o*(u*(m=p/this.a)+1)-m-.5*u*(m*m+a))/(this.es*Math.sin(2*l)*(m*m+a-2*o*m)/(4*u)+(o-m)*(u*f-2/Math.sin(2*l))-f),Math.abs(c)<=d){r=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=j(this.long0+Math.asin(i*u/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]},Te={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,i=t.y-this.lat0,n=r-this.long0,s=i/h*1e-5,o=n,a=1,l=0;for(e=1;e<=10;e++)a*=s,l+=this.A[e]*a;var c,u=l,d=o,p=1,f=0,m=0,g=0;for(e=1;e<=6;e++)c=f*u+p*d,p=p*u-f*d,f=c,m=m+this.B_re[e]*p-this.B_im[e]*f,g=g+this.B_im[e]*p+this.B_re[e]*f;return t.x=g*this.a+this.x0,t.y=m*this.a+this.y0,t},inverse:function(t){var e,r,i=t.x,n=t.y,s=i-this.x0,o=(n-this.y0)/this.a,a=s/this.a,l=1,c=0,u=0,d=0;for(e=1;e<=6;e++)r=c*o+l*a,l=l*o-c*a,c=r,u=u+this.C_re[e]*l-this.C_im[e]*c,d=d+this.C_im[e]*l+this.C_re[e]*c;for(var p=0;p.999999999999&&(r=.999999999999),e=Math.asin(r);var i=j(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var n=Math.asin(r);return t.x=i,t.y=n,t},names:["Mollweide","moll"]},Le={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;return 0!==r&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere?(n=j(this.long0+s/this.ns),i=Ae(this.g-r/this.a),t.x=n,t.y=i,t):(i=ye(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),n=j(this.long0+s/this.ns),t.x=n,t.y=i,t)},names:["Equidistant_Conic","eqdc"]},Pe={init:function(){this.R=this.a},forward:function(t){var e,r,i=t.x,n=t.y,s=j(i-this.long0);Math.abs(n)<=d&&(e=this.x0+this.R*s,r=this.y0);var o=_e(2*Math.abs(n/Math.PI));(Math.abs(s)<=d||Math.abs(Math.abs(n)-u)<=d)&&(e=this.x0,r=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var a=.5*Math.abs(Math.PI/s-s/Math.PI),l=a*a,c=Math.sin(o),h=Math.cos(o),p=h/(c+h-1),f=p*p,m=p*(2/c-1),g=m*m,A=Math.PI*this.R*(a*(p-g)+Math.sqrt(l*(p-g)*(p-g)-(g+l)*(f-g)))/(g+l);s<0&&(A=-A),e=this.x0+A;var y=l+p;return A=Math.PI*this.R*(m*y-a*Math.sqrt((g+l)*(l+1)-y*y))/(g+l),r=n>=0?this.y0+A:this.y0-A,t.x=e,t.y=r,t},inverse:function(t){var e,r,i,n,s,o,a,l,c,h,u,p;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=(i=t.x/u)*i+(n=t.y/u)*n,u=3*(n*n/(l=-2*(o=-Math.abs(n)*(1+s))+1+2*n*n+s*s)+(2*(a=o-2*n*n+i*i)*a*a/l/l/l-9*o*a/l/l)/27)/(c=(o-a*a/3/l)/l)/(h=2*Math.sqrt(-c/3)),Math.abs(u)>1&&(u=u>=0?1:-1),p=Math.acos(u)/3,r=t.y>=0?(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI:-(-h*Math.cos(p+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(i)2*u*this.a)return;return r=e/this.a,i=Math.sin(r),n=Math.cos(r),s=this.long0,Math.abs(e)<=d?o=this.lat0:(o=_e(n*this.sin_p12+t.y*i*this.cos_p12/e),a=Math.abs(this.lat0)-u,s=Math.abs(a)<=d?this.lat0>=0?j(this.long0+Math.atan2(t.x,-t.y)):j(this.long0-Math.atan2(-t.x,t.y)):j(this.long0+Math.atan2(t.x*i,e*this.cos_p12*n-t.y*this.sin_p12*i))),t.x=s,t.y=o,t}return l=de(this.es),c=pe(this.es),h=fe(this.es),p=me(this.es),Math.abs(this.sin_p12-1)<=d?(o=ye(((f=this.a*ue(l,c,h,p,u))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,l,c,h,p),s=j(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=o,t):Math.abs(this.sin_p12+1)<=d?(f=this.a*ue(l,c,h,p,u),o=ye(((e=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,l,c,h,p),s=j(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=o,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),A=Math.atan2(t.x,t.y),m=ge(this.a,this.e,this.sin_p12),y=Math.cos(A),x=-(v=this.e*this.cos_p12*y)*v/(1-this.es),b=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),E=1-x*(w=(_=e/m)-x*(1+x)*Math.pow(_,3)/6-b*(1+3*x)*Math.pow(_,4)/24)*w/2-_*w*w*w/6,g=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*y),s=j(this.long0+Math.asin(Math.sin(A)*Math.sin(w)/Math.cos(g))),M=Math.sin(g),o=Math.atan2((M-this.es*E*this.sin_p12)*Math.tan(g),M*(1-this.es)),t.x=s,t.y=o,t)},names:["Azimuthal_Equidistant","aeqd"]},Oe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,i,n,s,o,a,l=t.x,c=t.y;return i=j(l-this.long0),e=Math.sin(c),r=Math.cos(c),n=Math.cos(i),((s=this.sin_p14*e+this.cos_p14*r*n)>0||Math.abs(s)<=d)&&(o=1*this.a*r*Math.sin(i),a=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)),t.x=o,t.y=a,t},inverse:function(t){var e,r,i,n,s,o,a;return t.x-=this.x0,t.y-=this.y0,r=_e((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),i=Math.sin(r),n=Math.cos(r),o=this.long0,Math.abs(e)<=d?(a=this.lat0,t.x=o,t.y=a,t):(a=_e(n*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.abs(this.lat0)-u,Math.abs(s)<=d?(o=this.lat0>=0?j(this.long0+Math.atan2(t.x,-t.y)):j(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=a,t):(o=j(this.long0+Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i)),t.x=o,t.y=a,t))},names:["ortho"]};var ke=1,Ue=2,Ne=3,Fe=4;function ze(t,e,r,i){var n;return tm&&n<=u+m?(i.value=Ue,n-=u):n>u+m||n<=-(u+m)?(i.value=Ne,n=n>=0?n-A:n+A):(i.value=Fe,n+=u)),n}function Ge(t,e){var r=t+e;return r<-A?r+=g:r>+A&&(r-=g),r}const Qe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=u-m/2?this.face=5:this.lat0<=-(u-m/2)?this.face=6:Math.abs(this.long0)<=m?this.face=1:Math.abs(this.long0)<=u+m?this.face=this.long0>0?2:4:this.face=3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,i,n,s,o,a={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,5===this.face)n=u-e,r>=m&&r<=u+m?(l.value=ke,i=r-u):r>u+m||r<=-(u+m)?(l.value=Ue,i=r>0?r-A:r+A):r>-(u+m)&&r<=-m?(l.value=Ne,i=r+u):(l.value=Fe,i=r);else if(6===this.face)n=u+e,r>=m&&r<=u+m?(l.value=ke,i=-r+u):r=-m?(l.value=Ue,i=-r):r<-m&&r>=-(u+m)?(l.value=Ne,i=-r-u):(l.value=Fe,i=r>0?-r+A:-r-A);else{var c,h,d,p,f,g;2===this.face?r=Ge(r,+u):3===this.face?r=Ge(r,+A):4===this.face&&(r=Ge(r,-u)),p=Math.sin(e),f=Math.cos(e),g=Math.sin(r),c=f*Math.cos(r),h=f*g,d=p,1===this.face?i=ze(n=Math.acos(c),d,h,l):2===this.face?i=ze(n=Math.acos(h),d,-c,l):3===this.face?i=ze(n=Math.acos(-c),d,-h,l):4===this.face?i=ze(n=Math.acos(-h),d,c,l):(n=i=0,l.value=ke)}return o=Math.atan(12/A*(i+Math.acos(Math.sin(i)*Math.cos(m))-u)),s=Math.sqrt((1-Math.cos(n))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===Ue?o+=u:l.value===Ne?o+=A:l.value===Fe&&(o+=1.5*A),a.x=s*Math.cos(o),a.y=s*Math.sin(o),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var e,r,i,n,s,o,a,l,c,h,d,p,f={lam:0,phi:0},m={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?m.value=ke:t.y>=0&&t.y>=Math.abs(t.x)?(m.value=Ue,e-=u):t.x<0&&-t.x>=Math.abs(t.y)?(m.value=Ne,e=e<0?e+A:e-A):(m.value=Fe,e+=u),c=A/12*Math.tan(e),s=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),o=Math.atan(s),(a=1-(i=Math.cos(e))*i*(n=Math.tan(r))*n*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?a=-1:a>1&&(a=1),5===this.face)l=Math.acos(a),f.phi=u-l,m.value===ke?f.lam=o+u:m.value===Ue?f.lam=o<0?o+A:o-A:m.value===Ne?f.lam=o-u:f.lam=o;else if(6===this.face)l=Math.acos(a),f.phi=l-u,m.value===ke?f.lam=-o+u:m.value===Ue?f.lam=-o:m.value===Ne?f.lam=-o-u:f.lam=o<0?-o-A:-o+A;else{var g,y,v;c=(g=a)*g,y=(c+=(v=c>=1?0:Math.sqrt(1-c)*Math.sin(o))*v)>=1?0:Math.sqrt(1-c),m.value===Ue?(c=y,y=-v,v=c):m.value===Ne?(y=-y,v=-v):m.value===Fe&&(c=y,y=v,v=-c),2===this.face?(c=g,g=-y,y=c):3===this.face?(g=-g,y=-y):4===this.face&&(c=g,g=y,y=-c),f.phi=Math.acos(-v)-u,f.lam=Math.atan2(y,g),2===this.face?f.lam=Ge(f.lam,-u):3===this.face?f.lam=Ge(f.lam,-A):4===this.face&&(f.lam=Ge(f.lam,+u))}return 0!==this.es&&(h=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),h&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]};var je=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ve=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],He=.8487,We=1.3523,qe=f/5,Ze=1/qe,Ye=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};const Xe={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=j(t.x-this.long0),r=Math.abs(t.y),i=Math.floor(r*qe);i<0?i=0:i>=18&&(i=17);var n={x:Ye(je[i],r=f*(r-Ze*i))*e,y:Ye(Ve[i],r)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*He+this.x0,n.y=n.y*this.a*We+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*He),y:Math.abs(t.y-this.y0)/(this.a*We)};if(e.y>=1)e.x/=je[18][0],e.y=t.y<0?-u:u;else{var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(Ve[r][0]>e.y)--r;else{if(!(Ve[r+1][0]<=e.y))break;++r}var i=Ve[r],n=5*(e.y-i[0])/(Ve[r+1][0]-i[0]);n=function(t,e,r,i){for(var n=e;i;--i){var s=t(n);if(n-=s,Math.abs(s)<1e-10)break}return n}((function(t){return(Ye(i,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(i,t)}),n,0,100),e.x/=Ye(je[r],n),e.y=(5*r+n)*p,t.y<0&&(e.y=-e.y)}return e.x=j(e.x+this.long0),e},names:["Robinson","robin"]},Je={init:function(){this.name="geocent"},forward:function(t){return ht(t,this.es,this.a)},inverse:function(t){return ut(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};var Ke={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};const $e={init:function(){if(Object.keys(Ke).forEach(function(t){if(void 0===this[t])this[t]=Ke[t].def;else{if(Ke[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);Ke[t].num&&(this[t]=parseFloat(this[t]))}Ke[t].degrees&&(this[t]=this[t]*p)}.bind(this)),Math.abs(Math.abs(this.lat0)-u)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var e,r,i,n,s=Math.sin(t.y),o=Math.cos(t.y),a=Math.cos(t.x);switch(this.mode){case 3:r=this.sinph0*s+this.cosph0*o*a;break;case 2:r=o*a;break;case 1:r=-s;break;case 0:r=s}switch(e=(r=this.pn1/(this.p-r))*o*Math.sin(t.x),this.mode){case 3:r*=this.cosph0*s-this.sinph0*o*a;break;case 2:r*=s;break;case 0:r*=-o*a;break;case 1:r*=o*a}return n=1/((i=r*this.cg+e*this.sg)*this.sw*this.h1+this.cw),e=(e*this.cg-r*this.sg)*this.cw*n,r=i*n,t.x=e*this.a,t.y=r*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,r,i,n={x:t.x,y:t.y};i=1/(this.pn1-t.y*this.sw),e=this.pn1*t.x*i,r=this.pn1*t.y*this.cw*i,t.x=e*this.cg+r*this.sg,t.y=r*this.cg-e*this.sg;var s=Jt(t.x,t.y);if(Math.abs(s)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,i,n,s=t.x,o=t.y;if(s-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var a=this.radius_p/Jt(this.radius_p*Math.cos(o),Math.sin(o));if(r=a*Math.cos(s)*Math.cos(o),i=a*Math.sin(s)*Math.cos(o),n=a*Math.sin(o),(this.radius_g-r)*r-i*i-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/Jt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/Jt(i,e)))}else"sphere"===this.shape&&(e=Math.cos(o),r=Math.cos(s)*e,i=Math.sin(s)*e,n=Math.sin(o),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/Jt(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/Jt(i,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,i,n,s=-1,o=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Jt(1,a)):(o=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Jt(1,o));var l=a/this.radius_p;if(e=o*o+l*l+s*s,(i=(r=2*this.radius_g*s)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),s=this.radius_g+n*s,o*=n,a*=n,t.x=Math.atan2(o,s),t.y=Math.atan(a*Math.cos(t.x)/s),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),o=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(o=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+o*o)),e=o*o+a*a+s*s,(i=(r=2*this.radius_g*s)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),s=this.radius_g+n*s,o*=n,a*=n,t.x=Math.atan2(o,s),t.y=Math.atan(a*Math.cos(t.x)/s)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};var er;wt.defaultDatum="WGS84",wt.Proj=ct,wt.WGS84=new wt.Proj("WGS84"),wt.Point=Qt,wt.toPoint=At,wt.defs=U,wt.nadgrid=function(t,e){var r=new DataView(e),i=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),n=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:nt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,i),s=function(t,e,r){for(var i=176,n=[],s=0;s{"use strict";const i=r(43389),n=r(69208),s=r(48764).lW;t.exports=function(t,e){return new i((function(r,i){const o=n(t,e),a=new XMLHttpRequest;a.open("GET",o,!0),"prj"!==e&&"cpg"!==e&&(a.responseType="arraybuffer"),a.addEventListener("load",(function(){return a.status>399?"prj"===e||"cpg"===e?r(!1):i(new Error(a.status)):r("prj"!==e&&"cpg"!==e?s.from(a.response):a.response)}),!1),a.send()}))}},9078:(t,e,r)=>{"use strict";const i=r(94830),n=r(69208),s=r(48764).lW;t.exports=async function(t,e){if(!r.g.fetch)return i(t,e);const o=n(t,e),a="prj"===e||"cpg"===e;try{const t=await fetch(o);if(t.status>399)throw new Error(t.statusText);if(a)return t.text();const e=await t.arrayBuffer();return s.from(e)}catch(t){if(console.log("ERROR",t,e),a||"dbf"===e)return!1;throw t}}},69208:(t,e,r)=>{const i=r.g.URL;t.exports=(t,e)=>{if(!e)return t;const r=new i(t);return r.pathname=`${r.pathname}.${e}`,r.href}},79003:(t,e,r)=>{"use strict";let i=r(24472);i.default&&(i=i.default);const n=r(32555),s=r(9078),o=r(76415),a=r(9462),l=r(43389),c=r(95079),h=r(48764).lW,u=r.g.URL,d=new c({max:20});function p(t){if(!t)throw new Error("forgot to pass buffer");return h.isBuffer(t)?t:f(t)?h.from(t):f(t.buffer)?1===t.BYTES_PER_ELEMENT?h.from(t):h.from(t.buffer):void 0}function f(t){return t instanceof r.g.ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(t)}function m(t,e){return"string"==typeof t&&d.has(t)?l.resolve(d.get(t)):m.getShapefile(t,e).then((function(e){return"string"==typeof t&&d.set(t,e),e}))}m.combine=function([t,e]){const r={type:"FeatureCollection",features:[]};let i=0;const n=t.length;for(e||(e=[]);i-1?l.push(r.slice(0,-3)+r.slice(-3).toLowerCase()):"dbf"!==r.slice(-3).toLowerCase()&&"cpg"!==r.slice(-3).toLowerCase()||(s[r.slice(0,-3)+r.slice(-3).toLowerCase()]=s[r]));if(!l.length)throw new Error("no layers founds");const c=l.map((function(t){let r,i;const n=t.lastIndexOf(".");return n>-1&&t.slice(n).indexOf("json")>-1?(r=JSON.parse(s[t]),r.fileName=t.slice(0,n)):e.indexOf(t.slice(n+1))>-1?(r=s[t],r.fileName=t):(s[t+".dbf"]&&(i=a(s[t+".dbf"],s[t+".cpg"])),r=m.combine([o(s[t+".shp"],s[t+".prj"]),i]),r.fileName=t),r}));return 1===c.length?c[0]:c};const g=async t=>{const e=await l.all([s(t,"shp"),s(t,"prj")]);let r=!1;try{e[1]&&(r=i(e[1]))}catch(t){r=!1}return o(e[0],r)},A=async t=>{const[e,r]=await l.all([s(t,"dbf"),s(t,"cpg")]);if(e)return a(e,r)};m.getShapefile=async function(t,e){if("string"!=typeof t)return m.parseZip(t);if(((t,e)=>".zip"===new u(t).pathname.slice(-4).toLowerCase())(t))return async function(t,e){const r=await s(t);return m.parseZip(r,e)}(t,e);const r=await l.all([g(t),A(t)]);return m.combine(r)},m.parseShp=function(t,e){if(t=p(t),h.isBuffer(e)&&(e=e.toString()),"string"==typeof e)try{e=i(e)}catch(t){e=!1}return o(t,e)},m.parseDbf=function(t,e){return t=p(t),a(t,e)},t.exports=m},76415:t=>{"use strict";function e(t,e){return!function(t){let e=0,r=1;const i=t.length;let n,s;for(;r0}(e)&&t.length?t[t.length-1].push(e):t.push([e]),t}i.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}},i.prototype.parseZPoint=function(t){const e=this.parsePoint(t);return e.coordinates.push(t.readDoubleLE(16)),e},i.prototype.parsePointArray=function(t,e,r){const i=[];let n=0;for(;n20&&(e-=20),!(e in r))throw new Error("I don't know that shp type");var i;this.parseFunc=this[r[e]],this.parseCoord=(i=t)?function(t,e){const r=[t.readDoubleLE(e),t.readDoubleLE(e+8)];return i.inverse(r)}:function(t,e){return[t.readDoubleLE(e),t.readDoubleLE(e+8)]}},i.prototype.getShpCode=function(){return this.parseHeader().shpCode},i.prototype.parseHeader=function(){const t=this.buffer.slice(0,100);return{length:t.readInt32BE(24)<<1,version:t.readInt32LE(28),shpCode:t.readInt32LE(32),bbox:[t.readDoubleLE(36),t.readDoubleLE(44),t.readDoubleLE(52),t.readDoubleLE(52)]}},i.prototype.getRows=function(){let t=100;const e=this.buffer.byteLength,r=[];let i;for(;t{"use strict";const i=r(55733);t.exports=async t=>{const e=new i;await e.loadAsync(t);const r=e.file(/.+/),n={};return await Promise.all(r.map((async t=>{let e;e="shp"===t.name.slice(-3).toLowerCase()||"dbf"===t.name.slice(-3).toLowerCase()?await t.async("nodebuffer"):await t.async("text"),n[t.name]=e}))),n}},95079:t=>{!function(){function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function r(){return 1}t.exports?t.exports=s:this.LRUCache=s;var i=!1;function n(t){i||"string"==typeof t||"number"==typeof t||(i=!0,console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! "+typeof t).stack))}function s(t){if(!(this instanceof s))return new s(t);"number"==typeof t&&(t={max:t}),t||(t={}),this._max=t.max,(!this._max||"number"!=typeof this._max||this._max<=0)&&(this._max=1/0),this._lengthCalculator=t.length||r,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=r),this._allowStale=t.stale||!1,this._maxAge=t.maxAge||null,this._dispose=t.dispose,this.reset()}function o(t,e,r){n(e);var i=t._cache[e];return i&&(a(t,i)?(h(t,i),t._allowStale||(i=void 0)):r&&function(t,e){c(t,e),e.lu=t._mru++,t._lruList[e.lu]=e}(t,i),i&&(i=i.value)),i}function a(t,e){if(!e||!e.maxAge&&!t._maxAge)return!1;var r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t._maxAge&&r>t._maxAge}function l(t){for(;t._lrut._max;)h(t,t._lruList[t._lru])}function c(t,e){for(delete t._lruList[e.lu];t._lruthis._max&&l(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(s.prototype,"lengthCalculator",{set:function(t){if("function"!=typeof t)for(var e in this._lengthCalculator=r,this._length=this._itemCount,this._cache)this._cache[e].length=1;else for(var e in this._lengthCalculator=t,this._length=0,this._cache)this._cache[e].length=this._lengthCalculator(this._cache[e].value),this._length+=this._cache[e].length;this._length>this._max&&l(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(s.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(s.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),s.prototype.forEach=function(t,e){e=e||this;for(var r=0,i=this._itemCount,n=this._mru-1;n>=0&&r=0&&e=0&&e=0&&ethis._max?(h(this,this._cache[t]),!1):(this._dispose&&this._dispose(t,this._cache[t].value),this._cache[t].now=s,this._cache[t].maxAge=i,this._cache[t].value=r,this._length+=o-this._cache[t].length,this._cache[t].length=o,this.get(t),this._length>this._max&&l(this),!0);var a=new u(t,r,this._mru++,o,s,i);return a.length>this._max?(this._dispose&&this._dispose(t,r),!1):(this._length+=a.length,this._lruList[a.lu]=this._cache[t]=a,this._itemCount++,this._length>this._max&&l(this),!0)},s.prototype.has=function(t){return n(t),!!e(this._cache,t)&&!a(this,this._cache[t])},s.prototype.get=function(t){return n(t),o(this,t,!0)},s.prototype.peek=function(t){return n(t),o(this,t,!1)},s.prototype.pop=function(){var t=this._lruList[this._lru];return h(this,t),t||null},s.prototype.del=function(t){n(t),h(this,this._cache[t])},s.prototype.load=function(t){this.reset();for(var e=Date.now(),r=t.length-1;r>=0;r--){var i=t[r];n(i.k);var s=i.e||0;if(0===s)this.set(i.k,i.v);else{var o=s-e;o>0&&this.set(i.k,i.v,o)}}}}()},6941:(t,e,r)=>{var i=r(48764).lW,n=i.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},s=e.s=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!n(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=l;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(t){return t.toString(this.encoding)}function a(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function l(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}s.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i,n=t.length;if(this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived),n=(e+=t.toString(this.encoding,0,n)).length-1,(i=e.charCodeAt(n))>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),t.copy(this.charBuffer,0,0,s),e.substring(0,n)}return e},s.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},s.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;e+=i.slice(0,r).toString(n)}return e}},29718:(t,e,r)=>{t.exports=r(59141)},59141:function(t,e,r){!function(e){"use strict";function i(t,e,r){return e<=t&&t<=r}t.exports&&!e["encoding-indexes"]&&r(37597);var n=Math.floor;function s(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function o(t){return 0<=t&&t<=127}var a=o,l=-1;function c(t){this.tokens=[].slice.call(t),this.tokens.reverse()}c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():l},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.pop());else this.tokens.push(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(t)}};var h=-1;function u(t,e){if(t)throw TypeError("Decoder error");return e||65533}function d(t){throw TypeError("The code point "+t+" could not be encoded.")}function p(t){return t=String(t).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(m,t)?m[t]:null}var f=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],m={};f.forEach((function(t){t.encodings.forEach((function(t){t.labels.forEach((function(e){m[e]=t}))}))}));var g,A,y={},v={};function x(t,e){return e&&e[t]||null}function b(t,e){var r=e.indexOf(t);return-1===r?null:r}function _(t){if(!("encoding-indexes"in e))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return e["encoding-indexes"][t]}var w="utf-8";function E(t,e){if(!(this instanceof E))throw TypeError("Called as a function. Did you forget 'new'?");t=void 0!==t?String(t):w,e=s(e),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=p(t);if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+t);if(!v[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=r,Boolean(e.fatal)&&(i._error_mode="fatal"),Boolean(e.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal="fatal"===i._error_mode,this.ignoreBOM=i._ignoreBOM),i}function M(t,r){if(!(this instanceof M))throw TypeError("Called as a function. Did you forget 'new'?");r=s(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var i=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){var n=p(t=void 0!==t?String(t):w);if(null===n||"replacement"===n.name)throw RangeError("Unknown encoding: "+t);if(!y[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");i._encoding=n}else i._encoding=p("utf-8"),void 0!==t&&"console"in e&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase()),i}function S(t){var e=t.fatal,r=0,n=0,s=0,o=128,a=191;this.handler=function(t,c){if(c===l&&0!==s)return s=0,u(e);if(c===l)return h;if(0===s){if(i(c,0,127))return c;if(i(c,194,223))s=1,r=31&c;else if(i(c,224,239))224===c&&(o=160),237===c&&(a=159),s=2,r=15&c;else{if(!i(c,240,244))return u(e);240===c&&(o=144),244===c&&(a=143),s=3,r=7&c}return null}if(!i(c,o,a))return r=s=n=0,o=128,a=191,t.prepend(c),u(e);if(o=128,a=191,r=r<<6|63&c,(n+=1)!==s)return null;var d=r;return r=s=n=0,d}}function C(t){t.fatal,this.handler=function(t,e){if(e===l)return h;if(a(e))return e;var r,n;i(e,128,2047)?(r=1,n=192):i(e,2048,65535)?(r=2,n=224):i(e,65536,1114111)&&(r=3,n=240);for(var s=[(e>>6*r)+n];r>0;){var o=e>>6*(r-1);s.push(128|63&o),r-=1}return s}}function T(t,e){var r=e.fatal;this.handler=function(e,i){if(i===l)return h;if(o(i))return i;var n=t[i-128];return null===n?u(r):n}}function I(t,e){e.fatal,this.handler=function(e,r){if(r===l)return h;if(a(r))return r;var i=b(r,t);return null===i&&d(r),i+128}}function R(t){var e=t.fatal,r=0,n=0,s=0;this.handler=function(t,a){if(a===l&&0===r&&0===n&&0===s)return h;var c;if(a!==l||0===r&&0===n&&0===s||(r=0,n=0,s=0,u(e)),0!==s){c=null,i(a,48,57)&&(c=function(t){if(t>39419&&t<189e3||t>1237575)return null;if(7457===t)return 59335;var e,r=0,i=0,n=_("gb18030-ranges");for(e=0;e>8,i=255&t;return e?[r,i]:[i,r]}function j(t,e){var r=e.fatal,n=null,s=null;this.handler=function(e,o){if(o===l&&(null!==n||null!==s))return u(r);if(o===l&&null===n&&null===s)return h;if(null===n)return n=o,null;var a;if(a=t?(n<<8)+o:(o<<8)+n,n=null,null!==s){var c=s;return s=null,i(a,56320,57343)?65536+1024*(c-55296)+(a-56320):(e.prepend(Q(a,t)),u(r))}return i(a,55296,56319)?(s=a,null):i(a,56320,57343)?u(r):a}}function V(t,e){e.fatal,this.handler=function(e,r){if(r===l)return h;if(i(r,0,65535))return Q(r,t);var n=Q(55296+(r-65536>>10),t),s=Q(56320+(r-65536&1023),t);return n.concat(s)}}function H(t){t.fatal,this.handler=function(t,e){return e===l?h:o(e)?e:63360+e-128}}function W(t){t.fatal,this.handler=function(t,e){return e===l?h:a(e)?e:i(e,63360,63487)?e-63360+128:d(e)}}Object.defineProperty&&(Object.defineProperty(E.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(E.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(E.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),E.prototype.decode=function(t,e){var r;r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=s(e),this._do_not_flush||(this._decoder=v[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(e.stream);for(var i,n=new c(r),o=[];;){var a=n.read();if(a===l)break;if((i=this._decoder.handler(n,a))===h)break;null!==i&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}if(!this._do_not_flush){do{if((i=this._decoder.handler(n,n.read()))===h)break;null!==i&&(Array.isArray(i)?o.push.apply(o,i):o.push(i))}while(!n.endOfStream());this._decoder=null}return function(t){var e,r;return e=["UTF-8","UTF-16LE","UTF-16BE"],r=this._encoding.name,-1===e.indexOf(r)||this._ignoreBOM||this._BOMseen||(t.length>0&&65279===t[0]?(this._BOMseen=!0,t.shift()):t.length>0&&(this._BOMseen=!0)),function(t){for(var e="",r=0;r>10),56320+(1023&i)))}return e}(t)}.call(this,o)},Object.defineProperty&&Object.defineProperty(M.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),M.prototype.encode=function(t,e){t=void 0===t?"":String(t),e=s(e),this._do_not_flush||(this._encoder=y[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(e.stream);for(var r,i=new c(function(t){for(var e=String(t),r=e.length,i=0,n=[];i57343)n.push(s);else if(56320<=s&&s<=57343)n.push(65533);else if(55296<=s&&s<=56319)if(i===r-1)n.push(65533);else{var o=e.charCodeAt(i+1);if(56320<=o&&o<=57343){var a=1023&s,l=1023&o;n.push(65536+(a<<10)+l),i+=1}else n.push(65533)}i+=1}return n}(t)),n=[];;){var o=i.read();if(o===l)break;if((r=this._encoder.handler(i,o))===h)break;Array.isArray(r)?n.push.apply(n,r):n.push(r)}if(!this._do_not_flush){for(;(r=this._encoder.handler(i,i.read()))!==h;)Array.isArray(r)?n.push.apply(n,r):n.push(r);this._encoder=null}return new Uint8Array(n)},y["UTF-8"]=function(t){return new C(t)},v["UTF-8"]=function(t){return new S(t)},"encoding-indexes"in e&&f.forEach((function(t){"Legacy single-byte encodings"===t.heading&&t.encodings.forEach((function(t){var e=t.name,r=_(e.toLowerCase());v[e]=function(t){return new T(r,t)},y[e]=function(t){return new I(r,t)}}))})),v.GBK=function(t){return new R(t)},y.GBK=function(t){return new B(t,!0)},y.gb18030=function(t){return new B(t)},v.gb18030=function(t){return new R(t)},y.Big5=function(t){return new P(t)},v.Big5=function(t){return new L(t)},y["EUC-JP"]=function(t){return new O(t)},v["EUC-JP"]=function(t){return new D(t)},y["ISO-2022-JP"]=function(t){return new U(t)},v["ISO-2022-JP"]=function(t){return new k(t)},y.Shift_JIS=function(t){return new F(t)},v.Shift_JIS=function(t){return new N(t)},y["EUC-KR"]=function(t){return new G(t)},v["EUC-KR"]=function(t){return new z(t)},y["UTF-16BE"]=function(t){return new V(!0,t)},v["UTF-16BE"]=function(t){return new j(!0,t)},y["UTF-16LE"]=function(t){return new V(!1,t)},v["UTF-16LE"]=function(t){return new j(!1,t)},y["x-user-defined"]=function(t){return new W(t)},v["x-user-defined"]=function(t){return new H(t)},e.TextEncoder||(e.TextEncoder=M),e.TextDecoder||(e.TextDecoder=E),t.exports&&(t.exports={TextEncoder:e.TextEncoder,TextDecoder:e.TextDecoder,EncodingIndexes:e["encoding-indexes"]})}(this||{})},78963:()=>{},37597:()=>{},42917:(t,e,r)=>{"use strict";r(59749),r(86544),r(58373),r(96157),r(82529),r(84254),r(64155),r(93531),r(95906),r(50549),r(96285),r(18200),r(69373),r(66793),r(44578),r(21057),r(68932),r(95879),r(54927),r(92176),r(34338),r(2966),r(55791),r(97895),r(38077),r(25728),r(39772),r(59867),r(93383),r(62795),r(54564),r(49693),r(77049),r(76801),r(97195),r(63975),r(752),r(6203),r(72410),r(50886),r(37593),r(70560),r(278),r(81386),r(93374),r(89730),r(98742),r(65137),r(21932),r(62506),r(29830),r(12894),r(93530),r(13383),r(90385),r(91719),r(21319),r(69365),r(33870),r(99211),r(18201),r(55635),r(42227),r(99679),r(24343),r(65007),r(78150),r(59903),r(30024),r(60428),r(41517),r(56269),r(34284),r(45398),r(48324),r(7629),r(56646),r(89348),r(6557),r(62428),r(45263),r(74712),r(54986),r(47221),r(94992),r(25499),r(59944),r(78527),r(75239),r(92076),r(68813),r(96976),r(62700),r(91554),r(77509),r(21416),r(79288),r(53584),r(82243),r(95765),r(45993),r(92547),r(7936),r(32704),r(52362),r(21552),r(10704),r(97389),r(25284),r(60429),r(51013),r(33994),r(35082),r(40739),r(47409),r(36585),r(41830),r(85415),r(81919),r(99474),r(79997),r(88052),r(44079),r(14566),r(76101),r(36446),r(35140),r(4179),r(69358),r(75450),r(54993),r(48115),r(19330),r(30658),r(5399),r(60228),r(86466),r(80939),r(32320),r(73964),r(41195),r(87609),r(36409),r(13505),r(54333),r(30050),r(99871),r(1049),r(32349),r(50149),r(43792),r(69707),r(63545),r(62087),r(51505),r(45247),r(22373),r(76034),r(52003),r(68518),r(64043),r(25847),r(13440),r(7409),r(12826),r(19649),r(7961),r(86239),r(2918),r(20283),r(43843),r(12281),r(21694),r(22462),r(79866),r(72940),r(8472),r(92404),r(59588),r(57267),r(56532),r(61514),r(9873),r(268),r(20372),r(35237),r(28436),r(16386),r(3255),r(90343),r(21444),r(25906),r(95682),r(98041),r(6364),r(82954),r(19162),r(37960),r(470),r(67446),r(47729),r(2e3),r(29068),r(70292),r(55304),r(89988),r(854),r(28607),r(30938),r(75679),r(18557),r(95194),r(36664),r(55980),r(79943),r(96089),r(18539),r(48690),r(20522),r(82),r(45385),r(59495),r(85552),r(31803),r(91565),r(67987),r(49365),r(80677),r(19038),r(18118),r(41165),r(71522),r(79976),r(4797),r(7300),r(93356),r(62533),r(99724),r(24224),r(61121),r(99901),r(37133),r(622),r(51090),r(50414),r(89503),r(26810),r(18073),r(4154),r(7802),r(54883),r(38197),r(20097),r(36208),r(22525),r(96882),r(32539),r(5082),r(98),r(32221),r(67890),r(47041),r(86322),r(92253),r(97554),r(86247),r(21412),r(43097),r(11070),r(64578),r(77299),r(15694),r(17815),r(19029),r(6237),r(81954),r(87152),r(89667),r(49118),r(32411),r(3256),r(85625),r(10914),r(14494),r(9468),r(24587),r(60779),r(65503),r(50236),r(89246),r(31186),r(9279),r(26725),r(26125),r(2820),r(62517),r(54947),r(74993),r(78832),r(67602),r(50647),r(82639),r(63986),r(16054),r(53476),r(70928),r(49411),r(30005),r(73494),r(94564),r(41792),r(5985),r(31107),r(28244),r(3645),r(58429),r(39569),r(74320),r(20691),r(82964),r(67444),r(97968),r(747),r(41099),r(26320),r(20876),r(6052),r(39879),r(76791),r(75341),r(40019),r(92343),r(51096),r(4314),r(63111),r(23346),r(64984),r(64078),r(24453),r(66190),r(25684),r(31789),r(8677),r(346),r(59151),r(91069),r(18886),r(88065),r(68172),r(60445),r(99457),r(613),r(835),r(926),r(82899),r(29977),r(53669),r(31927),r(77131),r(55174),r(3210),r(76314),r(218),r(40393),r(6616),r(90810),r(19959),r(73347),r(71913),r(70003),r(79955),r(7859),r(31138),r(28809),r(2946),r(32460),r(57282),r(5058),r(15716),r(36814),r(30349),r(96986),r(95681),r(13781),r(33442),r(98873),r(61964),r(50308),r(69878),r(18955),r(52915),r(65115),r(19490),r(95752),r(32789),r(27913),r(6831),r(98686),r(90243),r(22275),r(98030),r(86220),r(21917),r(95853),r(66084),r(2741),r(59012),r(38320),r(78988),r(80546),r(62586),r(46019),r(5010),r(45749),r(4835),r(58799),r(18134),r(27041),r(44767),r(92981),r(85044),r(76677),r(96256),r(18241),r(59359),r(54302),r(1274),r(30548),r(25298),r(11882),r(915),r(91238),r(17911),r(23579),r(91117),r(85723),r(68680),r(77225),r(99369),r(22983),r(90201),r(13466),r(23321),r(84930),r(92465),r(45738),r(52586),r(84645),r(47522),r(76265),r(97337),r(13429),r(37462),r(40088),r(10455),r(3650),r(25564),r(96869),r(78730),r(69822),r(19979),r(79307),r(98858),r(61318),r(33228),r(50496)},46108:(t,e,r)=>{"use strict";r(42917)},10509:(t,e,r)=>{"use strict";var i=r(69985),n=r(23691),s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not a function")}},52655:(t,e,r)=>{"use strict";var i=r(19429),n=r(23691),s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not a constructor")}},9945:(t,e,r)=>{"use strict";var i=r(83914).has;t.exports=function(t){return i(t),t}},23550:(t,e,r)=>{"use strict";var i=r(69985),n=String,s=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw new s("Can't set "+n(t)+" as a prototype")}},10029:(t,e,r)=>{"use strict";var i=r(61034).has;t.exports=function(t){return i(t),t}},51082:t=>{"use strict";var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},457:(t,e,r)=>{"use strict";var i=r(16803).has;t.exports=function(t){return i(t),t}},53499:(t,e,r)=>{"use strict";var i=r(78616).has;t.exports=function(t){return i(t),t}},29199:(t,e,r)=>{"use strict";var i=r(22615),n=r(68844),s=r(54071),o=r(85027),a=r(10509),l=r(981),c=r(54849),h=r(44201),u=h("asyncDispose"),d=h("dispose"),p=n([].push),f=function(t,e,r){return arguments.length<3&&!l(t)&&(r=a(function(t,e){if("async-dispose"===e){var r=c(t,u);return void 0!==r?r:(r=c(t,d),function(){i(r,this)})}return c(t,d)}(o(t),e))),void 0===r?function(){}:s(r,t)};t.exports=function(t,e,r,i){var n;if(arguments.length<4){if(l(e)&&"sync-dispose"===r)return;n=f(e,r)}else n=f(void 0,r,i);p(t.stack,n)}},87370:(t,e,r)=>{"use strict";var i=r(44201),n=r(25391),s=r(72560).f,o=i("unscopables"),a=Array.prototype;void 0===a[o]&&s(a,o,{configurable:!0,value:n(null)}),t.exports=function(t){a[o][t]=!0}},71514:(t,e,r)=>{"use strict";var i=r(10730).charAt;t.exports=function(t,e,r){return e+(r?i(t,e).length:1)}},767:(t,e,r)=>{"use strict";var i=r(23622),n=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw new n("Incorrect invocation")}},33425:(t,e,r)=>{"use strict";var i=r(48999),n=String,s=TypeError;t.exports=function(t){if(void 0===t||i(t))return t;throw new s(n(t)+" is not an object or undefined")}},85027:(t,e,r)=>{"use strict";var i=r(48999),n=String,s=TypeError;t.exports=function(t){if(i(t))return t;throw new s(n(t)+" is not an object")}},95668:(t,e,r)=>{"use strict";var i=r(50926),n=TypeError;t.exports=function(t){if("Uint8Array"===i(t))return t;throw new n("Argument is not an Uint8Array")}},37075:t=>{"use strict";t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},33050:(t,e,r)=>{"use strict";var i=r(52743),n=r(6648),s=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==n(t))throw new s("ArrayBuffer expected");return t.byteLength}},22961:(t,e,r)=>{"use strict";var i=r(68844),n=r(33050),s=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==n(t))return!1;try{return s(t,0,0),!1}catch(t){return!0}}},11655:(t,e,r)=>{"use strict";var i=r(3689);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},29195:(t,e,r)=>{"use strict";var i=r(19037),n=r(68844),s=r(52743),o=r(19842),a=r(22961),l=r(33050),c=r(21420),h=r(63514),u=i.structuredClone,d=i.ArrayBuffer,p=i.DataView,f=i.TypeError,m=Math.min,g=d.prototype,A=p.prototype,y=n(g.slice),v=s(g,"resizable","get"),x=s(g,"maxByteLength","get"),b=n(A.getInt8),_=n(A.setInt8);t.exports=(h||c)&&function(t,e,r){var i,n=l(t),s=void 0===e?n:o(e),g=!v||!v(t);if(a(t))throw new f("ArrayBuffer is detached");if(h&&(t=u(t,{transfer:[t]}),n===s&&(r||g)))return t;if(n>=s&&(!r||g))i=y(t,0,s);else{var A=r&&!g&&x?{maxByteLength:x(t)}:void 0;i=new d(s,A);for(var w=new p(t),E=new p(i),M=m(s,n),S=0;S{"use strict";var i,n,s,o=r(37075),a=r(67697),l=r(19037),c=r(69985),h=r(48999),u=r(36812),d=r(50926),p=r(23691),f=r(75773),m=r(11880),g=r(62148),A=r(23622),y=r(61868),v=r(49385),x=r(44201),b=r(14630),_=r(618),w=_.enforce,E=_.get,M=l.Int8Array,S=M&&M.prototype,C=l.Uint8ClampedArray,T=C&&C.prototype,I=M&&y(M),R=S&&y(S),B=Object.prototype,L=l.TypeError,P=x("toStringTag"),D=b("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",k=o&&!!v&&"Opera"!==d(l.opera),U=!1,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},z=function(t){var e=y(t);if(h(e)){var r=E(e);return r&&u(r,O)?r[O]:z(e)}},G=function(t){if(!h(t))return!1;var e=d(t);return u(N,e)||u(F,e)};for(i in N)(s=(n=l[i])&&n.prototype)?w(s)[O]=n:k=!1;for(i in F)(s=(n=l[i])&&n.prototype)&&(w(s)[O]=n);if((!k||!c(I)||I===Function.prototype)&&(I=function(){throw new L("Incorrect invocation")},k))for(i in N)l[i]&&v(l[i],I);if((!k||!R||R===B)&&(R=I.prototype,k))for(i in N)l[i]&&v(l[i].prototype,R);if(k&&y(T)!==R&&v(T,R),a&&!u(R,P))for(i in U=!0,g(R,P,{configurable:!0,get:function(){return h(this)?this[D]:void 0}}),N)l[i]&&f(l[i],D,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:k,TYPED_ARRAY_TAG:U&&D,aTypedArray:function(t){if(G(t))return t;throw new L("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!v||A(I,t)))return t;throw new L(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,i){if(a){if(r)for(var n in N){var s=l[n];if(s&&u(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}R[t]&&!r||m(R,t,r?e:k&&S[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,r){var i,n;if(a){if(v){if(r)for(i in N)if((n=l[i])&&u(n,t))try{delete n[t]}catch(t){}if(I[t]&&!r)return;try{return m(I,t,r?e:k&&I[t]||e)}catch(t){}}for(i in N)!(n=l[i])||n[t]&&!r||m(n,t,e)}},getTypedArrayConstructor:z,isView:function(t){if(!h(t))return!1;var e=d(t);return"DataView"===e||u(N,e)||u(F,e)},isTypedArray:G,TypedArray:I,TypedArrayPrototype:R}},83999:(t,e,r)=>{"use strict";var i=r(19037),n=r(68844),s=r(67697),o=r(37075),a=r(41236),l=r(75773),c=r(62148),h=r(6045),u=r(3689),d=r(767),p=r(68700),f=r(43126),m=r(19842),g=r(37788),A=r(15477),y=r(61868),v=r(49385),x=r(72741).f,b=r(62872),_=r(9015),w=r(55997),E=r(618),M=a.PROPER,S=a.CONFIGURABLE,C="ArrayBuffer",T="DataView",I="prototype",R="Wrong index",B=E.getterFor(C),L=E.getterFor(T),P=E.set,D=i[C],O=D,k=O&&O[I],U=i[T],N=U&&U[I],F=Object.prototype,z=i.Array,G=i.RangeError,Q=n(b),j=n([].reverse),V=A.pack,H=A.unpack,W=function(t){return[255&t]},q=function(t){return[255&t,t>>8&255]},Z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},X=function(t){return V(g(t),23,4)},J=function(t){return V(t,52,8)},K=function(t,e,r){c(t[I],e,{configurable:!0,get:function(){return r(this)[e]}})},$=function(t,e,r,i){var n=L(t),s=m(r),o=!!i;if(s+e>n.byteLength)throw new G(R);var a=n.bytes,l=s+n.byteOffset,c=_(a,l,l+e);return o?c:j(c)},tt=function(t,e,r,i,n,s){var o=L(t),a=m(r),l=i(+n),c=!!s;if(a+e>o.byteLength)throw new G(R);for(var h=o.bytes,u=a+o.byteOffset,d=0;dnt;)(rt=it[nt++])in O||l(O,rt,D[rt]);k.constructor=O}v&&y(N)!==F&&v(N,F);var st=new U(new O(2)),ot=n(N.setInt8);st.setInt8(0,2147483648),st.setInt8(1,2147483649),!st.getInt8(0)&&st.getInt8(1)||h(N,{setInt8:function(t,e){ot(this,t,e<<24>>24)},setUint8:function(t,e){ot(this,t,e<<24>>24)}},{unsafe:!0})}else k=(O=function(t){d(this,k);var e=m(t);P(this,{type:C,bytes:Q(z(e),0),byteLength:e}),s||(this.byteLength=e,this.detached=!1)})[I],N=(U=function(t,e,r){d(this,N),d(t,k);var i=B(t),n=i.byteLength,o=p(e);if(o<0||o>n)throw new G("Wrong offset");if(o+(r=void 0===r?n-o:f(r))>n)throw new G("Wrong length");P(this,{type:T,buffer:t,byteLength:r,byteOffset:o,bytes:i.bytes}),s||(this.buffer=t,this.byteLength=r,this.byteOffset=o)})[I],s&&(K(O,"byteLength",B),K(U,"buffer",L),K(U,"byteLength",L),K(U,"byteOffset",L)),h(N,{getInt8:function(t){return $(this,1,t)[0]<<24>>24},getUint8:function(t){return $(this,1,t)[0]},getInt16:function(t){var e=$(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=$(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Y($(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Y($(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return H($(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return H($(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){tt(this,1,t,W,e)},setUint8:function(t,e){tt(this,1,t,W,e)},setInt16:function(t,e){tt(this,2,t,q,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){tt(this,2,t,q,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){tt(this,4,t,Z,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){tt(this,4,t,Z,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){tt(this,4,t,X,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){tt(this,8,t,J,e,arguments.length>2&&arguments[2])}});w(O,C),w(U,T),t.exports={ArrayBuffer:O,DataView:U}},70357:(t,e,r)=>{"use strict";var i=r(90690),n=r(27578),s=r(6310),o=r(98494),a=Math.min;t.exports=[].copyWithin||function(t,e){var r=i(this),l=s(r),c=n(t,l),h=n(e,l),u=arguments.length>2?arguments[2]:void 0,d=a((void 0===u?l:n(u,l))-h,l-c),p=1;for(h0;)h in r?r[c]=r[h]:o(r,c),c+=p,h+=p;return r}},62872:(t,e,r)=>{"use strict";var i=r(90690),n=r(27578),s=r(6310);t.exports=function(t){for(var e=i(this),r=s(e),o=arguments.length,a=n(o>1?arguments[1]:void 0,r),l=o>2?arguments[2]:void 0,c=void 0===l?r:n(l,r);c>a;)e[a++]=t;return e}},57612:(t,e,r)=>{"use strict";var i=r(2960).forEach,n=r(16834)("forEach");t.exports=n?[].forEach:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}},2231:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(90690),o=r(19429),a=r(13807),l=r(5185),c=r(22302),h=r(91664),u=r(54849),d=r(76058),p=r(88277),f=r(44201),m=r(29019),g=r(62489).toArray,A=f("asyncIterator"),y=n(p("Array","values")),v=n(y([]).next),x=function(){return new b(this)},b=function(t){this.iterator=y(t)};b.prototype.next=function(){return v(this.iterator)},t.exports=function(t){var e=this,r=arguments.length,n=r>1?arguments[1]:void 0,p=r>2?arguments[2]:void 0;return new(d("Promise"))((function(r){var d=s(t);void 0!==n&&(n=i(n,p));var f=u(d,A),y=f?void 0:h(d)||x,v=o(e)?new e:[],b=f?a(d,f):new m(c(l(d,y)));r(g(b,n,v))}))}},59976:(t,e,r)=>{"use strict";var i=r(6310);t.exports=function(t,e,r){for(var n=0,s=arguments.length>2?r:i(e),o=new t(s);s>n;)o[n]=e[n++];return o}},21055:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(90690),o=r(71228),a=r(93292),l=r(19429),c=r(6310),h=r(76522),u=r(5185),d=r(91664),p=Array;t.exports=function(t){var e=s(t),r=l(this),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m;g&&(m=i(m,f>2?arguments[2]:void 0));var A,y,v,x,b,_,w=d(e),E=0;if(!w||this===p&&a(w))for(A=c(e),y=r?new this(A):p(A);A>E;E++)_=g?m(e[E],E):e[E],h(y,E,_);else for(b=(x=u(e,w)).next,y=r?new this:[];!(v=n(b,x)).done;E++)_=g?o(x,m,[v.value,E],!0):v.value,h(y,E,_);return y.length=E,y}},44416:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(6310),l=r(83914),c=l.Map,h=l.get,u=l.has,d=l.set,p=n([].push);t.exports=function(t){for(var e,r,n=o(this),l=s(n),f=i(t,arguments.length>1?arguments[1]:void 0),m=new c,g=a(l),A=0;g>A;A++)e=f(r=l[A],A,n),u(m,e)?p(h(m,e),r):d(m,e,[r]);return m}},64976:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(18360),l=r(6310),c=r(25391),h=r(59976),u=Array,d=n([].push);t.exports=function(t,e,r,n){for(var p,f,m,g=o(t),A=s(g),y=i(e,r),v=c(null),x=l(A),b=0;x>b;b++)m=A[b],(f=a(y(m,b,g)))in v?d(v[f],m):v[f]=[m];if(n&&(p=n(g))!==u)for(f in v)v[f]=h(p,v[f]);return v}},84328:(t,e,r)=>{"use strict";var i=r(65290),n=r(27578),s=r(6310),o=function(t){return function(e,r,o){var a,l=i(e),c=s(l),h=n(o,c);if(t&&r!=r){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===r)return t||h||0;return!t&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},61969:(t,e,r)=>{"use strict";var i=r(54071),n=r(94413),s=r(90690),o=r(6310),a=function(t){var e=1===t;return function(r,a,l){for(var c,h=s(r),u=n(h),d=o(u),p=i(a,l);d-- >0;)if(p(c=u[d],d,h))switch(t){case 0:return c;case 1:return d}return e?-1:void 0}};t.exports={findLast:a(0),findLastIndex:a(1)}},2960:(t,e,r)=>{"use strict";var i=r(54071),n=r(68844),s=r(94413),o=r(90690),a=r(6310),l=r(27120),c=n([].push),h=function(t){var e=1===t,r=2===t,n=3===t,h=4===t,u=6===t,d=7===t,p=5===t||u;return function(f,m,g,A){for(var y,v,x=o(f),b=s(x),_=a(b),w=i(m,g),E=0,M=A||l,S=e?M(f,_):r||d?M(f,0):void 0;_>E;E++)if((p||E in b)&&(v=w(y=b[E],E,x),t))if(e)S[E]=v;else if(v)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:c(S,y)}else switch(t){case 4:return!1;case 7:c(S,y)}return u?-1:n||h?h:S}};t.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6),filterReject:h(7)}},60953:(t,e,r)=>{"use strict";var i=r(61735),n=r(65290),s=r(68700),o=r(6310),a=r(16834),l=Math.min,c=[].lastIndexOf,h=!!c&&1/[1].lastIndexOf(1,-0)<0,u=a("lastIndexOf"),d=h||!u;t.exports=d?function(t){if(h)return i(c,this,arguments)||0;var e=n(this),r=o(e),a=r-1;for(arguments.length>1&&(a=l(a,s(arguments[1]))),a<0&&(a=r+a);a>=0;a--)if(a in e&&e[a]===t)return a||0;return-1}:c},29042:(t,e,r)=>{"use strict";var i=r(3689),n=r(44201),s=r(3615),o=n("species");t.exports=function(t){return s>=51||!i((function(){var e=[];return(e.constructor={})[o]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},16834:(t,e,r)=>{"use strict";var i=r(3689);t.exports=function(t,e){var r=[][t];return!!r&&i((function(){r.call(null,e||function(){return 1},1)}))}},88820:(t,e,r)=>{"use strict";var i=r(10509),n=r(90690),s=r(94413),o=r(6310),a=TypeError,l=function(t){return function(e,r,l,c){var h=n(e),u=s(h),d=o(h);i(r);var p=t?d-1:0,f=t?-1:1;if(l<2)for(;;){if(p in u){c=u[p],p+=f;break}if(p+=f,t?p<0:d<=p)throw new a("Reduce of empty array with no initial value")}for(;t?p>=0:d>p;p+=f)p in u&&(c=r(c,u[p],p,h));return c}};t.exports={left:l(!1),right:l(!0)}},5649:(t,e,r)=>{"use strict";var i=r(67697),n=r(92297),s=TypeError,o=Object.getOwnPropertyDescriptor,a=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=a?function(t,e){if(n(t)&&!o(t,"length").writable)throw new s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},9015:(t,e,r)=>{"use strict";var i=r(27578),n=r(6310),s=r(76522),o=Array,a=Math.max;t.exports=function(t,e,r){for(var l=n(t),c=i(e,l),h=i(void 0===r?l:r,l),u=o(a(h-c,0)),d=0;c{"use strict";var i=r(68844);t.exports=i([].slice)},50382:(t,e,r)=>{"use strict";var i=r(9015),n=Math.floor,s=function(t,e){var r=t.length,l=n(r/2);return r<8?o(t,e):a(t,s(i(t,0,l),e),s(i(t,l),e),e)},o=function(t,e){for(var r,i,n=t.length,s=1;s0;)t[i]=t[--i];i!==s++&&(t[i]=r)}return t},a=function(t,e,r,i){for(var n=e.length,s=r.length,o=0,a=0;o{"use strict";var i=r(92297),n=r(19429),s=r(48999),o=r(44201)("species"),a=Array;t.exports=function(t){var e;return i(t)&&(e=t.constructor,(n(e)&&(e===a||i(e.prototype))||s(e)&&null===(e=e[o]))&&(e=void 0)),void 0===e?a:e}},27120:(t,e,r)=>{"use strict";var i=r(25271);t.exports=function(t,e){return new(i(t))(0===e?0:e)}},26166:(t,e,r)=>{"use strict";var i=r(6310);t.exports=function(t,e){for(var r=i(t),n=new e(r),s=0;s{"use strict";var i=r(68844),n=r(10509),s=r(981),o=r(6310),a=r(90690),l=r(83914),c=r(10613),h=l.Map,u=l.has,d=l.set,p=i([].push);t.exports=function(t){var e,r,i,l=a(this),f=o(l),m=[],g=new h,A=s(t)?function(t){return t}:n(t);for(e=0;e{"use strict";var i=r(6310),n=r(68700),s=RangeError;t.exports=function(t,e,r,o){var a=i(t),l=n(r),c=l<0?a+l:l;if(c>=a||c<0)throw new s("Incorrect index");for(var h=new e(a),u=0;u{"use strict";var i=r(22615),n=r(85027),s=r(25391),o=r(54849),a=r(6045),l=r(618),c=r(76058),h=r(23070),u=r(27807),d=c("Promise"),p="AsyncFromSyncIterator",f=l.set,m=l.getterFor(p),g=function(t,e,r){var i=t.done;d.resolve(t.value).then((function(t){e(u(t,i))}),r)},A=function(t){t.type=p,f(this,t)};A.prototype=a(s(h),{next:function(){var t=m(this);return new d((function(e,r){var s=n(i(t.next,t.iterator));g(s,e,r)}))},return:function(){var t=m(this).iterator;return new d((function(e,r){var s=o(t,"return");if(void 0===s)return e(u(void 0,!0));var a=n(i(s,t));g(a,e,r)}))}}),t.exports=A},52399:(t,e,r)=>{"use strict";var i=r(22615),n=r(76058),s=r(54849);t.exports=function(t,e,r,o){try{var a=s(t,"return");if(a)return n("Promise").resolve(i(a,t)).then((function(){e(r)}),(function(t){o(t)}))}catch(t){return o(t)}e(r)}},17394:(t,e,r)=>{"use strict";var i=r(22615),n=r(9302),s=r(85027),o=r(25391),a=r(75773),l=r(6045),c=r(44201),h=r(618),u=r(76058),d=r(54849),p=r(23070),f=r(27807),m=r(72125),g=u("Promise"),A=c("toStringTag"),y="AsyncIteratorHelper",v="WrapForValidAsyncIterator",x=h.set,b=function(t){var e=!t,r=h.getterFor(t?v:y),a=function(t){var i=n((function(){return r(t)})),s=i.error,o=i.value;return s||e&&o.done?{exit:!0,value:s?g.reject(o):g.resolve(f(void 0,!0))}:{exit:!1,value:o}};return l(o(p),{next:function(){var t=a(this),e=t.value;if(t.exit)return e;var r=n((function(){return s(e.nextHandler(g))})),i=r.error,o=r.value;return i&&(e.done=!0),i?g.reject(o):g.resolve(o)},return:function(){var e=a(this),r=e.value;if(e.exit)return r;r.done=!0;var o,l,c=r.iterator,h=n((function(){if(r.inner)try{m(r.inner.iterator,"normal")}catch(t){return m(c,"throw",t)}return d(c,"return")}));return o=l=h.value,h.error?g.reject(l):void 0===o?g.resolve(f(void 0,!0)):(l=(h=n((function(){return i(o,c)}))).value,h.error?g.reject(l):t?g.resolve(l):g.resolve(l).then((function(t){return s(t),f(void 0,!0)})))}})},_=b(!0),w=b(!1);a(w,A,"Async Iterator Helper"),t.exports=function(t,e){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=e?v:y,i.nextHandler=t,i.counter=0,i.done=!1,x(this,i)};return r.prototype=e?_:w,r}},40164:(t,e,r)=>{"use strict";var i=r(22615),n=r(82412),s=function(t,e){return[e,t]};t.exports=function(){return i(n,this,s)}},62489:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(48999),a=r(55565),l=r(76058),c=r(22302),h=r(52399),u=function(t){var e=0===t,r=1===t,u=2===t,d=3===t;return function(t,p,f){s(t);var m=void 0!==p;!m&&e||n(p);var g=c(t),A=l("Promise"),y=g.iterator,v=g.next,x=0;return new A((function(t,n){var l=function(t){h(y,n,t,n)},c=function(){try{if(m)try{a(x)}catch(t){l(t)}A.resolve(s(i(v,y))).then((function(i){try{if(s(i).done)e?(f.length=x,t(f)):t(!d&&(u||void 0));else{var a=i.value;try{if(m){var g=p(a,x),v=function(i){if(r)c();else if(u)i?c():h(y,t,!1,n);else if(e)try{f[x++]=i,c()}catch(t){l(t)}else i?h(y,t,d||a,n):c()};o(g)?A.resolve(g).then(v,l):v(g)}else f[x++]=a,c()}catch(t){l(t)}}}catch(t){n(t)}}),n)}catch(t){n(t)}};c()}))}};t.exports={toArray:u(0),forEach:u(1),every:u(2),some:u(3),find:u(4)}},82412:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(48999),a=r(22302),l=r(17394),c=r(27807),h=r(52399),u=l((function(t){var e=this,r=e.iterator,n=e.mapper;return new t((function(a,l){var u=function(t){e.done=!0,l(t)},d=function(t){h(r,u,t,u)};t.resolve(s(i(e.next,r))).then((function(r){try{if(s(r).done)e.done=!0,a(c(void 0,!0));else{var i=r.value;try{var l=n(i,e.counter++),h=function(t){a(c(t,!1))};o(l)?t.resolve(l).then(h,d):h(l)}catch(t){d(t)}}}catch(t){u(t)}}),u)}))}));t.exports=function(t){return s(this),n(t),new u(a(this),{mapper:t})}},23070:(t,e,r)=>{"use strict";var i,n,s=r(19037),o=r(84091),a=r(69985),l=r(25391),c=r(61868),h=r(11880),u=r(44201),d=r(53931),p="USE_FUNCTION_CONSTRUCTOR",f=u("asyncIterator"),m=s.AsyncIterator,g=o.AsyncIteratorPrototype;if(g)i=g;else if(a(m))i=m.prototype;else if(o[p]||s[p])try{n=c(c(c(Function("return async function*(){}()")()))),c(n)===Object.prototype&&(i=n)}catch(t){}i?d&&(i=l(i)):i={},a(i[f])||h(i,f,(function(){return this})),t.exports=i},40219:(t,e,r)=>{"use strict";var i=r(22615),n=r(17394);t.exports=n((function(){return i(this.next,this.iterator)}),!0)},18368:t=>{"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=e+"+/",i=e+"-_",n=function(t){for(var e={},r=0;r<64;r++)e[t.charAt(r)]=r;return e};t.exports={i2c:r,c2i:n(r),i2cUrl:i,c2iUrl:n(i)}},71228:(t,e,r)=>{"use strict";var i=r(85027),n=r(72125);t.exports=function(t,e,r,s){try{return s?e(i(r)[0],r[1]):e(r)}catch(e){n(t,"throw",e)}}},86431:(t,e,r)=>{"use strict";var i=r(44201)("iterator"),n=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){n=!0}};o[i]=function(){return this},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){try{if(!e&&!n)return!1}catch(t){return!1}var r=!1;try{var s={};s[i]=function(){return{next:function(){return{done:r=!0}}}},t(s)}catch(t){}return r}},6648:(t,e,r)=>{"use strict";var i=r(68844),n=i({}.toString),s=i("".slice);t.exports=function(t){return s(n(t),8,-1)}},50926:(t,e,r)=>{"use strict";var i=r(23043),n=r(69985),s=r(6648),o=r(44201)("toStringTag"),a=Object,l="Arguments"===s(function(){return arguments}());t.exports=i?s:function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=a(t),o))?r:l?s(e):"Object"===(i=s(e))&&n(e.callee)?"Arguments":i}},28737:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(10509),o=r(52655),a=r(981),l=r(18734),c=[].push;t.exports=function(t){var e,r,h,u,d=arguments.length,p=d>1?arguments[1]:void 0;return o(this),(e=void 0!==p)&&s(p),a(t)?new this:(r=[],e?(h=0,u=i(p,d>2?arguments[2]:void 0),l(t,(function(t){n(c,r,u(t,h++))}))):l(t,c,{that:r}),new this(r))}},1114:(t,e,r)=>{"use strict";var i=r(96004);t.exports=function(){return new this(i(arguments))}},70800:(t,e,r)=>{"use strict";var i=r(25391),n=r(62148),s=r(6045),o=r(54071),a=r(767),l=r(981),c=r(18734),h=r(91934),u=r(27807),d=r(14241),p=r(67697),f=r(45375).fastKey,m=r(618),g=m.set,A=m.getterFor;t.exports={getConstructor:function(t,e,r,h){var u=t((function(t,n){a(t,d),g(t,{type:e,index:i(null),first:void 0,last:void 0,size:0}),p||(t.size=0),l(n)||c(n,t[h],{that:t,AS_ENTRIES:r})})),d=u.prototype,m=A(e),y=function(t,e,r){var i,n,s=m(t),o=v(t,e);return o?o.value=r:(s.last=o={index:n=f(e,!0),key:e,value:r,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=o),i&&(i.next=o),p?s.size++:t.size++,"F"!==n&&(s.index[n]=o)),t},v=function(t,e){var r,i=m(t),n=f(e);if("F"!==n)return i.index[n];for(r=i.first;r;r=r.next)if(r.key===e)return r};return s(d,{clear:function(){for(var t=m(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,p?t.size=0:this.size=0},delete:function(t){var e=this,r=m(e),i=v(e,t);if(i){var n=i.next,s=i.previous;delete r.index[i.index],i.removed=!0,s&&(s.next=n),n&&(n.previous=s),r.first===i&&(r.first=n),r.last===i&&(r.last=s),p?r.size--:e.size--}return!!i},forEach:function(t){for(var e,r=m(this),i=o(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!v(this,t)}}),s(d,r?{get:function(t){var e=v(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),p&&n(d,"size",{configurable:!0,get:function(){return m(this).size}}),u},setStrong:function(t,e,r){var i=e+" Iterator",n=A(e),s=A(i);h(t,e,(function(t,e){g(this,{type:i,target:t,state:n(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?u("keys"===e?r.key:"values"===e?r.value:[r.key,r.value],!1):(t.target=void 0,u(void 0,!0))}),r?"entries":"values",!r,!0),d(e)}}},70637:(t,e,r)=>{"use strict";var i=r(68844),n=r(6045),s=r(45375).getWeakData,o=r(767),a=r(85027),l=r(981),c=r(48999),h=r(18734),u=r(2960),d=r(36812),p=r(618),f=p.set,m=p.getterFor,g=u.find,A=u.findIndex,y=i([].splice),v=0,x=function(t){return t.frozen||(t.frozen=new b)},b=function(){this.entries=[]},_=function(t,e){return g(t.entries,(function(t){return t[0]===e}))};b.prototype={get:function(t){var e=_(this,t);if(e)return e[1]},has:function(t){return!!_(this,t)},set:function(t,e){var r=_(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=A(this.entries,(function(e){return e[0]===t}));return~e&&y(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,r,i){var u=t((function(t,n){o(t,p),f(t,{type:e,id:v++,frozen:void 0}),l(n)||h(n,t[i],{that:t,AS_ENTRIES:r})})),p=u.prototype,g=m(e),A=function(t,e,r){var i=g(t),n=s(a(e),!0);return!0===n?x(i).set(e,r):n[i.id]=r,t};return n(p,{delete:function(t){var e=g(this);if(!c(t))return!1;var r=s(t);return!0===r?x(e).delete(t):r&&d(r,e.id)&&delete r[e.id]},has:function(t){var e=g(this);if(!c(t))return!1;var r=s(t);return!0===r?x(e).has(t):r&&d(r,e.id)}}),n(p,r?{get:function(t){var e=g(this);if(c(t)){var r=s(t);return!0===r?x(e).get(t):r?r[e.id]:void 0}},set:function(t,e){return A(this,t,e)}}:{add:function(t){return A(this,t,!0)}}),u}}},20319:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(35266),a=r(11880),l=r(45375),c=r(18734),h=r(767),u=r(69985),d=r(981),p=r(48999),f=r(3689),m=r(86431),g=r(55997),A=r(33457);t.exports=function(t,e,r){var y=-1!==t.indexOf("Map"),v=-1!==t.indexOf("Weak"),x=y?"set":"add",b=n[t],_=b&&b.prototype,w=b,E={},M=function(t){var e=s(_[t]);a(_,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(v&&!p(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return v&&!p(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(v&&!p(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(o(t,!u(b)||!(v||_.forEach&&!f((function(){(new b).entries().next()})))))w=r.getConstructor(e,t,y,x),l.enable();else if(o(t,!0)){var S=new w,C=S[x](v?{}:-0,1)!==S,T=f((function(){S.has(1)})),I=m((function(t){new b(t)})),R=!v&&f((function(){for(var t=new b,e=5;e--;)t[x](e,e);return!t.has(-0)}));I||((w=e((function(t,e){h(t,_);var r=A(new b,t,w);return d(e)||c(e,r[x],{that:r,AS_ENTRIES:y}),r}))).prototype=_,_.constructor=w),(T||R)&&(M("delete"),M("has"),y&&M("get")),(R||C)&&M(x),v&&_.clear&&delete _.clear}return E[t]=w,i({global:!0,constructor:!0,forced:w!==b},E),g(w,t),v||r.setStrong(w,t,y),w}},41544:(t,e,r)=>{"use strict";r(56646),r(51090);var i=r(76058),n=r(25391),s=r(48999),o=Object,a=TypeError,l=i("Map"),c=i("WeakMap"),h=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=n(null)};h.prototype.get=function(t,e){return this[t]||(this[t]=e())},h.prototype.next=function(t,e,r){var i=r?this.objectsByIndex[t]||(this.objectsByIndex[t]=new c):this.primitives||(this.primitives=new l),n=i.get(e);return n||i.set(e,n=new h),n};var u=new h;t.exports=function(){var t,e,r=u,i=arguments.length;for(t=0;t{"use strict";var i=r(36812),n=r(19152),s=r(82474),o=r(72560);t.exports=function(t,e,r){for(var a=n(e),l=o.f,c=s.f,h=0;h{"use strict";var i=r(44201)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[i]=!1,"/./"[t](e)}catch(t){}}return!1}},81748:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},71568:(t,e,r)=>{"use strict";var i=r(68844),n=r(74684),s=r(34327),o=/"/g,a=i("".replace);t.exports=function(t,e,r,i){var l=s(n(t)),c="<"+e;return""!==r&&(c+=" "+r+'="'+a(s(i),o,""")+'"'),c+">"+l+""}},27807:t=>{"use strict";t.exports=function(t,e){return{value:t,done:e}}},75773:(t,e,r)=>{"use strict";var i=r(67697),n=r(72560),s=r(75684);t.exports=i?function(t,e,r){return n.f(t,e,s(1,r))}:function(t,e,r){return t[e]=r,t}},75684:t=>{"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},76522:(t,e,r)=>{"use strict";var i=r(18360),n=r(72560),s=r(75684);t.exports=function(t,e,r){var o=i(e);o in t?n.f(t,o,s(0,r)):t[o]=r}},99455:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(77254).start,o=RangeError,a=isFinite,l=Math.abs,c=Date.prototype,h=c.toISOString,u=i(c.getTime),d=i(c.getUTCDate),p=i(c.getUTCFullYear),f=i(c.getUTCHours),m=i(c.getUTCMilliseconds),g=i(c.getUTCMinutes),A=i(c.getUTCMonth),y=i(c.getUTCSeconds);t.exports=n((function(){return"0385-07-25T07:06:39.999Z"!==h.call(new Date(-50000000000001))}))||!n((function(){h.call(new Date(NaN))}))?function(){if(!a(u(this)))throw new o("Invalid time value");var t=this,e=p(t),r=m(t),i=e<0?"-":e>9999?"+":"";return i+s(l(e),i?6:4,0)+"-"+s(A(t)+1,2,0)+"-"+s(d(t),2,0)+"T"+s(f(t),2,0)+":"+s(g(t),2,0)+":"+s(y(t),2,0)+"."+s(r,3,0)+"Z"}:h},81797:(t,e,r)=>{"use strict";var i=r(85027),n=r(35899),s=TypeError;t.exports=function(t){if(i(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new s("Incorrect hint");return n(this,t)}},62148:(t,e,r)=>{"use strict";var i=r(98702),n=r(72560);t.exports=function(t,e,r){return r.get&&i(r.get,e,{getter:!0}),r.set&&i(r.set,e,{setter:!0}),n.f(t,e,r)}},11880:(t,e,r)=>{"use strict";var i=r(69985),n=r(72560),s=r(98702),o=r(95014);t.exports=function(t,e,r,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:e;if(i(r)&&s(r,c,a),a.global)l?t[e]=r:o(e,r);else{try{a.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=r:n.f(t,e,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},6045:(t,e,r)=>{"use strict";var i=r(11880);t.exports=function(t,e,r){for(var n in e)i(t,n,e[n],r);return t}},95014:(t,e,r)=>{"use strict";var i=r(19037),n=Object.defineProperty;t.exports=function(t,e){try{n(i,t,{value:e,configurable:!0,writable:!0})}catch(r){i[t]=e}return e}},98494:(t,e,r)=>{"use strict";var i=r(23691),n=TypeError;t.exports=function(t,e){if(!delete t[e])throw new n("Cannot delete property "+i(e)+" of "+i(t))}},67697:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},21420:(t,e,r)=>{"use strict";var i,n,s,o,a=r(19037),l=r(21905),c=r(63514),h=a.structuredClone,u=a.ArrayBuffer,d=a.MessageChannel,p=!1;if(c)p=function(t){h(t,{transfer:[t]})};else if(u)try{d||(i=l("worker_threads"))&&(d=i.MessageChannel),d&&(n=new d,s=new u(2),o=function(t){n.port1.postMessage(null,[t])},2===s.byteLength&&(o(s),0===s.byteLength&&(p=o)))}catch(t){}t.exports=p},22659:t=>{"use strict";var e="object"==typeof document&&document.all,r=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:r}},36420:(t,e,r)=>{"use strict";var i=r(19037),n=r(48999),s=i.document,o=n(s)&&n(s.createElement);t.exports=function(t){return o?s.createElement(t):{}}},55565:t=>{"use strict";var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},37136:t=>{"use strict";t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},66338:t=>{"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},33265:(t,e,r)=>{"use strict";var i=r(36420)("span").classList,n=i&&i.constructor&&i.constructor.prototype;t.exports=n===Object.prototype?void 0:n},97365:(t,e,r)=>{"use strict";var i=r(30071).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},72532:(t,e,r)=>{"use strict";var i=r(88563),n=r(50806);t.exports=!i&&!n&&"object"==typeof window&&"object"==typeof document},83127:t=>{"use strict";t.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},88563:t=>{"use strict";t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},37298:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/MSIE|Trident/.test(i)},63221:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/ipad|iphone|ipod/i.test(i)&&"undefined"!=typeof Pebble},4764:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},50806:(t,e,r)=>{"use strict";var i=r(19037),n=r(6648);t.exports="process"===n(i.process)},27486:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/web0s(?!.*chrome)/i.test(i)},30071:t=>{"use strict";t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3615:(t,e,r)=>{"use strict";var i,n,s=r(19037),o=r(30071),a=s.process,l=s.Deno,c=a&&a.versions||l&&l.version,h=c&&c.v8;h&&(n=(i=h.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!n&&o&&(!(i=o.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=o.match(/Chrome\/(\d+)/))&&(n=+i[1]),t.exports=n},27922:(t,e,r)=>{"use strict";var i=r(30071).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},72739:t=>{"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},56610:(t,e,r)=>{"use strict";var i=r(68844),n=Error,s=i("".replace),o=String(new n("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,l=a.test(o);t.exports=function(t,e){if(l&&"string"==typeof t&&!n.prepareStackTrace)for(;e--;)t=s(t,a,"");return t}},65411:(t,e,r)=>{"use strict";var i=r(75773),n=r(56610),s=r(49599),o=Error.captureStackTrace;t.exports=function(t,e,r,a){s&&(o?o(t,e):i(t,"stack",n(r,a)))}},49599:(t,e,r)=>{"use strict";var i=r(3689),n=r(75684);t.exports=!i((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",n(1,7)),7!==t.stack)}))},20445:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(85027),o=r(13841),a=Error.prototype.toString,l=n((function(){if(i){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==a.call(t))return!0}return"2: 1"!==a.call({message:1,name:2})||"Error"!==a.call({})}));t.exports=l?function(){var t=s(this),e=o(t.name,"Error"),r=o(t.message);return e?r?e+": "+r:e:r}:a},79989:(t,e,r)=>{"use strict";var i=r(19037),n=r(82474).f,s=r(75773),o=r(11880),a=r(95014),l=r(8758),c=r(35266);t.exports=function(t,e){var r,h,u,d,p,f=t.target,m=t.global,g=t.stat;if(r=m?i:g?i[f]||a(f,{}):(i[f]||{}).prototype)for(h in e){if(d=e[h],u=t.dontCallGetSet?(p=n(r,h))&&p.value:r[h],!c(m?h:f+(g?".":"#")+h,t.forced)&&void 0!==u){if(typeof d==typeof u)continue;l(d,u)}(t.sham||u&&u.sham)&&s(d,"sham",!0),o(r,h,d,t)}}},3689:t=>{"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},65773:(t,e,r)=>{"use strict";r(64043);var i=r(46576),n=r(11880),s=r(56308),o=r(3689),a=r(44201),l=r(75773),c=a("species"),h=RegExp.prototype;t.exports=function(t,e,r,u){var d=a(t),p=!o((function(){var e={};return e[d]=function(){return 7},7!==""[t](e)})),f=p&&!o((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[d]=/./[d]),r.exec=function(){return e=!0,null},r[d](""),!e}));if(!p||!f||r){var m=i(/./[d]),g=e(d,""[t],(function(t,e,r,n,o){var a=i(t),l=e.exec;return l===s||l===h.exec?p&&!o?{done:!0,value:m(e,r,n)}:{done:!0,value:a(r,e,n)}:{done:!1}}));n(String.prototype,t,g[0]),n(h,d,g[1])}u&&l(h[d],"sham",!0)}},37809:(t,e,r)=>{"use strict";var i=r(92297),n=r(6310),s=r(55565),o=r(54071),a=function(t,e,r,l,c,h,u,d){for(var p,f,m=c,g=0,A=!!u&&o(u,d);g0&&i(p)?(f=n(p),m=a(t,e,p,f,m,h-1)-1):(s(m+1),t[m]=p),m++),g++;return m};t.exports=a},71594:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},61735:(t,e,r)=>{"use strict";var i=r(97215),n=Function.prototype,s=n.apply,o=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?o.bind(s):function(){return o.apply(s,arguments)})},54071:(t,e,r)=>{"use strict";var i=r(46576),n=r(10509),s=r(97215),o=i(i.bind);t.exports=function(t,e){return n(t),void 0===e?t:s?o(t,e):function(){return t.apply(e,arguments)}}},97215:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},86761:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509),s=r(48999),o=r(36812),a=r(96004),l=r(97215),c=Function,h=i([].concat),u=i([].join),d={};t.exports=l?c.bind:function(t){var e=n(this),r=e.prototype,i=a(arguments,1),l=function(){var r=h(i,a(arguments));return this instanceof l?function(t,e,r){if(!o(d,e)){for(var i=[],n=0;n{"use strict";var i=r(97215),n=Function.prototype.call;t.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},33505:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509);t.exports=function(){return i(n(this))}},41236:(t,e,r)=>{"use strict";var i=r(67697),n=r(36812),s=Function.prototype,o=i&&Object.getOwnPropertyDescriptor,a=n(s,"name"),l=a&&"something"===function(){}.name,c=a&&(!i||i&&o(s,"name").configurable);t.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},52743:(t,e,r)=>{"use strict";var i=r(68844),n=r(10509);t.exports=function(t,e,r){try{return i(n(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},46576:(t,e,r)=>{"use strict";var i=r(6648),n=r(68844);t.exports=function(t){if("Function"===i(t))return n(t)}},68844:(t,e,r)=>{"use strict";var i=r(97215),n=Function.prototype,s=n.call,o=i&&n.bind.bind(s,s);t.exports=i?o:function(t){return function(){return s.apply(t,arguments)}}},9093:t=>{"use strict";var e=TypeError;t.exports=function(t){var r=t&&t.alphabet;if(void 0===r||"base64"===r||"base64url"===r)return r||"base64";throw new e("Incorrect `alphabet` option")}},11427:(t,e,r)=>{"use strict";var i=r(22615),n=r(69985),s=r(85027),o=r(22302),a=r(91664),l=r(54849),c=r(44201),h=r(29019),u=c("asyncIterator");t.exports=function(t){var e,r=s(t),c=!0,d=l(r,u);return n(d)||(d=a(r),c=!1),void 0!==d?e=i(d,r):(e=r,c=!0),s(e),o(c?e:new h(o(e)))}},13807:(t,e,r)=>{"use strict";var i=r(22615),n=r(29019),s=r(85027),o=r(5185),a=r(22302),l=r(54849),c=r(44201)("asyncIterator");t.exports=function(t,e){var r=arguments.length<2?l(t,c):e;return r?s(i(r,t)):new n(a(o(t)))}},88277:(t,e,r)=>{"use strict";var i=r(19037);t.exports=function(t,e){var r=i[t],n=r&&r.prototype;return n&&n[e]}},76058:(t,e,r)=>{"use strict";var i=r(19037),n=r(69985);t.exports=function(t,e){return arguments.length<2?(r=i[t],n(r)?r:void 0):i[t]&&i[t][e];var r}},22302:t=>{"use strict";t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},36752:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(22302),o=r(91664);t.exports=function(t,e){e&&"string"==typeof t||n(t);var r=o(t);return s(n(void 0!==r?i(r,t):t))}},91664:(t,e,r)=>{"use strict";var i=r(50926),n=r(54849),s=r(981),o=r(9478),a=r(44201)("iterator");t.exports=function(t){if(!s(t))return n(t,a)||n(t,"@@iterator")||o[i(t)]}},5185:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(23691),a=r(91664),l=TypeError;t.exports=function(t,e){var r=arguments.length<2?a(t):e;if(n(r))return s(i(r,t));throw new l(o(t)+" is not iterable")}},92643:(t,e,r)=>{"use strict";var i=r(68844),n=r(92297),s=r(69985),o=r(6648),a=r(34327),l=i([].push);t.exports=function(t){if(s(t))return t;if(n(t)){for(var e=t.length,r=[],i=0;i{"use strict";var i=r(10509),n=r(981);t.exports=function(t,e){var r=t[e];return n(r)?void 0:i(r)}},41074:(t,e,r)=>{"use strict";var i=r(10509),n=r(85027),s=r(22615),o=r(68700),a=r(22302),l="Invalid size",c=RangeError,h=TypeError,u=Math.max,d=function(t,e,r,i){this.set=t,this.size=e,this.has=r,this.keys=i};d.prototype={getIterator:function(){return a(n(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}},t.exports=function(t){n(t);var e=+t.size;if(e!=e)throw new h(l);var r=o(e);if(r<0)throw new c(l);return new d(t,u(r,0),i(t.has),i(t.keys))}},27017:(t,e,r)=>{"use strict";var i=r(68844),n=r(90690),s=Math.floor,o=i("".charAt),a=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,i,u,d){var p=r+t.length,f=i.length,m=h;return void 0!==u&&(u=n(u),m=c),a(d,m,(function(n,a){var c;switch(o(a,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,r);case"'":return l(e,p);case"<":c=u[l(a,1,-1)];break;default:var h=+a;if(0===h)return n;if(h>f){var d=s(h/10);return 0===d?n:d<=f?void 0===i[d-1]?o(a,1):i[d-1]+o(a,1):n}c=i[h-1]}return void 0===c?"":c}))}},19037:function(t,e,r){"use strict";var i=function(t){return t&&t.Math===Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r.g&&r.g)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},36812:(t,e,r)=>{"use strict";var i=r(68844),n=r(90690),s=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(n(t),e)}},57248:t=>{"use strict";t.exports={}},20920:t=>{"use strict";t.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}},2688:(t,e,r)=>{"use strict";var i=r(76058);t.exports=i("document","documentElement")},68506:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(36420);t.exports=!i&&!n((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},15477:t=>{"use strict";var e=Array,r=Math.abs,i=Math.pow,n=Math.floor,s=Math.log,o=Math.LN2;t.exports={pack:function(t,a,l){var c,h,u,d=e(l),p=8*l-a-1,f=(1<>1,g=23===a?i(2,-24)-i(2,-77):0,A=t<0||0===t&&1/t<0?1:0,y=0;for((t=r(t))!=t||t===1/0?(h=t!=t?1:0,c=f):(c=n(s(t)/o),t*(u=i(2,-c))<1&&(c--,u*=2),(t+=c+m>=1?g/u:g*i(2,1-m))*u>=2&&(c++,u/=2),c+m>=f?(h=0,c=f):c+m>=1?(h=(t*u-1)*i(2,a),c+=m):(h=t*i(2,m-1)*i(2,a),c=0));a>=8;)d[y++]=255&h,h/=256,a-=8;for(c=c<0;)d[y++]=255&c,c/=256,p-=8;return d[--y]|=128*A,d},unpack:function(t,e){var r,n=t.length,s=8*n-e-1,o=(1<>1,l=s-7,c=n-1,h=t[c--],u=127&h;for(h>>=7;l>0;)u=256*u+t[c--],l-=8;for(r=u&(1<<-l)-1,u>>=-l,l+=e;l>0;)r=256*r+t[c--],l-=8;if(0===u)u=1-a;else{if(u===o)return r?NaN:h?-1/0:1/0;r+=i(2,e),u-=a}return(h?-1:1)*r*i(2,u-e)}}},94413:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(6648),o=Object,a=i("".split);t.exports=n((function(){return!o("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?a(t,""):o(t)}:o},33457:(t,e,r)=>{"use strict";var i=r(69985),n=r(48999),s=r(49385);t.exports=function(t,e,r){var o,a;return s&&i(o=e.constructor)&&o!==r&&n(a=o.prototype)&&a!==r.prototype&&s(t,a),t}},6738:(t,e,r)=>{"use strict";var i=r(68844),n=r(69985),s=r(84091),o=i(Function.toString);n(s.inspectSource)||(s.inspectSource=function(t){return o(t)}),t.exports=s.inspectSource},62570:(t,e,r)=>{"use strict";var i=r(48999),n=r(75773);t.exports=function(t,e){i(e)&&"cause"in e&&n(t,"cause",e.cause)}},45375:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(57248),o=r(48999),a=r(36812),l=r(72560).f,c=r(72741),h=r(26062),u=r(27049),d=r(14630),p=r(71594),f=!1,m=d("meta"),g=0,A=function(t){l(t,m,{value:{objectID:"O"+g++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},f=!0;var t=c.f,e=n([].splice),r={};r[m]=1,t(r).length&&(c.f=function(r){for(var i=t(r),n=0,s=i.length;n{"use strict";var i,n,s,o=r(59834),a=r(19037),l=r(48999),c=r(75773),h=r(36812),u=r(84091),d=r(2713),p=r(57248),f="Object already initialized",m=a.TypeError,g=a.WeakMap;if(o||u.state){var A=u.state||(u.state=new g);A.get=A.get,A.has=A.has,A.set=A.set,i=function(t,e){if(A.has(t))throw new m(f);return e.facade=t,A.set(t,e),e},n=function(t){return A.get(t)||{}},s=function(t){return A.has(t)}}else{var y=d("state");p[y]=!0,i=function(t,e){if(h(t,y))throw new m(f);return e.facade=t,c(t,y,e),e},n=function(t){return h(t,y)?t[y]:{}},s=function(t){return h(t,y)}}t.exports={set:i,get:n,has:s,enforce:function(t){return s(t)?n(t):i(t,{})},getterFor:function(t){return function(e){var r;if(!l(e)||(r=n(e)).type!==t)throw new m("Incompatible receiver, "+t+" required");return r}}}},93292:(t,e,r)=>{"use strict";var i=r(44201),n=r(9478),s=i("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||o[s]===t)}},92297:(t,e,r)=>{"use strict";var i=r(6648);t.exports=Array.isArray||function(t){return"Array"===i(t)}},9401:(t,e,r)=>{"use strict";var i=r(50926);t.exports=function(t){var e=i(t);return"BigInt64Array"===e||"BigUint64Array"===e}},69985:(t,e,r)=>{"use strict";var i=r(22659),n=i.all;t.exports=i.IS_HTMLDDA?function(t){return"function"==typeof t||t===n}:function(t){return"function"==typeof t}},19429:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(69985),o=r(50926),a=r(76058),l=r(6738),c=function(){},h=[],u=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=i(d.exec),f=!d.test(c),m=function(t){if(!s(t))return!1;try{return u(c,h,t),!0}catch(t){return!1}},g=function(t){if(!s(t))return!1;switch(o(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(d,l(t))}catch(t){return!0}};g.sham=!0,t.exports=!u||n((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?g:m},76251:(t,e,r)=>{"use strict";var i=r(36812);t.exports=function(t){return void 0!==t&&(i(t,"value")||i(t,"writable"))}},35266:(t,e,r)=>{"use strict";var i=r(3689),n=r(69985),s=/#|\.prototype\./,o=function(t,e){var r=l[a(t)];return r===h||r!==c&&(n(e)?i(e):!!e)},a=o.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=o.data={},c=o.NATIVE="N",h=o.POLYFILL="P";t.exports=o},71973:(t,e,r)=>{"use strict";var i=r(48999),n=Math.floor;t.exports=Number.isInteger||function(t){return!i(t)&&isFinite(t)&&n(t)===t}},9603:(t,e,r)=>{"use strict";var i=r(50926),n=r(36812),s=r(981),o=r(44201),a=r(9478),l=o("iterator"),c=Object;t.exports=function(t){if(s(t))return!1;var e=c(t);return void 0!==e[l]||"@@iterator"in e||n(a,i(e))}},981:t=>{"use strict";t.exports=function(t){return null==t}},48999:(t,e,r)=>{"use strict";var i=r(69985),n=r(22659),s=n.all;t.exports=n.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:i(t)||t===s}:function(t){return"object"==typeof t?null!==t:i(t)}},53931:t=>{"use strict";t.exports=!1},55670:(t,e,r)=>{"use strict";var i=r(48999),n=r(618).get;t.exports=function(t){if(!i(t))return!1;var e=n(t);return!!e&&"RawJSON"===e.type}},91245:(t,e,r)=>{"use strict";var i=r(48999),n=r(6648),s=r(44201)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[s])?!!e:"RegExp"===n(t))}},30734:(t,e,r)=>{"use strict";var i=r(76058),n=r(69985),s=r(23622),o=r(39525),a=Object;t.exports=o?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return n(e)&&s(e.prototype,a(t))}},96704:(t,e,r)=>{"use strict";var i=r(22615);t.exports=function(t,e,r){for(var n,s,o=r?t:t.iterator,a=t.next;!(n=i(a,o)).done;)if(void 0!==(s=e(n.value)))return s}},18734:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(85027),o=r(23691),a=r(93292),l=r(6310),c=r(23622),h=r(5185),u=r(91664),d=r(72125),p=TypeError,f=function(t,e){this.stopped=t,this.result=e},m=f.prototype;t.exports=function(t,e,r){var g,A,y,v,x,b,_,w=r&&r.that,E=!(!r||!r.AS_ENTRIES),M=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),T=i(e,w),I=function(t){return g&&d(g,"normal",t),new f(!0,t)},R=function(t){return E?(s(t),C?T(t[0],t[1],I):T(t[0],t[1])):C?T(t,I):T(t)};if(M)g=t.iterator;else if(S)g=t;else{if(!(A=u(t)))throw new p(o(t)+" is not iterable");if(a(A)){for(y=0,v=l(t);v>y;y++)if((x=R(t[y]))&&c(m,x))return x;return new f(!1)}g=h(t,A)}for(b=M?t.next:g.next;!(_=n(b,g)).done;){try{x=R(_.value)}catch(t){d(g,"throw",t)}if("object"==typeof x&&x&&c(m,x))return x}return new f(!1)}},72125:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(54849);t.exports=function(t,e,r){var o,a;n(t);try{if(!(o=s(t,"return"))){if("throw"===e)throw r;return r}o=i(o,t)}catch(t){a=!0,o=t}if("throw"===e)throw r;if(a)throw o;return n(o),r}},30974:(t,e,r)=>{"use strict";var i=r(12013).IteratorPrototype,n=r(25391),s=r(75684),o=r(55997),a=r(9478),l=function(){return this};t.exports=function(t,e,r,c){var h=e+" Iterator";return t.prototype=n(i,{next:s(+!c,r)}),o(t,h,!1,!0),a[h]=l,t}},65419:(t,e,r)=>{"use strict";var i=r(22615),n=r(25391),s=r(75773),o=r(6045),a=r(44201),l=r(618),c=r(54849),h=r(12013).IteratorPrototype,u=r(27807),d=r(72125),p=a("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",g=l.set,A=function(t){var e=l.getterFor(t?m:f);return o(n(h),{next:function(){var r=e(this);if(t)return r.nextHandler();try{var i=r.done?void 0:r.nextHandler();return u(i,r.done)}catch(t){throw r.done=!0,t}},return:function(){var r=e(this),n=r.iterator;if(r.done=!0,t){var s=c(n,"return");return s?i(s,n):u(void 0,!0)}if(r.inner)try{d(r.inner.iterator,"normal")}catch(t){return d(n,"throw",t)}return d(n,"normal"),u(void 0,!0)}})},y=A(!0),v=A(!1);s(v,p,"Iterator Helper"),t.exports=function(t,e){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=e?m:f,i.nextHandler=t,i.counter=0,i.done=!1,g(this,i)};return r.prototype=e?y:v,r}},91934:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(53931),o=r(41236),a=r(69985),l=r(30974),c=r(61868),h=r(49385),u=r(55997),d=r(75773),p=r(11880),f=r(44201),m=r(9478),g=r(12013),A=o.PROPER,y=o.CONFIGURABLE,v=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,b=f("iterator"),_="keys",w="values",E="entries",M=function(){return this};t.exports=function(t,e,r,o,f,g,S){l(r,e,o);var C,T,I,R=function(t){if(t===f&&O)return O;if(!x&&t&&t in P)return P[t];switch(t){case _:case w:case E:return function(){return new r(this,t)}}return function(){return new r(this)}},B=e+" Iterator",L=!1,P=t.prototype,D=P[b]||P["@@iterator"]||f&&P[f],O=!x&&D||R(f),k="Array"===e&&P.entries||D;if(k&&(C=c(k.call(new t)))!==Object.prototype&&C.next&&(s||c(C)===v||(h?h(C,v):a(C[b])||p(C,b,M)),u(C,B,!0,!0),s&&(m[B]=M)),A&&f===w&&D&&D.name!==w&&(!s&&y?d(P,"name",w):(L=!0,O=function(){return n(D,this)})),f)if(T={values:R(w),keys:g?O:R(_),entries:R(E)},S)for(I in T)(x||L||!(I in P))&&p(P,I,T[I]);else i({target:e,proto:!0,forced:x||L},T);return s&&!S||P[b]===O||p(P,b,O,{name:f}),m[e]=O,T}},47082:(t,e,r)=>{"use strict";var i=r(22615),n=r(88983),s=function(t,e){return[e,t]};t.exports=function(){return i(n,this,s)}},88983:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(85027),o=r(22302),a=r(65419),l=r(71228),c=a((function(){var t=this.iterator,e=s(i(this.next,t));if(!(this.done=!!e.done))return l(t,this.mapper,[e.value,this.counter++],!0)}));t.exports=function(t){return s(this),n(t),new c(o(this),{mapper:t})}},12013:(t,e,r)=>{"use strict";var i,n,s,o=r(3689),a=r(69985),l=r(48999),c=r(25391),h=r(61868),u=r(11880),d=r(44201),p=r(53931),f=d("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(n=h(h(s)))!==Object.prototype&&(i=n):m=!0),!l(i)||o((function(){var t={};return i[f].call(t)!==t}))?i={}:p&&(i=c(i)),a(i[f])||u(i,f,(function(){return this})),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:m}},9478:t=>{"use strict";t.exports={}},6310:(t,e,r)=>{"use strict";var i=r(43126);t.exports=function(t){return i(t.length)}},98702:(t,e,r)=>{"use strict";var i=r(68844),n=r(3689),s=r(69985),o=r(36812),a=r(67697),l=r(41236).CONFIGURABLE,c=r(6738),h=r(618),u=h.enforce,d=h.get,p=String,f=Object.defineProperty,m=i("".slice),g=i("".replace),A=i([].join),y=a&&!n((function(){return 8!==f((function(){}),"length",{value:8}).length})),v=String(String).split("String"),x=t.exports=function(t,e,r){"Symbol("===m(p(e),0,7)&&(e="["+g(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!o(t,"name")||l&&t.name!==e)&&(a?f(t,"name",{value:e,configurable:!0}):t.name=e),y&&r&&o(r,"arity")&&t.length!==r.arity&&f(t,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?a&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=u(t);return o(i,"source")||(i.source=A(v,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return s(this)&&d(this).source||c(this)}),"toString")},83914:(t,e,r)=>{"use strict";var i=r(68844),n=Map.prototype;t.exports={Map,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete),proto:n}},10613:(t,e,r)=>{"use strict";var i=r(68844),n=r(96704),s=r(83914),o=s.Map,a=s.proto,l=i(a.forEach),c=i(a.entries),h=c(new o).next;t.exports=function(t,e,r){return r?n({iterator:c(t),next:h},(function(t){return e(t[1],t[0])})):l(t,e)}},41432:(t,e,r)=>{"use strict";var i=r(22615),n=r(10509),s=r(69985),o=r(85027),a=TypeError;t.exports=function(t,e){var r,l=o(this),c=n(l.get),h=n(l.has),u=n(l.set),d=arguments.length>2?arguments[2]:void 0;if(!s(e)&&!s(d))throw new a("At least one callback required");return i(h,l,t)?(r=i(c,l,t),s(e)&&(r=e(r),i(u,l,t,r))):s(d)&&(r=d(),i(u,l,t,r)),r}},21745:t=>{"use strict";var e=Math.expm1,r=Math.exp;t.exports=!e||e(10)>22025.465794806718||e(10)<22025.465794806718||-2e-17!==e(-2e-17)?function(t){var e=+t;return 0===e?e:e>-1e-6&&e<1e-6?e+e*e/2:r(e)-1}:e},76043:(t,e,r)=>{"use strict";var i=r(40134);t.exports=Math.f16round||function(t){return i(t,.0009765625,65504,6103515625e-14)}},40134:(t,e,r)=>{"use strict";var i=r(55680),n=Math.abs,s=2220446049250313e-31,o=1/s;t.exports=function(t,e,r,a){var l=+t,c=n(l),h=i(l);if(cr||d!=d?h*(1/0):h*d}},37788:(t,e,r)=>{"use strict";var i=r(40134);t.exports=Math.fround||function(t){return i(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},4736:t=>{"use strict";var e=Math.log,r=Math.LOG10E;t.exports=Math.log10||function(t){return e(t)*r}},93956:t=>{"use strict";var e=Math.log;t.exports=Math.log1p||function(t){var r=+t;return r>-1e-8&&r<1e-8?r-r*r/2:e(1+r)}},84463:t=>{"use strict";t.exports=Math.scale||function(t,e,r,i,n){var s=+t,o=+e,a=+r,l=+i,c=+n;return s!=s||o!=o||a!=a||l!=l||c!=c?NaN:s===1/0||s===-1/0?s:(s-o)*(c-l)/(a-o)+l}},55680:t=>{"use strict";t.exports=Math.sign||function(t){var e=+t;return 0===e||e!=e?e:e<0?-1:1}},58828:t=>{"use strict";var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?r:e)(i)}},80231:(t,e,r)=>{"use strict";var i,n,s,o,a,l=r(19037),c=r(54071),h=r(82474).f,u=r(99886).set,d=r(34410),p=r(4764),f=r(63221),m=r(27486),g=r(50806),A=l.MutationObserver||l.WebKitMutationObserver,y=l.document,v=l.process,x=l.Promise,b=h(l,"queueMicrotask"),_=b&&b.value;if(!_){var w=new d,E=function(){var t,e;for(g&&(t=v.domain)&&t.exit();e=w.get();)try{e()}catch(t){throw w.head&&i(),t}t&&t.enter()};p||g||m||!A||!y?!f&&x&&x.resolve?((o=x.resolve(void 0)).constructor=x,a=c(o.then,o),i=function(){a(E)}):g?i=function(){v.nextTick(E)}:(u=c(u,l),i=function(){u(E)}):(n=!0,s=y.createTextNode(""),new A(E).observe(s,{characterData:!0}),i=function(){s.data=n=!n}),_=function(t){w.head||i(),w.add(t)}}t.exports=_},22818:(t,e,r)=>{"use strict";var i=r(3689);t.exports=!i((function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t}))},48742:(t,e,r)=>{"use strict";var i=r(10509),n=TypeError,s=function(t){var e,r;this.promise=new t((function(t,i){if(void 0!==e||void 0!==r)throw new n("Bad Promise constructor");e=t,r=i})),this.resolve=i(e),this.reject=i(r)};t.exports.f=function(t){return new s(t)}},13841:(t,e,r)=>{"use strict";var i=r(34327);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},4654:t=>{"use strict";var e=RangeError;t.exports=function(t){if(t==t)return t;throw new e("NaN is not allowed")}},42124:(t,e,r)=>{"use strict";var i=r(91245),n=TypeError;t.exports=function(t){if(i(t))throw new n("The method doesn't accept regular expressions");return t}},70046:(t,e,r)=>{"use strict";var i=r(19037).isFinite;t.exports=Number.isFinite||function(t){return"number"==typeof t&&i(t)}},14818:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(34327),a=r(61435).trim,l=r(86350),c=s("".charAt),h=i.parseFloat,u=i.Symbol,d=u&&u.iterator,p=1/h(l+"-0")!=-1/0||d&&!n((function(){h(Object(d))}));t.exports=p?function(t){var e=a(o(t)),r=h(e);return 0===r&&"-"===c(e,0)?-0:r}:h},67897:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(34327),a=r(61435).trim,l=r(86350),c=i.parseInt,h=i.Symbol,u=h&&h.iterator,d=/^[+-]?0x/i,p=s(d.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||u&&!n((function(){c(Object(u))}));t.exports=f?function(t,e){var r=a(o(t));return c(r,e>>>0||(p(d,r)?16:10))}:c},98554:(t,e,r)=>{"use strict";var i=r(618),n=r(30974),s=r(27807),o=r(981),a=r(48999),l=r(62148),c=r(67697),h="Incorrect Iterator.range arguments",u="NumericRangeIterator",d=i.set,p=i.getterFor(u),f=RangeError,m=TypeError,g=n((function(t,e,r,i,n,s){if(typeof t!=i||e!==1/0&&e!==-1/0&&typeof e!=i)throw new m(h);if(t===1/0||t===-1/0)throw new f(h);var l,p=e>t,g=!1;if(void 0===r)l=void 0;else if(a(r))l=r.step,g=!!r.inclusive;else{if(typeof r!=i)throw new m(h);l=r}if(o(l)&&(l=p?s:-s),typeof l!=i)throw new m(h);if(l===1/0||l===-1/0||l===n&&t!==e)throw new f(h);d(this,{type:u,start:t,end:e,step:l,inclusive:g,hitsEnd:t!=t||e!=e||l!=l||e>t!=l>n,currentCount:n,zero:n}),c||(this.start=t,this.end=e,this.step=l,this.inclusive=g)}),u,(function(){var t=p(this);if(t.hitsEnd)return s(void 0,!0);var e=t.start,r=t.end,i=e+t.step*t.currentCount++;i===r&&(t.hitsEnd=!0);var n=t.inclusive;return(r>e?n?i>r:i>=r:n?r>i:r>=i)?(t.hitsEnd=!0,s(void 0,!0)):s(i,!1)})),A=function(t){l(g.prototype,t,{get:function(){return p(this)[t]},set:function(){},configurable:!0,enumerable:!1})};c&&(A("start"),A("end"),A("inclusive"),A("step")),t.exports=g},45394:(t,e,r)=>{"use strict";var i=r(67697),n=r(68844),s=r(22615),o=r(3689),a=r(20300),l=r(7518),c=r(49556),h=r(90690),u=r(94413),d=Object.assign,p=Object.defineProperty,f=n([].concat);t.exports=!d||o((function(){if(i&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!==d({},t)[r]||a(d({},e)).join("")!==n}))?function(t,e){for(var r=h(t),n=arguments.length,o=1,d=l.f,p=c.f;n>o;)for(var m,g=u(arguments[o++]),A=d?f(a(g),d(g)):a(g),y=A.length,v=0;y>v;)m=A[v++],i&&!s(p,g,m)||(r[m]=g[m]);return r}:d},25391:(t,e,r)=>{"use strict";var i,n=r(85027),s=r(98920),o=r(72739),a=r(57248),l=r(2688),c=r(36420),h=r(2713),u="prototype",d="script",p=h("IE_PROTO"),f=function(){},m=function(t){return"<"+d+">"+t+""},g=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},A=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;A="undefined"!=typeof document?document.domain&&i?g(i):(e=c("iframe"),r="java"+d+":",e.style.display="none",l.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F):g(i);for(var n=o.length;n--;)delete A[u][o[n]];return A()};a[p]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(f[u]=n(t),r=new f,f[u]=null,r[p]=t):r=A(),void 0===e?r:s.f(r,e)}},98920:(t,e,r)=>{"use strict";var i=r(67697),n=r(15648),s=r(72560),o=r(85027),a=r(65290),l=r(20300);e.f=i&&!n?Object.defineProperties:function(t,e){o(t);for(var r,i=a(e),n=l(e),c=n.length,h=0;c>h;)s.f(t,r=n[h++],i[r]);return t}},72560:(t,e,r)=>{"use strict";var i=r(67697),n=r(68506),s=r(15648),o=r(85027),a=r(18360),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",p="writable";e.f=i?s?function(t,e,r){if(o(t),e=a(e),o(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]){var i=h(t,e);i&&i[p]&&(t[e]=r.value,r={configurable:d in r?r[d]:i[d],enumerable:u in r?r[u]:i[u],writable:!1})}return c(t,e,r)}:c:function(t,e,r){if(o(t),e=a(e),o(r),n)try{return c(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},82474:(t,e,r)=>{"use strict";var i=r(67697),n=r(22615),s=r(49556),o=r(75684),a=r(65290),l=r(18360),c=r(36812),h=r(68506),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(t,e){if(t=a(t),e=l(e),h)try{return u(t,e)}catch(t){}if(c(t,e))return o(!n(s.f,t,e),t[e])}},26062:(t,e,r)=>{"use strict";var i=r(6648),n=r(65290),s=r(72741).f,o=r(9015),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"Window"===i(t)?function(t){try{return s(t)}catch(t){return o(a)}}(t):s(n(t))}},72741:(t,e,r)=>{"use strict";var i=r(54948),n=r(72739).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,n)}},7518:(t,e)=>{"use strict";e.f=Object.getOwnPropertySymbols},61868:(t,e,r)=>{"use strict";var i=r(36812),n=r(69985),s=r(90690),o=r(2713),a=r(81748),l=o("IE_PROTO"),c=Object,h=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=s(t);if(i(e,l))return e[l];var r=e.constructor;return n(r)&&e instanceof r?r.prototype:e instanceof c?h:null}},27049:(t,e,r)=>{"use strict";var i=r(3689),n=r(48999),s=r(6648),o=r(11655),a=Object.isExtensible,l=i((function(){a(1)}));t.exports=l||o?function(t){return!!n(t)&&(!o||"ArrayBuffer"!==s(t))&&(!a||a(t))}:a},23622:(t,e,r)=>{"use strict";var i=r(68844);t.exports=i({}.isPrototypeOf)},42351:(t,e,r)=>{"use strict";var i=r(618),n=r(30974),s=r(27807),o=r(36812),a=r(20300),l=r(90690),c="Object Iterator",h=i.set,u=i.getterFor(c);t.exports=n((function(t,e){var r=l(t);h(this,{type:c,mode:e,object:r,keys:a(r),index:0})}),"Object",(function(){for(var t=u(this),e=t.keys;;){if(null===e||t.index>=e.length)return t.object=t.keys=null,s(void 0,!0);var r=e[t.index++],i=t.object;if(o(i,r)){switch(t.mode){case"keys":return s(r,!1);case"values":return s(i[r],!1)}return s([r,i[r]],!1)}}}))},54948:(t,e,r)=>{"use strict";var i=r(68844),n=r(36812),s=r(65290),o=r(84328).indexOf,a=r(57248),l=i([].push);t.exports=function(t,e){var r,i=s(t),c=0,h=[];for(r in i)!n(a,r)&&n(i,r)&&l(h,r);for(;e.length>c;)n(i,r=e[c++])&&(~o(h,r)||l(h,r));return h}},20300:(t,e,r)=>{"use strict";var i=r(54948),n=r(72739);t.exports=Object.keys||function(t){return i(t,n)}},49556:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);e.f=n?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},90600:(t,e,r)=>{"use strict";var i=r(53931),n=r(19037),s=r(3689),o=r(27922);t.exports=i||!s((function(){if(!(o&&o<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete n[t]}}))},49385:(t,e,r)=>{"use strict";var i=r(52743),n=r(85027),s=r(23550);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=i(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return n(r),s(i),e?t(r,i):r.__proto__=i,r}}():void 0)},49419:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689),s=r(68844),o=r(61868),a=r(20300),l=r(65290),c=s(r(49556).f),h=s([].push),u=i&&n((function(){var t=Object.create(null);return t[2]=2,!c(t,2)})),d=function(t){return function(e){for(var r,n=l(e),s=a(n),d=u&&null===o(n),p=s.length,f=0,m=[];p>f;)r=s[f++],i&&!(d?r in n:c(n,r))||h(m,t?[r,n[r]]:n[r]);return m}};t.exports={entries:d(!0),values:d(!1)}},65073:(t,e,r)=>{"use strict";var i=r(23043),n=r(50926);t.exports=i?{}.toString:function(){return"[object "+n(this)+"]"}},35899:(t,e,r)=>{"use strict";var i=r(22615),n=r(69985),s=r(48999),o=TypeError;t.exports=function(t,e){var r,a;if("string"===e&&n(r=t.toString)&&!s(a=i(r,t)))return a;if(n(r=t.valueOf)&&!s(a=i(r,t)))return a;if("string"!==e&&n(r=t.toString)&&!s(a=i(r,t)))return a;throw new o("Can't convert object to primitive value")}},19152:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=r(72741),o=r(7518),a=r(85027),l=n([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=s.f(a(t)),r=o.f;return r?l(e,r(t)):e}},46675:(t,e,r)=>{"use strict";var i=r(68844),n=r(36812),s=SyntaxError,o=parseInt,a=String.fromCharCode,l=i("".charAt),c=i("".slice),h=i(/./.exec),u={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var r=!0,i="";e{"use strict";var i=r(19037);t.exports=i},9302:t=>{"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},87073:(t,e,r)=>{"use strict";var i=r(19037),n=r(17919),s=r(69985),o=r(35266),a=r(6738),l=r(44201),c=r(72532),h=r(88563),u=r(53931),d=r(3615),p=n&&n.prototype,f=l("species"),m=!1,g=s(i.PromiseRejectionEvent),A=o("Promise",(function(){var t=a(n),e=t!==String(n);if(!e&&66===d)return!0;if(u&&(!p.catch||!p.finally))return!0;if(!d||d<51||!/native code/.test(t)){var r=new n((function(t){t(1)})),i=function(t){t((function(){}),(function(){}))};if((r.constructor={})[f]=i,!(m=r.then((function(){}))instanceof i))return!0}return!e&&(c||h)&&!g}));t.exports={CONSTRUCTOR:A,REJECTION_EVENT:g,SUBCLASSING:m}},17919:(t,e,r)=>{"use strict";var i=r(19037);t.exports=i.Promise},72945:(t,e,r)=>{"use strict";var i=r(85027),n=r(48999),s=r(48742);t.exports=function(t,e){if(i(t),n(e)&&e.constructor===t)return e;var r=s.f(t);return(0,r.resolve)(e),r.promise}},562:(t,e,r)=>{"use strict";var i=r(17919),n=r(86431),s=r(87073).CONSTRUCTOR;t.exports=s||!n((function(t){i.all(t).then(void 0,(function(){}))}))},38055:(t,e,r)=>{"use strict";var i=r(72560).f;t.exports=function(t,e,r){r in t||i(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},34410:t=>{"use strict";var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},33666:(t,e,r)=>{"use strict";r(56646),r(51090);var i=r(76058),n=r(68844),s=r(83430),o=i("Map"),a=i("WeakMap"),l=n([].push),c=s("metadata"),h=c.store||(c.store=new a),u=function(t,e,r){var i=h.get(t);if(!i){if(!r)return;h.set(t,i=new o)}var n=i.get(e);if(!n){if(!r)return;i.set(e,n=new o)}return n};t.exports={store:h,getMap:u,has:function(t,e,r){var i=u(e,r,!1);return void 0!==i&&i.has(t)},get:function(t,e,r){var i=u(e,r,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,r,i){u(r,i,!0).set(t,e)},keys:function(t,e){var r=u(t,e,!1),i=[];return r&&r.forEach((function(t,e){l(i,e)})),i},toKey:function(t){return void 0===t||"symbol"==typeof t?t:String(t)}}},66100:(t,e,r)=>{"use strict";var i=r(22615),n=r(85027),s=r(69985),o=r(6648),a=r(56308),l=TypeError;t.exports=function(t,e){var r=t.exec;if(s(r)){var c=i(r,t,e);return null!==c&&n(c),c}if("RegExp"===o(t))return i(a,t,e);throw new l("RegExp#exec called on incompatible receiver")}},56308:(t,e,r)=>{"use strict";var i,n,s=r(22615),o=r(68844),a=r(34327),l=r(69633),c=r(87901),h=r(83430),u=r(25391),d=r(618).get,p=r(62100),f=r(26738),m=h("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,A=g,y=o("".charAt),v=o("".indexOf),x=o("".replace),b=o("".slice),_=(n=/b*/g,s(g,i=/a/,"a"),s(g,n,"a"),0!==i.lastIndex||0!==n.lastIndex),w=c.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(_||E||w||p||f)&&(A=function(t){var e,r,i,n,o,c,h,p=this,f=d(p),M=a(t),S=f.raw;if(S)return S.lastIndex=p.lastIndex,e=s(A,S,M),p.lastIndex=S.lastIndex,e;var C=f.groups,T=w&&p.sticky,I=s(l,p),R=p.source,B=0,L=M;if(T&&(I=x(I,"y",""),-1===v(I,"g")&&(I+="g"),L=b(M,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(M,p.lastIndex-1))&&(R="(?: "+R+")",L=" "+L,B++),r=new RegExp("^(?:"+R+")",I)),E&&(r=new RegExp("^"+R+"$(?!\\s)",I)),_&&(i=p.lastIndex),n=s(g,T?r:p,L),T?n?(n.input=b(n.input,B),n[0]=b(n[0],B),n.index=p.lastIndex,p.lastIndex+=n[0].length):p.lastIndex=0:_&&n&&(p.lastIndex=p.global?n.index+n[0].length:i),E&&n&&n.length>1&&s(m,n[0],r,(function(){for(o=1;o{"use strict";var i=r(85027);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},63477:(t,e,r)=>{"use strict";var i=r(22615),n=r(36812),s=r(23622),o=r(69633),a=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in a||n(t,"flags")||!s(a,t)?e:i(o,t)}},87901:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp,s=i((function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),o=s||i((function(){return!n("a","y").sticky})),a=s||i((function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:o,UNSUPPORTED_Y:s}},62100:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp;t.exports=i((function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},26738:(t,e,r)=>{"use strict";var i=r(3689),n=r(19037).RegExp;t.exports=i((function(){var t=n("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},74684:(t,e,r)=>{"use strict";var i=r(981),n=TypeError;t.exports=function(t){if(i(t))throw new n("Can't call method on "+t);return t}},68600:t=>{"use strict";t.exports=function(t,e){return t===e||t!=t&&e!=e}},70953:t=>{"use strict";t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},8552:(t,e,r)=>{"use strict";var i,n=r(19037),s=r(61735),o=r(69985),a=r(83127),l=r(30071),c=r(96004),h=r(21500),u=n.Function,d=/MSIE .\./.test(l)||a&&((i=n.Bun.version.split(".")).length<3||"0"===i[0]&&(i[1]<3||"3"===i[1]&&"0"===i[2]));t.exports=function(t,e){var r=e?2:1;return d?function(i,n){var a=h(arguments.length,1)>r,l=o(i)?i:u(i),d=a?c(arguments,r):[],p=a?function(){s(l,this,d)}:l;return e?t(p,n):t(p)}:t}},3097:(t,e,r)=>{"use strict";var i=r(61034),n=r(48774),s=i.Set,o=i.add;t.exports=function(t){var e=new s;return n(t,(function(t){o(e,t)})),e}},27748:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(3097),o=r(17026),a=r(41074),l=r(48774),c=r(96704),h=n.has,u=n.remove;t.exports=function(t){var e=i(this),r=a(t),n=s(e);return o(e)<=r.size?l(e,(function(t){r.includes(t)&&u(n,t)})):c(r.getIterator(),(function(t){h(e,t)&&u(n,t)})),n}},61034:(t,e,r)=>{"use strict";var i=r(68844),n=Set.prototype;t.exports={Set,add:i(n.add),has:i(n.has),remove:i(n.delete),proto:n}},72948:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(17026),o=r(41074),a=r(48774),l=r(96704),c=n.Set,h=n.add,u=n.has;t.exports=function(t){var e=i(this),r=o(t),n=new c;return s(e)>r.size?l(r.getIterator(),(function(t){u(e,t)&&h(n,t)})):a(e,(function(t){r.includes(t)&&h(n,t)})),n}},97795:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).has,s=r(17026),o=r(41074),a=r(48774),l=r(96704),c=r(72125);t.exports=function(t){var e=i(this),r=o(t);if(s(e)<=r.size)return!1!==a(e,(function(t){if(r.includes(t))return!1}),!0);var h=r.getIterator();return!1!==l(h,(function(t){if(n(e,t))return c(h,"normal",!1)}))}},26951:(t,e,r)=>{"use strict";var i=r(10029),n=r(17026),s=r(48774),o=r(41074);t.exports=function(t){var e=i(this),r=o(t);return!(n(e)>r.size)&&!1!==s(e,(function(t){if(!r.includes(t))return!1}),!0)}},3894:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).has,s=r(17026),o=r(41074),a=r(96704),l=r(72125);t.exports=function(t){var e=i(this),r=o(t);if(s(e){"use strict";var i=r(68844),n=r(96704),s=r(61034),o=s.Set,a=s.proto,l=i(a.forEach),c=i(a.keys),h=c(new o).next;t.exports=function(t,e,r){return r?n({iterator:c(t),next:h},e):l(t,e)}},53234:(t,e,r)=>{"use strict";var i=r(76058),n=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var e=i("Set");try{(new e)[t](n(0));try{return(new e)[t](n(-1)),!1}catch(t){return!0}}catch(t){return!1}}},17026:(t,e,r)=>{"use strict";var i=r(52743),n=r(61034);t.exports=i(n.proto,"size","get")||function(t){return t.size}},14241:(t,e,r)=>{"use strict";var i=r(76058),n=r(62148),s=r(44201),o=r(67697),a=s("species");t.exports=function(t){var e=i(t);o&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},62289:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034),s=r(3097),o=r(41074),a=r(96704),l=n.add,c=n.has,h=n.remove;t.exports=function(t){var e=i(this),r=o(t).getIterator(),n=s(e);return a(r,(function(t){c(e,t)?h(n,t):l(n,t)})),n}},55997:(t,e,r)=>{"use strict";var i=r(72560).f,n=r(36812),s=r(44201)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!n(t,s)&&i(t,s,{configurable:!0,value:e})}},75674:(t,e,r)=>{"use strict";var i=r(10029),n=r(61034).add,s=r(3097),o=r(41074),a=r(96704);t.exports=function(t){var e=i(this),r=o(t).getIterator(),l=s(e);return a(r,(function(t){n(l,t)})),l}},2713:(t,e,r)=>{"use strict";var i=r(83430),n=r(14630),s=i("keys");t.exports=function(t){return s[t]||(s[t]=n(t))}},84091:(t,e,r)=>{"use strict";var i=r(19037),n=r(95014),s="__core-js_shared__",o=i[s]||n(s,{});t.exports=o},83430:(t,e,r)=>{"use strict";var i=r(53931),n=r(84091);(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.34.0",mode:i?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE",source:"https://github.com/zloirock/core-js"})},76373:(t,e,r)=>{"use strict";var i=r(85027),n=r(52655),s=r(981),o=r(44201)("species");t.exports=function(t,e){var r,a=i(t).constructor;return void 0===a||s(r=i(a)[o])?e:n(r)}},8195:(t,e,r)=>{"use strict";var i=r(68844),n=r(65290),s=r(34327),o=r(6310),a=TypeError,l=i([].push),c=i([].join);t.exports=function(t){var e=n(t),r=o(e);if(!r)return"";for(var i=arguments.length,h=[],u=0;;){var d=e[u++];if(void 0===d)throw new a("Incorrect template");if(l(h,s(d)),u===r)return c(h,"");u{"use strict";var i=r(3689);t.exports=function(t){return i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},10730:(t,e,r)=>{"use strict";var i=r(68844),n=r(68700),s=r(34327),o=r(74684),a=i("".charAt),l=i("".charCodeAt),c=i("".slice),h=function(t){return function(e,r){var i,h,u=s(o(e)),d=n(r),p=u.length;return d<0||d>=p?t?"":void 0:(i=l(u,d))<55296||i>56319||d+1===p||(h=l(u,d+1))<56320||h>57343?t?a(u,d):i:t?c(u,d,d+2):h-56320+(i-55296<<10)+65536}};t.exports={codeAt:h(!1),charAt:h(!0)}},35947:(t,e,r)=>{"use strict";var i=r(30071);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(i)},77254:(t,e,r)=>{"use strict";var i=r(68844),n=r(43126),s=r(34327),o=r(90534),a=r(74684),l=i(o),c=i("".slice),h=Math.ceil,u=function(t){return function(e,r,i){var o,u,d=s(a(e)),p=n(r),f=d.length,m=void 0===i?" ":s(i);return p<=f||""===m?d:((u=l(m,h((o=p-f)/m.length))).length>o&&(u=c(u,0,o)),t?d+u:u+d)}};t.exports={start:u(!1),end:u(!0)}},98985:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=String.fromCharCode,o=i("String","fromCodePoint"),a=n("".charAt),l=n("".charCodeAt),c=n("".indexOf),h=n("".slice),u=function(t,e){var r=l(t,e);return r>=48&&r<=57},d=function(t,e,r){if(r>=t.length)return-1;for(var i=0;e=48&&t<=57?t-48:t>=97&&t<=102?t-97+10:t>=65&&t<=70?t-65+10:-1};t.exports=function(t){for(var e,r="",i=0,n=0;(n=c(t,"\\",n))>-1;){if(r+=h(t,i,n),++n===t.length)return;var l=a(t,n++);switch(l){case"b":r+="\b";break;case"t":r+="\t";break;case"n":r+="\n";break;case"v":r+="\v";break;case"f":r+="\f";break;case"r":r+="\r";break;case"\r":n1114111)return;r+=o(e);break;default:if(u(l,0))return;r+=l}i=n}return r+h(t,i)}},6430:(t,e,r)=>{"use strict";var i=r(68844),n=2147483647,s=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",l=RangeError,c=i(o.exec),h=Math.floor,u=String.fromCharCode,d=i("".charCodeAt),p=i([].join),f=i([].push),m=i("".replace),g=i("".split),A=i("".toLowerCase),y=function(t){return t+22+75*(t<26)},v=function(t,e,r){var i=0;for(t=r?h(t/700):t>>1,t+=h(t/e);t>455;)t=h(t/35),i+=36;return h(i+36*t/(t+38))},x=function(t){var e=[];t=function(t){for(var e=[],r=0,i=t.length;r=55296&&n<=56319&&r=o&&ih((n-c)/b))throw new l(a);for(c+=(x-o)*b,o=x,r=0;rn)throw new l(a);if(i===o){for(var _=c,w=36;;){var E=w<=m?1:w>=m+26?26:w-m;if(_{"use strict";var i=r(68700),n=r(34327),s=r(74684),o=RangeError;t.exports=function(t){var e=n(s(this)),r="",a=i(t);if(a<0||a===1/0)throw new o("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(e+=e))1&a&&(r+=e);return r}},79558:(t,e,r)=>{"use strict";var i=r(61435).end,n=r(75984);t.exports=n("trimEnd")?function(){return i(this)}:"".trimEnd},75984:(t,e,r)=>{"use strict";var i=r(41236).PROPER,n=r(3689),s=r(86350);t.exports=function(t){return n((function(){return!!s[t]()||"​…᠎"!=="​…᠎"[t]()||i&&s[t].name!==t}))}},72291:(t,e,r)=>{"use strict";var i=r(61435).start,n=r(75984);t.exports=n("trimStart")?function(){return i(this)}:"".trimStart},61435:(t,e,r)=>{"use strict";var i=r(68844),n=r(74684),s=r(34327),o=r(86350),a=i("".replace),l=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),h=function(t){return function(e){var r=s(n(e));return 1&t&&(r=a(r,l,"")),2&t&&(r=a(r,c,"$1")),r}};t.exports={start:h(1),end:h(2),trim:h(3)}},63514:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(3615),o=r(72532),a=r(88563),l=r(50806),c=i.structuredClone;t.exports=!!c&&!n((function(){if(a&&s>92||l&&s>94||o&&s>97)return!1;var t=new ArrayBuffer(8),e=c(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength}))},50146:(t,e,r)=>{"use strict";var i=r(3615),n=r(3689),s=r(19037).String;t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},13032:(t,e,r)=>{"use strict";var i=r(22615),n=r(76058),s=r(44201),o=r(11880);t.exports=function(){var t=n("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,a=s("toPrimitive");e&&!e[a]&&o(e,a,(function(t){return i(r,this)}),{arity:1})}},18992:(t,e,r)=>{"use strict";var i=r(76058),n=r(68844),s=i("Symbol"),o=s.keyFor,a=n(s.prototype.valueOf);t.exports=s.isRegisteredSymbol||function(t){try{return void 0!==o(a(t))}catch(t){return!1}}},8957:(t,e,r)=>{"use strict";for(var i=r(83430),n=r(76058),s=r(68844),o=r(30734),a=r(44201),l=n("Symbol"),c=l.isWellKnownSymbol,h=n("Object","getOwnPropertyNames"),u=s(l.prototype.valueOf),d=i("wks"),p=0,f=h(l),m=f.length;p{"use strict";var i=r(50146);t.exports=i&&!!Symbol.for&&!!Symbol.keyFor},99886:(t,e,r)=>{"use strict";var i,n,s,o,a=r(19037),l=r(61735),c=r(54071),h=r(69985),u=r(36812),d=r(3689),p=r(2688),f=r(96004),m=r(36420),g=r(21500),A=r(4764),y=r(50806),v=a.setImmediate,x=a.clearImmediate,b=a.process,_=a.Dispatch,w=a.Function,E=a.MessageChannel,M=a.String,S=0,C={},T="onreadystatechange";d((function(){i=a.location}));var I=function(t){if(u(C,t)){var e=C[t];delete C[t],e()}},R=function(t){return function(){I(t)}},B=function(t){I(t.data)},L=function(t){a.postMessage(M(t),i.protocol+"//"+i.host)};v&&x||(v=function(t){g(arguments.length,1);var e=h(t)?t:w(t),r=f(arguments,1);return C[++S]=function(){l(e,void 0,r)},n(S),S},x=function(t){delete C[t]},y?n=function(t){b.nextTick(R(t))}:_&&_.now?n=function(t){_.now(R(t))}:E&&!A?(o=(s=new E).port2,s.port1.onmessage=B,n=c(o.postMessage,o)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&i&&"file:"!==i.protocol&&!d(L)?(n=L,a.addEventListener("message",B,!1)):n=T in m("script")?function(t){p.appendChild(m("script"))[T]=function(){p.removeChild(this),I(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:v,clear:x}},23648:(t,e,r)=>{"use strict";var i=r(68844);t.exports=i(1..valueOf)},27578:(t,e,r)=>{"use strict";var i=r(68700),n=Math.max,s=Math.min;t.exports=function(t,e){var r=i(t);return r<0?n(r+e,0):s(r,e)}},71530:(t,e,r)=>{"use strict";var i=r(88732),n=TypeError;t.exports=function(t){var e=i(t,"number");if("number"==typeof e)throw new n("Can't convert number to bigint");return BigInt(e)}},19842:(t,e,r)=>{"use strict";var i=r(68700),n=r(43126),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=i(t),r=n(e);if(e!==r)throw new s("Wrong length or index");return r}},65290:(t,e,r)=>{"use strict";var i=r(94413),n=r(74684);t.exports=function(t){return i(n(t))}},68700:(t,e,r)=>{"use strict";var i=r(58828);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},43126:(t,e,r)=>{"use strict";var i=r(68700),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},90690:(t,e,r)=>{"use strict";var i=r(74684),n=Object;t.exports=function(t){return n(i(t))}},83250:(t,e,r)=>{"use strict";var i=r(15904),n=RangeError;t.exports=function(t,e){var r=i(t);if(r%e)throw new n("Wrong offset");return r}},15904:(t,e,r)=>{"use strict";var i=r(68700),n=RangeError;t.exports=function(t){var e=i(t);if(e<0)throw new n("The argument can't be less than 0");return e}},88732:(t,e,r)=>{"use strict";var i=r(22615),n=r(48999),s=r(30734),o=r(54849),a=r(35899),l=r(44201),c=TypeError,h=l("toPrimitive");t.exports=function(t,e){if(!n(t)||s(t))return t;var r,l=o(t,h);if(l){if(void 0===e&&(e="default"),r=i(l,t,e),!n(r)||s(r))return r;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},18360:(t,e,r)=>{"use strict";var i=r(88732),n=r(30734);t.exports=function(t){var e=i(t,"string");return n(e)?e:e+""}},2939:(t,e,r)=>{"use strict";var i=r(76058),n=r(69985),s=r(9603),o=r(48999),a=i("Set");t.exports=function(t){return function(t){return o(t)&&"number"==typeof t.size&&n(t.has)&&n(t.keys)}(t)?t:s(t)?new a(t):t}},23043:(t,e,r)=>{"use strict";var i={};i[r(44201)("toStringTag")]="z",t.exports="[object z]"===String(i)},34327:(t,e,r)=>{"use strict";var i=r(50926),n=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}},87191:t=>{"use strict";var e=Math.round;t.exports=function(t){var r=e(t);return r<0?0:r>255?255:255&r}},21905:(t,e,r)=>{"use strict";var i=r(50806);t.exports=function(t){try{if(i)return Function('return require("'+t+'")')()}catch(t){}}},23691:t=>{"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},31158:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(22615),o=r(67697),a=r(39800),l=r(54872),c=r(83999),h=r(767),u=r(75684),d=r(75773),p=r(71973),f=r(43126),m=r(19842),g=r(83250),A=r(87191),y=r(18360),v=r(36812),x=r(50926),b=r(48999),_=r(30734),w=r(25391),E=r(23622),M=r(49385),S=r(72741).f,C=r(41304),T=r(2960).forEach,I=r(14241),R=r(62148),B=r(72560),L=r(82474),P=r(618),D=r(33457),O=P.get,k=P.set,U=P.enforce,N=B.f,F=L.f,z=n.RangeError,G=c.ArrayBuffer,Q=G.prototype,j=c.DataView,V=l.NATIVE_ARRAY_BUFFER_VIEWS,H=l.TYPED_ARRAY_TAG,W=l.TypedArray,q=l.TypedArrayPrototype,Z=l.aTypedArrayConstructor,Y=l.isTypedArray,X="BYTES_PER_ELEMENT",J="Wrong length",K=function(t,e){Z(t);for(var r=0,i=e.length,n=new t(i);i>r;)n[r]=e[r++];return n},$=function(t,e){R(t,e,{configurable:!0,get:function(){return O(this)[e]}})},tt=function(t){var e;return E(Q,t)||"ArrayBuffer"===(e=x(t))||"SharedArrayBuffer"===e},et=function(t,e){return Y(t)&&!_(e)&&e in t&&p(+e)&&e>=0},rt=function(t,e){return e=y(e),et(t,e)?u(2,t[e]):F(t,e)},it=function(t,e,r){return e=y(e),!(et(t,e)&&b(r)&&v(r,"value"))||v(r,"get")||v(r,"set")||r.configurable||v(r,"writable")&&!r.writable||v(r,"enumerable")&&!r.enumerable?N(t,e,r):(t[e]=r.value,t)};o?(V||(L.f=rt,B.f=it,$(q,"buffer"),$(q,"byteOffset"),$(q,"byteLength"),$(q,"length")),i({target:"Object",stat:!0,forced:!V},{getOwnPropertyDescriptor:rt,defineProperty:it}),t.exports=function(t,e,r){var o=t.match(/\d+/)[0]/8,l=t+(r?"Clamped":"")+"Array",c="get"+t,u="set"+t,p=n[l],y=p,v=y&&y.prototype,x={},_=function(t,e){N(t,e,{get:function(){return function(t,e){var r=O(t);return r.view[c](e*o+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,i){var n=O(t);n.view[u](e*o+n.byteOffset,r?A(i):i,!0)}(this,e,t)},enumerable:!0})};V?a&&(y=e((function(t,e,r,i){return h(t,v),D(b(e)?tt(e)?void 0!==i?new p(e,g(r,o),i):void 0!==r?new p(e,g(r,o)):new p(e):Y(e)?K(y,e):s(C,y,e):new p(m(e)),t,y)})),M&&M(y,W),T(S(p),(function(t){t in y||d(y,t,p[t])})),y.prototype=v):(y=e((function(t,e,r,i){h(t,v);var n,a,l,c=0,u=0;if(b(e)){if(!tt(e))return Y(e)?K(y,e):s(C,y,e);n=e,u=g(r,o);var d=e.byteLength;if(void 0===i){if(d%o)throw new z(J);if((a=d-u)<0)throw new z(J)}else if((a=f(i)*o)+u>d)throw new z(J);l=a/o}else l=m(e),n=new G(a=l*o);for(k(t,{buffer:n,byteOffset:u,byteLength:a,length:l,view:new j(n)});c{"use strict";var i=r(19037),n=r(3689),s=r(86431),o=r(54872).NATIVE_ARRAY_BUFFER_VIEWS,a=i.ArrayBuffer,l=i.Int8Array;t.exports=!o||!n((function(){l(1)}))||!n((function(){new l(-1)}))||!s((function(t){new l,new l(null),new l(1.5),new l(t)}),!0)||n((function(){return 1!==new l(new a(2),1,void 0).length}))},20716:(t,e,r)=>{"use strict";var i=r(59976),n=r(47338);t.exports=function(t,e){return i(n(t),e)}},41304:(t,e,r)=>{"use strict";var i=r(54071),n=r(22615),s=r(52655),o=r(90690),a=r(6310),l=r(5185),c=r(91664),h=r(93292),u=r(9401),d=r(54872).aTypedArrayConstructor,p=r(71530);t.exports=function(t){var e,r,f,m,g,A,y,v,x=s(this),b=o(t),_=arguments.length,w=_>1?arguments[1]:void 0,E=void 0!==w,M=c(b);if(M&&!h(M))for(v=(y=l(b,M)).next,b=[];!(A=n(v,y)).done;)b.push(A.value);for(E&&_>2&&(w=i(w,arguments[2])),r=a(b),f=new(d(x))(r),m=u(f),e=0;r>e;e++)g=E?w(b[e],e):b[e],f[e]=m?p(g):+g;return f}},47338:(t,e,r)=>{"use strict";var i=r(54872),n=r(76373),s=i.aTypedArrayConstructor,o=i.getTypedArrayConstructor;t.exports=function(t){return s(n(t,o(t)))}},14630:(t,e,r)=>{"use strict";var i=r(68844),n=0,s=Math.random(),o=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+o(++n+s,36)}},76837:(t,e,r)=>{"use strict";var i=r(3689),n=r(44201),s=r(67697),o=r(53931),a=n("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),i="";return t.pathname="c%20d",e.forEach((function(t,r){e.delete("b"),i+=r+t})),r.delete("a",2),r.delete("b",void 0),o&&(!t.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!e.size&&(o||!s)||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},39525:(t,e,r)=>{"use strict";var i=r(50146);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},15648:(t,e,r)=>{"use strict";var i=r(67697),n=r(3689);t.exports=i&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},21500:t=>{"use strict";var e=TypeError;t.exports=function(t,r){if(t{"use strict";var i=r(19037),n=r(69985),s=i.WeakMap;t.exports=n(s)&&/native code/.test(String(s))},16803:(t,e,r)=>{"use strict";var i=r(68844),n=WeakMap.prototype;t.exports={WeakMap,set:i(n.set),get:i(n.get),has:i(n.has),remove:i(n.delete)}},78616:(t,e,r)=>{"use strict";var i=r(68844),n=WeakSet.prototype;t.exports={WeakSet,add:i(n.add),has:i(n.has),remove:i(n.delete)}},35405:(t,e,r)=>{"use strict";var i=r(50496),n=r(36812),s=r(96145),o=r(72560).f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});n(e,t)||o(e,t,{value:s.f(t)})}},96145:(t,e,r)=>{"use strict";var i=r(44201);e.f=i},44201:(t,e,r)=>{"use strict";var i=r(19037),n=r(83430),s=r(36812),o=r(14630),a=r(50146),l=r(39525),c=i.Symbol,h=n("wks"),u=l?c.for||c:c&&c.withoutSetter||o;t.exports=function(t){return s(h,t)||(h[t]=a&&s(c,t)?c[t]:u("Symbol."+t)),h[t]}},86350:t=>{"use strict";t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},51064:(t,e,r)=>{"use strict";var i=r(76058),n=r(36812),s=r(75773),o=r(23622),a=r(49385),l=r(8758),c=r(38055),h=r(33457),u=r(13841),d=r(62570),p=r(65411),f=r(67697),m=r(53931);t.exports=function(t,e,r,g){var A="stackTraceLimit",y=g?2:1,v=t.split("."),x=v[v.length-1],b=i.apply(null,v);if(b){var _=b.prototype;if(!m&&n(_,"cause")&&delete _.cause,!r)return b;var w=i("Error"),E=e((function(t,e){var r=u(g?e:t,void 0),i=g?new b(t):new b;return void 0!==r&&s(i,"message",r),p(i,E,i.stack,2),this&&o(_,this)&&h(i,this,E),arguments.length>y&&d(i,arguments[y]),i}));if(E.prototype=_,"Error"!==x?a?a(E,w):l(E,w,{name:!0}):f&&A in b&&(c(E,b,A),c(E,b,"prepareStackTrace")),l(E,b),!m)try{_.name!==x&&s(_,"name",x),_.constructor=E}catch(t){}return E}}},54927:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(3689),a=r(51064),l="AggregateError",c=n(l),h=!o((function(){return 1!==c([1]).errors[0]}))&&o((function(){return 7!==c([1],l,{cause:7}).cause}));i({global:!0,constructor:!0,arity:2,forced:h},{AggregateError:a(l,(function(t){return function(e,r){return s(t,this,arguments)}}),h,!0)})},39382:(t,e,r)=>{"use strict";var i=r(79989),n=r(23622),s=r(61868),o=r(49385),a=r(8758),l=r(25391),c=r(75773),h=r(75684),u=r(62570),d=r(65411),p=r(18734),f=r(13841),m=r(44201)("toStringTag"),g=Error,A=[].push,y=function(t,e){var r,i=n(v,this);o?r=o(new g,i?s(this):v):(r=i?this:l(v),c(r,m,"Error")),void 0!==e&&c(r,"message",f(e)),d(r,y,r.stack,1),arguments.length>2&&u(r,arguments[2]);var a=[];return p(t,A,{that:a}),c(r,"errors",a),r};o?o(y,g):a(y,g,{name:!0});var v=y.prototype=l(g.prototype,{constructor:h(1,y),message:h(1,""),name:h(1,"AggregateError")});i({global:!0,constructor:!0,arity:2},{AggregateError:y})},95879:(t,e,r)=>{"use strict";r(39382)},69365:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(83999),o=r(14241),a="ArrayBuffer",l=s[a];i({global:!0,constructor:!0,forced:n[a]!==l},{ArrayBuffer:l}),o(a)},33870:(t,e,r)=>{"use strict";var i=r(79989),n=r(54872);i({target:"ArrayBuffer",stat:!0,forced:!n.NATIVE_ARRAY_BUFFER_VIEWS},{isView:n.isView})},99211:(t,e,r)=>{"use strict";var i=r(79989),n=r(46576),s=r(3689),o=r(83999),a=r(85027),l=r(27578),c=r(43126),h=r(76373),u=o.ArrayBuffer,d=o.DataView,p=d.prototype,f=n(u.prototype.slice),m=n(p.getUint8),g=n(p.setUint8);i({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:s((function(){return!new u(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(f&&void 0===e)return f(a(this),t);for(var r=a(this).byteLength,i=l(t,r),n=l(void 0===e?r:e,r),s=new(h(this,u))(c(n-i)),o=new d(this),p=new d(s),A=0;i{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(68700),a=r(87370);i({target:"Array",proto:!0},{at:function(t){var e=n(this),r=s(e),i=o(t),a=i>=0?i:r+i;return a<0||a>=r?void 0:e[a]}}),a("at")},34338:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(92297),o=r(48999),a=r(90690),l=r(6310),c=r(55565),h=r(76522),u=r(27120),d=r(29042),p=r(44201),f=r(3615),m=p("isConcatSpreadable"),g=f>=51||!n((function(){var t=[];return t[m]=!1,t.concat()[0]!==t})),A=function(t){if(!o(t))return!1;var e=t[m];return void 0!==e?!!e:s(t)};i({target:"Array",proto:!0,arity:1,forced:!g||!d("concat")},{concat:function(t){var e,r,i,n,s,o=a(this),d=u(o,0),p=0;for(e=-1,i=arguments.length;e{"use strict";var i=r(79989),n=r(70357),s=r(87370);i({target:"Array",proto:!0},{copyWithin:n}),s("copyWithin")},55791:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).every;i({target:"Array",proto:!0,forced:!r(16834)("every")},{every:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},97895:(t,e,r)=>{"use strict";var i=r(79989),n=r(62872),s=r(87370);i({target:"Array",proto:!0},{fill:n}),s("fill")},38077:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filter;i({target:"Array",proto:!0,forced:!r(29042)("filter")},{filter:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},39772:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).findIndex,s=r(87370),o="findIndex",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{findIndex:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},93383:(t,e,r)=>{"use strict";var i=r(79989),n=r(61969).findLastIndex,s=r(87370);i({target:"Array",proto:!0},{findLastIndex:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLastIndex")},59867:(t,e,r)=>{"use strict";var i=r(79989),n=r(61969).findLast,s=r(87370);i({target:"Array",proto:!0},{findLast:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLast")},25728:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).find,s=r(87370),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},54564:(t,e,r)=>{"use strict";var i=r(79989),n=r(37809),s=r(10509),o=r(90690),a=r(6310),l=r(27120);i({target:"Array",proto:!0},{flatMap:function(t){var e,r=o(this),i=a(r);return s(t),(e=l(r,0)).length=n(e,r,r,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},62795:(t,e,r)=>{"use strict";var i=r(79989),n=r(37809),s=r(90690),o=r(6310),a=r(68700),l=r(27120);i({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=s(this),r=o(e),i=l(e,0);return i.length=n(i,e,e,r,0,void 0===t?1:a(t)),i}})},49693:(t,e,r)=>{"use strict";var i=r(79989),n=r(57612);i({target:"Array",proto:!0,forced:[].forEach!==n},{forEach:n})},77049:(t,e,r)=>{"use strict";var i=r(79989),n=r(21055);i({target:"Array",stat:!0,forced:!r(86431)((function(t){Array.from(t)}))},{from:n})},76801:(t,e,r)=>{"use strict";var i=r(79989),n=r(84328).includes,s=r(3689),o=r(87370);i({target:"Array",proto:!0,forced:s((function(){return!Array(1).includes()}))},{includes:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),o("includes")},97195:(t,e,r)=>{"use strict";var i=r(79989),n=r(46576),s=r(84328).indexOf,o=r(16834),a=n([].indexOf),l=!!a&&1/a([1],1,-0)<0;i({target:"Array",proto:!0,forced:l||!o("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return l?a(this,t,e)||0:s(this,t,e)}})},63975:(t,e,r)=>{"use strict";r(79989)({target:"Array",stat:!0},{isArray:r(92297)})},752:(t,e,r)=>{"use strict";var i=r(65290),n=r(87370),s=r(9478),o=r(618),a=r(72560).f,l=r(91934),c=r(27807),h=r(53931),u=r(67697),d="Array Iterator",p=o.set,f=o.getterFor(d);t.exports=l(Array,"Array",(function(t,e){p(this,{type:d,target:i(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,c(void 0,!0);switch(t.kind){case"keys":return c(r,!1);case"values":return c(e[r],!1)}return c([r,e[r]],!1)}),"values");var m=s.Arguments=s.Array;if(n("keys"),n("values"),n("entries"),!h&&u&&"values"!==m.name)try{a(m,"name",{value:"values"})}catch(t){}},6203:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(94413),o=r(65290),a=r(16834),l=n([].join);i({target:"Array",proto:!0,forced:s!==Object||!a("join",",")},{join:function(t){return l(o(this),void 0===t?",":t)}})},72410:(t,e,r)=>{"use strict";var i=r(79989),n=r(60953);i({target:"Array",proto:!0,forced:n!==[].lastIndexOf},{lastIndexOf:n})},50886:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).map;i({target:"Array",proto:!0,forced:!r(29042)("map")},{map:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},37593:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(19429),o=r(76522),a=Array;i({target:"Array",stat:!0,forced:n((function(){function t(){}return!(a.of.call(t)instanceof t)}))},{of:function(){for(var t=0,e=arguments.length,r=new(s(this)?this:a)(e);e>t;)o(r,t,arguments[t++]);return r.length=e,r}})},70560:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(5649),a=r(55565);i({target:"Array",proto:!0,arity:1,forced:r(3689)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=n(this),r=s(e),i=arguments.length;a(r+i);for(var l=0;l{"use strict";var i=r(79989),n=r(88820).right,s=r(16834),o=r(3615);i({target:"Array",proto:!0,forced:!r(50806)&&o>79&&o<83||!s("reduceRight")},{reduceRight:function(t){return n(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},278:(t,e,r)=>{"use strict";var i=r(79989),n=r(88820).left,s=r(16834),o=r(3615);i({target:"Array",proto:!0,forced:!r(50806)&&o>79&&o<83||!s("reduce")},{reduce:function(t){var e=arguments.length;return n(this,t,e,e>1?arguments[1]:void 0)}})},93374:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(92297),o=n([].reverse),a=[1,2];i({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),o(this)}})},89730:(t,e,r)=>{"use strict";var i=r(79989),n=r(92297),s=r(19429),o=r(48999),a=r(27578),l=r(6310),c=r(65290),h=r(76522),u=r(44201),d=r(29042),p=r(96004),f=d("slice"),m=u("species"),g=Array,A=Math.max;i({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var r,i,u,d=c(this),f=l(d),y=a(t,f),v=a(void 0===e?f:e,f);if(n(d)&&(r=d.constructor,(s(r)&&(r===g||n(r.prototype))||o(r)&&null===(r=r[m]))&&(r=void 0),r===g||void 0===r))return p(d,y,v);for(i=new(void 0===r?g:r)(A(v-y,0)),u=0;y{"use strict";var i=r(79989),n=r(2960).some;i({target:"Array",proto:!0,forced:!r(16834)("some")},{some:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},65137:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(90690),a=r(6310),l=r(98494),c=r(34327),h=r(3689),u=r(50382),d=r(16834),p=r(97365),f=r(37298),m=r(3615),g=r(27922),A=[],y=n(A.sort),v=n(A.push),x=h((function(){A.sort(void 0)})),b=h((function(){A.sort(null)})),_=d("sort"),w=!h((function(){if(m)return m<70;if(!(p&&p>3)){if(f)return!0;if(g)return g<603;var t,e,r,i,n="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(i=0;i<47;i++)A.push({k:e+i,v:r})}for(A.sort((function(t,e){return e.v-t.v})),i=0;ic(r)?1:-1}}(t)),r=a(n),i=0;i{"use strict";r(14241)("Array")},62506:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(27578),o=r(68700),a=r(6310),l=r(5649),c=r(55565),h=r(27120),u=r(76522),d=r(98494),p=r(29042)("splice"),f=Math.max,m=Math.min;i({target:"Array",proto:!0,forced:!p},{splice:function(t,e){var r,i,p,g,A,y,v=n(this),x=a(v),b=s(t,x),_=arguments.length;for(0===_?r=i=0:1===_?(r=0,i=x-b):(r=_-2,i=m(f(o(e),0),x-b)),c(x+r-i),p=h(v,i),g=0;gx-i+r;g--)d(v,g-1)}else if(r>i)for(g=x-i;g>b;g--)y=g+r-1,(A=g+i-1)in v?v[y]=v[A]:d(v,y);for(g=0;g{"use strict";var i=r(79989),n=r(26166),s=r(65290),o=r(87370),a=Array;i({target:"Array",proto:!0},{toReversed:function(){return n(s(this),a)}}),o("toReversed")},12894:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(65290),a=r(59976),l=r(88277),c=r(87370),h=Array,u=n(l("Array","sort"));i({target:"Array",proto:!0},{toSorted:function(t){void 0!==t&&s(t);var e=o(this),r=a(h,e);return u(r,t)}}),c("toSorted")},93530:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370),s=r(55565),o=r(6310),a=r(27578),l=r(65290),c=r(68700),h=Array,u=Math.max,d=Math.min;i({target:"Array",proto:!0},{toSpliced:function(t,e){var r,i,n,p,f=l(this),m=o(f),g=a(t,m),A=arguments.length,y=0;for(0===A?r=i=0:1===A?(r=0,i=m-g):(r=A-2,i=d(u(c(e),0),m-g)),n=s(m+r-i),p=h(n);y{"use strict";r(87370)("flatMap")},13383:(t,e,r)=>{"use strict";r(87370)("flat")},91719:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(6310),o=r(5649),a=r(98494),l=r(55565);i({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}}()},{unshift:function(t){var e=n(this),r=s(e),i=arguments.length;if(i){l(r+i);for(var c=r;c--;){var h=c+i;c in e?e[h]=e[c]:a(e,h)}for(var u=0;u{"use strict";var i=r(79989),n=r(16134),s=r(65290),o=Array;i({target:"Array",proto:!0},{with:function(t,e){return n(s(this),o,t,e)}})},87347:(t,e,r)=>{"use strict";var i=r(79989),n=r(83999);i({global:!0,constructor:!0,forced:!r(37075)},{DataView:n.DataView})},18201:(t,e,r)=>{"use strict";r(87347)},55635:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(3689)((function(){return 120!==new Date(16e11).getYear()})),o=n(Date.prototype.getFullYear);i({target:"Date",proto:!0,forced:s},{getYear:function(){return o(this)-1900}})},42227:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=Date,o=n(s.prototype.getTime);i({target:"Date",stat:!0},{now:function(){return o(new s)}})},99679:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=Date.prototype,a=n(o.getTime),l=n(o.setFullYear);i({target:"Date",proto:!0},{setYear:function(t){a(this);var e=s(t);return l(this,e>=0&&e<=99?e+1900:e)}})},24343:(t,e,r)=>{"use strict";r(79989)({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},65007:(t,e,r)=>{"use strict";var i=r(79989),n=r(99455);i({target:"Date",proto:!0,forced:Date.prototype.toISOString!==n},{toISOString:n})},78150:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(90690),o=r(88732);i({target:"Date",proto:!0,arity:1,forced:n((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=s(this),r=o(e,"number");return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},59903:(t,e,r)=>{"use strict";var i=r(36812),n=r(11880),s=r(81797),o=r(44201)("toPrimitive"),a=Date.prototype;i(a,o)||n(a,o,s)},30024:(t,e,r)=>{"use strict";var i=r(68844),n=r(11880),s=Date.prototype,o="Invalid Date",a="toString",l=i(s[a]),c=i(s.getTime);String(new Date(NaN))!==o&&n(s,a,(function(){var t=c(this);return t==t?l(this):o}))},21057:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(61735),o=r(51064),a="WebAssembly",l=n[a],c=7!==new Error("e",{cause:7}).cause,h=function(t,e){var r={};r[t]=o(t,e,c),i({global:!0,constructor:!0,arity:1,forced:c},r)},u=function(t,e){if(l&&l[t]){var r={};r[t]=o(a+"."+t,e,c),i({target:a,stat:!0,constructor:!0,arity:1,forced:c},r)}};h("Error",(function(t){return function(e){return s(t,this,arguments)}})),h("EvalError",(function(t){return function(e){return s(t,this,arguments)}})),h("RangeError",(function(t){return function(e){return s(t,this,arguments)}})),h("ReferenceError",(function(t){return function(e){return s(t,this,arguments)}})),h("SyntaxError",(function(t){return function(e){return s(t,this,arguments)}})),h("TypeError",(function(t){return function(e){return s(t,this,arguments)}})),h("URIError",(function(t){return function(e){return s(t,this,arguments)}})),u("CompileError",(function(t){return function(e){return s(t,this,arguments)}})),u("LinkError",(function(t){return function(e){return s(t,this,arguments)}})),u("RuntimeError",(function(t){return function(e){return s(t,this,arguments)}}))},68932:(t,e,r)=>{"use strict";var i=r(11880),n=r(20445),s=Error.prototype;s.toString!==n&&i(s,"toString",n)},60428:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=n("".charAt),a=n("".charCodeAt),l=n(/./.exec),c=n(1..toString),h=n("".toUpperCase),u=/[\w*+\-./@]/,d=function(t,e){for(var r=c(t,16);r.length{"use strict";var i=r(79989),n=r(86761);i({target:"Function",proto:!0,forced:Function.bind!==n},{bind:n})},56269:(t,e,r)=>{"use strict";var i=r(69985),n=r(48999),s=r(72560),o=r(61868),a=r(44201),l=r(98702),c=a("hasInstance"),h=Function.prototype;c in h||s.f(h,c,{value:l((function(t){if(!i(this)||!n(t))return!1;var e=this.prototype;if(!n(e))return t instanceof this;for(;t=o(t);)if(e===t)return!0;return!1}),c)})},34284:(t,e,r)=>{"use strict";var i=r(67697),n=r(41236).EXISTS,s=r(68844),o=r(62148),a=Function.prototype,l=s(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,h=s(c.exec);i&&!n&&o(a,"name",{configurable:!0,get:function(){try{return h(c,l(this))[1]}catch(t){return""}}})},45398:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037);i({global:!0,forced:n.globalThis!==n},{globalThis:n})},48324:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(22615),a=r(68844),l=r(3689),c=r(69985),h=r(30734),u=r(96004),d=r(92643),p=r(50146),f=String,m=n("JSON","stringify"),g=a(/./.exec),A=a("".charAt),y=a("".charCodeAt),v=a("".replace),x=a(1..toString),b=/[\uD800-\uDFFF]/g,_=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,E=!p||l((function(){var t=n("Symbol")("stringify detection");return"[null]"!==m([t])||"{}"!==m({a:t})||"{}"!==m(Object(t))})),M=l((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),S=function(t,e){var r=u(arguments),i=d(e);if(c(i)||void 0!==t&&!h(t))return r[1]=function(t,e){if(c(i)&&(e=o(i,this,f(t),e)),!h(e))return e},s(m,null,r)},C=function(t,e,r){var i=A(r,e-1),n=A(r,e+1);return g(_,t)&&!g(w,n)||g(w,t)&&!g(_,i)?"\\u"+x(y(t,0),16):t};m&&i({target:"JSON",stat:!0,arity:3,forced:E||M},{stringify:function(t,e,r){var i=u(arguments),n=s(E?S:m,null,i);return M&&"string"==typeof n?v(n,b,C):n}})},7629:(t,e,r)=>{"use strict";var i=r(19037);r(55997)(i.JSON,"JSON",!0)},9322:(t,e,r)=>{"use strict";r(20319)("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70800))},89348:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10509),o=r(74684),a=r(18734),l=r(83914),c=r(53931),h=l.Map,u=l.has,d=l.get,p=l.set,f=n([].push);i({target:"Map",stat:!0,forced:c},{groupBy:function(t,e){o(t),s(e);var r=new h,i=0;return a(t,(function(t){var n=e(t,i++);u(r,n)?f(d(r,n),t):p(r,n,[t])})),r}})},56646:(t,e,r)=>{"use strict";r(9322)},6557:(t,e,r)=>{"use strict";var i=r(79989),n=r(93956),s=Math.acosh,o=Math.log,a=Math.sqrt,l=Math.LN2;i({target:"Math",stat:!0,forced:!s||710!==Math.floor(s(Number.MAX_VALUE))||s(1/0)!==1/0},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?o(e)+l:n(e-1+a(e-1)*a(e+1))}})},62428:(t,e,r)=>{"use strict";var i=r(79989),n=Math.asinh,s=Math.log,o=Math.sqrt;i({target:"Math",stat:!0,forced:!(n&&1/n(0)>0)},{asinh:function t(e){var r=+e;return isFinite(r)&&0!==r?r<0?-t(-r):s(r+o(r*r+1)):r}})},45263:(t,e,r)=>{"use strict";var i=r(79989),n=Math.atanh,s=Math.log;i({target:"Math",stat:!0,forced:!(n&&1/n(-0)<0)},{atanh:function(t){var e=+t;return 0===e?e:s((1+e)/(1-e))/2}})},74712:(t,e,r)=>{"use strict";var i=r(79989),n=r(55680),s=Math.abs,o=Math.pow;i({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return n(e)*o(s(e),1/3)}})},54986:(t,e,r)=>{"use strict";var i=r(79989),n=Math.floor,s=Math.log,o=Math.LOG2E;i({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-n(s(e+.5)*o):32}})},47221:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745),s=Math.cosh,o=Math.abs,a=Math.E;i({target:"Math",stat:!0,forced:!s||s(710)===1/0},{cosh:function(t){var e=n(o(t)-1)+1;return(e+1/(e*a*a))*(a/2)}})},94992:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745);i({target:"Math",stat:!0,forced:n!==Math.expm1},{expm1:n})},25499:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{fround:r(37788)})},59944:(t,e,r)=>{"use strict";var i=r(79989),n=Math.hypot,s=Math.abs,o=Math.sqrt;i({target:"Math",stat:!0,arity:2,forced:!!n&&n(1/0,NaN)!==1/0},{hypot:function(t,e){for(var r,i,n=0,a=0,l=arguments.length,c=0;a0?(i=r/c)*i:r;return c===1/0?1/0:c*o(n)}})},78527:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=Math.imul;i({target:"Math",stat:!0,forced:n((function(){return-5!==s(4294967295,5)||2!==s.length}))},{imul:function(t,e){var r=65535,i=+t,n=+e,s=r&i,o=r&n;return 0|s*o+((r&i>>>16)*o+s*(r&n>>>16)<<16>>>0)}})},75239:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{log10:r(4736)})},92076:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{log1p:r(93956)})},68813:(t,e,r)=>{"use strict";var i=r(79989),n=Math.log,s=Math.LN2;i({target:"Math",stat:!0},{log2:function(t){return n(t)/s}})},96976:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{sign:r(55680)})},62700:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(21745),o=Math.abs,a=Math.exp,l=Math.E;i({target:"Math",stat:!0,forced:n((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(t){var e=+t;return o(e)<1?(s(e)-s(-e))/2:(a(e-1)-a(-e-1))*(l/2)}})},91554:(t,e,r)=>{"use strict";var i=r(79989),n=r(21745),s=Math.exp;i({target:"Math",stat:!0},{tanh:function(t){var e=+t,r=n(e),i=n(-e);return r===1/0?1:i===1/0?-1:(r-i)/(s(e)+s(-e))}})},77509:(t,e,r)=>{"use strict";r(55997)(Math,"Math",!0)},21416:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{trunc:r(58828)})},79288:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(67697),o=r(19037),a=r(50496),l=r(68844),c=r(35266),h=r(36812),u=r(33457),d=r(23622),p=r(30734),f=r(88732),m=r(3689),g=r(72741).f,A=r(82474).f,y=r(72560).f,v=r(23648),x=r(61435).trim,b="Number",_=o[b],w=a[b],E=_.prototype,M=o.TypeError,S=l("".slice),C=l("".charCodeAt),T=c(b,!_(" 0o1")||!_("0b1")||_("+0x1")),I=function(t){var e,r=arguments.length<1?0:_(function(t){var e=f(t,"number");return"bigint"==typeof e?e:function(t){var e,r,i,n,s,o,a,l,c=f(t,"number");if(p(c))throw new M("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=x(c),43===(e=C(c,0))||45===e){if(88===(r=C(c,2))||120===r)return NaN}else if(48===e){switch(C(c,1)){case 66:case 98:i=2,n=49;break;case 79:case 111:i=8,n=55;break;default:return+c}for(o=(s=S(c,2)).length,a=0;an)return NaN;return parseInt(s,i)}return+c}(e)}(t));return d(E,e=this)&&m((function(){v(e)}))?u(Object(r),this,I):r};I.prototype=E,T&&!n&&(E.constructor=I),i({global:!0,constructor:!0,wrap:!0,forced:T},{Number:I});var R=function(t,e){for(var r,i=s?g(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),n=0;i.length>n;n++)h(e,r=i[n])&&!h(t,r)&&y(t,r,A(e,r))};n&&w&&R(a[b],w),(T||n)&&R(a[b],_)},53584:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},82243:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isFinite:r(70046)})},95765:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isInteger:r(71973)})},45993:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},92547:(t,e,r)=>{"use strict";var i=r(79989),n=r(71973),s=Math.abs;i({target:"Number",stat:!0},{isSafeInteger:function(t){return n(t)&&s(t)<=9007199254740991}})},7936:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},32704:(t,e,r)=>{"use strict";r(79989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},52362:(t,e,r)=>{"use strict";var i=r(79989),n=r(14818);i({target:"Number",stat:!0,forced:Number.parseFloat!==n},{parseFloat:n})},21552:(t,e,r)=>{"use strict";var i=r(79989),n=r(67897);i({target:"Number",stat:!0,forced:Number.parseInt!==n},{parseInt:n})},10704:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=r(23648),a=r(90534),l=r(4736),c=r(3689),h=RangeError,u=String,d=isFinite,p=Math.abs,f=Math.floor,m=Math.pow,g=Math.round,A=n(1..toExponential),y=n(a),v=n("".slice),x="-6.9000e-11"===A(-69e-12,4)&&"1.25e+0"===A(1.255,2)&&"1.235e+4"===A(12345,3)&&"3e+1"===A(25,0);i({target:"Number",proto:!0,forced:!x||!(c((function(){A(1,1/0)}))&&c((function(){A(1,-1/0)})))||!!c((function(){A(1/0,1/0),A(NaN,1/0)}))},{toExponential:function(t){var e=o(this);if(void 0===t)return A(e);var r=s(t);if(!d(e))return String(e);if(r<0||r>20)throw new h("Incorrect fraction digits");if(x)return A(e,r);var i="",n="",a=0,c="",b="";if(e<0&&(i="-",e=-e),0===e)a=0,n=y("0",r+1);else{var _=l(e);a=f(_);var w=0,E=m(10,a-r);2*e>=(2*(w=g(e/E))+1)*E&&(w+=1),w>=m(10,r+1)&&(w/=10,a+=1),n=u(w)}return 0!==r&&(n=v(n,0,1)+"."+v(n,1)),0===a?(c="+",b="0"):(c=a>0?"+":"-",b=u(p(a))),i+(n+"e")+c+b}})},97389:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o=r(23648),a=r(90534),l=r(3689),c=RangeError,h=String,u=Math.floor,d=n(a),p=n("".slice),f=n(1..toFixed),m=function(t,e,r){return 0===e?r:e%2==1?m(t,e-1,r*t):m(t*t,e/2,r)},g=function(t,e,r){for(var i=-1,n=r;++i<6;)n+=e*t[i],t[i]=n%1e7,n=u(n/1e7)},A=function(t,e){for(var r=6,i=0;--r>=0;)i+=t[r],t[r]=u(i/e),i=i%e*1e7},y=function(t){for(var e=6,r="";--e>=0;)if(""!==r||0===e||0!==t[e]){var i=h(t[e]);r=""===r?i:r+d("0",7-i.length)+i}return r};i({target:"Number",proto:!0,forced:l((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!l((function(){f({})}))},{toFixed:function(t){var e,r,i,n,a=o(this),l=s(t),u=[0,0,0,0,0,0],f="",v="0";if(l<0||l>20)throw new c("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return h(a);if(a<0&&(f="-",a=-a),a>1e-21)if(r=(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(a*m(2,69,1))-69)<0?a*m(2,-e,1):a/m(2,e,1),r*=4503599627370496,(e=52-e)>0){for(g(u,0,r),i=l;i>=7;)g(u,1e7,0),i-=7;for(g(u,m(10,i,1),0),i=e-1;i>=23;)A(u,1<<23),i-=23;A(u,1<0?f+((n=v.length)<=l?"0."+d("0",l-n)+v:p(v,0,n-l)+"."+p(v,n-l)):f+v}})},25284:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(3689),o=r(23648),a=n(1..toPrecision);i({target:"Number",proto:!0,forced:s((function(){return"1"!==a(1,void 0)}))||!s((function(){a({})}))},{toPrecision:function(t){return void 0===t?a(o(this)):a(o(this),t)}})},60429:(t,e,r)=>{"use strict";var i=r(79989),n=r(45394);i({target:"Object",stat:!0,arity:2,forced:Object.assign!==n},{assign:n})},51013:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0,sham:!r(67697)},{create:r(25391)})},33994:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(10509),a=r(90690),l=r(72560);n&&i({target:"Object",proto:!0,forced:s},{__defineGetter__:function(t,e){l.f(a(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},35082:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(98920).f;i({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!n},{defineProperties:s})},40739:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(72560).f;i({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!n},{defineProperty:s})},47409:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(10509),a=r(90690),l=r(72560);n&&i({target:"Object",proto:!0,forced:s},{__defineSetter__:function(t,e){l.f(a(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},36585:(t,e,r)=>{"use strict";var i=r(79989),n=r(49419).entries;i({target:"Object",stat:!0},{entries:function(t){return n(t)}})},41830:(t,e,r)=>{"use strict";var i=r(79989),n=r(71594),s=r(3689),o=r(48999),a=r(45375).onFreeze,l=Object.freeze;i({target:"Object",stat:!0,forced:s((function(){l(1)})),sham:!n},{freeze:function(t){return l&&o(t)?l(a(t)):t}})},85415:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(76522);i({target:"Object",stat:!0},{fromEntries:function(t){var e={};return n(t,(function(t,r){s(e,t,r)}),{AS_ENTRIES:!0}),e}})},81919:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(65290),o=r(82474).f,a=r(67697);i({target:"Object",stat:!0,forced:!a||n((function(){o(1)})),sham:!a},{getOwnPropertyDescriptor:function(t,e){return o(s(t),e)}})},99474:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19152),o=r(65290),a=r(82474),l=r(76522);i({target:"Object",stat:!0,sham:!n},{getOwnPropertyDescriptors:function(t){for(var e,r,i=o(t),n=a.f,c=s(i),h={},u=0;c.length>u;)void 0!==(r=n(i,e=c[u++]))&&l(h,e,r);return h}})},79997:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(26062).f;i({target:"Object",stat:!0,forced:n((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:s})},79434:(t,e,r)=>{"use strict";var i=r(79989),n=r(50146),s=r(3689),o=r(7518),a=r(90690);i({target:"Object",stat:!0,forced:!n||s((function(){o.f(1)}))},{getOwnPropertySymbols:function(t){var e=o.f;return e?e(a(t)):[]}})},88052:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(90690),o=r(61868),a=r(81748);i({target:"Object",stat:!0,forced:n((function(){o(1)})),sham:!a},{getPrototypeOf:function(t){return o(s(t))}})},44079:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(68844),o=r(10509),a=r(74684),l=r(18360),c=r(18734),h=n("Object","create"),u=s([].push);i({target:"Object",stat:!0},{groupBy:function(t,e){a(t),o(e);var r=h(null),i=0;return c(t,(function(t){var n=l(e(t,i++));n in r?u(r[n],t):r[n]=[t]})),r}})},14566:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{hasOwn:r(36812)})},36446:(t,e,r)=>{"use strict";var i=r(79989),n=r(27049);i({target:"Object",stat:!0,forced:Object.isExtensible!==n},{isExtensible:n})},35140:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(48999),o=r(6648),a=r(11655),l=Object.isFrozen;i({target:"Object",stat:!0,forced:a||n((function(){l(1)}))},{isFrozen:function(t){return!s(t)||!(!a||"ArrayBuffer"!==o(t))||!!l&&l(t)}})},4179:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(48999),o=r(6648),a=r(11655),l=Object.isSealed;i({target:"Object",stat:!0,forced:a||n((function(){l(1)}))},{isSealed:function(t){return!s(t)||!(!a||"ArrayBuffer"!==o(t))||!!l&&l(t)}})},76101:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{is:r(70953)})},69358:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(20300);i({target:"Object",stat:!0,forced:r(3689)((function(){s(1)}))},{keys:function(t){return s(n(t))}})},75450:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(90690),a=r(18360),l=r(61868),c=r(82474).f;n&&i({target:"Object",proto:!0,forced:s},{__lookupGetter__:function(t){var e,r=o(this),i=a(t);do{if(e=c(r,i))return e.get}while(r=l(r))}})},54993:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(90600),o=r(90690),a=r(18360),l=r(61868),c=r(82474).f;n&&i({target:"Object",proto:!0,forced:s},{__lookupSetter__:function(t){var e,r=o(this),i=a(t);do{if(e=c(r,i))return e.set}while(r=l(r))}})},48115:(t,e,r)=>{"use strict";var i=r(79989),n=r(48999),s=r(45375).onFreeze,o=r(71594),a=r(3689),l=Object.preventExtensions;i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{preventExtensions:function(t){return l&&n(t)?l(s(t)):t}})},19330:(t,e,r)=>{"use strict";var i=r(67697),n=r(62148),s=r(48999),o=r(90690),a=r(74684),l=Object.getPrototypeOf,c=Object.setPrototypeOf,h=Object.prototype,u="__proto__";if(i&&l&&c&&!(u in h))try{n(h,u,{configurable:!0,get:function(){return l(o(this))},set:function(t){var e=a(this);(s(t)||null===t)&&s(e)&&c(e,t)}})}catch(t){}},30658:(t,e,r)=>{"use strict";var i=r(79989),n=r(48999),s=r(45375).onFreeze,o=r(71594),a=r(3689),l=Object.seal;i({target:"Object",stat:!0,forced:a((function(){l(1)})),sham:!o},{seal:function(t){return l&&n(t)?l(s(t)):t}})},5399:(t,e,r)=>{"use strict";r(79989)({target:"Object",stat:!0},{setPrototypeOf:r(49385)})},60228:(t,e,r)=>{"use strict";var i=r(23043),n=r(11880),s=r(65073);i||n(Object.prototype,"toString",s,{unsafe:!0})},86466:(t,e,r)=>{"use strict";var i=r(79989),n=r(49419).values;i({target:"Object",stat:!0},{values:function(t){return n(t)}})},80939:(t,e,r)=>{"use strict";var i=r(79989),n=r(14818);i({global:!0,forced:parseFloat!==n},{parseFloat:n})},32320:(t,e,r)=>{"use strict";var i=r(79989),n=r(67897);i({global:!0,forced:parseInt!==n},{parseInt:n})},41195:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{allSettled:function(t){var e=this,r=o.f(e),i=r.resolve,c=r.reject,h=a((function(){var r=s(e.resolve),o=[],a=0,c=1;l(t,(function(t){var s=a++,l=!1;c++,n(r,e,t).then((function(t){l||(l=!0,o[s]={status:"fulfilled",value:t},--c||i(o))}),(function(t){l||(l=!0,o[s]={status:"rejected",reason:t},--c||i(o))}))})),--c||i(o)}));return h.error&&c(h.value),r.promise}})},81692:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{all:function(t){var e=this,r=o.f(e),i=r.resolve,c=r.reject,h=a((function(){var r=s(e.resolve),o=[],a=0,h=1;l(t,(function(t){var s=a++,l=!1;h++,n(r,e,t).then((function(t){l||(l=!0,o[s]=t,--h||i(o))}),c)})),--h||i(o)}));return h.error&&c(h.value),r.promise}})},87609:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(76058),a=r(48742),l=r(9302),c=r(18734),h=r(562),u="No one promise resolved";i({target:"Promise",stat:!0,forced:h},{any:function(t){var e=this,r=o("AggregateError"),i=a.f(e),h=i.resolve,d=i.reject,p=l((function(){var i=s(e.resolve),o=[],a=0,l=1,p=!1;c(t,(function(t){var s=a++,c=!1;l++,n(i,e,t).then((function(t){c||p||(p=!0,h(t))}),(function(t){c||p||(c=!0,o[s]=t,--l||d(new r(o,u)))}))})),--l||d(new r(o,u))}));return p.error&&d(p.value),i.promise}})},75089:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(87073).CONSTRUCTOR,o=r(17919),a=r(76058),l=r(69985),c=r(11880),h=o&&o.prototype;if(i({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(t){return this.then(void 0,t)}}),!n&&l(o)){var u=a("Promise").prototype.catch;h.catch!==u&&c(h,"catch",u,{unsafe:!0})}},56697:(t,e,r)=>{"use strict";var i,n,s,o=r(79989),a=r(53931),l=r(50806),c=r(19037),h=r(22615),u=r(11880),d=r(49385),p=r(55997),f=r(14241),m=r(10509),g=r(69985),A=r(48999),y=r(767),v=r(76373),x=r(99886).set,b=r(80231),_=r(20920),w=r(9302),E=r(34410),M=r(618),S=r(17919),C=r(87073),T=r(48742),I="Promise",R=C.CONSTRUCTOR,B=C.REJECTION_EVENT,L=C.SUBCLASSING,P=M.getterFor(I),D=M.set,O=S&&S.prototype,k=S,U=O,N=c.TypeError,F=c.document,z=c.process,G=T.f,Q=G,j=!!(F&&F.createEvent&&c.dispatchEvent),V="unhandledrejection",H=function(t){var e;return!(!A(t)||!g(e=t.then))&&e},W=function(t,e){var r,i,n,s=e.value,o=1===e.state,a=o?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{a?(o||(2===e.rejection&&J(e),e.rejection=1),!0===a?r=s:(u&&u.enter(),r=a(s),u&&(u.exit(),n=!0)),r===t.promise?c(new N("Promise-chain cycle")):(i=H(r))?h(i,r,l,c):l(r)):c(s)}catch(t){u&&!n&&u.exit(),c(t)}},q=function(t,e){t.notified||(t.notified=!0,b((function(){for(var r,i=t.reactions;r=i.get();)W(r,t);t.notified=!1,e&&!t.rejection&&Y(t)})))},Z=function(t,e,r){var i,n;j?((i=F.createEvent("Event")).promise=e,i.reason=r,i.initEvent(t,!1,!0),c.dispatchEvent(i)):i={promise:e,reason:r},!B&&(n=c["on"+t])?n(i):t===V&&_("Unhandled promise rejection",r)},Y=function(t){h(x,c,(function(){var e,r=t.facade,i=t.value;if(X(t)&&(e=w((function(){l?z.emit("unhandledRejection",i,r):Z(V,r,i)})),t.rejection=l||X(t)?2:1,e.error))throw e.value}))},X=function(t){return 1!==t.rejection&&!t.parent},J=function(t){h(x,c,(function(){var e=t.facade;l?z.emit("rejectionHandled",e):Z("rejectionhandled",e,t.value)}))},K=function(t,e,r){return function(i){t(e,i,r)}},$=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,q(t,!0))},tt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new N("Promise can't be resolved itself");var i=H(e);i?b((function(){var r={done:!1};try{h(i,e,K(tt,r,t),K($,r,t))}catch(e){$(r,e,t)}})):(t.value=e,t.state=1,q(t,!1))}catch(e){$({done:!1},e,t)}}};if(R&&(U=(k=function(t){y(this,U),m(t),h(i,this);var e=P(this);try{t(K(tt,e),K($,e))}catch(t){$(e,t)}}).prototype,(i=function(t){D(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=u(U,"then",(function(t,e){var r=P(this),i=G(v(this,k));return r.parent=!0,i.ok=!g(t)||t,i.fail=g(e)&&e,i.domain=l?z.domain:void 0,0===r.state?r.reactions.add(i):b((function(){W(i,r)})),i.promise})),n=function(){var t=new i,e=P(t);this.promise=t,this.resolve=K(tt,e),this.reject=K($,e)},T.f=G=function(t){return t===k||void 0===t?new n(t):Q(t)},!a&&g(S)&&O!==Object.prototype)){s=O.then,L||u(O,"then",(function(t,e){var r=this;return new k((function(t,e){h(s,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete O.constructor}catch(t){}d&&d(O,U)}o({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:k}),p(k,I,!1,!0),f(I)},36409:(t,e,r)=>{"use strict";var i=r(79989),n=r(53931),s=r(17919),o=r(3689),a=r(76058),l=r(69985),c=r(76373),h=r(72945),u=r(11880),d=s&&s.prototype;if(i({target:"Promise",proto:!0,real:!0,forced:!!s&&o((function(){d.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=c(this,a("Promise")),r=l(t);return this.then(r?function(r){return h(e,t()).then((function(){return r}))}:t,r?function(r){return h(e,t()).then((function(){throw r}))}:t)}}),!n&&l(s)){var p=a("Promise").prototype.finally;d.finally!==p&&u(d,"finally",p,{unsafe:!0})}},73964:(t,e,r)=>{"use strict";r(56697),r(81692),r(75089),r(58829),r(42092),r(57905)},58829:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(48742),a=r(9302),l=r(18734);i({target:"Promise",stat:!0,forced:r(562)},{race:function(t){var e=this,r=o.f(e),i=r.reject,c=a((function(){var o=s(e.resolve);l(t,(function(t){n(o,e,t).then(r.resolve,i)}))}));return c.error&&i(c.value),r.promise}})},42092:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(48742);i({target:"Promise",stat:!0,forced:r(87073).CONSTRUCTOR},{reject:function(t){var e=s.f(this);return n(e.reject,void 0,t),e.promise}})},57905:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(53931),o=r(17919),a=r(87073).CONSTRUCTOR,l=r(72945),c=n("Promise"),h=s&&!a;i({target:"Promise",stat:!0,forced:s||a},{resolve:function(t){return l(h&&this===c?o:this,t)}})},13505:(t,e,r)=>{"use strict";var i=r(79989),n=r(48742);i({target:"Promise",stat:!0},{withResolvers:function(){var t=n.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},54333:(t,e,r)=>{"use strict";var i=r(79989),n=r(61735),s=r(10509),o=r(85027);i({target:"Reflect",stat:!0,forced:!r(3689)((function(){Reflect.apply((function(){}))}))},{apply:function(t,e,r){return n(s(t),e,o(r))}})},30050:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(61735),o=r(86761),a=r(52655),l=r(85027),c=r(48999),h=r(25391),u=r(3689),d=n("Reflect","construct"),p=Object.prototype,f=[].push,m=u((function(){function t(){}return!(d((function(){}),[],t)instanceof t)})),g=!u((function(){d((function(){}))})),A=m||g;i({target:"Reflect",stat:!0,forced:A,sham:A},{construct:function(t,e){a(t),l(e);var r=arguments.length<3?t:a(arguments[2]);if(g&&!m)return d(t,e,r);if(t===r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return s(f,i,e),new(s(o,t,i))}var n=r.prototype,u=h(c(n)?n:p),A=s(t,u,e);return c(A)?A:u}})},99871:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(85027),o=r(18360),a=r(72560);i({target:"Reflect",stat:!0,forced:r(3689)((function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})})),sham:!n},{defineProperty:function(t,e,r){s(t);var i=o(e);s(r);try{return a.f(t,i,r),!0}catch(t){return!1}}})},1049:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(82474).f;i({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var r=s(n(t),e);return!(r&&!r.configurable)&&delete t[e]}})},50149:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(85027),o=r(82474);i({target:"Reflect",stat:!0,sham:!n},{getOwnPropertyDescriptor:function(t,e){return o.f(s(t),e)}})},43792:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(61868);i({target:"Reflect",stat:!0,sham:!r(81748)},{getPrototypeOf:function(t){return s(n(t))}})},32349:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(48999),o=r(85027),a=r(76251),l=r(82474),c=r(61868);i({target:"Reflect",stat:!0},{get:function t(e,r){var i,h,u=arguments.length<3?e:arguments[2];return o(e)===u?e[r]:(i=l.f(e,r))?a(i)?i.value:void 0===i.get?void 0:n(i.get,u):s(h=c(e))?t(h,r,u):void 0}})},69707:(t,e,r)=>{"use strict";r(79989)({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},63545:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(27049);i({target:"Reflect",stat:!0},{isExtensible:function(t){return n(t),s(t)}})},62087:(t,e,r)=>{"use strict";r(79989)({target:"Reflect",stat:!0},{ownKeys:r(19152)})},51505:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(85027);i({target:"Reflect",stat:!0,sham:!r(71594)},{preventExtensions:function(t){s(t);try{var e=n("Object","preventExtensions");return e&&e(t),!0}catch(t){return!1}}})},22373:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(23550),o=r(49385);o&&i({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){n(t),s(e);try{return o(t,e),!0}catch(t){return!1}}})},45247:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(48999),a=r(76251),l=r(3689),c=r(72560),h=r(82474),u=r(61868),d=r(75684);i({target:"Reflect",stat:!0,forced:l((function(){var t=function(){},e=c.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}))},{set:function t(e,r,i){var l,p,f,m=arguments.length<4?e:arguments[3],g=h.f(s(e),r);if(!g){if(o(p=u(e)))return t(p,r,i,m);g=d(0)}if(a(g)){if(!1===g.writable||!o(m))return!1;if(l=h.f(m,r)){if(l.get||l.set||!1===l.writable)return!1;l.value=i,c.f(m,r,l)}else c.f(m,r,d(0,i))}else{if(void 0===(f=g.set))return!1;n(f,m,i)}return!0}})},76034:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(55997);i({global:!0},{Reflect:{}}),s(n.Reflect,"Reflect",!0)},52003:(t,e,r)=>{"use strict";var i=r(67697),n=r(19037),s=r(68844),o=r(35266),a=r(33457),l=r(75773),c=r(25391),h=r(72741).f,u=r(23622),d=r(91245),p=r(34327),f=r(63477),m=r(87901),g=r(38055),A=r(11880),y=r(3689),v=r(36812),x=r(618).enforce,b=r(14241),_=r(44201),w=r(62100),E=r(26738),M=_("match"),S=n.RegExp,C=S.prototype,T=n.SyntaxError,I=s(C.exec),R=s("".charAt),B=s("".replace),L=s("".indexOf),P=s("".slice),D=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,O=/a/g,k=/a/g,U=new S(O)!==O,N=m.MISSED_STICKY,F=m.UNSUPPORTED_Y;if(o("RegExp",i&&(!U||N||w||E||y((function(){return k[M]=!1,S(O)!==O||S(k)===k||"/a/i"!==String(S(O,"i"))}))))){for(var z=function(t,e){var r,i,n,s,o,h,m=u(C,this),g=d(t),A=void 0===e,y=[],b=t;if(!m&&g&&A&&t.constructor===z)return t;if((g||u(C,t))&&(t=t.source,A&&(e=f(b))),t=void 0===t?"":p(t),e=void 0===e?"":p(e),b=t,w&&"dotAll"in O&&(i=!!e&&L(e,"s")>-1)&&(e=B(e,/s/g,"")),r=e,N&&"sticky"in O&&(n=!!e&&L(e,"y")>-1)&&F&&(e=B(e,/y/g,"")),E&&(s=function(t){for(var e,r=t.length,i=0,n="",s=[],o=c(null),a=!1,l=!1,h=0,u="";i<=r;i++){if("\\"===(e=R(t,i)))e+=R(t,++i);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:I(D,P(t,i+1))&&(i+=2,l=!0),n+=e,h++;continue;case">"===e&&l:if(""===u||v(o,u))throw new T("Invalid capture group name");o[u]=!0,s[s.length]=[u,h],l=!1,u="";continue}l?u+=e:n+=e}return[n,s]}(t),t=s[0],y=s[1]),o=a(S(t,e),m?this:C,z),(i||n||y.length)&&(h=x(o),i&&(h.dotAll=!0,h.raw=z(function(t){for(var e,r=t.length,i=0,n="",s=!1;i<=r;i++)"\\"!==(e=R(t,i))?s||"."!==e?("["===e?s=!0:"]"===e&&(s=!1),n+=e):n+="[\\s\\S]":n+=e+R(t,++i);return n}(t),r)),n&&(h.sticky=!0),y.length&&(h.groups=y)),t!==b)try{l(o,"source",""===b?"(?:)":b)}catch(t){}return o},G=h(S),Q=0;G.length>Q;)g(z,S,G[Q++]);C.constructor=z,z.prototype=C,A(n,"RegExp",z,{constructor:!0})}b("RegExp")},68518:(t,e,r)=>{"use strict";var i=r(67697),n=r(62100),s=r(6648),o=r(62148),a=r(618).get,l=RegExp.prototype,c=TypeError;i&&n&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},64043:(t,e,r)=>{"use strict";var i=r(79989),n=r(56308);i({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})},25847:(t,e,r)=>{"use strict";var i=r(19037),n=r(67697),s=r(62148),o=r(69633),a=r(3689),l=i.RegExp,c=l.prototype;n&&a((function(){var t=!0;try{l(".","d")}catch(e){t=!1}var e={},r="",i=t?"dgimsy":"gimsy",n=function(t,i){Object.defineProperty(e,t,{get:function(){return r+=i,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in t&&(s.hasIndices="d"),s)n(o,s[o]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(e)!==i||r!==i}))&&s(c,"flags",{configurable:!0,get:o})},13440:(t,e,r)=>{"use strict";var i=r(67697),n=r(87901).MISSED_STICKY,s=r(6648),o=r(62148),a=r(618).get,l=RegExp.prototype,c=TypeError;i&&n&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!a(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},7409:(t,e,r)=>{"use strict";r(64043);var i,n,s=r(79989),o=r(22615),a=r(69985),l=r(85027),c=r(34327),h=(i=!1,(n=/[ac]/).exec=function(){return i=!0,/./.exec.apply(this,arguments)},!0===n.test("abc")&&i),u=/./.test;s({target:"RegExp",proto:!0,forced:!h},{test:function(t){var e=l(this),r=c(t),i=e.exec;if(!a(i))return o(u,e,r);var n=o(i,e,r);return null!==n&&(l(n),!0)}})},12826:(t,e,r)=>{"use strict";var i=r(41236).PROPER,n=r(11880),s=r(85027),o=r(34327),a=r(3689),l=r(63477),c="toString",h=RegExp.prototype[c],u=a((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),d=i&&h.name!==c;(u||d)&&n(RegExp.prototype,c,(function(){var t=s(this);return"/"+o(t.source)+"/"+o(l(t))}),{unsafe:!0})},17985:(t,e,r)=>{"use strict";r(20319)("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70800))},19649:(t,e,r)=>{"use strict";r(17985)},90343:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("anchor")},{anchor:function(t){return n(this,"a","name",t)}})},7961:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(68700),a=r(34327),l=r(3689),c=n("".charAt);i({target:"String",proto:!0,forced:l((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(t){var e=a(s(this)),r=e.length,i=o(t),n=i>=0?i:r+i;return n<0||n>=r?void 0:c(e,n)}})},21444:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("big")},{big:function(){return n(this,"big","","")}})},25906:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("blink")},{blink:function(){return n(this,"blink","","")}})},95682:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("bold")},{bold:function(){return n(this,"b","","")}})},86239:(t,e,r)=>{"use strict";var i=r(79989),n=r(10730).codeAt;i({target:"String",proto:!0},{codePointAt:function(t){return n(this,t)}})},2918:(t,e,r)=>{"use strict";var i,n=r(79989),s=r(46576),o=r(82474).f,a=r(43126),l=r(34327),c=r(42124),h=r(74684),u=r(27413),d=r(53931),p=s("".endsWith),f=s("".slice),m=Math.min,g=u("endsWith");n({target:"String",proto:!0,forced:!(!d&&!g&&(i=o(String.prototype,"endsWith"),i&&!i.writable)||g)},{endsWith:function(t){var e=l(h(this));c(t);var r=arguments.length>1?arguments[1]:void 0,i=e.length,n=void 0===r?i:m(a(r),i),s=l(t);return p?p(e,s,n):f(e,n-s.length,n)===s}})},98041:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fixed")},{fixed:function(){return n(this,"tt","","")}})},6364:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fontcolor")},{fontcolor:function(t){return n(this,"font","color",t)}})},82954:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("fontsize")},{fontsize:function(t){return n(this,"font","size",t)}})},20283:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(27578),o=RangeError,a=String.fromCharCode,l=String.fromCodePoint,c=n([].join);i({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(t){for(var e,r=[],i=arguments.length,n=0;i>n;){if(e=+arguments[n++],s(e,1114111)!==e)throw new o(e+" is not a valid code point");r[n]=e<65536?a(e):a(55296+((e-=65536)>>10),e%1024+56320)}return c(r,"")}})},43843:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(42124),o=r(74684),a=r(34327),l=r(27413),c=n("".indexOf);i({target:"String",proto:!0,forced:!l("includes")},{includes:function(t){return!!~c(a(o(this)),a(s(t)),arguments.length>1?arguments[1]:void 0)}})},12281:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(34327),a=n("".charCodeAt);i({target:"String",proto:!0},{isWellFormed:function(){for(var t=o(s(this)),e=t.length,r=0;r=56320||++r>=e||56320!=(64512&a(t,r))))return!1}return!0}})},19162:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("italics")},{italics:function(){return n(this,"i","","")}})},21694:(t,e,r)=>{"use strict";var i=r(10730).charAt,n=r(34327),s=r(618),o=r(91934),a=r(27807),l="String Iterator",c=s.set,h=s.getterFor(l);o(String,"String",(function(t){c(this,{type:l,string:n(t),index:0})}),(function(){var t,e=h(this),r=e.string,n=e.index;return n>=r.length?a(void 0,!0):(t=i(r,n),e.index+=t.length,a(t,!1))}))},37960:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("link")},{link:function(t){return n(this,"a","href",t)}})},79866:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(46576),o=r(30974),a=r(27807),l=r(74684),c=r(43126),h=r(34327),u=r(85027),d=r(981),p=r(6648),f=r(91245),m=r(63477),g=r(54849),A=r(11880),y=r(3689),v=r(44201),x=r(76373),b=r(71514),_=r(66100),w=r(618),E=r(53931),M=v("matchAll"),S="RegExp String",C=S+" Iterator",T=w.set,I=w.getterFor(C),R=RegExp.prototype,B=TypeError,L=s("".indexOf),P=s("".matchAll),D=!!P&&!y((function(){P("a",/./)})),O=o((function(t,e,r,i){T(this,{type:C,regexp:t,string:e,global:r,unicode:i,done:!1})}),S,(function(){var t=I(this);if(t.done)return a(void 0,!0);var e=t.regexp,r=t.string,i=_(e,r);return null===i?(t.done=!0,a(void 0,!0)):t.global?(""===h(i[0])&&(e.lastIndex=b(r,c(e.lastIndex),t.unicode)),a(i,!1)):(t.done=!0,a(i,!1))})),k=function(t){var e,r,i,n=u(this),s=h(t),o=x(n,RegExp),a=h(m(n));return e=new o(o===RegExp?n.source:n,a),r=!!~L(a,"g"),i=!!~L(a,"u"),e.lastIndex=c(n.lastIndex),new O(e,s,r,i)};i({target:"String",proto:!0,forced:D},{matchAll:function(t){var e,r,i,s,o=l(this);if(d(t)){if(D)return P(o,t)}else{if(f(t)&&(e=h(l(m(t))),!~L(e,"g")))throw new B("`.matchAll` does not allow non-global regexes");if(D)return P(o,t);if(void 0===(i=g(t,M))&&E&&"RegExp"===p(t)&&(i=k),i)return n(i,t,o)}return r=h(o),s=new RegExp(t,"g"),E?n(k,s,r):s[M](r)}}),E||M in R||A(R,M,k)},22462:(t,e,r)=>{"use strict";var i=r(22615),n=r(65773),s=r(85027),o=r(981),a=r(43126),l=r(34327),c=r(74684),h=r(54849),u=r(71514),d=r(66100);n("match",(function(t,e,r){return[function(e){var r=c(this),n=o(e)?void 0:h(e,t);return n?i(n,e,r):new RegExp(e)[t](l(r))},function(t){var i=s(this),n=l(t),o=r(e,i,n);if(o.done)return o.value;if(!i.global)return d(i,n);var c=i.unicode;i.lastIndex=0;for(var h,p=[],f=0;null!==(h=d(i,n));){var m=l(h[0]);p[f]=m,""===m&&(i.lastIndex=u(n,a(i.lastIndex),c)),f++}return 0===f?null:p}]}))},72940:(t,e,r)=>{"use strict";var i=r(79989),n=r(77254).end;i({target:"String",proto:!0,forced:r(35947)},{padEnd:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},8472:(t,e,r)=>{"use strict";var i=r(79989),n=r(77254).start;i({target:"String",proto:!0,forced:r(35947)},{padStart:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},92404:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(65290),o=r(90690),a=r(34327),l=r(6310),c=n([].push),h=n([].join);i({target:"String",stat:!0},{raw:function(t){var e=s(o(t).raw),r=l(e);if(!r)return"";for(var i=arguments.length,n=[],u=0;;){if(c(n,a(e[u++])),u===r)return h(n,"");u{"use strict";r(79989)({target:"String",proto:!0},{repeat:r(90534)})},56532:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(68844),o=r(74684),a=r(69985),l=r(981),c=r(91245),h=r(34327),u=r(54849),d=r(63477),p=r(27017),f=r(44201),m=r(53931),g=f("replace"),A=TypeError,y=s("".indexOf),v=s("".replace),x=s("".slice),b=Math.max,_=function(t,e,r){return r>t.length?-1:""===e?r:y(t,e,r)};i({target:"String",proto:!0},{replaceAll:function(t,e){var r,i,s,f,w,E,M,S,C,T=o(this),I=0,R=0,B="";if(!l(t)){if((r=c(t))&&(i=h(o(d(t))),!~y(i,"g")))throw new A("`.replaceAll` does not allow non-global regexes");if(s=u(t,g))return n(s,t,T,e);if(m&&r)return v(h(T),t,e)}for(f=h(T),w=h(t),(E=a(e))||(e=h(e)),M=w.length,S=b(1,M),I=_(f,w,0);-1!==I;)C=E?h(e(w,I,f)):p(w,f,I,[],void 0,e),B+=x(f,R,I)+C,R=I+M,I=_(f,w,I+S);return R{"use strict";var i=r(61735),n=r(22615),s=r(68844),o=r(65773),a=r(3689),l=r(85027),c=r(69985),h=r(981),u=r(68700),d=r(43126),p=r(34327),f=r(74684),m=r(71514),g=r(54849),A=r(27017),y=r(66100),v=r(44201)("replace"),x=Math.max,b=Math.min,_=s([].concat),w=s([].push),E=s("".indexOf),M=s("".slice),S="$0"==="a".replace(/./,"$0"),C=!!/./[v]&&""===/./[v]("a","$0");o("replace",(function(t,e,r){var s=C?"$":"$0";return[function(t,r){var i=f(this),s=h(t)?void 0:g(t,v);return s?n(s,t,i,r):n(e,p(i),t,r)},function(t,n){var o=l(this),a=p(t);if("string"==typeof n&&-1===E(n,s)&&-1===E(n,"$<")){var h=r(e,o,a,n);if(h.done)return h.value}var f=c(n);f||(n=p(n));var g,v=o.global;v&&(g=o.unicode,o.lastIndex=0);for(var S,C=[];null!==(S=y(o,a))&&(w(C,S),v);)""===p(S[0])&&(o.lastIndex=m(a,d(o.lastIndex),g));for(var T,I="",R=0,B=0;B=R&&(I+=M(a,R,D)+L,R=D+P.length)}return I+M(a,R)}]}),!!a((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!S||C)},61514:(t,e,r)=>{"use strict";var i=r(22615),n=r(65773),s=r(85027),o=r(981),a=r(74684),l=r(70953),c=r(34327),h=r(54849),u=r(66100);n("search",(function(t,e,r){return[function(e){var r=a(this),n=o(e)?void 0:h(e,t);return n?i(n,e,r):new RegExp(e)[t](c(r))},function(t){var i=s(this),n=c(t),o=r(e,i,n);if(o.done)return o.value;var a=i.lastIndex;l(a,0)||(i.lastIndex=0);var h=u(i,n);return l(i.lastIndex,a)||(i.lastIndex=a),null===h?-1:h.index}]}))},470:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("small")},{small:function(){return n(this,"small","","")}})},9873:(t,e,r)=>{"use strict";var i=r(61735),n=r(22615),s=r(68844),o=r(65773),a=r(85027),l=r(981),c=r(91245),h=r(74684),u=r(76373),d=r(71514),p=r(43126),f=r(34327),m=r(54849),g=r(9015),A=r(66100),y=r(56308),v=r(87901),x=r(3689),b=v.UNSUPPORTED_Y,_=4294967295,w=Math.min,E=[].push,M=s(/./.exec),S=s(E),C=s("".slice);o("split",(function(t,e,r){var s;return s="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var s=f(h(this)),o=void 0===r?_:r>>>0;if(0===o)return[];if(void 0===t)return[s];if(!c(t))return n(e,s,t,o);for(var a,l,u,d=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),m=0,A=new RegExp(t.source,p+"g");(a=n(y,A,s))&&!((l=A.lastIndex)>m&&(S(d,C(s,m,a.index)),a.length>1&&a.index=o));)A.lastIndex===a.index&&A.lastIndex++;return m===s.length?!u&&M(A,"")||S(d,""):S(d,C(s,m)),d.length>o?g(d,0,o):d}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:n(e,this,t,r)}:e,[function(e,r){var i=h(this),o=l(e)?void 0:m(e,t);return o?n(o,e,i,r):n(s,f(i),e,r)},function(t,i){var n=a(this),o=f(t),l=r(s,n,o,i,s!==e);if(l.done)return l.value;var c=u(n,RegExp),h=n.unicode,m=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(b?"g":"y"),g=new c(b?"^(?:"+n.source+")":n,m),y=void 0===i?_:i>>>0;if(0===y)return[];if(0===o.length)return null===A(g,o)?[o]:[];for(var v=0,x=0,E=[];x{"use strict";var i,n=r(79989),s=r(46576),o=r(82474).f,a=r(43126),l=r(34327),c=r(42124),h=r(74684),u=r(27413),d=r(53931),p=s("".startsWith),f=s("".slice),m=Math.min,g=u("startsWith");n({target:"String",proto:!0,forced:!(!d&&!g&&(i=o(String.prototype,"startsWith"),i&&!i.writable)||g)},{startsWith:function(t){var e=l(h(this));c(t);var r=a(m(arguments.length>1?arguments[1]:void 0,e.length)),i=l(t);return p?p(e,i,r):f(e,r,r+i.length)===i}})},67446:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("strike")},{strike:function(){return n(this,"strike","","")}})},47729:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("sub")},{sub:function(){return n(this,"sub","","")}})},20372:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(74684),o=r(68700),a=r(34327),l=n("".slice),c=Math.max,h=Math.min;i({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(t,e){var r,i,n=a(s(this)),u=n.length,d=o(t);return d===1/0&&(d=0),d<0&&(d=c(u+d,0)),(r=void 0===e?u:o(e))<=0||r===1/0||d>=(i=h(d+r,u))?"":l(n,d,i)}})},2e3:(t,e,r)=>{"use strict";var i=r(79989),n=r(71568);i({target:"String",proto:!0,forced:r(74580)("sup")},{sup:function(){return n(this,"sup","","")}})},35237:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(68844),o=r(74684),a=r(34327),l=r(3689),c=Array,h=s("".charAt),u=s("".charCodeAt),d=s([].join),p="".toWellFormed,f=p&&l((function(){return"1"!==n(p,1)}));i({target:"String",proto:!0,forced:f},{toWellFormed:function(){var t=a(o(this));if(f)return n(p,t);for(var e=t.length,r=c(e),i=0;i=56320||i+1>=e||56320!=(64512&u(t,i+1))?r[i]="�":(r[i]=h(t,i),r[++i]=h(t,i))}return d(r,"")}})},16386:(t,e,r)=>{"use strict";r(61313);var i=r(79989),n=r(79558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==n},{trimEnd:n})},10974:(t,e,r)=>{"use strict";var i=r(79989),n=r(72291);i({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==n},{trimLeft:n})},61313:(t,e,r)=>{"use strict";var i=r(79989),n=r(79558);i({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==n},{trimRight:n})},3255:(t,e,r)=>{"use strict";r(10974);var i=r(79989),n=r(72291);i({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==n},{trimStart:n})},28436:(t,e,r)=>{"use strict";var i=r(79989),n=r(61435).trim;i({target:"String",proto:!0,forced:r(75984)("trim")},{trim:function(){return n(this)}})},58373:(t,e,r)=>{"use strict";r(35405)("asyncIterator")},37855:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(22615),o=r(68844),a=r(53931),l=r(67697),c=r(50146),h=r(3689),u=r(36812),d=r(23622),p=r(85027),f=r(65290),m=r(18360),g=r(34327),A=r(75684),y=r(25391),v=r(20300),x=r(72741),b=r(26062),_=r(7518),w=r(82474),E=r(72560),M=r(98920),S=r(49556),C=r(11880),T=r(62148),I=r(83430),R=r(2713),B=r(57248),L=r(14630),P=r(44201),D=r(96145),O=r(35405),k=r(13032),U=r(55997),N=r(618),F=r(2960).forEach,z=R("hidden"),G="Symbol",Q="prototype",j=N.set,V=N.getterFor(G),H=Object[Q],W=n.Symbol,q=W&&W[Q],Z=n.RangeError,Y=n.TypeError,X=n.QObject,J=w.f,K=E.f,$=b.f,tt=S.f,et=o([].push),rt=I("symbols"),it=I("op-symbols"),nt=I("wks"),st=!X||!X[Q]||!X[Q].findChild,ot=function(t,e,r){var i=J(H,e);i&&delete H[e],K(t,e,r),i&&t!==H&&K(H,e,i)},at=l&&h((function(){return 7!==y(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?ot:K,lt=function(t,e){var r=rt[t]=y(q);return j(r,{type:G,tag:t,description:e}),l||(r.description=e),r},ct=function(t,e,r){t===H&&ct(it,e,r),p(t);var i=m(e);return p(r),u(rt,i)?(r.enumerable?(u(t,z)&&t[z][i]&&(t[z][i]=!1),r=y(r,{enumerable:A(0,!1)})):(u(t,z)||K(t,z,A(1,{})),t[z][i]=!0),at(t,i,r)):K(t,i,r)},ht=function(t,e){p(t);var r=f(e),i=v(r).concat(ft(r));return F(i,(function(e){l&&!s(ut,r,e)||ct(t,e,r[e])})),t},ut=function(t){var e=m(t),r=s(tt,this,e);return!(this===H&&u(rt,e)&&!u(it,e))&&(!(r||!u(this,e)||!u(rt,e)||u(this,z)&&this[z][e])||r)},dt=function(t,e){var r=f(t),i=m(e);if(r!==H||!u(rt,i)||u(it,i)){var n=J(r,i);return!n||!u(rt,i)||u(r,z)&&r[z][i]||(n.enumerable=!0),n}},pt=function(t){var e=$(f(t)),r=[];return F(e,(function(t){u(rt,t)||u(B,t)||et(r,t)})),r},ft=function(t){var e=t===H,r=$(e?it:f(t)),i=[];return F(r,(function(t){!u(rt,t)||e&&!u(H,t)||et(i,rt[t])})),i};c||(C(q=(W=function(){if(d(q,this))throw new Y("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,e=L(t),r=function(t){var i=void 0===this?n:this;i===H&&s(r,it,t),u(i,z)&&u(i[z],e)&&(i[z][e]=!1);var o=A(1,t);try{at(i,e,o)}catch(t){if(!(t instanceof Z))throw t;ot(i,e,o)}};return l&&st&&at(H,e,{configurable:!0,set:r}),lt(e,t)})[Q],"toString",(function(){return V(this).tag})),C(W,"withoutSetter",(function(t){return lt(L(t),t)})),S.f=ut,E.f=ct,M.f=ht,w.f=dt,x.f=b.f=pt,_.f=ft,D.f=function(t){return lt(P(t),t)},l&&(T(q,"description",{configurable:!0,get:function(){return V(this).description}}),a||C(H,"propertyIsEnumerable",ut,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:W}),F(v(nt),(function(t){O(t)})),i({target:G,stat:!0,forced:!c},{useSetter:function(){st=!0},useSimple:function(){st=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(t,e){return void 0===e?y(t):ht(y(t),e)},defineProperty:ct,defineProperties:ht,getOwnPropertyDescriptor:dt}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:pt}),k(),U(W,G),B[z]=!0},86544:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19037),o=r(68844),a=r(36812),l=r(69985),c=r(23622),h=r(34327),u=r(62148),d=r(8758),p=s.Symbol,f=p&&p.prototype;if(n&&l(p)&&(!("description"in f)||void 0!==p().description)){var m={},g=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:h(arguments[0]),e=c(f,this)?new p(t):void 0===t?p():p(t);return""===t&&(m[e]=!0),e};d(g,p),g.prototype=f,f.constructor=g;var A="Symbol(description detection)"===String(p("description detection")),y=o(f.valueOf),v=o(f.toString),x=/^Symbol\((.*)\)[^)]+$/,b=o("".replace),_=o("".slice);u(f,"description",{configurable:!0,get:function(){var t=y(this);if(a(m,t))return"";var e=v(t),r=A?_(e,7,-1):b(e,x,"$1");return""===r?void 0:r}}),i({global:!0,constructor:!0,forced:!0},{Symbol:g})}},43975:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(36812),o=r(34327),a=r(83430),l=r(46549),c=a("string-to-symbol-registry"),h=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{for:function(t){var e=o(t);if(s(c,e))return c[e];var r=n("Symbol")(e);return c[e]=r,h[r]=e,r}})},96157:(t,e,r)=>{"use strict";r(35405)("hasInstance")},82529:(t,e,r)=>{"use strict";r(35405)("isConcatSpreadable")},84254:(t,e,r)=>{"use strict";r(35405)("iterator")},59749:(t,e,r)=>{"use strict";r(37855),r(43975),r(81445),r(48324),r(79434)},81445:(t,e,r)=>{"use strict";var i=r(79989),n=r(36812),s=r(30734),o=r(23691),a=r(83430),l=r(46549),c=a("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{keyFor:function(t){if(!s(t))throw new TypeError(o(t)+" is not a symbol");if(n(c,t))return c[t]}})},93531:(t,e,r)=>{"use strict";r(35405)("matchAll")},64155:(t,e,r)=>{"use strict";r(35405)("match")},95906:(t,e,r)=>{"use strict";r(35405)("replace")},50549:(t,e,r)=>{"use strict";r(35405)("search")},96285:(t,e,r)=>{"use strict";r(35405)("species")},18200:(t,e,r)=>{"use strict";r(35405)("split")},69373:(t,e,r)=>{"use strict";var i=r(35405),n=r(13032);i("toPrimitive"),n()},66793:(t,e,r)=>{"use strict";var i=r(76058),n=r(35405),s=r(55997);n("toStringTag"),s(i("Symbol"),"Symbol")},44578:(t,e,r)=>{"use strict";r(35405)("unscopables")},95194:(t,e,r)=>{"use strict";var i=r(54872),n=r(6310),s=r(68700),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",(function(t){var e=o(this),r=n(e),i=s(t),a=i>=0?i:r+i;return a<0||a>=r?void 0:e[a]}))},36664:(t,e,r)=>{"use strict";var i=r(68844),n=r(54872),s=i(r(70357)),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("copyWithin",(function(t,e){return s(o(this),t,e,arguments.length>2?arguments[2]:void 0)}))},55980:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).every,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("every",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},79943:(t,e,r)=>{"use strict";var i=r(54872),n=r(62872),s=r(71530),o=r(50926),a=r(22615),l=r(68844),c=r(3689),h=i.aTypedArray,u=i.exportTypedArrayMethod,d=l("".slice);u("fill",(function(t){var e=arguments.length;h(this);var r="Big"===d(o(this),0,3)?s(t):+t;return a(n,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),c((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},96089:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filter,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filter",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}))},48690:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).findIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},82:(t,e,r)=>{"use strict";var i=r(54872),n=r(61969).findLastIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},20522:(t,e,r)=>{"use strict";var i=r(54872),n=r(61969).findLast,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},18539:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).find,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("find",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},29068:(t,e,r)=>{"use strict";r(31158)("Float32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},70292:(t,e,r)=>{"use strict";r(31158)("Float64",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},45385:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).forEach,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("forEach",(function(t){n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},59495:(t,e,r)=>{"use strict";var i=r(39800);(0,r(54872).exportTypedArrayStaticMethod)("from",r(41304),i)},85552:(t,e,r)=>{"use strict";var i=r(54872),n=r(84328).includes,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("includes",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},31803:(t,e,r)=>{"use strict";var i=r(54872),n=r(84328).indexOf,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("indexOf",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},89988:(t,e,r)=>{"use strict";r(31158)("Int16",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},854:(t,e,r)=>{"use strict";r(31158)("Int32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},55304:(t,e,r)=>{"use strict";r(31158)("Int8",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},91565:(t,e,r)=>{"use strict";var i=r(19037),n=r(3689),s=r(68844),o=r(54872),a=r(752),l=r(44201)("iterator"),c=i.Uint8Array,h=s(a.values),u=s(a.keys),d=s(a.entries),p=o.aTypedArray,f=o.exportTypedArrayMethod,m=c&&c.prototype,g=!n((function(){m[l].call([1])})),A=!!m&&m.values&&m[l]===m.values&&"values"===m.values.name,y=function(){return h(p(this))};f("entries",(function(){return d(p(this))}),g),f("keys",(function(){return u(p(this))}),g),f("values",y,g||!A,{name:"values"}),f(l,y,g||!A,{name:"values"})},67987:(t,e,r)=>{"use strict";var i=r(54872),n=r(68844),s=i.aTypedArray,o=i.exportTypedArrayMethod,a=n([].join);o("join",(function(t){return a(s(this),t)}))},49365:(t,e,r)=>{"use strict";var i=r(54872),n=r(61735),s=r(60953),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return n(s,o(this),e>1?[t,arguments[1]]:[t])}))},80677:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).map,s=r(47338),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("map",(function(t){return n(o(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(s(t))(e)}))}))},19038:(t,e,r)=>{"use strict";var i=r(54872),n=r(39800),s=i.aTypedArrayConstructor;(0,i.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,e=arguments.length,r=new(s(this))(e);e>t;)r[t]=arguments[t++];return r}),n)},41165:(t,e,r)=>{"use strict";var i=r(54872),n=r(88820).right,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},18118:(t,e,r)=>{"use strict";var i=r(54872),n=r(88820).left,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},71522:(t,e,r)=>{"use strict";var i=r(54872),n=i.aTypedArray,s=i.exportTypedArrayMethod,o=Math.floor;s("reverse",(function(){for(var t,e=this,r=n(e).length,i=o(r/2),s=0;s{"use strict";var i=r(19037),n=r(22615),s=r(54872),o=r(6310),a=r(83250),l=r(90690),c=r(3689),h=i.RangeError,u=i.Int8Array,d=u&&u.prototype,p=d&&d.set,f=s.aTypedArray,m=s.exportTypedArrayMethod,g=!c((function(){var t=new Uint8ClampedArray(2);return n(p,t,{length:1,0:3},1),3!==t[1]})),A=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new u(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));m("set",(function(t){f(this);var e=a(arguments.length>1?arguments[1]:void 0,1),r=l(t);if(g)return n(p,this,r,e);var i=this.length,s=o(r),c=0;if(s+e>i)throw new h("Wrong length");for(;c{"use strict";var i=r(54872),n=r(47338),s=r(3689),o=r(96004),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("slice",(function(t,e){for(var r=o(a(this),t,e),i=n(this),s=0,l=r.length,c=new i(l);l>s;)c[s]=r[s++];return c}),s((function(){new Int8Array(1).slice()})))},7300:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).some,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("some",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},93356:(t,e,r)=>{"use strict";var i=r(19037),n=r(46576),s=r(3689),o=r(10509),a=r(50382),l=r(54872),c=r(97365),h=r(37298),u=r(3615),d=r(27922),p=l.aTypedArray,f=l.exportTypedArrayMethod,m=i.Uint16Array,g=m&&n(m.prototype.sort),A=!(!g||s((function(){g(new m(2),null)}))&&s((function(){g(new m(2),{})}))),y=!!g&&!s((function(){if(u)return u<74;if(c)return c<67;if(h)return!0;if(d)return d<602;var t,e,r=new m(516),i=Array(516);for(t=0;t<516;t++)e=t%4,r[t]=515-t,i[t]=t-2*e+3;for(g(r,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(r[t]!==i[t])return!0}));f("sort",(function(t){return void 0!==t&&o(t),y?g(this,t):a(p(this),function(t){return function(e,r){return void 0!==t?+t(e,r)||0:r!=r?-1:e!=e?1:0===e&&0===r?1/e>0&&1/r<0?1:-1:e>r}}(t))}),!y||A)},62533:(t,e,r)=>{"use strict";var i=r(54872),n=r(43126),s=r(27578),o=r(47338),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("subarray",(function(t,e){var r=a(this),i=r.length,l=s(t,i);return new(o(r))(r.buffer,r.byteOffset+l*r.BYTES_PER_ELEMENT,n((void 0===e?i:s(e,i))-l))}))},99724:(t,e,r)=>{"use strict";var i=r(19037),n=r(61735),s=r(54872),o=r(3689),a=r(96004),l=i.Int8Array,c=s.aTypedArray,h=s.exportTypedArrayMethod,u=[].toLocaleString,d=!!l&&o((function(){u.call(new l(1))}));h("toLocaleString",(function(){return n(u,d?a(c(this)):c(this),a(arguments))}),o((function(){return[1,2].toLocaleString()!==new l([1,2]).toLocaleString()}))||!o((function(){l.prototype.toLocaleString.call([1,2])})))},24224:(t,e,r)=>{"use strict";var i=r(26166),n=r(54872),s=n.aTypedArray,o=n.exportTypedArrayMethod,a=n.getTypedArrayConstructor;o("toReversed",(function(){return i(s(this),a(this))}))},61121:(t,e,r)=>{"use strict";var i=r(54872),n=r(68844),s=r(10509),o=r(59976),a=i.aTypedArray,l=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,h=n(i.TypedArrayPrototype.sort);c("toSorted",(function(t){void 0!==t&&s(t);var e=a(this),r=o(l(e),e);return h(r,t)}))},99901:(t,e,r)=>{"use strict";var i=r(54872).exportTypedArrayMethod,n=r(3689),s=r(19037),o=r(68844),a=s.Uint8Array,l=a&&a.prototype||{},c=[].toString,h=o([].join);n((function(){c.call({})}))&&(c=function(){return h(this)});var u=l.toString!==c;i("toString",c,u)},75679:(t,e,r)=>{"use strict";r(31158)("Uint16",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},18557:(t,e,r)=>{"use strict";r(31158)("Uint32",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},28607:(t,e,r)=>{"use strict";r(31158)("Uint8",(function(t){return function(e,r,i){return t(this,e,r,i)}}))},30938:(t,e,r)=>{"use strict";r(31158)("Uint8",(function(t){return function(e,r,i){return t(this,e,r,i)}}),!0)},37133:(t,e,r)=>{"use strict";var i=r(16134),n=r(54872),s=r(9401),o=r(68700),a=r(71530),l=n.aTypedArray,c=n.getTypedArrayConstructor,h=n.exportTypedArrayMethod,u=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();h("with",{with:function(t,e){var r=l(this),n=o(t),h=s(r)?a(e):+e;return i(r,c(r),n,h)}}.with,!u)},622:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=String.fromCharCode,a=n("".charAt),l=n(/./.exec),c=n("".slice),h=/^[\da-f]{2}$/i,u=/^[\da-f]{4}$/i;i({global:!0},{unescape:function(t){for(var e,r,i=s(t),n="",d=i.length,p=0;p{"use strict";var i,n=r(71594),s=r(19037),o=r(68844),a=r(6045),l=r(45375),c=r(20319),h=r(70637),u=r(48999),d=r(618).enforce,p=r(3689),f=r(59834),m=Object,g=Array.isArray,A=m.isExtensible,y=m.isFrozen,v=m.isSealed,x=m.freeze,b=m.seal,_={},w={},E=!s.ActiveXObject&&"ActiveXObject"in s,M=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},S=c("WeakMap",M,h),C=S.prototype,T=o(C.set);if(f)if(E){i=h.getConstructor(M,"WeakMap",!0),l.enable();var I=o(C.delete),R=o(C.has),B=o(C.get);a(C,{delete:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),I(this,t)||e.frozen.delete(t)}return I(this,t)},has:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),R(this,t)||e.frozen.has(t)}return R(this,t)},get:function(t){if(u(t)&&!A(t)){var e=d(this);return e.frozen||(e.frozen=new i),R(this,t)?B(this,t):e.frozen.get(t)}return B(this,t)},set:function(t,e){if(u(t)&&!A(t)){var r=d(this);r.frozen||(r.frozen=new i),R(this,t)?T(this,t,e):r.frozen.set(t,e)}else T(this,t,e);return this}})}else n&&p((function(){var t=x([]);return T(new S,t,1),!y(t)}))&&a(C,{set:function(t,e){var r;return g(t)&&(y(t)?r=_:v(t)&&(r=w)),T(this,t,e),r===_&&x(t),r===w&&b(t),this}})},51090:(t,e,r)=>{"use strict";r(45164)},87884:(t,e,r)=>{"use strict";r(20319)("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r(70637))},50414:(t,e,r)=>{"use strict";r(87884)},89503:(t,e,r)=>{"use strict";r(95879)},86247:(t,e,r)=>{"use strict";var i=r(67697),n=r(62148),s=r(22961),o=ArrayBuffer.prototype;i&&!("detached"in o)&&n(o,"detached",{configurable:!0,get:function(){return s(this)}})},43097:(t,e,r)=>{"use strict";var i=r(79989),n=r(29195);n&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},21412:(t,e,r)=>{"use strict";var i=r(79989),n=r(29195);n&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},4154:(t,e,r)=>{"use strict";r(92176)},7802:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filterReject,s=r(87370);i({target:"Array",proto:!0,forced:!0},{filterOut:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("filterOut")},54883:(t,e,r)=>{"use strict";var i=r(79989),n=r(2960).filterReject,s=r(87370);i({target:"Array",proto:!0,forced:!0},{filterReject:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("filterReject")},20097:(t,e,r)=>{"use strict";r(93383)},38197:(t,e,r)=>{"use strict";r(59867)},18073:(t,e,r)=>{"use strict";r(79989)({target:"Array",stat:!0},{fromAsync:r(2231)})},96882:(t,e,r)=>{"use strict";var i=r(79989),n=r(16834),s=r(87370),o=r(44416);i({target:"Array",proto:!0,name:"groupToMap",forced:r(53931)||!n("groupByToMap")},{groupByToMap:o}),s("groupByToMap")},22525:(t,e,r)=>{"use strict";var i=r(79989),n=r(64976),s=r(16834),o=r(87370);i({target:"Array",proto:!0,forced:!s("groupBy")},{groupBy:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),o("groupBy")},32539:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370),s=r(44416);i({target:"Array",proto:!0,forced:r(53931)},{groupToMap:s}),n("groupToMap")},36208:(t,e,r)=>{"use strict";var i=r(79989),n=r(64976),s=r(87370);i({target:"Array",proto:!0},{group:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("group")},5082:(t,e,r)=>{"use strict";var i=r(79989),n=r(92297),s=Object.isFrozen,o=function(t,e){if(!s||!n(t)||!s(t))return!1;for(var r,i=0,o=t.length;i{"use strict";var i=r(67697),n=r(87370),s=r(90690),o=r(6310),a=r(62148);i&&(a(Array.prototype,"lastIndex",{configurable:!0,get:function(){var t=s(this),e=o(t);return 0===e?0:e-1}}),n("lastIndex"))},32221:(t,e,r)=>{"use strict";var i=r(67697),n=r(87370),s=r(90690),o=r(6310),a=r(62148);i&&(a(Array.prototype,"lastItem",{configurable:!0,get:function(){var t=s(this),e=o(t);return 0===e?void 0:t[e-1]},set:function(t){var e=s(this),r=o(e);return e[0===r?0:r-1]=t}}),n("lastItem"))},67890:(t,e,r)=>{"use strict";r(29830)},47041:(t,e,r)=>{"use strict";r(12894)},86322:(t,e,r)=>{"use strict";r(93530)},92253:(t,e,r)=>{"use strict";var i=r(79989),n=r(87370);i({target:"Array",proto:!0,forced:!0},{uniqueBy:r(12397)}),n("uniqueBy")},97554:(t,e,r)=>{"use strict";r(21319)},11070:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(76058),o=r(10509),a=r(767),l=r(11880),c=r(6045),h=r(62148),u=r(44201),d=r(618),p=r(29199),f=s("Promise"),m=s("SuppressedError"),g=ReferenceError,A=u("asyncDispose"),y=u("toStringTag"),v="AsyncDisposableStack",x=d.set,b=d.getterFor(v),_="async-dispose",w="disposed",E=function(t){var e=b(t);if(e.state===w)throw new g(v+" already disposed");return e},M=function(){x(a(this,S),{type:v,state:"pending",stack:[]}),n||(this.disposed=!1)},S=M.prototype;c(S,{disposeAsync:function(){var t=this;return new f((function(e,r){var i=b(t);if(i.state===w)return e(void 0);i.state=w,n||(t.disposed=!0);var s,o=i.stack,a=o.length,l=!1,c=function(t){l?s=new m(t,s):(l=!0,s=t),h()},h=function(){if(a){var t=o[--a];o[a]=null;try{f.resolve(t()).then(h,c)}catch(t){c(t)}}else i.stack=null,l?r(s):e(void 0)};h()}))},use:function(t){return p(E(this),t,_),t},adopt:function(t,e){var r=E(this);return o(e),p(r,void 0,_,(function(){return e(t)})),t},defer:function(t){var e=E(this);o(t),p(e,void 0,_,t)},move:function(){var t=E(this),e=new M;return b(e).stack=t.stack,t.stack=[],t.state=w,n||(this.disposed=!0),e}}),n&&h(S,"disposed",{configurable:!0,get:function(){return b(this).state===w}}),l(S,A,S.disposeAsync,{name:"disposeAsync"}),l(S,y,v,{nonWritable:!0}),i({global:!0,constructor:!0},{AsyncDisposableStack:M})},77299:(t,e,r)=>{"use strict";r(79989)({target:"AsyncIterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(40164)})},15694:(t,e,r)=>{"use strict";var i=r(22615),n=r(11880),s=r(76058),o=r(54849),a=r(36812),l=r(44201),c=r(23070),h=l("asyncDispose"),u=s("Promise");a(c,h)||n(c,h,(function(){var t=this;return new u((function(e,r){var n=o(t,"return");n?u.resolve(i(n,t)).then((function(){e(void 0)}),r):e(void 0)}))}))},64578:(t,e,r)=>{"use strict";var i=r(79989),n=r(767),s=r(61868),o=r(75773),a=r(36812),l=r(44201),c=r(23070),h=r(53931),u=l("toStringTag"),d=TypeError,p=function(){if(n(this,c),s(this)===c)throw new d("Abstract class AsyncIterator not directly constructable")};p.prototype=c,a(c,u)||o(c,u,"AsyncIterator"),!h&&a(c,"constructor")&&c.constructor!==Object||o(c,"constructor",p),i({global:!0,constructor:!0,forced:h},{AsyncIterator:p})},17815:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(17394),h=r(27807),u=r(53931),d=c((function(t){var e=this;return new t((function(r,i){var o=function(t){e.done=!0,i(t)},a=function(){try{t.resolve(s(n(e.next,e.iterator))).then((function(t){try{s(t).done?(e.done=!0,r(h(void 0,!0))):e.remaining?(e.remaining--,a()):r(h(t.value,!1))}catch(t){o(t)}}),o)}catch(t){o(t)}};a()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:u},{drop:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},19029:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).every;i({target:"AsyncIterator",proto:!0,real:!0},{every:function(t){return n(this,t)}})},6237:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(22302),c=r(17394),h=r(27807),u=r(52399),d=r(53931),p=c((function(t){var e=this,r=e.iterator,i=e.predicate;return new t((function(s,l){var c=function(t){e.done=!0,l(t)},d=function(t){u(r,c,t,c)},p=function(){try{t.resolve(o(n(e.next,r))).then((function(r){try{if(o(r).done)e.done=!0,s(h(void 0,!0));else{var n=r.value;try{var l=i(n,e.counter++),u=function(t){t?s(h(n,!1)):p()};a(l)?t.resolve(l).then(u,d):u(l)}catch(t){d(t)}}}catch(t){c(t)}}),c)}catch(t){c(t)}};p()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:d},{filter:function(t){return o(this),s(t),new p(l(this),{predicate:t})}})},81954:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).find;i({target:"AsyncIterator",proto:!0,real:!0},{find:function(t){return n(this,t)}})},87152:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(22302),c=r(17394),h=r(27807),u=r(11427),d=r(52399),p=r(53931),f=c((function(t){var e=this,r=e.iterator,i=e.mapper;return new t((function(s,l){var c=function(t){e.done=!0,l(t)},p=function(t){d(r,c,t,c)},f=function(){try{t.resolve(o(n(e.next,r))).then((function(r){try{if(o(r).done)e.done=!0,s(h(void 0,!0));else{var n=r.value;try{var l=i(n,e.counter++),d=function(t){try{e.inner=u(t),m()}catch(t){p(t)}};a(l)?t.resolve(l).then(d,p):d(l)}catch(t){p(t)}}}catch(t){c(t)}}),c)}catch(t){c(t)}},m=function(){var r=e.inner;if(r)try{t.resolve(o(n(r.next,r.iterator))).then((function(t){try{o(t).done?(e.inner=null,f()):s(h(t.value,!1))}catch(t){p(t)}}),p)}catch(t){p(t)}else f()};m()}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:p},{flatMap:function(t){return o(this),s(t),new f(l(this),{mapper:t,inner:null})}})},89667:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).forEach;i({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(t){return n(this,t)}})},49118:(t,e,r)=>{"use strict";var i=r(79989),n=r(90690),s=r(23622),o=r(11427),a=r(23070),l=r(40219);i({target:"AsyncIterator",stat:!0,forced:r(53931)},{from:function(t){var e=o("string"==typeof t?n(t):t);return s(a,e.iterator)?e.iterator:new l(e)}})},32411:(t,e,r)=>{"use strict";r(79989)({target:"AsyncIterator",proto:!0,real:!0,forced:!0},{indexed:r(40164)})},3256:(t,e,r)=>{"use strict";var i=r(79989),n=r(82412);i({target:"AsyncIterator",proto:!0,real:!0,forced:r(53931)},{map:n})},85625:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(48999),l=r(76058),c=r(22302),h=r(52399),u=l("Promise"),d=TypeError;i({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(t){o(this),s(t);var e=c(this),r=e.iterator,i=e.next,l=arguments.length<2,p=l?void 0:arguments[1],f=0;return new u((function(e,s){var c=function(t){h(r,s,t,s)},m=function(){try{u.resolve(o(n(i,r))).then((function(r){try{if(o(r).done)l?s(new d("Reduce of empty iterator with no initial value")):e(p);else{var i=r.value;if(l)l=!1,p=i,m();else try{var n=t(p,i,f),h=function(t){p=t,m()};a(n)?u.resolve(n).then(h,c):h(n)}catch(t){c(t)}}f++}catch(t){s(t)}}),s)}catch(t){s(t)}};m()}))}})},10914:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).some;i({target:"AsyncIterator",proto:!0,real:!0},{some:function(t){return n(this,t)}})},14494:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(17394),h=r(27807),u=r(53931),d=c((function(t){var e,r=this,i=r.iterator;if(!r.remaining--){var o=h(void 0,!0);return r.done=!0,void 0!==(e=i.return)?t.resolve(n(e,i,void 0)).then((function(){return o})):o}return t.resolve(n(r.next,i)).then((function(t){return s(t).done?(r.done=!0,h(void 0,!0)):h(t.value,!1)})).then(null,(function(t){throw r.done=!0,t}))}));i({target:"AsyncIterator",proto:!0,real:!0,forced:u},{take:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},9468:(t,e,r)=>{"use strict";var i=r(79989),n=r(62489).toArray;i({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return n(this,void 0,[])}})},24587:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554);"function"==typeof BigInt&&i({target:"BigInt",stat:!0,forced:!0},{range:function(t,e,r){return new n(t,e,r,"bigint",BigInt(0),BigInt(1))}})},60779:(t,e,r)=>{"use strict";var i=r(79989),n=r(61735),s=r(41544),o=r(76058),a=r(25391),l=Object,c=function(){var t=o("Object","freeze");return t?t(a(null)):a(null)};i({global:!0,forced:!0},{compositeKey:function(){return n(s,l,arguments).get("object",c)}})},65503:(t,e,r)=>{"use strict";var i=r(79989),n=r(41544),s=r(76058),o=r(61735);i({global:!0,forced:!0},{compositeSymbol:function(){return 1===arguments.length&&"string"==typeof arguments[0]?s("Symbol").for(arguments[0]):o(n,null,arguments).get("symbol",s("Symbol"))}})},50236:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(15477).unpack,o=n(DataView.prototype.getUint16);i({target:"DataView",proto:!0},{getFloat16:function(t){var e=o(this,t,arguments.length>1&&arguments[1]);return s([255&e,e>>8&255],10)}})},89246:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844)(DataView.prototype.getUint8);i({target:"DataView",proto:!0,forced:!0},{getUint8Clamped:function(t){return n(this,t)}})},31186:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(50926),o=r(19842),a=r(15477).pack,l=r(76043),c=TypeError,h=n(DataView.prototype.setUint16);i({target:"DataView",proto:!0},{setFloat16:function(t,e){if("DataView"!==s(this))throw new c("Incorrect receiver");var r=o(t),i=a(l(e),10,2);return h(this,r,i[1]<<8|i[0],arguments.length>2&&arguments[2])}})},9279:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(50926),o=r(19842),a=r(87191),l=TypeError,c=n(DataView.prototype.setUint8);i({target:"DataView",proto:!0,forced:!0},{setUint8Clamped:function(t,e){if("DataView"!==s(this))throw new l("Incorrect receiver");var r=o(t);return c(this,r,a(e))}})},26725:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(76058),o=r(10509),a=r(767),l=r(11880),c=r(6045),h=r(62148),u=r(44201),d=r(618),p=r(29199),f=s("SuppressedError"),m=ReferenceError,g=u("dispose"),A=u("toStringTag"),y="DisposableStack",v=d.set,x=d.getterFor(y),b="sync-dispose",_="disposed",w=function(t){var e=x(t);if(e.state===_)throw new m(y+" already disposed");return e},E=function(){v(a(this,M),{type:y,state:"pending",stack:[]}),n||(this.disposed=!1)},M=E.prototype;c(M,{dispose:function(){var t=x(this);if(t.state!==_){t.state=_,n||(this.disposed=!0);for(var e,r=t.stack,i=r.length,s=!1;i;){var o=r[--i];r[i]=null;try{o()}catch(t){s?e=new f(t,e):(s=!0,e=t)}}if(t.stack=null,s)throw e}},use:function(t){return p(w(this),t,b),t},adopt:function(t,e){var r=w(this);return o(e),p(r,void 0,b,(function(){e(t)})),t},defer:function(t){var e=w(this);o(t),p(e,void 0,b,t)},move:function(){var t=w(this),e=new E;return x(e).stack=t.stack,t.stack=[],t.state=_,n||(this.disposed=!0),e}}),n&&h(M,"disposed",{configurable:!0,get:function(){return x(this).state===_}}),l(M,g,M.dispose,{name:"dispose"}),l(M,A,y,{nonWritable:!0}),i({global:!0,constructor:!0},{DisposableStack:E})},26125:(t,e,r)=>{"use strict";r(79989)({target:"Function",proto:!0,forced:!0},{demethodize:r(33505)})},2820:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(69985),o=r(6738),a=r(36812),l=r(67697),c=Object.getOwnPropertyDescriptor,h=/^\s*class\b/,u=n(h.exec);i({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(t){return s(t)&&!function(t){try{if(!l||!u(h,o(t)))return!1}catch(t){}var e=c(t,"prototype");return!!e&&a(e,"writable")&&!e.writable}(t)}})},62517:(t,e,r)=>{"use strict";r(79989)({target:"Function",stat:!0,forced:!0},{isConstructor:r(19429)})},54947:(t,e,r)=>{"use strict";var i=r(44201),n=r(72560).f,s=i("metadata"),o=Function.prototype;void 0===o[s]&&n(o,s,{value:null})},74993:(t,e,r)=>{"use strict";r(79989)({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:r(33505)})},78832:(t,e,r)=>{"use strict";r(45398)},50647:(t,e,r)=>{"use strict";r(79989)({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:r(47082)})},67602:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(767),o=r(85027),a=r(69985),l=r(61868),c=r(62148),h=r(76522),u=r(3689),d=r(36812),p=r(44201),f=r(12013).IteratorPrototype,m=r(67697),g=r(53931),A="constructor",y="Iterator",v=p("toStringTag"),x=TypeError,b=n[y],_=g||!a(b)||b.prototype!==f||!u((function(){b({})})),w=function(){if(s(this,f),l(this)===f)throw new x("Abstract class Iterator not directly constructable")},E=function(t,e){m?c(f,t,{configurable:!0,get:function(){return e},set:function(e){if(o(this),this===f)throw new x("You can't redefine this property");d(this,t)?this[t]=e:h(this,t,e)}}):f[t]=e};d(f,v)||E(v,y),!_&&d(f,A)&&f[A]!==Object||E(A,w),w.prototype=f,i({global:!0,constructor:!0,forced:_},{Iterator:w})},82639:(t,e,r)=>{"use strict";var i=r(22615),n=r(11880),s=r(54849),o=r(36812),a=r(44201),l=r(12013).IteratorPrototype,c=a("dispose");o(l,c)||n(l,c,(function(){var t=s(this,"return");t&&i(t,this)}))},63986:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(65419),h=r(53931),u=c((function(){for(var t,e=this.iterator,r=this.next;this.remaining;)if(this.remaining--,t=s(n(r,e)),this.done=!!t.done)return;if(t=s(n(r,e)),!(this.done=!!t.done))return t.value}));i({target:"Iterator",proto:!0,real:!0,forced:h},{drop:function(t){s(this);var e=l(a(+t));return new u(o(this),{remaining:e})}})},16054:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{every:function(t){o(this),s(t);var e=a(this),r=0;return!n(e,(function(e,i){if(!t(e,r++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},53476:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(22302),l=r(65419),c=r(71228),h=r(53931),u=l((function(){for(var t,e,r=this.iterator,i=this.predicate,s=this.next;;){if(t=o(n(s,r)),this.done=!!t.done)return;if(e=t.value,c(r,i,[e,this.counter++],!0))return e}}));i({target:"Iterator",proto:!0,real:!0,forced:h},{filter:function(t){return o(this),s(t),new u(a(this),{predicate:t})}})},70928:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{find:function(t){o(this),s(t);var e=a(this),r=0;return n(e,(function(e,i){if(t(e,r++))return i(e)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},49411:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(10509),o=r(85027),a=r(22302),l=r(36752),c=r(65419),h=r(72125),u=r(53931),d=c((function(){for(var t,e,r=this.iterator,i=this.mapper;;){if(e=this.inner)try{if(!(t=o(n(e.next,e.iterator))).done)return t.value;this.inner=null}catch(t){h(r,"throw",t)}if(t=o(n(this.next,r)),this.done=!!t.done)return;try{this.inner=l(i(t.value,this.counter++),!1)}catch(t){h(r,"throw",t)}}}));i({target:"Iterator",proto:!0,real:!0,forced:u},{flatMap:function(t){return o(this),s(t),new d(a(this),{mapper:t,inner:null})}})},30005:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{forEach:function(t){o(this),s(t);var e=a(this),r=0;n(e,(function(e){t(e,r++)}),{IS_RECORD:!0})}})},73494:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(90690),o=r(23622),a=r(12013).IteratorPrototype,l=r(65419),c=r(36752),h=r(53931),u=l((function(){return n(this.next,this.iterator)}),!0);i({target:"Iterator",stat:!0,forced:h},{from:function(t){var e=c("string"==typeof t?s(t):t,!0);return o(a,e.iterator)?e.iterator:new u(e)}})},94564:(t,e,r)=>{"use strict";r(79989)({target:"Iterator",proto:!0,real:!0,forced:!0},{indexed:r(47082)})},41792:(t,e,r)=>{"use strict";var i=r(79989),n=r(88983);i({target:"Iterator",proto:!0,real:!0,forced:r(53931)},{map:n})},5985:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554),s=TypeError;i({target:"Iterator",stat:!0,forced:!0},{range:function(t,e,r){if("number"==typeof t)return new n(t,e,r,"number",0,1);if("bigint"==typeof t)return new n(t,e,r,"bigint",BigInt(0),BigInt(1));throw new s("Incorrect Iterator.range arguments")}})},31107:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302),l=TypeError;i({target:"Iterator",proto:!0,real:!0},{reduce:function(t){o(this),s(t);var e=a(this),r=arguments.length<2,i=r?void 0:arguments[1],c=0;if(n(e,(function(e){r?(r=!1,i=e):i=t(i,e,c),c++}),{IS_RECORD:!0}),r)throw new l("Reduce of empty iterator with no initial value");return i}})},28244:(t,e,r)=>{"use strict";var i=r(79989),n=r(18734),s=r(10509),o=r(85027),a=r(22302);i({target:"Iterator",proto:!0,real:!0},{some:function(t){o(this),s(t);var e=a(this),r=0;return n(e,(function(e,i){if(t(e,r++))return i()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3645:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(85027),o=r(22302),a=r(4654),l=r(15904),c=r(65419),h=r(72125),u=r(53931),d=c((function(){var t=this.iterator;if(!this.remaining--)return this.done=!0,h(t,"normal",void 0);var e=s(n(this.next,t));return(this.done=!!e.done)?void 0:e.value}));i({target:"Iterator",proto:!0,real:!0,forced:u},{take:function(t){s(this);var e=l(a(+t));return new d(o(this),{remaining:e})}})},58429:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(18734),o=r(22302),a=[].push;i({target:"Iterator",proto:!0,real:!0},{toArray:function(){var t=[];return s(o(n(this)),a,{that:t,IS_RECORD:!0}),t}})},39569:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(29019),o=r(40219),a=r(22302);i({target:"Iterator",proto:!0,real:!0,forced:r(53931)},{toAsync:function(){return new o(a(new s(a(n(this)))))}})},74320:(t,e,r)=>{"use strict";r(79989)({target:"JSON",stat:!0,forced:!r(22818)},{isRawJSON:r(55670)})},20691:(t,e,r)=>{"use strict";var i=r(79989),n=r(67697),s=r(19037),o=r(76058),a=r(68844),l=r(22615),c=r(69985),h=r(48999),u=r(92297),d=r(36812),p=r(34327),f=r(6310),m=r(76522),g=r(3689),A=r(46675),y=r(50146),v=s.JSON,x=s.Number,b=s.SyntaxError,_=v&&v.parse,w=o("Object","keys"),E=Object.getOwnPropertyDescriptor,M=a("".charAt),S=a("".slice),C=a(/./.exec),T=a([].push),I=/^\d$/,R=/^[1-9]$/,B=/^(?:-|\d)$/,L=/^[\t\n\r ]$/,P=function(t,e,r,i){var n,s,o,a,c,p=t[e],m=i&&p===i.value,g=m&&"string"==typeof i.source?{source:i.source}:{};if(h(p)){var A=u(p),y=m?i.nodes:A?[]:{};if(A)for(n=y.length,o=f(p),a=0;a{"use strict";var i=r(79989),n=r(71594),s=r(22818),o=r(76058),a=r(22615),l=r(68844),c=r(69985),h=r(55670),u=r(34327),d=r(76522),p=r(46675),f=r(92643),m=r(14630),g=r(618).set,A=String,y=SyntaxError,v=o("JSON","parse"),x=o("JSON","stringify"),b=o("Object","create"),_=o("Object","freeze"),w=l("".charAt),E=l("".slice),M=l(/./.exec),S=l([].push),C=m(),T=C.length,I="Unacceptable as raw JSON",R=/^[\t\n\r ]$/;i({target:"JSON",stat:!0,forced:!s},{rawJSON:function(t){var e=u(t);if(""===e||M(R,w(e,0))||M(R,w(e,e.length-1)))throw new y(I);var r=v(e);if("object"==typeof r&&null!==r)throw new y(I);var i=b(null);return g(i,{type:"RawJSON"}),d(i,"rawJSON",e),n?_(i):i}}),x&&i({target:"JSON",stat:!0,arity:3,forced:!s},{stringify:function(t,e,r){var i=f(e),n=[],s=x(t,(function(t,e){var r=c(i)?a(i,this,A(t),e):e;return h(r)?C+(S(n,r.rawJSON)-1):r}),r);if("string"!=typeof s)return s;for(var o="",l=s.length,u=0;u{"use strict";var i=r(79989),n=r(9945),s=r(83914).remove;i({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(9945),s=r(83914),o=s.get,a=s.has,l=s.set;i({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,i,s=n(this);return a(s,t)?(r=o(s,t),"update"in e&&(r=e.update(r,t,s),l(s,t,r)),r):(i=e.insert(t,s),l(s,t,i),i)}})},747:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!1!==o(e,(function(t,i){if(!r(t,i,e))return!1}),!0)}})},41099:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){r(t,n,e)&&c(i,n,t)})),i}})},20876:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t,i){if(r(t,i,e))return{key:i}}),!0);return i&&i.key}})},26320:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t,i){if(r(t,i,e))return{value:t}}),!0);return i&&i.value}})},6052:(t,e,r)=>{"use strict";r(79989)({target:"Map",stat:!0,forced:!0},{from:r(28737)})},39879:(t,e,r)=>{"use strict";r(89348)},76791:(t,e,r)=>{"use strict";var i=r(79989),n=r(68600),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(t){return!0===o(s(this),(function(e){if(n(e,t))return!0}),!0)}})},75341:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(18734),o=r(69985),a=r(10509),l=r(83914).Map;i({target:"Map",stat:!0,forced:!0},{keyBy:function(t,e){var r=new(o(this)?this:l);a(e);var i=a(r.set);return s(t,(function(t){n(i,r,e(t),t)})),r}})},40019:(t,e,r)=>{"use strict";var i=r(79989),n=r(9945),s=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(t){var e=s(n(this),(function(e,r){if(e===t)return{key:r}}),!0);return e&&e.key}})},92343:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){c(i,r(t,n,e),t)})),i}})},51096:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(83914),a=r(10613),l=o.Map,c=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t,n){c(i,n,r(t,n,e))})),i}})},4314:(t,e,r)=>{"use strict";var i=r(79989),n=r(9945),s=r(18734),o=r(83914).set;i({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(t){for(var e=n(this),r=arguments.length,i=0;i{"use strict";r(79989)({target:"Map",stat:!0,forced:!0},{of:r(1114)})},23346:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(9945),o=r(10613),a=TypeError;i({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),r=arguments.length<2,i=r?void 0:arguments[1];if(n(t),o(e,(function(n,s){r?(r=!1,i=n):i=t(i,n,s,e)})),r)throw new a("Reduce of empty map with no initial value");return i}})},64984:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(9945),o=r(10613);i({target:"Map",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!0===o(e,(function(t,i){if(r(t,i,e))return!0}),!0)}})},24453:(t,e,r)=>{"use strict";r(79989)({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:r(41432)})},64078:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(9945),o=r(83914),a=TypeError,l=o.get,c=o.has,h=o.set;i({target:"Map",proto:!0,real:!0,forced:!0},{update:function(t,e){var r=s(this),i=arguments.length;n(e);var o=c(r,t);if(!o&&i<3)throw new a("Updating absent value");var u=o?l(r,t):n(i>2?arguments[2]:void 0)(t,r);return h(r,t,e(u,t,r)),r}})},66190:(t,e,r)=>{"use strict";r(79989)({target:"Map",proto:!0,real:!0,forced:!0},{upsert:r(41432)})},25684:(t,e,r)=>{"use strict";var i=r(79989),n=Math.min,s=Math.max;i({target:"Math",stat:!0,forced:!0},{clamp:function(t,e,r){return n(r,s(e,t))}})},31789:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180})},8677:(t,e,r)=>{"use strict";var i=r(79989),n=180/Math.PI;i({target:"Math",stat:!0,forced:!0},{degrees:function(t){return t*n}})},59151:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0},{f16round:r(76043)})},346:(t,e,r)=>{"use strict";var i=r(79989),n=r(84463),s=r(37788);i({target:"Math",stat:!0,forced:!0},{fscale:function(t,e,r,i,o){return s(n(t,e,r,i,o))}})},91069:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{iaddh:function(t,e,r,i){var n=t>>>0,s=r>>>0;return(e>>>0)+(i>>>0)+((n&s|(n|s)&~(n+s>>>0))>>>31)|0}})},18886:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{imulh:function(t,e){var r=65535,i=+t,n=+e,s=i&r,o=n&r,a=i>>16,l=n>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>16)+((s*l>>>0)+(c&r)>>16)}})},88065:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{isubh:function(t,e,r,i){var n=t>>>0,s=r>>>0;return(e>>>0)-(i>>>0)-((~n&s|~(n^s)&n-s>>>0)>>>31)|0}})},68172:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},60445:(t,e,r)=>{"use strict";var i=r(79989),n=Math.PI/180;i({target:"Math",stat:!0,forced:!0},{radians:function(t){return t*n}})},99457:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{scale:r(84463)})},613:(t,e,r)=>{"use strict";var i=r(79989),n=r(85027),s=r(70046),o=r(30974),a=r(27807),l=r(618),c="Seeded Random",h=c+" Generator",u=l.set,d=l.getterFor(h),p=TypeError,f=o((function(t){u(this,{type:h,seed:t%2147483647})}),c,(function(){var t=d(this),e=t.seed=(1103515245*t.seed+12345)%2147483647;return a((1073741823&e)/1073741823,!1)}));i({target:"Math",stat:!0,forced:!0},{seededPRNG:function(t){var e=n(t).seed;if(!s(e))throw new p('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new f(e)}})},835:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{signbit:function(t){var e=+t;return e==e&&0===e?1/e==-1/0:e<0}})},926:(t,e,r)=>{"use strict";r(79989)({target:"Math",stat:!0,forced:!0},{umulh:function(t,e){var r=65535,i=+t,n=+e,s=i&r,o=n&r,a=i>>>16,l=n>>>16,c=(a*o>>>0)+(s*o>>>16);return a*l+(c>>>16)+((s*l>>>0)+(c&r)>>>16)}})},82899:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(68700),o="Invalid number representation",a=RangeError,l=SyntaxError,c=TypeError,h=parseInt,u=Math.pow,d=/^[\d.a-z]+$/,p=n("".charAt),f=n(d.exec),m=n(1..toString),g=n("".slice),A=n("".split);i({target:"Number",stat:!0,forced:!0},{fromString:function(t,e){var r=1;if("string"!=typeof t)throw new c(o);if(!t.length)throw new l(o);if("-"===p(t,0)&&(r=-1,!(t=g(t,1)).length))throw new l(o);var i=void 0===e?10:s(e);if(i<2||i>36)throw new a("Invalid radix");if(!f(d,t))throw new l(o);var n=A(t,"."),y=h(n[0],i);if(n.length>1&&(y+=h(n[1],i)/u(i,n[1].length)),10===i&&m(y,i)!==t)throw new l(o);return r*y}})},29977:(t,e,r)=>{"use strict";var i=r(79989),n=r(98554);i({target:"Number",stat:!0,forced:!0},{range:function(t,e,r){return new n(t,e,r,"number",0,1)}})},3210:(t,e,r)=>{"use strict";r(44079)},53669:(t,e,r)=>{"use strict";r(14566)},31927:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateEntries:function(t){return new n(t,"entries")}})},77131:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateKeys:function(t){return new n(t,"keys")}})},55174:(t,e,r)=>{"use strict";var i=r(79989),n=r(42351);i({target:"Object",stat:!0,forced:!0},{iterateValues:function(t){return new n(t,"values")}})},63503:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(67697),o=r(14241),a=r(10509),l=r(85027),c=r(767),h=r(69985),u=r(981),d=r(48999),p=r(54849),f=r(11880),m=r(6045),g=r(62148),A=r(20920),y=r(44201),v=r(618),x=y("observable"),b="Observable",_="Subscription",w="SubscriptionObserver",E=v.getterFor,M=v.set,S=E(b),C=E(_),T=E(w),I=function(t){this.observer=l(t),this.cleanup=void 0,this.subscriptionObserver=void 0};I.prototype={type:_,clean:function(){var t=this.cleanup;if(t){this.cleanup=void 0;try{t()}catch(t){A(t)}}},close:function(){if(!s){var t=this.facade,e=this.subscriptionObserver;t.closed=!0,e&&(e.closed=!0)}this.observer=void 0},isClosed:function(){return void 0===this.observer}};var R=function(t,e){var r,i=M(this,new I(t));s||(this.closed=!1);try{(r=p(t,"start"))&&n(r,t,this)}catch(t){A(t)}if(!i.isClosed()){var o=i.subscriptionObserver=new B(i);try{var l=e(o),c=l;u(l)||(i.cleanup=h(l.unsubscribe)?function(){c.unsubscribe()}:a(l))}catch(t){return void o.error(t)}i.isClosed()&&i.clean()}};R.prototype=m({},{unsubscribe:function(){var t=C(this);t.isClosed()||(t.close(),t.clean())}}),s&&g(R.prototype,"closed",{configurable:!0,get:function(){return C(this).isClosed()}});var B=function(t){M(this,{type:w,subscriptionState:t}),s||(this.closed=!1)};B.prototype=m({},{next:function(t){var e=T(this).subscriptionState;if(!e.isClosed()){var r=e.observer;try{var i=p(r,"next");i&&n(i,r,t)}catch(t){A(t)}}},error:function(t){var e=T(this).subscriptionState;if(!e.isClosed()){var r=e.observer;e.close();try{var i=p(r,"error");i?n(i,r,t):A(t)}catch(t){A(t)}e.clean()}},complete:function(){var t=T(this).subscriptionState;if(!t.isClosed()){var e=t.observer;t.close();try{var r=p(e,"complete");r&&n(r,e)}catch(t){A(t)}t.clean()}}}),s&&g(B.prototype,"closed",{configurable:!0,get:function(){return T(this).subscriptionState.isClosed()}});var L=function(t){c(this,P),M(this,{type:b,subscriber:a(t)})},P=L.prototype;m(P,{subscribe:function(t){var e=arguments.length;return new R(h(t)?{next:t,error:e>1?arguments[1]:void 0,complete:e>2?arguments[2]:void 0}:d(t)?t:{},S(this).subscriber)}}),f(P,x,(function(){return this})),i({global:!0,constructor:!0,forced:!0},{Observable:L}),o(b)},9818:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(22615),o=r(85027),a=r(19429),l=r(5185),c=r(54849),h=r(18734),u=r(44201)("observable");i({target:"Observable",stat:!0,forced:!0},{from:function(t){var e=a(this)?this:n("Observable"),r=c(o(t),u);if(r){var i=o(s(r,t));return i.constructor===e?i:new e((function(t){return i.subscribe(t)}))}var d=l(t);return new e((function(t){h(d,(function(e,r){if(t.next(e),t.closed)return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),t.complete()}))}})},76314:(t,e,r)=>{"use strict";r(63503),r(9818),r(38771)},38771:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(19429),o=n("Array");i({target:"Observable",stat:!0,forced:!0},{of:function(){for(var t=s(this)?this:n("Observable"),e=arguments.length,r=o(e),i=0;i{"use strict";r(41195)},40393:(t,e,r)=>{"use strict";r(87609)},6616:(t,e,r)=>{"use strict";var i=r(79989),n=r(48742),s=r(9302);i({target:"Promise",stat:!0,forced:!0},{try:function(t){var e=n.f(this),r=s(t);return(r.error?e.reject:e.resolve)(r.value),e.promise}})},90810:(t,e,r)=>{"use strict";r(13505)},19959:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.set;i({target:"Reflect",stat:!0},{defineMetadata:function(t,e,r){var i=arguments.length<4?void 0:o(arguments[3]);a(t,e,s(r),i)}})},73347:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.getMap,l=n.store;i({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var r=arguments.length<3?void 0:o(arguments[2]),i=a(s(e),r,!1);if(void 0===i||!i.delete(t))return!1;if(i.size)return!0;var n=l.get(e);return n.delete(r),!!n.size||l.delete(e)}})},70003:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(33666),o=r(85027),a=r(61868),l=n(r(12397)),c=n([].concat),h=s.keys,u=s.toKey,d=function(t,e){var r=h(t,e),i=a(t);if(null===i)return r;var n=d(i,e);return n.length?r.length?l(c(r,n)):n:r};i({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:u(arguments[1]);return d(o(t),e)}})},71913:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=r(61868),a=n.has,l=n.get,c=n.toKey,h=function(t,e,r){if(a(t,e,r))return l(t,e,r);var i=o(e);return null!==i?h(t,i,r):void 0};i({target:"Reflect",stat:!0},{getMetadata:function(t,e){var r=arguments.length<3?void 0:c(arguments[2]);return h(t,s(e),r)}})},7859:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.keys,a=n.toKey;i({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:a(arguments[1]);return o(s(t),e)}})},79955:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.get,a=n.toKey;i({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var r=arguments.length<3?void 0:a(arguments[2]);return o(t,s(e),r)}})},31138:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=r(61868),a=n.has,l=n.toKey,c=function(t,e,r){if(a(t,e,r))return!0;var i=o(e);return null!==i&&c(t,i,r)};i({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var r=arguments.length<3?void 0:l(arguments[2]);return c(t,s(e),r)}})},28809:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.has,a=n.toKey;i({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var r=arguments.length<3?void 0:a(arguments[2]);return o(t,s(e),r)}})},2946:(t,e,r)=>{"use strict";var i=r(79989),n=r(33666),s=r(85027),o=n.toKey,a=n.set;i({target:"Reflect",stat:!0},{metadata:function(t,e){return function(r,i){a(t,e,s(r),o(i))}}})},32460:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(34327),o=r(86350),a=n("".charCodeAt),l=n("".replace),c=RegExp("[!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^`{|}~"+o+"]","g");i({target:"RegExp",stat:!0,forced:!0},{escape:function(t){var e=s(t),r=a(e,0);return(r>47&&r<58?"\\x3":"")+l(e,c,"\\$&")}})},57282:(t,e,r)=>{"use strict";var i=r(79989),n=r(10029),s=r(61034).add;i({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,r=arguments.length;e{"use strict";var i=r(79989),n=r(10029),s=r(61034).remove;i({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(27748);i({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(t){return n(o,this,s(t))}})},15716:(t,e,r)=>{"use strict";var i=r(79989),n=r(27748);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("difference")},{difference:n})},30349:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!1!==o(e,(function(t){if(!r(t,t,e))return!1}),!0)}})},96986:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(61034),a=r(48774),l=o.Set,c=o.add;i({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t){r(t,t,e)&&c(i,t)})),i}})},95681:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=o(e,(function(t){if(r(t,t,e))return{value:t}}),!0);return i&&i.value}})},13781:(t,e,r)=>{"use strict";r(79989)({target:"Set",stat:!0,forced:!0},{from:r(28737)})},98873:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(72948);i({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(t){return n(o,this,s(t))}})},33442:(t,e,r)=>{"use strict";var i=r(79989),n=r(3689),s=r(72948);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("intersection")||n((function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:s})},50308:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(97795);i({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(t){return n(o,this,s(t))}})},61964:(t,e,r)=>{"use strict";var i=r(79989),n=r(97795);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isDisjointFrom")},{isDisjointFrom:n})},18955:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(26951);i({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(t){return n(o,this,s(t))}})},69878:(t,e,r)=>{"use strict";var i=r(79989),n=r(26951);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isSubsetOf")},{isSubsetOf:n})},65115:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(3894);i({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(t){return n(o,this,s(t))}})},52915:(t,e,r)=>{"use strict";var i=r(79989),n=r(3894);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("isSupersetOf")},{isSupersetOf:n})},19490:(t,e,r)=>{"use strict";var i=r(79989),n=r(68844),s=r(10029),o=r(48774),a=r(34327),l=n([].join),c=n([].push);i({target:"Set",proto:!0,real:!0,forced:!0},{join:function(t){var e=s(this),r=void 0===t?",":a(t),i=[];return o(e,(function(t){c(i,t)})),l(i,r)}})},95752:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(61034),a=r(48774),l=o.Set,c=o.add;i({target:"Set",proto:!0,real:!0,forced:!0},{map:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0),i=new l;return a(e,(function(t){c(i,r(t,t,e))})),i}})},32789:(t,e,r)=>{"use strict";r(79989)({target:"Set",stat:!0,forced:!0},{of:r(1114)})},27913:(t,e,r)=>{"use strict";var i=r(79989),n=r(10509),s=r(10029),o=r(48774),a=TypeError;i({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),r=arguments.length<2,i=r?void 0:arguments[1];if(n(t),o(e,(function(n){r?(r=!1,i=n):i=t(i,n,n,e)})),r)throw new a("Reduce of empty set with no initial value");return i}})},6831:(t,e,r)=>{"use strict";var i=r(79989),n=r(54071),s=r(10029),o=r(48774);i({target:"Set",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),r=n(t,arguments.length>1?arguments[1]:void 0);return!0===o(e,(function(t){if(r(t,t,e))return!0}),!0)}})},90243:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(62289);i({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(t){return n(o,this,s(t))}})},98686:(t,e,r)=>{"use strict";var i=r(79989),n=r(62289);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("symmetricDifference")},{symmetricDifference:n})},98030:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615),s=r(2939),o=r(75674);i({target:"Set",proto:!0,real:!0,forced:!0},{union:function(t){return n(o,this,s(t))}})},22275:(t,e,r)=>{"use strict";var i=r(79989),n=r(75674);i({target:"Set",proto:!0,real:!0,forced:!r(53234)("union")},{union:n})},86220:(t,e,r)=>{"use strict";var i=r(79989),n=r(10730).charAt,s=r(74684),o=r(68700),a=r(34327);i({target:"String",proto:!0,forced:!0},{at:function(t){var e=a(s(this)),r=e.length,i=o(t),l=i>=0?i:r+i;return l<0||l>=r?void 0:n(e,l)}})},95853:(t,e,r)=>{"use strict";var i=r(79989),n=r(30974),s=r(27807),o=r(74684),a=r(34327),l=r(618),c=r(10730),h=c.codeAt,u=c.charAt,d="String Iterator",p=l.set,f=l.getterFor(d),m=n((function(t){p(this,{type:d,string:t,index:0})}),"String",(function(){var t,e=f(this),r=e.string,i=e.index;return i>=r.length?s(void 0,!0):(t=u(r,i),e.index+=t.length,s({codePoint:h(t,0),position:i},!1))}));i({target:"String",proto:!0,forced:!0},{codePoints:function(){return new m(a(o(this)))}})},21917:(t,e,r)=>{"use strict";r(79989)({target:"String",stat:!0,forced:!0},{cooked:r(8195)})},66084:(t,e,r)=>{"use strict";var i=r(71594),n=r(79989),s=r(98702),o=r(68844),a=r(61735),l=r(85027),c=r(90690),h=r(69985),u=r(6310),d=r(72560).f,p=r(9015),f=r(16803),m=r(8195),g=r(98985),A=r(86350),y=new f.WeakMap,v=f.get,x=f.has,b=f.set,_=Array,w=TypeError,E=Object.freeze||Object,M=Object.isFrozen,S=Math.min,C=o("".charAt),T=o("".slice),I=o("".split),R=o(/./.exec),B=/([\n\u2028\u2029]|\r\n?)/g,L=RegExp("^["+A+"]*"),P=RegExp("[^"+A+"]"),D="Invalid tag",O=function(t,e){if(void 0===e||t===e)return t;for(var r=0,i=S(t.length,e.length);r0)throw new w("Invalid opening line");e[1]=""}if(p){if(1===e.length||R(P,e[e.length-1]))throw new w("Invalid closing line");e[e.length-2]="",e[e.length-1]=""}for(var f=2;f{"use strict";r(12281)},59012:(t,e,r)=>{"use strict";r(79866)},38320:(t,e,r)=>{"use strict";r(56532)},78988:(t,e,r)=>{"use strict";r(35237)},26810:(t,e,r)=>{"use strict";var i=r(79989),n=r(23622),s=r(61868),o=r(49385),a=r(8758),l=r(25391),c=r(75773),h=r(75684),u=r(65411),d=r(13841),p=r(44201)("toStringTag"),f=Error,m=function(t,e,r){var i,a=n(g,this);return o?i=o(new f,a?s(this):g):(i=a?this:l(g),c(i,p,"Error")),void 0!==r&&c(i,"message",d(r)),u(i,m,i.stack,1),c(i,"error",t),c(i,"suppressed",e),i};o?o(m,f):a(m,f,{name:!0});var g=m.prototype=l(f.prototype,{constructor:h(1,m),message:h(1,""),name:h(1,"SuppressedError")});i({global:!0,constructor:!0,arity:3},{SuppressedError:m})},80546:(t,e,r)=>{"use strict";var i=r(19037),n=r(35405),s=r(72560).f,o=r(82474).f,a=i.Symbol;if(n("asyncDispose"),a){var l=o(a,"asyncDispose");l.enumerable&&l.configurable&&l.writable&&s(a,"asyncDispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},62586:(t,e,r)=>{"use strict";var i=r(19037),n=r(35405),s=r(72560).f,o=r(82474).f,a=i.Symbol;if(n("dispose"),a){var l=o(a,"dispose");l.enumerable&&l.configurable&&l.writable&&s(a,"dispose",{value:l.value,enumerable:!1,configurable:!1,writable:!1})}},46019:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(18992)})},5010:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(18992)})},45749:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(8957)})},4835:(t,e,r)=>{"use strict";r(79989)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(8957)})},58799:(t,e,r)=>{"use strict";r(35405)("matcher")},27041:(t,e,r)=>{"use strict";r(35405)("metadataKey")},18134:(t,e,r)=>{"use strict";r(35405)("metadata")},44767:(t,e,r)=>{"use strict";r(35405)("observable")},92981:(t,e,r)=>{"use strict";r(35405)("patternMatch")},85044:(t,e,r)=>{"use strict";r(35405)("replaceAll")},96256:(t,e,r)=>{"use strict";r(95194)},18241:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filterReject,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filterOut",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},59359:(t,e,r)=>{"use strict";var i=r(54872),n=r(2960).filterReject,s=r(20716),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("filterReject",(function(t){var e=n(o(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},1274:(t,e,r)=>{"use strict";r(82)},54302:(t,e,r)=>{"use strict";r(20522)},76677:(t,e,r)=>{"use strict";var i=r(76058),n=r(52655),s=r(2231),o=r(54872),a=r(59976),l=o.aTypedArrayConstructor;(0,o.exportTypedArrayStaticMethod)("fromAsync",(function(t){var e=this,r=arguments.length,o=r>1?arguments[1]:void 0,c=r>2?arguments[2]:void 0;return new(i("Promise"))((function(r){n(e),r(s(t,o,c))})).then((function(t){return a(l(e),t)}))}),!0)},30548:(t,e,r)=>{"use strict";var i=r(54872),n=r(64976),s=r(47338),o=i.aTypedArray;(0,i.exportTypedArrayMethod)("groupBy",(function(t){var e=arguments.length>1?arguments[1]:void 0;return n(o(this),t,e,s)}),!0)},25298:(t,e,r)=>{"use strict";r(24224)},11882:(t,e,r)=>{"use strict";r(61121)},915:(t,e,r)=>{"use strict";var i=r(54872),n=r(6310),s=r(9401),o=r(27578),a=r(71530),l=r(68700),c=r(3689),h=i.aTypedArray,u=i.getTypedArrayConstructor,d=i.exportTypedArrayMethod,p=Math.max,f=Math.min;d("toSpliced",(function(t,e){var r,i,c,d,m,g,A,y=h(this),v=u(y),x=n(y),b=o(t,x),_=arguments.length,w=0;if(0===_)r=i=0;else if(1===_)r=0,i=x-b;else if(i=f(p(l(e),0),x-b),r=_-2){d=new v(r),c=s(d);for(var E=2;E<_;E++)m=arguments[E],d[E-2]=c?a(m):+m}for(A=new v(g=x+r-i);w{"use strict";var i=r(68844),n=r(54872),s=r(59976),o=r(12397),a=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,h=i(o);c("uniqueBy",(function(t){return a(this),s(l(this),h(this,t))}),!0)},17911:(t,e,r)=>{"use strict";r(37133)},23579:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(33425),a=r(51082),l=r(36812),c=r(59976),h=r(18368),u=r(9093),d=h.c2i,p=h.c2iUrl,f=n.Uint8Array,m=n.SyntaxError,g=s("".charAt),A=s("".replace),y=s("".slice),v=s([].push),x=/[\t\n\f\r ]/g,b="Extra bits";f&&i({target:"Uint8Array",stat:!0,forced:!0},{fromBase64:function(t){a(t);var e=arguments.length>1?o(arguments[1]):void 0,r="base64"===u(e)?d:p,i=!!e&&!!e.strict,n=i?t:A(t,x,"");if(n.length%4==0)"=="===y(n,-2)?n=y(n,0,-2):"="===y(n,-1)&&(n=y(n,0,-1));else if(i)throw new m("Input is not correctly padded");var s=n.length%4;switch(s){case 1:throw new m("Bad input length");case 2:n+="AA";break;case 3:n+="A"}for(var h=[],_=0,w=n.length,E=function(t){var e=g(n,_+t);if(!l(r,e))throw new m('Bad char in input: "'+e+'"');return r[e]<<18-6*t};_>16&255,M>>8&255,255&M)}var S=h.length;if(2===s){if(i&&0!==h[S-2])throw new m(b);S-=2}else if(3===s){if(i&&0!==h[S-1])throw new m(b);S--}return c(f,h,S)}})},91117:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(51082),a=n.Uint8Array,l=n.SyntaxError,c=n.parseInt,h=/[^\da-f]/i,u=s(h.exec),d=s("".slice);a&&i({target:"Uint8Array",stat:!0,forced:!0},{fromHex:function(t){o(t);var e=t.length;if(e%2)throw new l("String should have an even number of characters");if(u(h,t))throw new l("String should only contain hex characters");for(var r=new a(e/2),i=0;i{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(33425),a=r(95668),l=r(18368),c=r(9093),h=l.i2c,u=l.i2cUrl,d=n.Uint8Array,p=s("".charAt);d&&i({target:"Uint8Array",proto:!0,forced:!0},{toBase64:function(){for(var t,e=a(this),r=arguments.length?o(arguments[0]):void 0,i="base64"===c(r)?h:u,n="",s=0,l=e.length,d=function(e){return p(i,t>>6*e&63)};s+2{"use strict";var i=r(79989),n=r(19037),s=r(68844),o=r(95668),a=n.Uint8Array,l=s(1..toString);a&&i({target:"Uint8Array",proto:!0,forced:!0},{toHex:function(){o(this);for(var t="",e=0,r=this.length;e{"use strict";var i=r(79989),n=r(457),s=r(16803).remove;i({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";var i=r(79989),n=r(457),s=r(16803),o=s.get,a=s.has,l=s.set;i({target:"WeakMap",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var r,i,s=n(this);return a(s,t)?(r=o(s,t),"update"in e&&(r=e.update(r,t,s),l(s,t,r)),r):(i=e.insert(t,s),l(s,t,i),i)}})},99369:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",stat:!0,forced:!0},{from:r(28737)})},22983:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",stat:!0,forced:!0},{of:r(1114)})},13466:(t,e,r)=>{"use strict";r(79989)({target:"WeakMap",proto:!0,real:!0,forced:!0},{upsert:r(41432)})},23321:(t,e,r)=>{"use strict";var i=r(79989),n=r(53499),s=r(78616).add;i({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,r=arguments.length;e{"use strict";var i=r(79989),n=r(53499),s=r(78616).remove;i({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),r=!0,i=0,o=arguments.length;i{"use strict";r(79989)({target:"WeakSet",stat:!0,forced:!0},{from:r(28737)})},45738:(t,e,r)=>{"use strict";r(79989)({target:"WeakSet",stat:!0,forced:!0},{of:r(1114)})},52586:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(68844),a=r(22615),l=r(3689),c=r(34327),h=r(21500),u=r(18368).c2i,d=/[^\d+/a-z]/i,p=/[\t\n\f\r ]+/g,f=/[=]{1,2}$/,m=s("atob"),g=String.fromCharCode,A=o("".charAt),y=o("".replace),v=o(d.exec),x=!!m&&!l((function(){return"hi"!==m("aGk=")})),b=x&&l((function(){return""!==m(" ")})),_=x&&!l((function(){m("a")})),w=x&&!l((function(){m()})),E=x&&1!==m.length;i({global:!0,bind:!0,enumerable:!0,forced:!x||b||_||w||E},{atob:function(t){if(h(arguments.length,1),x&&!b&&!_)return a(m,n,t);var e,r,i,o=y(c(t),p,""),l="",w=0,E=0;if(o.length%4==0&&(o=y(o,f,"")),(e=o.length)%4==1||v(d,o))throw new(s("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;w>(-2*E&6)));return l}})},84645:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(68844),a=r(22615),l=r(3689),c=r(34327),h=r(21500),u=r(18368).i2c,d=s("btoa"),p=o("".charAt),f=o("".charCodeAt),m=!!d&&!l((function(){return"aGk="!==d("hi")})),g=m&&!l((function(){d()})),A=m&&l((function(){return"bnVsbA=="!==d(null)})),y=m&&1!==d.length;i({global:!0,bind:!0,enumerable:!0,forced:!m||g||A||y},{btoa:function(t){if(h(arguments.length,1),m)return a(d,n,c(t));for(var e,r,i=c(t),o="",l=0,g=u;p(i,l)||(g="=",l%1);){if((r=f(i,l+=3/4))>255)throw new(s("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");o+=p(g,63&(e=e<<8|r)>>8-l%1*8)}return o}})},19742:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(99886).clear;i({global:!0,bind:!0,enumerable:!0,forced:n.clearImmediate!==s},{clearImmediate:s})},47522:(t,e,r)=>{"use strict";var i=r(19037),n=r(66338),s=r(33265),o=r(57612),a=r(75773),l=function(t){if(t&&t.forEach!==o)try{a(t,"forEach",o)}catch(e){t.forEach=o}};for(var c in n)n[c]&&l(i[c]&&i[c].prototype);l(s)},76265:(t,e,r)=>{"use strict";var i=r(19037),n=r(66338),s=r(33265),o=r(752),a=r(75773),l=r(55997),c=r(44201)("iterator"),h=o.values,u=function(t,e){if(t){if(t[c]!==h)try{a(t,c,h)}catch(e){t[c]=h}if(l(t,e,!0),n[e])for(var r in o)if(t[r]!==o[r])try{a(t,r,o[r])}catch(e){t[r]=o[r]}}};for(var d in n)u(i[d]&&i[d].prototype,d);u(s,"DOMTokenList")},97337:(t,e,r)=>{"use strict";var i=r(79989),n=r(21905),s=r(76058),o=r(3689),a=r(25391),l=r(75684),c=r(72560).f,h=r(11880),u=r(62148),d=r(36812),p=r(767),f=r(85027),m=r(20445),g=r(13841),A=r(37136),y=r(56610),v=r(618),x=r(67697),b=r(53931),_="DOMException",w="DATA_CLONE_ERR",E=s("Error"),M=s(_)||function(){try{(new(s("MessageChannel")||n("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(t){if(t.name===w&&25===t.code)return t.constructor}}(),S=M&&M.prototype,C=E.prototype,T=v.set,I=v.getterFor(_),R="stack"in new E(_),B=function(t){return d(A,t)&&A[t].m?A[t].c:0},L=function(){p(this,P);var t=arguments.length,e=g(t<1?void 0:arguments[0]),r=g(t<2?void 0:arguments[1],"Error"),i=B(r);if(T(this,{type:_,name:r,message:e,code:i}),x||(this.name=r,this.message=e,this.code=i),R){var n=new E(e);n.name=_,c(this,"stack",l(1,y(n.stack,1)))}},P=L.prototype=a(C),D=function(t){return{enumerable:!0,configurable:!0,get:t}},O=function(t){return D((function(){return I(this)[t]}))};x&&(u(P,"code",O("code")),u(P,"message",O("message")),u(P,"name",O("name"))),c(P,"constructor",l(1,L));var k=o((function(){return!(new M instanceof E)})),U=k||o((function(){return C.toString!==m||"2: 1"!==String(new M(1,2))})),N=k||o((function(){return 25!==new M(1,"DataCloneError").code})),F=k||25!==M[w]||25!==S[w],z=b?U||N||F:k;i({global:!0,constructor:!0,forced:z},{DOMException:z?L:M});var G=s(_),Q=G.prototype;for(var j in U&&(b||M===G)&&h(Q,"toString",m),N&&x&&M===G&&u(Q,"code",D((function(){return B(f(this).name)}))),A)if(d(A,j)){var V=A[j],H=V.s,W=l(6,V.c);d(G,H)||c(G,H,W),d(Q,H)||c(Q,H,W)}},13429:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(76058),o=r(75684),a=r(72560).f,l=r(36812),c=r(767),h=r(33457),u=r(13841),d=r(37136),p=r(56610),f=r(67697),m=r(53931),g="DOMException",A=s("Error"),y=s(g),v=function(){c(this,x);var t=arguments.length,e=u(t<1?void 0:arguments[0]),r=u(t<2?void 0:arguments[1],"Error"),i=new y(e,r),n=new A(e);return n.name=g,a(i,"stack",o(1,p(n.stack,1))),h(i,this,v),i},x=v.prototype=y.prototype,b="stack"in new A(g),_="stack"in new y(1,2),w=y&&f&&Object.getOwnPropertyDescriptor(n,g),E=!(!w||w.writable&&w.configurable),M=b&&!E&&!_;i({global:!0,constructor:!0,forced:m||M},{DOMException:M?v:y});var S=s(g),C=S.prototype;if(C.constructor!==S)for(var T in m||a(C,"constructor",o(1,S)),d)if(l(d,T)){var I=d[T],R=I.s;l(S,R)||a(S,R,o(6,I.c))}},37462:(t,e,r)=>{"use strict";var i=r(76058),n="DOMException";r(55997)(i(n),n)},40088:(t,e,r)=>{"use strict";r(19742),r(52731)},10455:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(80231),o=r(10509),a=r(21500),l=r(50806),c=n.process;i({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){a(arguments.length,1),o(t);var e=l&&c.domain;s(e?e.bind(t):t)}})},3650:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(62148),o=r(67697),a=TypeError,l=Object.defineProperty,c=n.self!==n;try{if(o){var h=Object.getOwnPropertyDescriptor(n,"self");!c&&h&&h.get&&h.enumerable||s(n,"self",{get:function(){return n},set:function(t){if(this!==n)throw new a("Illegal invocation");l(n,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else i({global:!0,simple:!0,forced:c},{self:n})}catch(t){}},52731:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(99886).set,o=r(8552),a=n.setImmediate?o(s,!1):s;i({global:!0,bind:!0,enumerable:!0,forced:n.setImmediate!==a},{setImmediate:a})},10209:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(8552)(n.setInterval,!0);i({global:!0,bind:!0,forced:n.setInterval!==s},{setInterval:s})},83509:(t,e,r)=>{"use strict";var i=r(79989),n=r(19037),s=r(8552)(n.setTimeout,!0);i({global:!0,bind:!0,forced:n.setTimeout!==s},{setTimeout:s})},25564:(t,e,r)=>{"use strict";var i,n=r(53931),s=r(79989),o=r(19037),a=r(76058),l=r(68844),c=r(3689),h=r(14630),u=r(69985),d=r(19429),p=r(981),f=r(48999),m=r(30734),g=r(18734),A=r(85027),y=r(50926),v=r(36812),x=r(76522),b=r(75773),_=r(6310),w=r(21500),E=r(63477),M=r(83914),S=r(61034),C=r(48774),T=r(21420),I=r(49599),R=r(63514),B=o.Object,L=o.Array,P=o.Date,D=o.Error,O=o.TypeError,k=o.PerformanceMark,U=a("DOMException"),N=M.Map,F=M.has,z=M.get,G=M.set,Q=S.Set,j=S.add,V=S.has,H=a("Object","keys"),W=l([].push),q=l((!0).valueOf),Z=l(1..valueOf),Y=l("".valueOf),X=l(P.prototype.getTime),J=h("structuredClone"),K="DataCloneError",$="Transferring",tt=function(t){return!c((function(){var e=new o.Set([7]),r=t(e),i=t(B(7));return r===e||!r.has(7)||!f(i)||7!=+i}))&&t},et=function(t,e){return!c((function(){var r=new e,i=t({a:r,b:r});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===r.stack)}))},rt=o.structuredClone,it=n||!et(rt,D)||!et(rt,U)||(i=rt,!!c((function(){var t=i(new o.AggregateError([1],J,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==J||3!==t.cause}))),nt=!rt&&tt((function(t){return new k(J,{detail:t}).detail})),st=tt(rt)||nt,ot=function(t){throw new U("Uncloneable type: "+t,K)},at=function(t,e){throw new U((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",K)},lt=function(t,e){return st||at(e),st(t)},ct=function(t,e,r){if(F(e,t))return z(e,t);var i,n,s,a,l,c;if("SharedArrayBuffer"===(r||y(t)))i=st?st(t):t;else{var h=o.DataView;h||u(t.slice)||at("ArrayBuffer");try{if(u(t.slice)&&!t.resizable)i=t.slice(0);else{n=t.byteLength,s="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0,i=new ArrayBuffer(n,s),a=new h(t),l=new h(i);for(c=0;c1&&!p(arguments[1])?A(arguments[1]):void 0,n=i?i.transfer:void 0;void 0!==n&&(r=function(t,e){if(!f(t))throw new O("Transfer option cannot be converted to a sequence");var r=[];g(t,(function(t){W(r,A(t))}));for(var i,n,s,a,l,c=0,h=_(r),p=new Q;c{"use strict";r(10209),r(83509)},2625:(t,e,r)=>{"use strict";r(752);var i=r(79989),n=r(19037),s=r(22615),o=r(68844),a=r(67697),l=r(76837),c=r(11880),h=r(62148),u=r(6045),d=r(55997),p=r(30974),f=r(618),m=r(767),g=r(69985),A=r(36812),y=r(54071),v=r(50926),x=r(85027),b=r(48999),_=r(34327),w=r(25391),E=r(75684),M=r(5185),S=r(91664),C=r(27807),T=r(21500),I=r(44201),R=r(50382),B=I("iterator"),L="URLSearchParams",P=L+"Iterator",D=f.set,O=f.getterFor(L),k=f.getterFor(P),U=Object.getOwnPropertyDescriptor,N=function(t){if(!a)return n[t];var e=U(n,t);return e&&e.value},F=N("fetch"),z=N("Request"),G=N("Headers"),Q=z&&z.prototype,j=G&&G.prototype,V=n.RegExp,H=n.TypeError,W=n.decodeURIComponent,q=n.encodeURIComponent,Z=o("".charAt),Y=o([].join),X=o([].push),J=o("".replace),K=o([].shift),$=o([].splice),tt=o("".split),et=o("".slice),rt=/\+/g,it=Array(4),nt=function(t){return it[t-1]||(it[t-1]=V("((?:%[\\da-f]{2}){"+t+"})","gi"))},st=function(t){try{return W(t)}catch(e){return t}},ot=function(t){var e=J(t,rt," "),r=4;try{return W(e)}catch(t){for(;r;)e=J(e,nt(r--),st);return e}},at=/[!'()~]|%20/g,lt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ct=function(t){return lt[t]},ht=function(t){return J(q(t),at,ct)},ut=p((function(t,e){D(this,{type:P,target:O(t).entries,index:0,kind:e})}),L,(function(){var t=k(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,C(void 0,!0);var i=e[r];switch(t.kind){case"keys":return C(i.key,!1);case"values":return C(i.value,!1)}return C([i.key,i.value],!1)}),!0),dt=function(t){this.entries=[],this.url=null,void 0!==t&&(b(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Z(t,0)?et(t,1):t:_(t)))};dt.prototype={type:L,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,i,n,o,a,l,c=this.entries,h=S(t);if(h)for(r=(e=M(t,h)).next;!(i=s(r,e)).done;){if(o=(n=M(x(i.value))).next,(a=s(o,n)).done||(l=s(o,n)).done||!s(o,n).done)throw new H("Expected sequence with length 2");X(c,{key:_(a.value),value:_(l.value)})}else for(var u in t)A(t,u)&&X(c,{key:u,value:_(t[u])})},parseQuery:function(t){if(t)for(var e,r,i=this.entries,n=tt(t,"&"),s=0;s0?arguments[0]:void 0));a||(this.size=t.entries.length)},ft=pt.prototype;if(u(ft,{append:function(t,e){var r=O(this);T(arguments.length,2),X(r.entries,{key:_(t),value:_(e)}),a||this.length++,r.updateURL()},delete:function(t){for(var e=O(this),r=T(arguments.length,1),i=e.entries,n=_(t),s=r<2?void 0:arguments[1],o=void 0===s?s:_(s),l=0;le.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=O(this).entries,i=y(t,arguments.length>1?arguments[1]:void 0),n=0;n1?At(arguments[1]):{})}}),g(z)){var yt=function(t){return m(this,Q),new z(t,arguments.length>1?At(arguments[1]):{})};Q.constructor=yt,yt.prototype=Q,i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:yt})}}t.exports={URLSearchParams:pt,getState:O}},98858:(t,e,r)=>{"use strict";var i=r(11880),n=r(68844),s=r(34327),o=r(21500),a=URLSearchParams,l=a.prototype,c=n(l.append),h=n(l.delete),u=n(l.forEach),d=n([].push),p=new a("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&i(l,"delete",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=[];u(this,(function(t,e){d(i,{key:e,value:t})})),o(e,1);for(var n,a=s(t),l=s(r),p=0,f=0,m=!1,g=i.length;p{"use strict";var i=r(11880),n=r(68844),s=r(34327),o=r(21500),a=URLSearchParams,l=a.prototype,c=n(l.getAll),h=n(l.has),u=new a("a=1");!u.has("a",2)&&u.has("a",void 0)||i(l,"has",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=c(this,t);o(e,1);for(var n=s(r),a=0;a{"use strict";r(2625)},33228:(t,e,r)=>{"use strict";var i=r(67697),n=r(68844),s=r(62148),o=URLSearchParams.prototype,a=n(o.forEach);i&&!("size"in o)&&s(o,"size",{get:function(){var t=0;return a(this,(function(){t++})),t},configurable:!0,enumerable:!0})},69822:(t,e,r)=>{"use strict";var i=r(79989),n=r(76058),s=r(3689),o=r(21500),a=r(34327),l=r(76837),c=n("URL");i({target:"URL",stat:!0,forced:!(l&&s((function(){c.canParse()})))},{canParse:function(t){var e=o(arguments.length,1),r=a(t),i=e<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return!!new c(r,i)}catch(t){return!1}}})},79391:(t,e,r)=>{"use strict";r(21694);var i,n=r(79989),s=r(67697),o=r(76837),a=r(19037),l=r(54071),c=r(68844),h=r(11880),u=r(62148),d=r(767),p=r(36812),f=r(45394),m=r(21055),g=r(9015),A=r(10730).codeAt,y=r(6430),v=r(34327),x=r(55997),b=r(21500),_=r(2625),w=r(618),E=w.set,M=w.getterFor("URL"),S=_.URLSearchParams,C=_.getState,T=a.URL,I=a.TypeError,R=a.parseInt,B=Math.floor,L=Math.pow,P=c("".charAt),D=c(/./.exec),O=c([].join),k=c(1..toString),U=c([].pop),N=c([].push),F=c("".replace),z=c([].shift),G=c("".split),Q=c("".slice),j=c("".toLowerCase),V=c([].unshift),H="Invalid scheme",W="Invalid host",q="Invalid port",Z=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,J=/^0x/i,K=/^[0-7]+$/,$=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,rt=/[\0\t\n\r #/:<>?@[\\\]^|]/,it=/^[\u0000-\u0020]+/,nt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,st=/[\t\n\r]/g,ot=function(t){var e,r,i,n;if("number"==typeof t){for(e=[],r=0;r<4;r++)V(e,t%256),t=B(t/256);return O(e,".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,r=1,i=null,n=0,s=0;s<8;s++)0!==t[s]?(n>r&&(e=i,r=n),i=null,n=0):(null===i&&(i=s),++n);return n>r&&(e=i,r=n),e}(t),r=0;r<8;r++)n&&0===t[r]||(n&&(n=!1),i===r?(e+=r?":":"::",n=!0):(e+=k(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},at={},lt=f({},at,{" ":1,'"':1,"<":1,">":1,"`":1}),ct=f({},lt,{"#":1,"?":1,"{":1,"}":1}),ht=f({},ct,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ut=function(t,e){var r=A(t,0);return r>32&&r<127&&!p(e,t)?t:encodeURIComponent(t)},dt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pt=function(t,e){var r;return 2===t.length&&D(Z,P(t,0))&&(":"===(r=P(t,1))||!e&&"|"===r)},ft=function(t){var e;return t.length>1&&pt(Q(t,0,2))&&(2===t.length||"/"===(e=P(t,2))||"\\"===e||"?"===e||"#"===e)},mt=function(t){return"."===t||"%2e"===j(t)},gt={},At={},yt={},vt={},xt={},bt={},_t={},wt={},Et={},Mt={},St={},Ct={},Tt={},It={},Rt={},Bt={},Lt={},Pt={},Dt={},Ot={},kt={},Ut=function(t,e,r){var i,n,s,o=v(t);if(e){if(n=this.parse(o))throw new I(n);this.searchParams=null}else{if(void 0!==r&&(i=new Ut(r,!0)),n=this.parse(o,null,i))throw new I(n);(s=C(new S)).bindURL(this),this.searchParams=s}};Ut.prototype={type:"URL",parse:function(t,e,r){var n,s,o,a,l,c=this,h=e||gt,u=0,d="",f=!1,A=!1,y=!1;for(t=v(t),e||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=F(t,it,""),t=F(t,nt,"$1")),t=F(t,st,""),n=m(t);u<=n.length;){switch(s=n[u],h){case gt:if(!s||!D(Z,s)){if(e)return H;h=yt;continue}d+=j(s),h=At;break;case At:if(s&&(D(Y,s)||"+"===s||"-"===s||"."===s))d+=j(s);else{if(":"!==s){if(e)return H;d="",h=yt,u=0;continue}if(e&&(c.isSpecial()!==p(dt,d)||"file"===d&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=d,e)return void(c.isSpecial()&&dt[c.scheme]===c.port&&(c.port=null));d="","file"===c.scheme?h=It:c.isSpecial()&&r&&r.scheme===c.scheme?h=vt:c.isSpecial()?h=wt:"/"===n[u+1]?(h=xt,u++):(c.cannotBeABaseURL=!0,N(c.path,""),h=Dt)}break;case yt:if(!r||r.cannotBeABaseURL&&"#"!==s)return H;if(r.cannotBeABaseURL&&"#"===s){c.scheme=r.scheme,c.path=g(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,h=kt;break}h="file"===r.scheme?It:bt;continue;case vt:if("/"!==s||"/"!==n[u+1]){h=bt;continue}h=Et,u++;break;case xt:if("/"===s){h=Mt;break}h=Pt;continue;case bt:if(c.scheme=r.scheme,s===i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query;else if("/"===s||"\\"===s&&c.isSpecial())h=_t;else if("?"===s)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query="",h=Ot;else{if("#"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.path.length--,h=Pt;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=g(r.path),c.query=r.query,c.fragment="",h=kt}break;case _t:if(!c.isSpecial()||"/"!==s&&"\\"!==s){if("/"!==s){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,h=Pt;continue}h=Mt}else h=Et;break;case wt:if(h=Et,"/"!==s||"/"!==P(d,u+1))continue;u++;break;case Et:if("/"!==s&&"\\"!==s){h=Mt;continue}break;case Mt:if("@"===s){f&&(d="%40"+d),f=!0,o=m(d);for(var x=0;x65535)return q;c.port=c.isSpecial()&&w===dt[c.scheme]?null:w,d=""}if(e)return;h=Lt;continue}return q}d+=s;break;case It:if(c.scheme="file","/"===s||"\\"===s)h=Rt;else{if(!r||"file"!==r.scheme){h=Pt;continue}switch(s){case i:c.host=r.host,c.path=g(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=g(r.path),c.query="",h=Ot;break;case"#":c.host=r.host,c.path=g(r.path),c.query=r.query,c.fragment="",h=kt;break;default:ft(O(g(n,u),""))||(c.host=r.host,c.path=g(r.path),c.shortenPath()),h=Pt;continue}}break;case Rt:if("/"===s||"\\"===s){h=Bt;break}r&&"file"===r.scheme&&!ft(O(g(n,u),""))&&(pt(r.path[0],!0)?N(c.path,r.path[0]):c.host=r.host),h=Pt;continue;case Bt:if(s===i||"/"===s||"\\"===s||"?"===s||"#"===s){if(!e&&pt(d))h=Pt;else if(""===d){if(c.host="",e)return;h=Lt}else{if(a=c.parseHost(d))return a;if("localhost"===c.host&&(c.host=""),e)return;d="",h=Lt}continue}d+=s;break;case Lt:if(c.isSpecial()){if(h=Pt,"/"!==s&&"\\"!==s)continue}else if(e||"?"!==s)if(e||"#"!==s){if(s!==i&&(h=Pt,"/"!==s))continue}else c.fragment="",h=kt;else c.query="",h=Ot;break;case Pt:if(s===i||"/"===s||"\\"===s&&c.isSpecial()||!e&&("?"===s||"#"===s)){if(".."===(l=j(l=d))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===s||"\\"===s&&c.isSpecial()||N(c.path,"")):mt(d)?"/"===s||"\\"===s&&c.isSpecial()||N(c.path,""):("file"===c.scheme&&!c.path.length&&pt(d)&&(c.host&&(c.host=""),d=P(d,0)+":"),N(c.path,d)),d="","file"===c.scheme&&(s===i||"?"===s||"#"===s))for(;c.path.length>1&&""===c.path[0];)z(c.path);"?"===s?(c.query="",h=Ot):"#"===s&&(c.fragment="",h=kt)}else d+=ut(s,ct);break;case Dt:"?"===s?(c.query="",h=Ot):"#"===s?(c.fragment="",h=kt):s!==i&&(c.path[0]+=ut(s,at));break;case Ot:e||"#"!==s?s!==i&&("'"===s&&c.isSpecial()?c.query+="%27":c.query+="#"===s?"%23":ut(s,at)):(c.fragment="",h=kt);break;case kt:s!==i&&(c.fragment+=ut(s,lt))}u++}},parseHost:function(t){var e,r,i;if("["===P(t,0)){if("]"!==P(t,t.length-1))return W;if(e=function(t){var e,r,i,n,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,h=null,u=0,d=function(){return P(t,u)};if(":"===d()){if(":"!==P(t,1))return;u+=2,h=++c}for(;d();){if(8===c)return;if(":"!==d()){for(e=r=0;r<4&&D(tt,d());)e=16*e+R(d(),16),u++,r++;if("."===d()){if(0===r)return;if(u-=r,c>6)return;for(i=0;d();){if(n=null,i>0){if(!("."===d()&&i<4))return;u++}if(!D(X,d()))return;for(;D(X,d());){if(s=R(d(),10),null===n)n=s;else{if(0===n)return;n=10*n+s}if(n>255)return;u++}l[c]=256*l[c]+n,2!=++i&&4!==i||c++}if(4!==i)return;break}if(":"===d()){if(u++,!d())return}else if(d())return;l[c++]=e}else{if(null!==h)return;u++,h=++c}}if(null!==h)for(o=c-h,c=7;0!==c&&o>0;)a=l[c],l[c--]=l[h+o-1],l[h+--o]=a;else if(8!==c)return;return l}(Q(t,1,-1)),!e)return W;this.host=e}else if(this.isSpecial()){if(t=y(t),D(et,t))return W;if(e=function(t){var e,r,i,n,s,o,a,l=G(t,".");if(l.length&&""===l[l.length-1]&&l.length--,(e=l.length)>4)return t;for(r=[],i=0;i1&&"0"===P(n,0)&&(s=D(J,n)?16:8,n=Q(n,8===s?1:2)),""===n)o=0;else{if(!D(10===s?$:8===s?K:tt,n))return t;o=R(n,s)}N(r,o)}for(i=0;i=L(256,5-e))return null}else if(o>255)return null;for(a=U(r),i=0;i1?arguments[1]:void 0,i=E(e,new Ut(t,!1,r));s||(e.href=i.serialize(),e.origin=i.getOrigin(),e.protocol=i.getProtocol(),e.username=i.getUsername(),e.password=i.getPassword(),e.host=i.getHost(),e.hostname=i.getHostname(),e.port=i.getPort(),e.pathname=i.getPathname(),e.search=i.getSearch(),e.searchParams=i.getSearchParams(),e.hash=i.getHash())},Ft=Nt.prototype,zt=function(t,e){return{get:function(){return M(this)[t]()},set:e&&function(t){return M(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(u(Ft,"href",zt("serialize","setHref")),u(Ft,"origin",zt("getOrigin")),u(Ft,"protocol",zt("getProtocol","setProtocol")),u(Ft,"username",zt("getUsername","setUsername")),u(Ft,"password",zt("getPassword","setPassword")),u(Ft,"host",zt("getHost","setHost")),u(Ft,"hostname",zt("getHostname","setHostname")),u(Ft,"port",zt("getPort","setPort")),u(Ft,"pathname",zt("getPathname","setPathname")),u(Ft,"search",zt("getSearch","setSearch")),u(Ft,"searchParams",zt("getSearchParams")),u(Ft,"hash",zt("getHash","setHash"))),h(Ft,"toJSON",(function(){return M(this).serialize()}),{enumerable:!0}),h(Ft,"toString",(function(){return M(this).serialize()}),{enumerable:!0}),T){var Gt=T.createObjectURL,Qt=T.revokeObjectURL;Gt&&h(Nt,"createObjectURL",l(Gt,T)),Qt&&h(Nt,"revokeObjectURL",l(Qt,T))}x(Nt,"URL"),n({global:!0,constructor:!0,forced:!o,sham:!s},{URL:Nt})},78730:(t,e,r)=>{"use strict";r(79391)},19979:(t,e,r)=>{"use strict";var i=r(79989),n=r(22615);i({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return n(URL.prototype.toString,this)}})},92294:(t,e,r)=>{"use strict";r.d(e,{TE:()=>Lr,th:()=>Hr});var i={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",private:!0,default:0,minimum:0,maximum:1,doc:"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{js:"v2.10.0",android:"10.7.0",ios:"10.7.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0",android:"10.0.0",ios:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0",android:"10.0.0",ios:"10.0.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0",ios:"4.1.0",macos:"0.8.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."},globe:{doc:"A globe projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",requires:["source"],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{js:"2.10.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",requires:["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"2.10.0",android:"10.7.0",ios:"10.7.0"}}}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0",macos:"10.5.0"}},"property-type":"constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={},o={exports:{}};!function(t,e){!function(r){var i=e&&!e.nodeType&&e,s=t&&!t.nodeType&&t,o="object"==typeof n&&n;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var a,l,c=2147483647,h=36,u=26,d=38,p=700,f=/^xn--/,m=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=h-1,v=Math.floor,x=String.fromCharCode;function b(t){throw RangeError(A[t])}function _(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function w(t,e){var r=t.split("@"),i="";return r.length>1&&(i=r[0]+"@",t=r[1]),i+_((t=t.replace(g,".")).split("."),e).join(".")}function E(t){for(var e,r,i=[],n=0,s=t.length;n=55296&&e<=56319&&n65535&&(e+=x((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+x(t)})).join("")}function S(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function C(t,e,r){var i=0;for(t=r?v(t/p):t>>1,t+=v(t/e);t>y*u>>1;i+=h)t=v(t/y);return v(i+(y+1)*t/(t+d))}function T(t){var e,r,i,n,s,o,a,l,d,p,f,m=[],g=t.length,A=0,y=128,x=72;for((r=t.lastIndexOf("-"))<0&&(r=0),i=0;i=128&&b("not-basic"),m.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=g&&b("invalid-input"),((l=(f=t.charCodeAt(n++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:h)>=h||l>v((c-A)/o))&&b("overflow"),A+=l*o,!(l<(d=a<=x?1:a>=x+u?u:a-x));a+=h)o>v(c/(p=h-d))&&b("overflow"),o*=p;x=C(A-s,e=m.length+1,0==s),v(A/e)>c-y&&b("overflow"),y+=v(A/e),A%=e,m.splice(A++,0,y)}return M(m)}function I(t){var e,r,i,n,s,o,a,l,d,p,f,m,g,A,y,_=[];for(m=(t=E(t)).length,e=128,r=0,s=72,o=0;o=e&&fv((c-r)/(g=i+1))&&b("overflow"),r+=(a-e)*g,e=a,o=0;oc&&b("overflow"),f==e){for(l=r,d=h;!(l<(p=d<=s?1:d>=s+u?u:d-s));d+=h)y=l-p,A=h-p,_.push(x(S(p+y%A,0))),l=v(y/A);_.push(x(S(l,0))),s=C(r,g,i==n),r=0,++i}++r,++e}return _.join("")}if(a={version:"1.3.2",ucs2:{decode:E,encode:M},decode:T,encode:I,toASCII:function(t){return w(t,(function(t){return m.test(t)?"xn--"+I(t):t}))},toUnicode:function(t){return w(t,(function(t){return f.test(t)?T(t.slice(4).toLowerCase()):t}))}},i&&s)if(t.exports==i)s.exports=a;else for(l in a)a.hasOwnProperty(l)&&(i[l]=a[l]);else r.punycode=a}(n)}(o,o.exports);var a={};function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var c=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};a.decode=a.parse=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var s=/\+/g;t=t.split(e);var o=1e3;i&&"number"==typeof i.maxKeys&&(o=i.maxKeys);var a=t.length;o>0&&a>o&&(a=o);for(var c=0;c=0?(h=f.substr(0,m),u=f.substr(m+1)):(h=f,u=""),d=decodeURIComponent(h),p=decodeURIComponent(u),l(n,d)?Array.isArray(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n},a.encode=a.stringify=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var n=encodeURIComponent(c(i))+r;return Array.isArray(t[i])?t[i].map((function(t){return n+encodeURIComponent(c(t))})).join(e):n+encodeURIComponent(c(t[i]))})).join(e):i?encodeURIComponent(c(i))+r+encodeURIComponent(c(t)):""};var h=o.exports,u=function(t){return"string"==typeof t},d=function(t){return"object"==typeof t&&null!==t},p=function(t){return null===t},f=function(t){return null==t};function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}s.parse=I,s.resolve=function(t,e){return I(t,!1,!0).resolve(e)},s.resolveObject=function(t,e){return t?I(t,!1,!0).resolveObject(e):e},s.format=function(t){return u(t)&&(t=I(t)),t instanceof m?t.format():m.prototype.format.call(t)},s.Url=m;var g=/^([a-z0-9.+-]+:)/i,A=/:[0-9]*$/,y=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,v=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),x=["'"].concat(v),b=["%","/","?",";","#"].concat(x),_=["/","?","#"],w=/^[+a-z0-9A-Z_-]{0,63}$/,E=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},C={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=a;function I(t,e,r){if(t&&d(t)&&t instanceof m)return t;var i=new m;return i.parse(t,e,r),i}function R(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}m.prototype.parse=function(t,e,r){if(!u(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i127?P+="x":P+=L[D];if(!P.match(w)){var k=R.slice(0,A),U=R.slice(A+1),N=L.match(E);N&&(k.push(N[1]),U.unshift(N[2])),U.length&&(o="/"+U.join(".")+o),this.hostname=k.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=h.toASCII(this.hostname));var F=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+F,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!M[c])for(A=0,B=x.length;A0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift())),r.search=t.search,r.query=t.query,p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!w.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=w.slice(-1)[0],T=(r.host||t.host||w.length>1)&&("."===M||".."===M)||""===M,I=0,R=w.length;R>=0;R--)"."===(M=w[R])?w.splice(R,1):".."===M?(w.splice(R,1),I++):I&&(w.splice(R,1),I--);if(!b&&!_)for(;I--;I)w.unshift("..");!b||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),T&&"/"!==w.join("/").substr(-1)&&w.push("");var B,L=""===w[0]||w[0]&&"/"===w[0].charAt(0);return E&&(r.hostname=r.host=L?"":w.length?w.shift():"",(B=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=B.shift(),r.host=r.hostname=B.shift())),(b=b||r.host&&w.length)&&!L&&w.unshift(""),w.length?r.pathname=w.join("/"):(r.pathname=null,r.path=null),p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},m.prototype.parseHost=function(){var t=this.host,e=A.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};class B extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}var L=B;class P{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,r]of e)this.bindings[t]=r}concat(t){return new P(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}var D=P;const O={kind:"null"},k={kind:"number"},U={kind:"string"},N={kind:"boolean"},F={kind:"color"},z={kind:"object"},G={kind:"value"},Q={kind:"collator"},j={kind:"formatted"},V={kind:"resolvedImage"};function H(t,e){return{kind:"array",itemType:t,N:e}}function W(t){if("array"===t.kind){const e=W(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const q=[O,k,U,N,F,j,z,H(G),V];function Z(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Z(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of q)if(!Z(t,e))return null}return`Expected ${W(t)} but found ${W(e)} instead.`}function Y(t,e){return e.some((e=>e.kind===t.kind))}function X(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var J,K={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 $(t){return(t=Math.round(t))<0?0:t>255?255:t}function tt(t){return t<0?0:t>1?1:t}function et(t){return"%"===t[t.length-1]?$(parseFloat(t)/100*255):$(parseInt(t))}function rt(t){return"%"===t[t.length-1]?tt(parseFloat(t)/100):tt(parseFloat(t))}function it(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{J={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in K)return K[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.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===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var s=r.substr(0,i),o=r.substr(i+1,n-(i+1)).split(","),a=1;switch(s){case"rgba":if(4!==o.length)return null;a=rt(o.pop());case"rgb":return 3!==o.length?null:[et(o[0]),et(o[1]),et(o[2]),a];case"hsla":if(4!==o.length)return null;a=rt(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,c=rt(o[1]),h=rt(o[2]),u=h<=.5?h*(c+1):h+c-h*c,d=2*h-u;return[$(255*it(d,u,l+1/3)),$(255*it(d,u,l)),$(255*it(d,u,l-1/3)),a];default:return null}}return null}}catch(t){}class nt{constructor(t,e,r,i=1){this.r=t,this.g=e,this.b=r,this.a=i}static parse(t){if(!t)return;if(t instanceof nt)return t;if("string"!=typeof t)return;const e=J(t);return e?new nt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,r,i]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(r)},${i})`}toArray(){const{r:t,g:e,b:r,a:i}=this;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*r/i,i]}toArray01(){const{r:t,g:e,b:r,a:i}=this;return 0===i?[0,0,0,0]:[t/i,e/i,r/i,i]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:r,a:i}=this;return[t,e,r,i]}}nt.black=new nt(0,0,0,1),nt.white=new nt(1,1,1,1),nt.transparent=new nt(0,0,0,0),nt.red=new nt(1,0,0,1),nt.blue=new nt(0,0,1,1);var st=nt;class ot{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class at{constructor(t,e,r,i,n){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n}}class lt{constructor(t){this.sections=t}static fromString(t){return new lt([new at(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof lt?t:lt.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const r={};e.fontStack&&(r["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(r["font-scale"]=e.scale),e.textColor&&(r["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(r)}return t}}class ct{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new ct({name:t,available:!1}):null}serialize(){return["image",this.name]}}function ht(t,e,r,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ut(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof st)return!0;if(t instanceof ot)return!0;if(t instanceof lt)return!0;if(t instanceof ct)return!0;if(Array.isArray(t)){for(const e of t)if(!ut(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!ut(t[e]))return!1;return!0}return!1}function dt(t){if(null===t)return O;if("string"==typeof t)return U;if("boolean"==typeof t)return N;if("number"==typeof t)return k;if(t instanceof st)return F;if(t instanceof ot)return Q;if(t instanceof lt)return j;if(t instanceof ct)return V;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=dt(e);if(r){if(r===t)continue;r=G;break}r=t}return H(r||G,e)}return z}function pt(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof st||t instanceof lt||t instanceof ct?t.toString():JSON.stringify(t)}class ft{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!ut(t[1]))return e.error("invalid value");const r=t[1];let i=dt(r);const n=e.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new ft(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof st?["rgba"].concat(this.value.toArray()):this.value instanceof lt?this.value.serialize():this.value}}var mt=ft,gt=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const At={string:U,number:k,boolean:N,object:z};class yt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,i=1;const n=t[0];if("array"===n){let n,s;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in At)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=At[r],i++}else n=G;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],i++}r=H(n,s)}else r=At[n];const s=[];for(;it.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);const i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map((t=>t.serialize())))}}var vt=yt;class xt{constructor(t){this.type=j,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const i=[];let n=!1;for(let r=1;r<=t.length-1;++r){const s=t[r];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;let t=null;if(s["font-scale"]&&(t=e.parse(s["font-scale"],1,k),!t))return null;let r=null;if(s["text-font"]&&(r=e.parse(s["text-font"],1,H(U)),!r))return null;let o=null;if(s["text-color"]&&(o=e.parse(s["text-color"],1,F),!o))return null;const a=i[i.length-1];a.scale=t,a.font=r,a.textColor=o}else{const s=e.parse(t[r],1,G);if(!s)return null;const o=s.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:s,scale:null,font:null,textColor:null})}}return new xt(i)}evaluate(t){return new lt(this.sections.map((e=>{const r=e.content.evaluate(t);return dt(r)===V?new at("",r,null,null,null):new at(pt(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const r={};e.scale&&(r["font-scale"]=e.scale.serialize()),e.font&&(r["text-font"]=e.font.serialize()),e.textColor&&(r["text-color"]=e.textColor.serialize()),t.push(r)}return t}}class bt{constructor(t){this.type=V,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,U);return r?new bt(r):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),r=ct.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const _t={"to-boolean":N,"to-color":F,"to-number":k,"to-string":U};class wt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");const i=_t[r],n=[];for(let r=1;r4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:ht(e[0],e[1],e[2],e[3]),!r))return new st(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gt(r||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const i=Number(e);if(!isNaN(i))return i}throw new gt(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?lt.fromString(pt(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ct.fromString(pt(this.args[0].evaluate(t))):pt(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new xt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new bt(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Et=wt;const Mt=["Unknown","Point","LineString","Polygon"];var St=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Mt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:r,y:i}=this.featureTileCoord,n=r*e-t[0],s=i*e-t[1];return this.featureDistanceData.bearing[0]*n+this.featureDistanceData.bearing[1]*s}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=st.parse(t)),e}};class Ct{constructor(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const r=t[0],i=Ct.definitions[r];if(!i)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(i)?i[0]:i.type,s=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,o=s.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[i,s]of o){a=new ee(e.registry,e.path,null,e.scope);const o=[];let l=!1;for(let e=1;e{return e=t,Array.isArray(e)?`(${e.map(W).join(", ")})`:`(${W(e.type)}...)`;var e})).join(" | "),i=[];for(let r=1;r=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Pt(t,e){const r=(180+t[0])/360,i=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const s=Math.pow(2,e.z);return[Math.round(r*s*Rt),Math.round(i*s*Rt)]}function Dt(t,e,r){const i=t[0]-e[0],n=t[1]-e[1],s=t[0]-r[0],o=t[1]-r[1];return i*o-s*n==0&&i*s<=0&&n*o<=0}function Ot(t,e){let r=!1;for(let o=0,a=e.length;oi[1]!=s[1]>i[1]&&i[0]<(s[0]-n[0])*(i[1]-n[1])/(s[1]-n[1])+n[0]&&(r=!r)}}var i,n,s;return r}function kt(t,e){for(let r=0;r0&&u<0||h<0&&u>0}function Nt(t,e,r,i){const n=[e[0]-t[0],e[1]-t[1]];return 0!=(s=[i[0]-r[0],i[1]-r[1]])[0]*(o=n)[1]-s[1]*o[0]&&!(!Ut(t,e,r,i)||!Ut(r,i,t,e));var s,o}function Ft(t,e,r){for(const i of r)for(let r=0;rr[2]){const e=.5*i;let n=t[0]-r[0]>e?-i:r[0]-t[0]>e?i:0;0===n&&(n=t[0]-r[2]>e?-i:r[2]-t[0]>e?i:0),t[0]+=n}Bt(e,t)}function Ht(t,e,r,i){const n=Math.pow(2,i.z)*Rt,s=[i.x*Rt,i.y*Rt],o=[];if(!t)return o;for(const i of t)for(const t of i){const i=[t.x+s[0],t.y+s[1]];Vt(i,e,r,n),o.push(i)}return o}function Wt(t,e,r,i){const n=Math.pow(2,i.z)*Rt,s=[i.x*Rt,i.y*Rt],o=[];if(!t)return o;for(const r of t){const t=[];for(const i of r){const r=[i.x+s[0],i.y+s[1]];Bt(e,r),t.push(r)}o.push(t)}if(e[2]-e[0]<=n/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of o)for(const i of t)Vt(i,e,r,n)}var a;return o}class qt{constructor(t,e){this.type=N,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(ut(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t{e&&!Yt(t)&&(e=!1)})),e}function Xt(t){if(t instanceof Tt&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Xt(t)&&(e=!1)})),e}function Jt(t,e){if(t instanceof Tt&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild((t=>{r&&!Jt(t,e)&&(r=!1)})),r}class Kt{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const r=t[1];return e.scope.has(r)?new Kt(r,e.scope.get(r)):e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var $t=Kt;class te{constructor(t,e=[],r,i=new D,n=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=i,this.errors=n,this.expectedType=r}parse(t,e,r,i,n={}){return e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)}_parse(t,e){function r(t,e,r){return"assert"===r?new vt(e,[t]):"coerce"===r?new Et(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=t[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const n=this.registry[i];if(n){let i=n.parse(t,this);if(!i)return null;if(this.expectedType){const t=this.expectedType,n=i.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else i=r(i,t,e.typeAnnotation||"coerce");else i=r(i,t,e.typeAnnotation||"assert")}if(!(i instanceof mt)&&"resolvedImage"!==i.type.kind&&re(i)){const t=new St;try{i=new mt(i.type,i.evaluate(t))}catch(t){return this.error(t.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){const i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new te(this.registry,i,e||null,n,this.errors)}error(t,...e){const r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new L(r,t))}checkSubtype(t,e){const r=Z(t,e);return r&&this.error(r),r}}var ee=te;function re(t){if(t instanceof $t)return re(t.boundExpression);if(t instanceof Tt&&"error"===t.name)return!1;if(t instanceof It)return!1;if(t instanceof Zt)return!1;const e=t instanceof Et||t instanceof vt;let r=!0;return t.eachChild((t=>{r=e?r&&re(t):r&&t instanceof mt})),!!r&&Yt(t)&&Jt(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function ie(t,e){const r=t.length-1;let i,n,s=0,o=r,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),i=t[a],n=t[a+1],i<=e){if(a===r||ee))throw new gt("Input is not a number.");o=a-1}return 0}class ne{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,k);if(!r)return null;const i=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let r=1;r=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=e.parse(o,l,n);if(!c)return null;n=n||c.type,i.push([s,c])}return new ne(n,r,i)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);const n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[ie(e,i)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var se=ne,oe=ae;function ae(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=i}function le(t,e,r){return t*(1-r)+e*r}ae.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,i=0;i<8;i++){var n=this.sampleCurveX(r)-t;if(Math.abs(n)n?o=r:a=r,r=.5*(a-o)+o;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var ce=Object.freeze({__proto__:null,number:le,color:function(t,e,r){return new st(le(t.r,e.r,r),le(t.g,e.g,r),le(t.b,e.b,r),le(t.a,e.a,r))},array:function(t,e,r){return t.map(((t,i)=>le(t,e[i],r)))}});const he=.95047,ue=1.08883,de=4/29,pe=6/29,fe=3*pe*pe,me=pe*pe*pe,ge=Math.PI/180,Ae=180/Math.PI;function ye(t){return t>me?Math.pow(t,1/3):t/fe+de}function ve(t){return t>pe?t*t*t:fe*(t-de)}function xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function be(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _e(t){const e=be(t.r),r=be(t.g),i=be(t.b),n=ye((.4124564*e+.3575761*r+.1804375*i)/he),s=ye((.2126729*e+.7151522*r+.072175*i)/1);return{l:116*s-16,a:500*(n-s),b:200*(s-ye((.0193339*e+.119192*r+.9503041*i)/ue)),alpha:t.a}}function we(t){let e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*ve(e),r=he*ve(r),i=ue*ve(i),new st(xe(3.2404542*r-1.5371385*e-.4985314*i),xe(-.969266*r+1.8760108*e+.041556*i),xe(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function Ee(t,e,r){const i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}const Me={forward:_e,reverse:we,interpolate:function(t,e,r){return{l:le(t.l,e.l,r),a:le(t.a,e.a,r),b:le(t.b,e.b,r),alpha:le(t.alpha,e.alpha,r)}}},Se={forward:function(t){const{l:e,a:r,b:i}=_e(t),n=Math.atan2(i,r)*Ae;return{h:n<0?n+360:n,c:Math.sqrt(r*r+i*i),l:e,alpha:t.a}},reverse:function(t){const e=t.h*ge,r=t.c;return we({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:Ee(t.h,e.h,r),c:le(t.c,e.c,r),l:le(t.l,e.l,r),alpha:le(t.alpha,e.alpha,r)}}};var Ce=Object.freeze({__proto__:null,lab:Me,hcl:Se});class Te{constructor(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[t,e]of n)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,r,i){let n=0;if("exponential"===t.name)n=Ie(e,t.base,r,i);else if("linear"===t.name)n=Ie(e,1,r,i);else if("cubic-bezier"===t.name){const s=t.controlPoints;n=new oe(s[0],s[1],s[2],s[3]).solve(Ie(e,1,r,i))}return n}static parse(t,e){let[r,i,n,...s]=t;if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const t=i[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:t}}else{if("cubic-bezier"!==i[0])return e.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const t=i.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,k),!n)return null;const o=[];let a=null;"interpolate-hcl"===r||"interpolate-lab"===r?a=F:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=e.parse(i,l,a);if(!c)return null;a=a||c.type,o.push([r,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Te(a,r,i,n,o):e.error(`Type ${W(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);const n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);const s=ie(e,i),o=e[s],a=e[s+1],l=Te.interpolationFactor(this.interpolation,i,o,a),c=r[s].evaluate(t),h=r[s+1].evaluate(t);return"interpolate"===this.operator?ce[this.type.kind.toLowerCase()](c,h,l):"interpolate-hcl"===this.operator?Se.reverse(Se.interpolate(Se.forward(c),Se.forward(h),l)):Me.reverse(Me.interpolate(Me.forward(c),Me.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;tZ(i,t.type)));return new Be(s?G:r,n)}evaluate(t){let e,r=null,i=0;for(const n of this.args){if(i++,r=n.evaluate(t),r&&r instanceof ct&&!r.available&&(e||(e=r),r=null,i===this.args.length))return e;if(null!==r)break}return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Le=Be;class Pe{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let i=1;i=r.length)throw new gt(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new gt(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var ke=Oe;class Ue{constructor(t,e){this.type=N,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,G);return r&&i?Y(r.type,[N,U,k,O,G])?new Ue(r,i):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!X(e,["boolean","string","number","null"]))throw new gt(`Expected first argument to be of type boolean, string, number or null, but found ${W(dt(e))} instead.`);if(!X(r,["string","array"]))throw new gt(`Expected second argument to be of type array or string, but found ${W(dt(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Ne=Ue;class Fe{constructor(t,e,r){this.type=k,this.needle=t,this.haystack=e,this.fromIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,G);if(!r||!i)return null;if(!Y(r.type,[N,U,k,O,G]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${W(r.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,k);return n?new Fe(r,i,n):null}return new Fe(r,i)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!X(e,["boolean","string","number","null"]))throw new gt(`Expected first argument to be of type boolean, string, number or null, but found ${W(dt(e))} instead.`);if(!X(r,["string","array"]))throw new gt(`Expected second argument to be of type array or string, but found ${W(dt(r))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var ze=Fe;class Ge{constructor(t,e,r,i,n,s){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=s}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n={},s=[];for(let o=2;oNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,dt(t)))return null}else r=dt(t);if(void 0!==n[String(t)])return c.error("Branch labels must be unique.");n[String(t)]=s.length}const h=e.parse(l,o,i);if(!h)return null;i=i||h.type,s.push(h)}const o=e.parse(t[1],1,G);if(!o)return null;const a=e.parse(t[t.length-1],t.length-1,i);return a?"value"!==o.type.kind&&e.concat(1).checkSubtype(r,o.type)?null:new Ge(r,i,o,n,s,a):null}evaluate(t){const e=this.input.evaluate(t);return(dt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),r=[],i={};for(const t of e){const e=i[this.cases[t]];void 0===e?(i[this.cases[t]]=r.length,r.push([this.cases[t],[t]])):r[e][1].push(t)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,i]of r)1===i.length?t.push(n(i[0])):t.push(i.map(n)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}var Qe=Ge;class je{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const i=[];for(let n=1;ne.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}var Ve=je;class He{constructor(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,G),i=e.parse(t[2],2,k);if(!r||!i)return null;if(!Y(r.type,[H(G),U,G]))return e.error(`Expected first argument to be of type array or string, but found ${W(r.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,k);return n?new He(r.type,r,i,n):null}return new He(r.type,r,i)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!X(e,["string","array"]))throw new gt(`Expected first argument to be of type array or string, but found ${W(dt(e))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var We=He;function qe(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Ze(t,e,r,i){return 0===i.compare(e,r)}function Ye(t,e,r){const i="=="!==t&&"!="!==t;return class n{constructor(t,e,r){this.type=N,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let s=e.parse(t[1],1,G);if(!s)return null;if(!qe(r,s.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${W(s.type)}'.`);let o=e.parse(t[2],2,G);if(!o)return null;if(!qe(r,o.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${W(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${W(s.type)}' and '${W(o.type)}'.`);i&&("value"===s.type.kind&&"value"!==o.type.kind?s=new vt(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new vt(s.type,[o])));let a=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Q),!a)return null}return new n(s,o,a)}evaluate(n){const s=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){const e=dt(s),r=dt(o);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new gt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const t=dt(s),r=dt(o);if("string"!==t.kind||"string"!==r.kind)return e(n,s,o)}return this.collator?r(n,s,o,this.collator.evaluate(n)):e(n,s,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Xe=Ye("==",(function(t,e,r){return e===r}),Ze),Je=Ye("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!Ze(0,e,r,i)})),Ke=Ye("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),tr=Ye("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),er=Ye(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0}));class rr{constructor(t,e,r,i,n,s){this.type=U,this.number=t,this.locale=e,this.currency=r,this.unit=i,this.minFractionDigits=n,this.maxFractionDigits=s}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,k);if(!r)return null;const i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=e.parse(i.locale,1,U),!n))return null;let s=null;if(i.currency&&(s=e.parse(i.currency,1,U),!s))return null;let o=null;if(i.unit&&(o=e.parse(i.unit,1,U),!o))return null;let a=null;if(i["min-fraction-digits"]&&(a=e.parse(i["min-fraction-digits"],1,k),!a))return null;let l=null;return i["max-fraction-digits"]&&(l=e.parse(i["max-fraction-digits"],1,k),!l)?null:new rr(r,n,s,o,a,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class ir{constructor(t){this.type=k,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${W(r.type)} instead.`):new ir(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new gt(`Expected value to be of type string or array, but found ${W(dt(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const nr={"==":Xe,"!=":Je,">":$e,"<":Ke,">=":er,"<=":tr,array:vt,at:ke,boolean:vt,case:Ve,coalesce:Le,collator:It,format:xt,image:bt,in:Ne,"index-of":ze,interpolate:Re,"interpolate-hcl":Re,"interpolate-lab":Re,length:ir,let:De,literal:mt,match:Qe,number:vt,"number-format":rr,object:vt,slice:We,step:se,string:vt,"to-boolean":Et,"to-color":Et,"to-number":Et,"to-string":Et,var:$t,within:Zt};function sr(t,[e,r,i,n]){e=e.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);const s=n?n.evaluate(t):1,o=ht(e,r,i,s);if(o)throw new gt(o);return new st(e/255*s,r/255*s,i/255*s,s)}function or(t,e){return t in e}function ar(t,e){const r=e[t];return void 0===r?null:r}function lr(t){return{type:t}}Tt.register(nr,{error:[{kind:"error"},[U],(t,[e])=>{throw new gt(e.evaluate(t))}],typeof:[U,[G],(t,[e])=>W(dt(e.evaluate(t)))],"to-rgba":[H(k,4),[F],(t,[e])=>e.evaluate(t).toArray()],rgb:[F,[k,k,k],sr],rgba:[F,[k,k,k,k],sr],has:{type:N,overloads:[[[U],(t,[e])=>or(e.evaluate(t),t.properties())],[[U,z],(t,[e,r])=>or(e.evaluate(t),r.evaluate(t))]]},get:{type:G,overloads:[[[U],(t,[e])=>ar(e.evaluate(t),t.properties())],[[U,z],(t,[e,r])=>ar(e.evaluate(t),r.evaluate(t))]]},"feature-state":[G,[U],(t,[e])=>ar(e.evaluate(t),t.featureState||{})],properties:[z,[],t=>t.properties()],"geometry-type":[U,[],t=>t.geometryType()],id:[G,[],t=>t.id()],zoom:[k,[],t=>t.globals.zoom],pitch:[k,[],t=>t.globals.pitch||0],"distance-from-center":[k,[],t=>t.distanceFromCenter()],"heatmap-density":[k,[],t=>t.globals.heatmapDensity||0],"line-progress":[k,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[k,[],t=>t.globals.skyRadialProgress||0],accumulated:[G,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[k,lr(k),(t,e)=>{let r=0;for(const i of e)r+=i.evaluate(t);return r}],"*":[k,lr(k),(t,e)=>{let r=1;for(const i of e)r*=i.evaluate(t);return r}],"-":{type:k,overloads:[[[k,k],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[k],(t,[e])=>-e.evaluate(t)]]},"/":[k,[k,k],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[k,[k,k],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[k,[],()=>Math.LN2],pi:[k,[],()=>Math.PI],e:[k,[],()=>Math.E],"^":[k,[k,k],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[k,[k],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[k,[k],(t,[e])=>Math.log(e.evaluate(t))],log2:[k,[k],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[k,[k],(t,[e])=>Math.sin(e.evaluate(t))],cos:[k,[k],(t,[e])=>Math.cos(e.evaluate(t))],tan:[k,[k],(t,[e])=>Math.tan(e.evaluate(t))],asin:[k,[k],(t,[e])=>Math.asin(e.evaluate(t))],acos:[k,[k],(t,[e])=>Math.acos(e.evaluate(t))],atan:[k,[k],(t,[e])=>Math.atan(e.evaluate(t))],min:[k,lr(k),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[k,lr(k),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[k,[k],(t,[e])=>Math.abs(e.evaluate(t))],round:[k,[k],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[k,[k],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[k,[k],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[N,[U,G],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[N,[G],(t,[e])=>t.id()===e.value],"filter-type-==":[N,[U],(t,[e])=>t.geometryType()===e.value],"filter-<":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i{const r=t.id(),i=e.value;return typeof r==typeof i&&r":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r>i}],"filter-<=":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r<=i}],"filter->=":[N,[U,G],(t,[e,r])=>{const i=t.properties()[e.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[N,[G],(t,[e])=>{const r=t.id(),i=e.value;return typeof r==typeof i&&r>=i}],"filter-has":[N,[G],(t,[e])=>e.value in t.properties()],"filter-has-id":[N,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[N,[H(U)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[N,[H(G)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[N,[U,H(G)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[N,[U,H(G)],(t,[e,r])=>function(t,e,r,i){for(;r<=i;){const n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=n+1}return!1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:N,overloads:[[[N,N],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[lr(N),(t,e)=>{for(const r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:N,overloads:[[[N,N],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[lr(N),(t,e)=>{for(const r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[N,[N],(t,[e])=>!e.evaluate(t)],"is-supported-script":[N,[U],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return!r||r(e.evaluate(t))}],upcase:[U,[U],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[U,[U],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[U,lr(G),(t,e)=>e.map((e=>pt(e.evaluate(t)))).join("")],"resolved-locale":[U,[Q],(t,[e])=>e.evaluate(t).resolvedLocale()]});var cr=nr;function hr(t){return{result:"success",value:t}}function ur(t){return{result:"error",value:t}}function dr(t){return!!t.expression&&t.expression.interpolated}function pr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function fr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function mr(t){return t}function gr(t,e){const r="color"===e.type,i=t.stops&&"object"==typeof t.stops[0][0],n=i||void 0!==t.property,s=i||!n,o=t.type||(dr(e)?"exponential":"interval");if(r&&((t=R({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],st.parse(t[1])]))),t.default?t.default=st.parse(t.default):t.default=st.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!Ce[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let a,l,c;if("exponential"===o)a=xr;else if("interval"===o)a=vr;else if("categorical"===o){a=yr,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=br}if(i){const r={},i=[];for(let e=0;et[0])),evaluate:({zoom:r},i)=>xr({stops:n,base:t.base},e,r).evaluate(r,i)}}if(s){const r="exponential"===o?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Re.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>a(t,e,r,l,c)}}return{kind:"source",evaluate(r,i){const n=i&&i.properties?i.properties[t.property]:void 0;return void 0===n?Ar(t.default,e.default):a(t,e,n,l,c)}}}function Ar(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function yr(t,e,r,i,n){return Ar(typeof r===n?i[r]:void 0,t.default,e.default)}function vr(t,e,r){if("number"!==pr(r))return Ar(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const n=ie(t.stops.map((t=>t[0])),r);return t.stops[n][1]}function xr(t,e,r){const i=void 0!==t.base?t.base:1;if("number"!==pr(r))return Ar(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const s=ie(t.stops.map((t=>t[0])),r),o=function(t,e,r,i){const n=i-r,s=t-r;return 0===n?0:1===e?s/n:(Math.pow(e,s)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[s][0],t.stops[s+1][0]),a=t.stops[s][1],l=t.stops[s+1][1];let c=ce[e.type]||mr;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=Ce[t.colorSpace];c=(t,r)=>e.reverse(e.interpolate(e.forward(t),e.forward(r),o))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),r=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==r)return c(e,r,o)}}:c(a,l,o)}function br(t,e,r){return"color"===e.type?r=st.parse(r):"formatted"===e.type?r=lt.fromString(r.toString()):"resolvedImage"===e.type?r=ct.fromString(r.toString()):pr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Ar(r,t.default,e.default)}class _r{constructor(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new St,this._defaultValue=e?"color"===(r=e).type&&(fr(r.default)||Array.isArray(r.default))?new st(0,0,0,0):"color"===r.type?st.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,r,i,n,s,o,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,i,n,s,o,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s||null,this._evaluator.featureTileCoord=o||null,this._evaluator.featureDistanceData=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new gt(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function wr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in cr}function Er(t,e){const r=new ee(cr,[],e?function(t){const e={color:F,string:U,number:k,enum:U,boolean:N,formatted:j,resolvedImage:V};return"array"===t.type?H(e[t.value]||G,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?hr(new _r(i,e)):ur(r.errors)}class Mr{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Xt(e.expression)}evaluateWithoutErrorHandling(t,e,r,i,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,s)}evaluate(t,e,r,i,n,s){return this._styleExpression.evaluate(t,e,r,i,n,s)}}class Sr{constructor(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Xt(e.expression),this.interpolationType=i}evaluateWithoutErrorHandling(t,e,r,i,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,s)}evaluate(t,e,r,i,n,s){return this._styleExpression.evaluate(t,e,r,i,n,s)}interpolationFactor(t,e,r){return this.interpolationType?Re.interpolationFactor(this.interpolationType,t,e,r):0}}function Cr(t,e){if("error"===(t=Er(t,e)).result)return t;const r=t.value.expression,i=Yt(r);if(!i&&"data-driven"!==e["property-type"])return ur([new L("","data expressions not supported")]);const n=Jt(r,["zoom","pitch","distance-from-center"]);if(!n&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return ur([new L("","zoom expressions not supported")]);const s=Ir(r);if(!s&&!n)return ur([new L("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof L)return ur([s]);if(s instanceof Re&&!dr(e))return ur([new L("",'"interpolate" expressions cannot be used with this property')]);if(!s)return hr(new Mr(i?"constant":"source",t.value));const o=s instanceof Re?s.interpolation:void 0;return hr(new Sr(i?"camera":"composite",t.value,s.labels,o))}class Tr{constructor(t,e){this._parameters=t,this._specification=e,R(this,gr(this._parameters,this._specification))}static deserialize(t){return new Tr(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Ir(t){let e=null;if(t instanceof De)e=Ir(t.result);else if(t instanceof Le){for(const r of t.args)if(e=Ir(r),e)break}else(t instanceof se||t instanceof Re)&&t.input instanceof Tt&&"zoom"===t.input.name&&(e=t);return e instanceof L||t.eachChild((t=>{const r=Ir(t);r instanceof L?e=r:!e&&r?e=new L("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new L("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Rr(t){if(Array.isArray(t))return t.map(Rr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const r in t)e[r]=Rr(t[r]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Br(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Br(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Lr(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Br(t)||(t=Fr(t));const r=t;let n=!0;try{n=function(t){if(!Or(t))return t;let e=Rr(t);return Dr(e),e=Pr(e),e}(r)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(r,null,2)}\n `)}const s=i[`filter_${e}`],o=Er(n,s);let a=null;if("error"===o.result)throw new Error(o.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,r)=>o.value.evaluate(t,e,{},r);let l=null,c=null;if(n!==r){const t=Er(r,s);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));l=(e,r,i,n,s)=>t.value.evaluate(e,r,{},i,void 0,void 0,n,s),c=!Yt(t.value.expression)}return{filter:a,dynamicFilter:l||void 0,needGeometry:Nr(n),needFeature:!!c}}function Pr(t){if(!Array.isArray(t))return t;const e=function(t){if(kr.has(t[0]))for(let e=1;ePr(t)))}function Dr(t){let e=!1;const r=[];if("case"===t[0]){for(let i=1;i",">=","<","<=","to-boolean"]);function Ur(t,e){return te?1:0}function Nr(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e"===e||"<="===e||">="===e?zr(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Fr))):"all"===e?["all"].concat(t.slice(1).map(Fr)):"none"===e?["all"].concat(t.slice(1).map(Fr).map(jr)):"in"===e?Gr(t[1],t.slice(2)):"!in"===e?jr(Gr(t[1],t.slice(2))):"has"===e?Qr(t[1]):"!has"===e?jr(Qr(t[1])):"within"!==e||t;var r}function zr(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}function Gr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Ur)]]:["filter-in-small",t,["literal",e]]}}function Qr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function jr(t){return["!",t]}function Vr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}!function(t){var e=function(){var t=function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r},e=[1,12],r=[1,13],i=[1,9],n=[1,10],s=[1,11],o=[1,14],a=[1,15],l=[14,18,22,24],c=[18,22],h=[22,24],u={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,r,i,n,s,o){var a=s.length-1;switch(n){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=s[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=s[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[s[a-2],s[a]];break;case 16:this.$={},this.$[s[a][0]]=s[a][1];break;case 17:this.$=s[a-2],s[a-2][s[a][0]]=s[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[s[a]];break;case 21:this.$=s[a-2],s[a-2].push(s[a])}},table:[{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,12:1,13:2,15:7,16:8,17:o,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:23,15:7,16:8,17:o,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(c,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:30,15:7,16:8,17:o,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:r,7:3,8:i,9:4,10:n,11:s,13:31,15:7,16:8,17:o,23:a},t(c,[2,17]),t(c,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=[0],r=[null],i=[],n=this.table,s="",o=0,a=0,l=i.slice.call(arguments,1),c=Object.create(this.lexer),h={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(h.yy[u]=this.yy[u]);c.setInput(t,h.yy),h.yy.lexer=c,h.yy.parser=this,void 0===c.yylloc&&(c.yylloc={});var d=c.yylloc;i.push(d);var p=c.options&&c.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,g,A,y,v,x,b,_,w={};;){if(m=e[e.length-1],this.defaultActions[m]?g=this.defaultActions[m]:(null==f&&(_=void 0,"number"!=typeof(_=c.lex()||1)&&(_=this.symbols_[_]||_),f=_),g=n[m]&&n[m][f]),void 0===g||!g.length||!g[0]){var E;for(y in b=[],n[m])this.terminals_[y]&&y>2&&b.push("'"+this.terminals_[y]+"'");E=c.showPosition?"Parse error on line "+(o+1)+":\n"+c.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(E,{text:c.match,token:this.terminals_[f]||f,line:c.yylineno,loc:d,expected:b})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+f);switch(g[0]){case 1:e.push(f),r.push(c.yytext),i.push(c.yylloc),e.push(g[1]),f=null,a=c.yyleng,s=c.yytext,o=c.yylineno,d=c.yylloc;break;case 2:if(v=this.productions_[g[1]][1],w.$=r[r.length-v],w._$={first_line:i[i.length-(v||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(v||1)].first_column,last_column:i[i.length-1].last_column},p&&(w._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(A=this.performAction.apply(w,[s,a,o,h.yy,g[1],r,i].concat(l))))return A;v&&(e=e.slice(0,-1*v*2),r=r.slice(0,-1*v),i=i.slice(0,-1*v)),e.push(this.productions_[g[1]][0]),r.push(w.$),i.push(w._$),x=n[e[e.length-2]][e[e.length-1]],e.push(x);break;case 3:return!0}}return!0}},d={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var s in n)this[s]=n[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),s=0;se[0].length)){if(e=r,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,n[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,i){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function p(){this.yy={}}return u.lexer=d,p.prototype=u,u.Parser=p,new p}();void 0!==Vr&&(t.parser=e,t.Parser=e.Parser,t.parse=function(){return e.parse.apply(e,arguments)})}({}),new Set(["vector","raster","raster-dem"]);const Hr={StyleExpression:_r,isExpression:wr,isExpressionFilter:Br,createExpression:Er,createPropertyExpression:Cr,normalizePropertyExpression:function(t,e){if(fr(t))return new Tr(t,e);if(wr(t)){const r=Cr(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return"string"==typeof t&&"color"===e.type&&(r=st.parse(t)),{kind:"constant",evaluate:()=>r}}},ZoomConstantExpression:Mr,ZoomDependentExpression:Sr,StylePropertyFunction:Tr}},75153:(t,e,r)=>{"use strict";function i(t,e){return Array.from(t.getElementsByTagName(e))}function n(t){return"#"===t[0]?t:`#${t}`}function s(t){return t?.normalize(),t&&t.textContent||""}function o(t,e,r){const i=t.getElementsByTagName(e),n=i.length?i[0]:null;return n&&r&&r(n),n}function a(t,e,r){const i={};if(!t)return i;const n=t.getElementsByTagName(e),s=n.length?n[0]:null;return s&&r?r(s,i):i}function l(t,e,r){const i=s(o(t,e));return i&&r&&r(i)||{}}function c(t,e,r){const i=parseFloat(s(o(t,e)));if(!isNaN(i))return i&&r&&r(i)||{}}function h(t,e,r){const i=parseFloat(s(o(t,e)));if(!isNaN(i))return r&&r(i),i}function u(t,e){const r={};for(const i of e)l(t,i,(t=>{r[i]=t}));return r}function d(t){return 1===t?.nodeType}function p(t){return a(t,"line",(t=>Object.assign({},l(t,"color",(t=>({stroke:`#${t}`}))),c(t,"opacity",(t=>({"stroke-opacity":t}))),c(t,"width",(t=>({"stroke-width":96*t/25.4}))))))}function f(t){let e=[];if(null===t)return e;for(const r of Array.from(t.childNodes)){if(!d(r))continue;const t=m(r.nodeName);if("gpxtpx:TrackPointExtension"===t)e=e.concat(f(r));else{const i=s(r);e.push([t,g(i)])}}return e}function m(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function g(t){const e=parseFloat(t);return isNaN(e)?t:e}function A(t){const e=[parseFloat(t.getAttribute("lon")||""),parseFloat(t.getAttribute("lat")||"")];if(isNaN(e[0])||isNaN(e[1]))return null;h(t,"ele",(t=>{e.push(t)}));const r=o(t,"time");return{coordinates:e,time:r?s(r):null,extendedValues:f(o(t,"extensions"))}}function y(t){const e=u(t,["name","cmt","desc","type","time","keywords"]),r=Array.from(t.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const i of r)i.parentNode?.parentNode===t&&(e[i.tagName.replace(":","_")]=s(i));const n=i(t,"link");return n.length&&(e.links=n.map((t=>Object.assign({href:t.getAttribute("href")},u(t,["text","type"]))))),e}function v(t,e){const r=i(t,e),n=[],s=[],o={};for(let t=0;t1,l=Object.assign({_gpxType:"trk"},y(t),p(o(t,"extensions")),n.length?{coordinateProperties:{times:a?n:n[0]}}:{});for(const t of s){r.push(t.line),l.coordinateProperties||(l.coordinateProperties={});const e=l.coordinateProperties,i=Object.entries(t.extendedValues);for(let t=0;tnew Array(t.line.length).fill(null)))),e[r][t]=n):e[r]=n}}return{type:"Feature",properties:l,geometry:a?{type:"MultiLineString",coordinates:r}:{type:"LineString",coordinates:r[0]}}}function _(t){const e=Object.assign(y(t),u(t,["sym"])),r=A(t);return r?{type:"Feature",properties:e,geometry:{type:"Point",coordinates:r.coordinates}}:null}function*w(t){for(const e of i(t,"trk")){const t=b(e);t&&(yield t)}for(const e of i(t,"rte")){const t=x(e);t&&(yield t)}for(const e of i(t,"wpt")){const t=_(e);t&&(yield t)}}function E(t){return{type:"FeatureCollection",features:Array.from(w(t))}}function M(t,e){const r={},i="stroke"==e||"fill"===e?e:e+"-color";return"#"===t[0]&&(t=t.substring(1)),6===t.length||3===t.length?r[i]="#"+t:8===t.length&&(r[e+"-opacity"]=parseInt(t.substring(0,2),16)/255,r[i]="#"+t.substring(6,8)+t.substring(4,6)+t.substring(2,4)),r}function S(t,e,r){const i={};return h(t,e,(t=>{i[r]=t})),i}function C(t,e){return a(t,"color",(t=>M(s(t),e)))}function T(t){return a(t,"Icon",((t,e)=>(l(t,"href",(t=>{e.icon=t})),e)))}function I(t){return Object.assign({},function(t){return a(t,"PolyStyle",((t,e)=>Object.assign(e,a(t,"color",(t=>M(s(t),"fill"))),l(t,"fill",(t=>{if("0"===t)return{"fill-opacity":0}})),l(t,"outline",(t=>{if("0"===t)return{"stroke-opacity":0}})))))}(t),function(t){return a(t,"LineStyle",(t=>Object.assign(C(t,"stroke"),S(t,"width","stroke-width"))))}(t),function(t){return a(t,"LabelStyle",(t=>Object.assign(C(t,"label"),S(t,"scale","label-scale"))))}(t),function(t){return a(t,"IconStyle",(t=>Object.assign(C(t,"icon"),S(t,"scale","icon-scale"),S(t,"heading","icon-heading"),a(t,"hotSpot",(t=>{const e=parseFloat(t.getAttribute("x")||""),r=parseFloat(t.getAttribute("y")||""),i=t.getAttribute("xunits")||"",n=t.getAttribute("yunits")||"";return isNaN(e)||isNaN(r)?{}:{"icon-offset":[e,r],"icon-offset-units":[i,n]}})),T(t))))}(t))}r.d(e,{DS:()=>J,ng:()=>E});const R=t=>Number(t),B={string:t=>t,int:R,uint:R,short:R,ushort:R,float:R,double:R,bool:t=>Boolean(t)};function L(t,e){return a(t,"ExtendedData",((t,r)=>{for(const e of i(t,"Data"))r[e.getAttribute("name")||""]=s(o(e,"value"));for(const n of i(t,"SimpleData")){const t=n.getAttribute("name")||"",i=e[t]||B.string;r[t]=i(s(n))}return r}))}function P(t){const e=o(t,"description");for(const t of Array.from(e?.childNodes||[]))if(4===t.nodeType)return{description:{"@type":"html",value:s(t)}};return{}}function D(t){return a(t,"TimeSpan",(t=>({timespan:{begin:s(o(t,"begin")),end:s(o(t,"end"))}})))}function O(t){return a(t,"TimeStamp",(t=>({timestamp:s(o(t,"when"))})))}function k(t,e){return l(t,"styleUrl",(t=>(t=n(t),e[t]?Object.assign({styleUrl:t},e[t]):{styleUrl:t})))}const U=/\s*/g,N=/^\s*|\s*$/g,F=/\s+/;function z(t){return t.replace(U,"").split(",").map(parseFloat).filter((t=>!isNaN(t))).slice(0,3)}function G(t){return t.replace(N,"").split(F).map(z).filter((t=>t.length>=2))}function Q(t){let e=i(t,"coord");var r;0===e.length&&(r=t,"coord","*",e=Array.from(r.getElementsByTagNameNS("*","coord")));const n=e.map((t=>s(t).split(" ").map(parseFloat)));return 0===n.length?null:{geometry:n.length>2?{type:"LineString",coordinates:n}:{type:"Point",coordinates:n[0]},times:i(t,"when").map((t=>s(t)))}}function j(t){if(0===t.length)return t;const e=t[0],r=t[t.length-1];let i=!0;for(let t=0;t=2&&e.push({type:"Point",coordinates:t});break}case"LinearRing":case"LineString":{const t=G(V(s));t.length>=2&&e.push({type:"LineString",coordinates:t});break}case"Polygon":{const t=[];for(const e of i(s,"LinearRing")){const r=j(G(V(e)));r.length>=4&&t.push(r)}t.length&&e.push({type:"Polygon",coordinates:t});break}case"Track":case"gx:Track":{const t=Q(s);if(!t)break;const{times:i,geometry:n}=t;e.push(n),i.length&&r.push(i);break}}}return{geometries:e,coordTimes:r}}function W(t,e,r,i){const{coordTimes:n,geometries:s}=H(t),o=function(t){return 0===t.length?null:1===t.length?t[0]:{type:"GeometryCollection",geometries:t}}(s);if(!o&&i.skipNullGeometry)return null;const a={type:"Feature",geometry:o,properties:Object.assign(u(t,["name","address","visibility","open","phoneNumber","description"]),P(t),k(t,e),I(t),L(t,r),D(t),O(t),n.length?{coordinateProperties:{times:1===n.length?n[0]:n}}:{})};void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=t.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}const q=Math.PI/180;function Z(t,e,r,i){const n=function(t){return o(t,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[j(G(V(t)))]}}:function(t){const e=o(t,"LatLonBox");if(e){const t=h(e,"north"),r=h(e,"west"),i=h(e,"east"),n=h(e,"south"),s=h(e,"rotation");if("number"==typeof t&&"number"==typeof n&&"number"==typeof r&&"number"==typeof i){const e=[r,n,i,t];let o=[[[r,t],[i,t],[i,n],[r,n],[r,t]]];return"number"==typeof s&&(o=function(t,e,r){const i=[(t[0]+t[2])/2,(t[1]+t[3])/2];return[e[0].map((t=>{const e=t[1]-i[1],n=t[0]-i[0],s=Math.sqrt(Math.pow(e,2)+Math.pow(n,2)),o=Math.atan2(e,n)+r*q;return[i[0]+Math.cos(o)*s,i[1]+Math.sin(o)*s]}))]}(e,o,s)),{bbox:e,geometry:{type:"Polygon",coordinates:o}}}}return null}(t)}(t),s=n?.geometry||null;if(!s&&i.skipNullGeometry)return null;const a={type:"Feature",geometry:s,properties:Object.assign({"@geometry-type":"groundoverlay"},u(t,["name","address","visibility","open","phoneNumber","description"]),P(t),k(t,e),I(t),T(t),L(t,r),D(t),O(t))};n?.bbox&&(a.bbox=n.bbox),void 0!==a.properties?.visibility&&(a.properties.visibility="0"!==a.properties.visibility);const l=t.getAttribute("id");return null!==l&&""!==l&&(a.id=l),a}function Y(t){let e=t.getAttribute("id");const r=t.parentNode;return!e&&d(r)&&"CascadingStyle"===r.localName&&(e=r.getAttribute("kml:id")||r.getAttribute("id")),n(e||"")}function*X(t,e={skipNullGeometry:!1}){const r=function(t){const e={};for(const r of i(t,"Style"))e[Y(r)]=I(r);for(const r of i(t,"StyleMap")){const t=n(r.getAttribute("id")||"");l(r,"styleUrl",(r=>{r=n(r),e[r]&&(e[t]=e[r])}))}return e}(t),s=function(t){const e={};for(const r of i(t,"SimpleField"))e[r.getAttribute("name")||""]=B[r.getAttribute("type")||""]||B.string;return e}(t);for(const n of i(t,"Placemark")){const t=W(n,r,s,e);t&&(yield t)}for(const n of i(t,"GroundOverlay")){const t=Z(n,r,s,e);t&&(yield t)}}function J(t,e={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(X(t,e))}}},61861:(t,e,r)=>{"use strict";r.d(e,{Q:()=>Y,Z:()=>lt});var i=r(99477);const n=1e3/60,s=function(t){t.id&&(clearInterval(t.id),t.id=void 0),t.waitTimer&&(clearInterval(t.waitTimer),t.waitTimer=void 0),t.keyframe=0},o=function(t){s(t),t.isEnded()&&t.dispatchEvent({type:"animation-ended"}),t.dispatchEvent({type:"animation-stopped"}),t.duration=0};class a extends i.EventDispatcher{constructor(){super(),this.id=null,this.keyframe=0,this.duration=0,this.state=0,this.waitTimer=null,this.callback=()=>{}}isPlaying(){return 1===this.state}isStopped(){return 0===this.state}isEnded(){return 2===this.state}setCallback(t){this.callback=t}play(t){this.duration=t,this.dispatchEvent({type:"animation-started"}),this.state=1,s(this),this.id=setInterval(this.frame.bind(this),n)}playLater(t,e){const r=Math.floor(n*e);window.clearInterval(this.waitTimer);const i=this;this.waitTimer=window.setTimeout((()=>{i.play(t)}),r)}stop(){this.state=0,o(this)}frame(){this.keyframe1&&void 0!==arguments[1]?arguments[1]:{};super(),this._view=t,this._domElement=t.domElement;let r=!0;Object.defineProperty(this,"enabled",{get:()=>r,set:t=>{t||(this.onKeyUp(),this.onPointerUp()),r=t}});let n=!0;Object.defineProperty(this,"enableKeys",{get:()=>n,set:t=>{t||this.onKeyUp(),n=t}}),this.NONE={};let s=this.NONE;Object.defineProperty(this,"currentState",{get:()=>s,set:t=>{if(s!==t){const e=s;s=t,this.dispatchEvent({type:"state-changed",viewCoords:p,previous:e})}}}),this._clickTimeStamp=0,this._lastMousePressed={viewCoords:new i.Vector2},this._currentMousePressed=void 0,this._currentKeyPressed=void 0,this._onPointerDown=this.onPointerDown.bind(this),this._onPointerMove=this.onPointerMove.bind(this),this._onPointerUp=this.onPointerUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onBlur=this.onBlur.bind(this),this._onContextMenu=this.onContextMenu.bind(this),this._domElement.addEventListener("pointerdown",this._onPointerDown,!1),this._domElement.addEventListener("wheel",this._onMouseWheel,!1),this._domElement.addEventListener("keydown",this._onKeyDown,!1),this._domElement.addEventListener("keyup",this._onKeyUp,!1),this._domElement.addEventListener("blur",this._onBlur),this._domElement.addEventListener("contextmenu",this._onContextMenu,!1),this.setFromOptions(e)}inputToState(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const i of Object.keys(d)){const n=this[i];if(n.enable&&n.mouseButton===t&&n.keyboard===e&&n.double===r){if(!n._trigger)return n;this.dispatchEvent({type:n._event,viewCoords:void 0!==t&&p,direction:n._direction})}}return this.NONE}touchToState(t){for(const e of Object.keys(d)){const r=this[e];if(r.enable&&t==r.finger)return r}return this.NONE}setFromOptions(t){for(const e in d)if({}.hasOwnProperty.call(d,e)){let r={};r=t[e]||this[e]||Object.assign(r,d[e]),t[e]&&void 0===t[e].enable&&(r.enable=this[e].enable),r.double=!!r.double,r._event=d[e]._event,r._trigger=d[e]._trigger,r._direction=d[e]._direction,this[e]=r}}onPointerDown(t){this.enabled&&(p.copy(this._view.eventToViewCoords(t)),"mouse"===t.pointerType&&(this._currentMousePressed=t.button,void 0===this._currentKeyPressed&&(t.ctrlKey?this._currentKeyPressed=17:t.shiftKey?this._currentKeyPressed=16:t.metaKey&&(this._currentKeyPressed=91)),this.currentState=this.inputToState(this._currentMousePressed,this._currentKeyPressed,t.timeStamp-this._clickTimeStamp<500&&this._lastMousePressed.button===this._currentMousePressed&&this._lastMousePressed.viewCoords.distanceTo(p)<5),this._clickTimeStamp=t.timeStamp,this._lastMousePressed.button=this._currentMousePressed,this._lastMousePressed.viewCoords.copy(p)),this._domElement.addEventListener("pointermove",this._onPointerMove,!1),this._domElement.addEventListener("pointerup",this._onPointerUp,!1),this._domElement.addEventListener("mouseleave",this._onPointerUp,!1))}onPointerMove(t){t.preventDefault(),this.enabled&&(p.copy(this._view.eventToViewCoords(t)),"mouse"===t.pointerType)&&this.dispatchEvent({type:this.currentState._event,viewCoords:p})}onPointerUp(){this.enabled&&(this._currentMousePressed=void 0,this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("mouseleave",this._onPointerUp,!1),this.currentState=this.NONE)}onMouseWheel(t){t.preventDefault(),this.enabled&&this.ZOOM.enable&&this.dispatchEvent({type:this.ZOOM._event,delta:t.deltaY})}onKeyDown(t){this.enabled&&this.enableKeys&&(this._currentKeyPressed=t.keyCode,this.inputToState(this._currentMousePressed,this._currentKeyPressed))}onKeyUp(){this.enabled&&this.enableKeys&&(this._currentKeyPressed=void 0,void 0===this._currentMousePressed&&(this.currentState=this.NONE))}onBlur(){this.onKeyUp(),this.onPointerUp()}onContextMenu(t){t.preventDefault()}dispose(){this._clickTimeStamp=0,this._lastMousePressed=void 0,this._currentKeyPressed=void 0,this._domElement.removeEventListener("pointerdown",this._onPointerDown,!1),this._domElement.removeEventListener("pointermove",this._onPointerMove,!1),this._domElement.removeEventListener("pointerup",this._onPointerUp,!1),this._domElement.removeEventListener("wheel",this._onMouseWheel,!1),this._domElement.removeEventListener("keydown",this._onKeyDown,!1),this._domElement.removeEventListener("keyup",this._onKeyUp,!1),this._domElement.removeEventListener("blur",this._onBlur),this._domElement.removeEventListener("contextmenu",this._onContextMenu,!1)}}const m=f;var g=r(73502);const A=1e-6,y={up:new i.Vector2(0,1),bottom:new i.Vector2(0,-1),left:new i.Vector2(1,0),right:new i.Vector2(-1,0)},v=new i.Vector2,x=new i.Vector2,b=new i.Vector2,_=new i.Spherical(1,.01,0),w=new i.Spherical(1,0,0);let E=1;const M=new i.Vector2,S=new i.Vector2,C=new i.Vector2,T=new i.Vector3,I=new i.Vector2,R=new i.Vector2,B=new i.Vector2;let L;const P=new i.Quaternion,D=new i.Object3D,O=new c.Z("EPSG:4978");D.matrixWorldInverse=new i.Matrix4;const k=new c.Z("EPSG:4978",0,0,0),U=new c.Z("EPSG:4326",0,0,0);function N(t,e){k.setFromVector3(t).as("EPSG:4326",U),e.position.copy(t),e.lookAt(U.geodesicNormal.add(t)),e.rotateX(.5*Math.PI),e.updateMatrixWorld(!0)}let F=0,z=!0;const G=new i.Quaternion(0,0,0,1),Q=new i.Vector3,j=new i.Vector3,V=new i.Quaternion,H=new i.Sphere,W=new i.Vector3,q=new i.Vector3,Z={},Y={PAN_CHANGED:"pan-changed",ORIENTATION_CHANGED:"orientation-changed",RANGE_CHANGED:"range-changed",CAMERA_TARGET_CHANGED:"camera-target-changed"},X=new i.Quaternion,J=new i.Quaternion,K=new i.Vector3(1,0,0);let $=1/0;const tt=new i.Vector3,et=new i.Vector3,rt=new i.Raycaster,it=new i.Vector3,nt=new i.Vector3,st=new i.Sphere;let ot;class at extends i.EventDispatcher{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.player=new l,this.view=t,this.camera=t.camera3D,this.states=new m(this.view),Object.defineProperty(this,"enabled",{get:()=>this.states.enabled,set:t=>{console.warn("GlobeControls.enabled property is deprecated. Use StateControl.enabled instead - which you can access with GlobeControls.states.enabled."),this.states.enabled=t}}),r.zoomSpeed&&(console.warn("Controls zoomSpeed parameter is deprecated. Use zoomFactor instead."),r.zoomFactor=r.zoomFactor||r.zoomSpeed),this.zoomFactor=r.zoomFactor||1.25,this.minDistance=r.minDistance||250,this.maxDistance=r.maxDistance||8*h.c.x,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.rotateSpeed=r.rotateSpeed||.25,this.keyPanSpeed=r.keyPanSpeed||7,this.minPolarAngle=i.MathUtils.degToRad(r.minPolarAngle??.5),this.maxPolarAngle=i.MathUtils.degToRad(r.minPolarAngle??86),this.minAzimuthAngle=r.minAzimuthAngle?i.MathUtils.degToRad(r.minAzimuthAngle):-1/0,this.maxAzimuthAngle=r.maxAzimuthAngle?i.MathUtils.degToRad(r.maxAzimuthAngle):1/0,this.handleCollision=void 0===r.handleCollision||r.handleCollision,this.minDistanceCollision=60,Object.defineProperty(this,"enableKeys",{get:()=>this.states.enableKeys,set:t=>{console.warn("GlobeControls.enableKeys property is deprecated. Use StateControl.enableKeys instead - which you can access with GlobeControls.states.enableKeys."),this.states.enableKeys=t}}),this.enableDamping=!1!==r.enableDamping,this.dampingMoveFactor=null!=r.dampingMoveFactor?r.dampingMoveFactor:.25,this.startEvent={type:"start"},this.endEvent={type:"end"},this.updateHelper=function(){},this._onEndingMove=null,this._onTravel=this.travel.bind(this),this._onTouchStart=this.onTouchStart.bind(this),this._onTouchEnd=this.onTouchEnd.bind(this),this._onTouchMove=this.onTouchMove.bind(this),this._onStateChange=this.onStateChange.bind(this),this._onRotation=this.handleRotation.bind(this),this._onDrag=this.handleDrag.bind(this),this._onDolly=this.handleDolly.bind(this),this._onPan=this.handlePan.bind(this),this._onPanoramic=this.handlePanoramic.bind(this),this._onZoom=this.handleZoom.bind(this),this.states.addEventListener("state-changed",this._onStateChange,!1),this.states.addEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.addEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.addEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.addEventListener(this.states.PAN._event,this._onPan,!1),this.states.addEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.addEventListener("zoom",this._onZoom,!1),this.view.domElement.addEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.addEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.addEventListener("touchmove",this._onTouchMove,!1),this.states.addEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.addEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),t.scene.add(D),e.isExtent?e.center().as("EPSG:4978",k):(e.coord.as("EPSG:4978",k),e.tilt=e.tilt||89.5,e.heading=e.heading||0),N(k,D),this.lookAtCoordinate(e,!1),O.crs=this.view.referenceCrs}get dollyInScale(){return this.zoomFactor}get dollyOutScale(){return 1/this.zoomFactor}get isPaused(){return this.states.currentState===this.states.NONE&&!this.player.isPlaying()}onEndingMove(t){this._onEndingMove&&(this.player.removeEventListener("animation-stopped",this._onEndingMove),this._onEndingMove=null),this.handlingEvent(t)}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.theta-=t}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;w.phi-=t}panLeft(t){const e=this.camera.matrix.elements;T.fromArray(e),T.multiplyScalar(-t),Q.add(T)}panUp(t){const e=this.camera.matrix.elements;T.fromArray(e,4),T.multiplyScalar(t),Q.add(T)}mouseToPan(t,e){const r=this.view.mainLoop.gfxEngine;if(this.camera.isPerspectiveCamera){let n=this.camera.position.distanceTo(this.getCameraTargetPosition());n*=2*Math.tan(i.MathUtils.degToRad(.5*this.camera.fov)),this.panLeft(t*n/r.width*this.camera.aspect),this.panUp(e*n/r.height)}else this.camera.isOrthographicCamera&&(this.panLeft(t*(this.camera.right-this.camera.left)/r.width),this.panUp(e*(this.camera.top-this.camera.bottom)/r.height))}dolly(t){0!==t&&(L=t>0?this.dollyInScale:this.dollyOutScale,this.camera.isPerspectiveCamera?E/=L:this.camera.isOrthographicCamera&&(this.camera.zoom=i.MathUtils.clamp(this.camera.zoom*L,this.minZoom,this.maxZoom),this.camera.updateProjectionMatrix(),this.view.notifyChange(this.camera)))}getMinDistanceCameraBoundingSphereObbsUp(t){if(t.level>10&&1==t.children.length&&t.geometry){const e=t.obb;st.center.copy(this.camera.position),st.radius=this.minDistanceCollision,e.isSphereAboveXYBox(st)&&($=Math.min(st.center.z-e.box3D.max.z,$))}}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.states.currentState;if($=1/0,this.handleCollision&&this.view.tileLayer)for(const t of this.view.tileLayer.level0Nodes)t.traverse(this.getMinDistanceCameraBoundingSphereObbsUp.bind(this));switch(t){case this.states.MOVE_GLOBE:if($<0)D.translateY(-$),this.camera.position.setLength(this.camera.position.length()-$);else if($r&&w.phi>0){const t=e-r,i=1-(t-($-r))/t;w.phi*=i*i}else if($-r&&w.phi>n){let t=-Math.asin(.25*(r-$)/_.radius);t=i.MathUtils.clamp(t,n,0);const e=1-(r-$)/(2*r);w.phi=i.MathUtils.lerp(w.phi,t,e),$-=Math.sin(w.phi)*_.radius}_.theta+=w.theta,_.phi+=w.phi,_.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,_.theta)),_.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,_.phi)),_.radius=this.camera.position.length()*E,_.makeSafe(),_.radius=Math.max(this.minDistance,Math.min(this.maxDistance,_.radius)),this.camera.position.setFromSpherical(_),$<0&&(this.camera.position.y-=$,_.setFromVector3(this.camera.position),w.phi=0),D.localToWorld(this.camera.position)}}this.camera.up.copy(D.position).normalize(),this.camera.lookAt(D.position),this.enableDamping?(w.theta*=.75,w.phi*=.75,P.slerp(G,.2*this.dampingMoveFactor)):(w.theta=0,w.phi=0,P.set(0,0,0,1)),E=1,Q.set(0,0,0),(j.distanceToSquared(this.camera.position)>A||8*(1-V.dot(this.camera.quaternion))>A)&&(this.view.notifyChange(this.camera),j.copy(this.camera.position),V.copy(this.camera.quaternion)),this.enableDamping&&t===this.states.ORBIT&&this.player.isStopped()&&(w.theta>A||w.phi>A)&&(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.playLater(60,2)),this.view.dispatchEvent({type:g.b.CAMERA_MOVED,coord:O.setFromVector3(D.position),range:_.radius,heading:-i.MathUtils.radToDeg(_.theta),tilt:90-i.MathUtils.radToDeg(_.phi)})}onStateChange(t){this.states.currentState!==this.states.NONE?(u.ZP.stop(this.view,this.camera),this.onEndingMove(),this.player.stop(),this.updateTarget(),ot=u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,nt),v.copy(t.viewCoords),this.view.getPickingPositionFromDepth(t.viewCoords,W)&&(H.radius=W.length(),tt.copy(W).normalize(),this.updateHelper(W,Z.picking)),I.copy(t.viewCoords),M.copy(t.viewCoords)):this.handleEndMovement(t)}handleRotation(t){this.player.stop(),this.handlePanoramic(t)}handleDrag(t){const e=this.view.viewToNormalizedCoords(t.viewCoords);this.camera.updateMatrixWorld(),rt.setFromCamera(e,this.camera),rt.ray.intersectSphere(H,q)?(et.copy(q).normalize(),P.setFromUnitVectors(et,tt),F=Date.now(),this.update()):this.states.onPointerUp()}handleDolly(t){R.copy(t.viewCoords),B.subVectors(R,I),this.dolly(-B.y),I.copy(R),this.update()}handlePan(t){t.viewCoords?(S.copy(t.viewCoords),C.subVectors(S,M),M.copy(S)):t.direction&&C.copy(y[t.direction]).multiplyScalar(this.keyPanSpeed),this.mouseToPan(C.x,C.y),this.update(this.states.PAN)}handlePanoramic(t){x.copy(t.viewCoords),b.subVectors(x,v);const e=this.view.mainLoop.gfxEngine;w.theta-=2*Math.PI*b.x/e.width*this.rotateSpeed,w.phi-=2*Math.PI*b.y/e.height*this.rotateSpeed,v.copy(x),this.update()}handleEndMovement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dispatchEvent(this.endEvent),this.player.stop(),this.enableDamping?t.previous===this.states.ORBIT&&(w.theta>A||w.phi>A)?(this.player.setCallback((()=>{this.update(this.states.ORBIT)})),this.player.play(60),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):t.previous===this.states.MOVE_GLOBE&&Date.now()-F<50?(this.player.setCallback((()=>{this.update(this.states.MOVE_GLOBE)})),this.player.play(120),this._onEndingMove=()=>this.onEndingMove(),this.player.addEventListener("animation-stopped",this._onEndingMove)):this.onEndingMove():this.onEndingMove()}updateTarget(){if(this.view.getPickingPositionFromDepth(null,nt)){const t=isNaN(nt.x)?100:this.camera.position.distanceTo(nt);it.set(0,0,-t),this.camera.localToWorld(it),N(it,D),D.matrixWorldInverse.copy(D.matrixWorld).invert(),it.copy(this.camera.position),it.applyMatrix4(D.matrixWorldInverse),_.setFromVector3(it)}}handlingEvent(t){t=t||u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera);const e=u.ZP.getDiffParams(ot,t);if(e&&(e.range&&this.dispatchEvent({type:Y.RANGE_CHANGED,previous:e.range.previous,new:e.range.new}),e.coord&&this.dispatchEvent({type:Y.CAMERA_TARGET_CHANGED,previous:e.coord.previous,new:e.coord.new}),e.tilt||e.heading)){const t={type:Y.ORIENTATION_CHANGED};e.tilt&&(t.previous={tilt:e.tilt.previous},t.new={tilt:e.tilt.new}),e.heading&&(t.previous=t.previous||{},t.new=t.new||{},t.new.heading=e.heading.new,t.previous.heading=e.heading.previous),this.dispatchEvent(t)}}travel(t){this.player.stop();const e=this.view.getPickingPositionFromDepth(t.viewCoords),r=this.getRange(e);if(e&&r>this.minDistance)return this.lookAtCoordinate({coord:new c.Z("EPSG:4978",e),range:r*("out"===t.direction?1/.6:.6),time:1500})}handleZoom(t){this.player.stop(),u.ZP.stop(this.view,this.camera),this.updateTarget();const e=-t.delta;this.dolly(e);const r=this.getRange(nt);this.update();const i=this.getRange(nt);Math.abs(i-r)/r>.001&&this.dispatchEvent({type:Y.RANGE_CHANGED,previous:r,new:i}),this.dispatchEvent(this.startEvent),this.dispatchEvent(this.endEvent)}onTouchStart(t){if(this.player.stop(),!1!==this.states.enabled&&(this.state=this.states.touchToState(t.touches.length),this.updateTarget(),this.state!==this.states.NONE)){switch(this.state){case this.states.MOVE_GLOBE:{const e=this.view.eventToViewCoords(t);this.view.getPickingPositionFromDepth(e,W)?(H.radius=W.length(),tt.copy(W).normalize(),this.updateHelper(W,Z.picking)):this.state=this.states.NONE;break}case this.states.ORBIT:case this.states.DOLLY:{const e=t.touches[0].pageX,r=t.touches[0].pageY,i=e-t.touches[1].pageX,n=r-t.touches[1].pageY,s=Math.sqrt(i*i+n*n);I.set(0,s),v.set(e,r);break}case this.states.PAN:M.set(t.touches[0].pageX,t.touches[0].pageY)}this.dispatchEvent(this.startEvent)}}onTouchMove(t){if(this.player.isPlaying()&&this.player.stop(),!1!==this.states.enabled){switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case this.states.MOVE_GLOBE.finger:{const e=this.view.eventToViewCoords(t),r=this.view.viewToNormalizedCoords(e);this.camera.updateMatrixWorld(),rt.setFromCamera(r,this.camera),rt.ray.intersectSphere(H,q)?(et.copy(q).normalize(),P.setFromUnitVectors(et,tt),F=Date.now()):this.onTouchEnd();break}case this.states.ORBIT.finger:case this.states.DOLLY.finger:{const e=this.view.mainLoop.gfxEngine;x.set(t.touches[0].pageX,t.touches[0].pageY),b.subVectors(x,v),this.rotateLeft(2*Math.PI*b.x/e.width*this.rotateSpeed),this.rotateUp(2*Math.PI*b.y/e.height*this.rotateSpeed),v.copy(x);const r=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(r*r+i*i);R.set(0,n),B.subVectors(R,I),this.dolly(B.y),I.copy(R);break}case this.states.PAN.finger:S.set(t.touches[0].pageX,t.touches[0].pageY),C.subVectors(S,M),this.mouseToPan(C.x,C.y),M.copy(S);break;default:this.state=this.states.NONE}this.state!==this.states.NONE&&this.update(this.state)}}onTouchEnd(){this.handleEndMovement({previous:this.state}),this.state=this.states.NONE}dispose(){this.view.domElement.removeEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.removeEventListener("touchend",this._onTouchEnd,!1),this.view.domElement.removeEventListener("touchmove",this._onTouchMove,!1),this.states.dispose(),this.states.removeEventListener("state-changed",this._onStateChange,!1),this.states.removeEventListener(this.states.ORBIT._event,this._onRotation,!1),this.states.removeEventListener(this.states.MOVE_GLOBE._event,this._onDrag,!1),this.states.removeEventListener(this.states.DOLLY._event,this._onDolly,!1),this.states.removeEventListener(this.states.PAN._event,this._onPan,!1),this.states.removeEventListener(this.states.PANORAMIC._event,this._onPanoramic,!1),this.states.removeEventListener("zoom",this._onZoom,!1),this.states.removeEventListener(this.states.TRAVEL_IN._event,this._onTravel,!1),this.states.removeEventListener(this.states.TRAVEL_OUT._event,this._onTravel,!1),this.dispatchEvent({type:"dispose"})}setTilt(t,e){return this.lookAtCoordinate({tilt:t},e)}setHeading(t,e){return this.lookAtCoordinate({heading:t},e)}setRange(t,e){return this.lookAtCoordinate({range:t},e)}getCameraTargetPosition(){return D.position}getRange(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).range}getTilt(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).tilt}getHeading(t){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera,t).heading}pan(t){return this.mouseToPan(t.x,t.y),this.update(this.states.PAN),Promise.resolve()}getCameraOrientation(){return this.view.getPickingPositionFromDepth(null,nt),[this.getTilt(nt),this.getHeading(nt)]}getCameraCoordinate(){return new c.Z("EPSG:4978",this.camera.position).as("EPSG:4326")}getLookAtCoordinate(){return u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera).coord}setAnimationEnabled(t){z=t}isAnimationEnabled(){return z}getZoom(){return this.view.tileLayer.computeTileZoomFromDistanceCamera(this.getRange(),this.view.camera)}setZoom(t,e){return this.lookAtCoordinate({zoom:t},e)}getScale(t){return console.warn("Deprecated, use View#getScale instead."),this.view.getScale(t)}pixelsToMeters(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;return console.warn("Deprecated use View#getPixelsToMeters instead."),t*e/this.getScale(e)/1e3}pixelsToDegrees(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.");const r=this.pixelsToMeters(t,e);return i.MathUtils.radToDeg(2*Math.asin(r/(2*h.c.x)))}metersToPixels(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getMetersToPixels instead.");const r=this.getScale(e);return e/=1e3,t*r/e}setScale(t,e,r){return this.lookAtCoordinate({scale:t,pitch:e},r)}lookAtCoordinate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isAnimationEnabled();if(this.player.stop(),!t.isExtent&&(t.zoom?t.range=this.view.tileLayer.computeDistanceCameraFromTileZoom(t.zoom,this.view.camera):t.scale&&(t.range=this.view.getScaleFromDistance(t.pitch,t.scale),(t.rangethis.maxDistance)&&(console.warn(`This scale ${t.scale} can not be reached`),t.range=i.MathUtils.clamp(t.range,this.minDistance,this.maxDistance))),void 0!==t.tilt)){const e=90-i.MathUtils.radToDeg(this.maxPolarAngle),r=90-i.MathUtils.radToDeg(this.minPolarAngle);(t.tiltr)&&(t.tilt=i.MathUtils.clamp(t.tilt,e,r),console.warn("Tilt was clamped to ",t.tilt,` the interval is between ${e} and ${r} degree`))}return ot=u.ZP.getTransformCameraLookingAtTarget(this.view,this.camera),e?(t.callback=t=>D.position.copy(t.targetWorldPosition),this.dispatchEvent({type:"animation-started"}),u.ZP.animateCameraToLookAtTarget(this.view,this.camera,t).then((t=>(this.dispatchEvent({type:"animation-ended"}),this.handlingEvent(t),t)))):u.ZP.transformCameraToLookAtTarget(this.view,this.camera,t).then((t=>(D.position.copy(t.targetWorldPosition),this.handlingEvent(t),t)))}pickGeoPosition(t){const e=this.view.getPickingPositionFromDepth(t);if(e)return new c.Z("EPSG:4978",e).as("EPSG:4326")}}const lt=at},29571:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>Q,uZ:()=>z});var i=r(99477),n=r(99617);const s=i.MOUSE.LEFT,o=i.MOUSE.MIDDLE,a=i.MOUSE.RIGHT;let l;const c=new i.Vector3,h=new i.Quaternion;let u=0;const d=new i.Vector3,p=-1,f={default:"auto",drag:"move",pan:"cell",travel:"wait",rotate:"move",ortho_zoom:"wait"},m=new i.Vector3,g=new i.Vector2,A=new i.Vector2,y=new i.Vector2(0,0),v=new i.Vector3,x=new i.Vector3,b=new i.Vector3,_=new i.Vector3(0,0,0);let w=0;const E=new i.Vector3,M=new i.Quaternion,S=new i.Vector2,C=new i.Vector3,T=new i.Vector3,I=new i.Quaternion,R=new i.Quaternion;let B=0,L=0,P=!1,D=!1,O=0,k=0;const U=new i.Raycaster,N=new i.Plane(new i.Vector3(0,0,-1)),F={enabled:!0,enableRotation:!0,rotateSpeed:2,minPanSpeed:.05,maxPanSpeed:15,zoomTravelTime:.2,zoomFactor:2,maxResolution:0,minResolution:1/0,maxAltitude:5e7,groundLevel:200,autoTravelTimeMin:1.5,autoTravelTimeMax:4,autoTravelTimeDist:5e4,smartTravelHeightMin:75,smartTravelHeightMax:500,instantTravel:!1,minZenithAngle:0,maxZenithAngle:82.5,handleCollision:!0,minDistanceCollision:30,enableSmartTravel:!0,enablePan:!0},z={MOVED:"moved"};class G extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.camera=t.camera3D,this.enabled="boolean"==typeof e.enabled?e.enabled:F.enabled,this.camera.isOrthographicCamera?(u=this.camera.zoom,this.enableRotation=!1,this.enablePan=!1,this.maxAltitude=1/0,this.zoomTravelTime="number"==typeof e.zoomTravelTime?e.zoomTravelTime:F.zoomTravelTime):(this.enableRotation=void 0===e.enableRotation?F.enableRotation:e.enableRotation,this.rotateSpeed=e.rotateSpeed||F.rotateSpeed,this.enablePan=void 0===e.enablePan?F.enablePan:e.enablePan,this.minPanSpeed=e.minPanSpeed||F.minPanSpeed,this.maxPanSpeed=e.maxPanSpeed||F.maxPanSpeed,this.maxAltitude=e.maxAltitude||F.maxAltitude,this.zoomTravelTime=e.zoomTravelTime||F.zoomTravelTime),e.zoomInFactor&&(console.warn("Controls zoomInFactor parameter is deprecated. Use zoomFactor instead."),e.zoomFactor=e.zoomFactor||e.zoomInFactor),e.zoomOutFactor&&(console.warn("Controls zoomOutFactor parameter is deprecated. Use zoomFactor instead."),e.zoomFactor=e.zoomFactor||e.zoomInFactor||1/e.zoomOutFactor),0===e.zoomFactor&&(console.warn("Controls zoomFactor parameter can not be equal to 0. Its value will be set to default."),e.zoomFactor=F.zoomFactor),this.zoomInFactor=e.zoomFactor||F.zoomFactor,this.zoomOutFactor=1/(e.zoomFactor||F.zoomFactor),this.maxResolution=e.maxResolution||F.maxResolution,this.minResolution=e.minResolution||F.minResolution,this.groundLevel=e.groundLevel||F.groundLevel,this.autoTravelTimeMin=e.autoTravelTimeMin||F.autoTravelTimeMin,this.autoTravelTimeMax=e.autoTravelTimeMax||F.autoTravelTimeMax,this.autoTravelTimeDist=e.autoTravelTimeDist||F.autoTravelTimeDist,e.smartZoomHeightMin&&(console.warn("Controls smartZoomHeightMin parameter is deprecated. Use smartTravelHeightMin instead."),e.smartTravelHeightMin=e.smartTravelHeightMin||e.smartZoomHeightMin),e.smartZoomHeightMax&&(console.warn("Controls smartZoomHeightMax parameter is deprecated. Use smartTravelHeightMax instead."),e.smartTravelHeightMax=e.smartTravelHeightMax||e.smartZoomHeightMax),this.smartTravelHeightMin=e.smartTravelHeightMin||F.smartTravelHeightMin,this.smartTravelHeightMax=e.smartTravelHeightMax||F.smartTravelHeightMax,this.instantTravel=e.instantTravel||F.instantTravel,this.minZenithAngle=(e.minZenithAngle||F.minZenithAngle)*Math.PI/180,this.maxZenithAngle=(e.maxZenithAngle||F.maxZenithAngle)*Math.PI/180,e.focusOnMouseOver&&console.warn("Planar controls 'focusOnMouseOver' optional parameter has been removed."),e.focusOnMouseClick&&console.warn("Planar controls 'focusOnMouseClick' optional parameter has been removed."),this.handleCollision=void 0===e.handleCollision?F.handleCollision:e.handleCollision,this.minDistanceCollision=F.minDistanceCollision,this.enableSmartTravel=void 0===e.enableSmartTravel?F.enableSmartTravel:e.enableSmartTravel,c.copy(this.camera.position),h.copy(this.camera.quaternion),this.state=p,this.cursor=f,this.view.controls&&(console.warn("Deprecated use of PlanarControls. See examples to correct PlanarControls implementation."),this.view.controls.dispose()),this.view.controls=this,this._handlerOnKeyDown=this.onKeyDown.bind(this),this._handlerOnMouseDown=this.onMouseDown.bind(this),this._handlerOnMouseUp=this.onMouseUp.bind(this),this._handlerOnMouseMove=this.onMouseMove.bind(this),this._handlerOnMouseWheel=this.onMouseWheel.bind(this),this._handlerContextMenu=this.onContextMenu.bind(this),this._handlerUpdate=this.update.bind(this),this.view.addFrameRequester(n.Ao.AFTER_CAMERA_UPDATE,this._handlerUpdate),this.addInputListeners()}dispose(){this.removeInputListeners(),this.view.removeFrameRequester(n.Ao.AFTER_CAMERA_UPDATE,this._handlerUpdate)}update(t,e){e&&(t=16);const r=this.state!==p;switch(this.state){case 3:this.handleTravel(t),this.view.notifyChange(this.camera);break;case 4:this.handleZoomOrtho(t),this.view.notifyChange(this.camera);break;case 0:this.handleDragMovement(),this.view.notifyChange(this.camera);break;case 2:this.handleRotation(),this.view.notifyChange(this.camera);break;case 1:this.handlePanMovement(),this.view.notifyChange(this.camera)}this.handleCollision&&this.view.camera.adjustAltitudeToAvoidCollisionWithLayer(this.view,this.view.tileLayer,this.minDistanceCollision),r&&this.view.dispatchEvent({type:z.MOVED}),y.set(0,0)}initiateDrag(){this.state=0,v.copy(this.getWorldPointAtScreenXY(g)),b.set(0,0,0)}handleDragMovement(){this.getWorldPointFromMathPlaneAtScreenXY(g,v.z,x),b.subVectors(v,x),this.camera.position.add(b),b.set(0,0,0)}initiatePan(){this.state=1}handlePanMovement(){E.set(-y.x,y.y,0),this.camera.localToWorld(E),this.camera.position.copy(E)}initiateRotation(){this.state=2,_.copy(this.getWorldPointAtScreenXY(new i.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height)));const t=this.camera.position.distanceTo(_);w=Math.acos((this.camera.position.z-_.z)/t)}handleRotation(){const t=-this.rotateSpeed*y.x/this.view.mainLoop.gfxEngine.width,e=-this.rotateSpeed*y.y/this.view.mainLoop.gfxEngine.height,r=this.camera.position.clone().sub(_);0===t&&0===e||(w+e>=this.minZenithAngle&&w+e<=this.maxZenithAngle&&0!==e&&(w+=e,E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E),r.applyQuaternion(M),E.setFromMatrixColumn(this.camera.matrix,0),M.setFromAxisAngle(E,e),r.applyQuaternion(M),E.set(0,0,1),M.setFromUnitVectors(this.camera.up,E).invert(),r.applyQuaternion(M)),0!==t&&(E.set(0,0,1),M.setFromAxisAngle(E,t),r.applyQuaternion(M))),this.camera.position.copy(r),this.camera.lookAt(m),this.camera.position.add(_),this.camera.updateMatrixWorld()}initiateZoom(t){const e=-t.deltaY;d.copy(this.getWorldPointAtScreenXY(g));const r=new i.Vector3;if(e>0||e<0&&this.maxAltitude>this.camera.position.z){const t=e>0?this.zoomInFactor:this.zoomOutFactor,i=this.view.getPixelsToMeters()/t;if(this.maxResolution>i||i>this.minResolution)return;this.camera.isOrthographicCamera?(this.state=4,this.view.notifyChange(this.camera),O=this.camera.zoom,k=O*t,d.z=this.camera.position.z,B=0,L=this.zoomTravelTime,this.updateMouseCursorType()):(r.lerpVectors(this.camera.position,d,1-1/t),this.initiateTravel(r,this.zoomTravelTime,null,!1))}}handleZoomOrtho(t){B=Math.min(B+t/1e3/L,1);const e=O+B*(k-O);this.camera.zoom!==e&&(this.camera.zoom=e,this.camera.updateProjectionMatrix(),this.view.viewToNormalizedCoords(g,E),E.z=0,E.unproject(this.camera),this.camera.position.x+=d.x-E.x,this.camera.position.y+=d.y-E.y,this.camera.updateMatrixWorld(!0)),this.testAnimationEnd()}initiateSmartTravel(){const t=this.getWorldPointAtScreenXY(g),e=new i.Vector3;e.copy(t).sub(this.camera.position),e.z=0,e.normalize();const r=this.camera.position.distanceTo(t),n=i.MathUtils.lerp(this.smartTravelHeightMin,this.smartTravelHeightMax,Math.min(r/5e3,1)),s=new i.Vector3;s.copy(t),this.enableRotation&&s.add(e.multiplyScalar(2*-n)),s.z=t.z+n,this.camera.isOrthographicCamera&&(O=this.camera.zoom,k=O*(1+Math.min(r/5e3,1)),s.z=this.camera.position.z),this.initiateTravel(s,"auto",t,!0)}initiateTravel(t,e,r,n){if(this.state=3,this.view.notifyChange(this.camera),B=0,this.updateMouseCursorType(),P=this.enableRotation&&r&&(r.isQuaternion||r.isVector3),D=n,T.copy(this.camera.position),I.copy(this.camera.quaternion),P&&(r.isQuaternion?R.copy(r):r.isVector3&&(t===r?(this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I)):(this.camera.position.copy(t),this.camera.lookAt(r),R.copy(this.camera.quaternion),this.camera.quaternion.copy(I),this.camera.position.copy(T)))),C.copy(t),this.instantTravel)L=0;else if("auto"===e){const e=Math.min(1,t.distanceTo(this.camera.position)/this.autoTravelTimeDist);if(L=i.MathUtils.lerp(this.autoTravelTimeMin,this.autoTravelTimeMax,e),P){const t=.5-.5*R.normalize().dot(this.camera.quaternion.normalize());L*=1+2*t,L=Math.min(L,this.autoTravelTimeMax)}}else L=e}handleTravel(t){B=Math.min(B+t/1e3/L,1);const e=D?this.smooth(B):B;this.camera.position.lerpVectors(T,C,e);const r=O+e*(k-O);this.camera.isOrthographicCamera&&this.camera.zoom!==r&&(this.camera.zoom=r,this.camera.updateProjectionMatrix()),!0===P&&this.camera.quaternion.slerpQuaternions(I,R,e),this.testAnimationEnd()}testAnimationEnd(){1===B&&(this.state=p,this.updateMouseCursorType())}goToTopView(){const t=new i.Vector3,e=new i.Quaternion;t.copy(this.getWorldPointAtScreenXY(new i.Vector2(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height))),t.z+=Math.min(this.maxAltitude,this.camera.position.distanceTo(t)),e.setFromAxisAngle(new i.Vector3(1,0,0),0),this.initiateTravel(t,"auto",e,!0)}goToStartView(){this.camera.isOrthographicCamera&&(O=this.camera.zoom,k=u),this.initiateTravel(c,"auto",h,!0)}getWorldPointFromMathPlaneAtScreenXY(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Vector3;return S.copy(this.view.viewToNormalizedCoords(t)),U.setFromCamera(S,this.camera),N.constant=e,U.ray.intersectPlane(N,r),r}getWorldPointAtScreenXY(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;return this.view.getPickingPositionFromDepth(t,e)||this.getWorldPointFromMathPlaneAtScreenXY(t,this.groundLevel,e),e}addInputListeners(){this.view.domElement.addEventListener("keydown",this._handlerOnKeyDown,!1),this.view.domElement.addEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.addEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.addEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.addEventListener("contextmenu",this._handlerContextMenu,!1)}removeInputListeners(){this.view.domElement.removeEventListener("keydown",this._handlerOnKeyDown,!0),this.view.domElement.removeEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.removeEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.removeEventListener("wheel",this._handlerOnMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._handlerContextMenu,!1)}updateMouseCursorType(){switch(this.state){case p:this.view.domElement.style.cursor=this.cursor.default;break;case 0:this.view.domElement.style.cursor=this.cursor.drag;break;case 1:this.view.domElement.style.cursor=this.cursor.pan;break;case 3:this.view.domElement.style.cursor=this.cursor.travel;break;case 4:this.view.domElement.style.cursor=this.cursor.ortho_zoom;break;case 2:this.view.domElement.style.cursor=this.cursor.rotate}}updateMousePositionAndDelta(t){this.view.eventToViewCoords(t,g),y.copy(g).sub(A),A.copy(g)}setCursor(t,e){this.cursor[t]=e,this.updateMouseCursorType()}onMouseDown(t){if(this.enabled&&(t.preventDefault(),this.view.domElement.focus(),p===this.state)){if(l=t.button,this.updateMousePositionAndDelta(t),s===t.button)if(t.ctrlKey){if(!this.enableRotation)return;this.initiateRotation()}else this.initiateDrag();else if(o===t.button){if(!this.enableSmartTravel)return;this.initiateSmartTravel()}else if(a===t.button){if(!this.enablePan)return;this.initiatePan()}this.updateMouseCursorType()}}onMouseUp(t){t.preventDefault(),3!==this.state&&4!==this.state&&l===t.button&&(this.state=p),this.updateMouseCursorType()}onMouseMove(t){this.enabled&&(t.preventDefault(),this.updateMousePositionAndDelta(t),p!==this.state&&this.view.notifyChange())}onKeyDown(t){if(p===this.state&&this.enabled)switch(t.keyCode){case 84:this.camera.isOrthographicCamera||this.goToTopView();break;case 89:this.goToStartView();break;case 32:this.enableSmartTravel&&this.initiateSmartTravel(t)}}onMouseWheel(t){this.enabled&&(t.preventDefault(),t.stopPropagation(),p===this.state&&this.initiateZoom(t))}onContextMenu(t){t.preventDefault()}smooth(t){return(t**2*(3-2*t))**1.2}}const Q=G},5626:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var i=r(99477);const n={BYTE:1,UNSIGNED_BYTE:1,SHORT:2,UNSIGNED_SHORT:2,INT:4,UNSIGNED_INT:4,FLOAT:4,DOUBLE:8},s={BYTE:Int8Array,UNSIGNED_BYTE:Uint8Array,SHORT:Int16Array,UNSIGNED_SHORT:Uint16Array,INT:Int32Array,UNSIGNED_INT:Uint32Array,FLOAT:Float32Array,DOUBLE:Float64Array},o={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},a={VEC2:i.Vector2,VEC3:i.Vector3,VEC4:i.Vector4},l=function(t,e,r,i,l){if(!t)throw new Error("Buffer is mandatory to parse binary property.");if(null==e)throw new Error("batchLength is mandatory to parse binary property.");if(null==r)throw new Error("byteOffset is mandatory to parse binary property.");if(!n[i])throw new Error(`Uknown component type: ${i}. Cannot access binary property.`);if(!o[l])throw new Error(`Uknown type: ${l}. Cannot access binary property.`);const c=o[l],h=new s[i](t,r,e*c);if("SCALAR"===l)return Array.from(h);{const t=[];for(let e=0;e<=h.length-c;e+=c){const r=new a[l];r.fromArray(h,e),t.push(r)}return t}};var c=r(39865);const h=new TextDecoder,u=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ArrayBuffer,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4?arguments[4]:void 0;4!==arguments.length||"object"!=typeof i||Array.isArray(i)||null===i||console.warn("You most likely used a deprecated constructor of C3DTBatchTable."),e+r!==t.byteLength&&console.error("3DTiles batch table json length and binary length are not consistent with total buffer length. The batch table may be wrong."),this.type=c.h.batchtable,this.batchLength=i;const s=t.slice(0,e),o=h.decode(new Uint8Array(s)),a=""===o?null:JSON.parse(o);if(r>0){const i=t.slice(e,e+r);for(const t in a){if(!Object.prototype.hasOwnProperty.call(a,t))continue;const e=a[t];Array.isArray(e)||(void 0!==(null==e?void 0:e.byteOffset)&&void 0!==(null==e?void 0:e.componentType)&&void 0!==(null==e?void 0:e.type)?a[t]=l(i,this.batchLength,e.byteOffset,e.componentType,e.type):console.error("Invalid 3D Tiles batch table property that is neither a JSON array nor a valid accessor to a binary body"))}}a&&a.extensions&&(this.extensions=n.parseExtensions(a.extensions,this.type),delete a.extensions),this.content=a}getInfoById(t){if(t<0&&t{"use strict";r.d(e,{Z:()=>g});var i=r(99477),n=r(2359),s=r(62310),o=r(39865);const a=new n.Z,l=new i.Vector3,c=new i.Vector3,h=new s.Z("EPSG:4326"),u=new i.Vector3,d=new s.Z("EPSG:4326"),p=new i.Vector3,f=new i.Vector3,m=new i.Vector3,g=class{constructor(t,e,r){if(this.type=o.h.boundingVolume,t.region)this.initialVolumeType=o.D.region,this.volume=function(t,e){const r=t[2],n=t[0],s=t[1],o=t[3],l=t[4],c=t[5],m=i.MathUtils.radToDeg(r),g=i.MathUtils.radToDeg(n),A=i.MathUtils.radToDeg(s),y=i.MathUtils.radToDeg(o);d.setFromValues(g,y,l),a.cartographicToCartesian(d,p),h.setFromValues(m,A,c),a.cartographicToCartesian(h,u);const v=new i.Vector3;v.lerpVectors(p,u,.5);const x=f.subVectors(p,u).length()/2,b=new i.Sphere(v,x);return b.applyMatrix4(e),b}(t.region,e);else if(t.box)this.initialVolumeType=o.D.box,this.volume=function(t){c.set(t[0],t[1],t[2]),l.set(t[3],t[7],t[11]).multiplyScalar(2);const e=new i.Box3;return e.setFromCenterAndSize(c,l),e}(t.box);else{if(!t.sphere)throw new Error(`Unknown bounding volume type: ${t}. 3D Tiles nodes must have a bounding volume of type\n region, box or sphere.`);this.initialVolumeType=o.D.sphere,this.volume=function(t){const e=new i.Vector3;return e.set(t[0],t[1],t[2]),new i.Sphere(e,t[3])}(t.sphere)}t.extensions&&(this.extensions=r.parseExtensions(t.extensions,this.type))}boundingVolumeCulling(t,e){if(this.initialVolumeType===o.D.box)return!t.isBox3Visible(this.volume,e);if(this.initialVolumeType===o.D.sphere||this.initialVolumeType===o.D.region)return!t.isSphereVisible(this.volume,e);throw new Error("Unknown bounding volume type.")}viewerRequestVolumeCulling(t,e){return this.initialVolumeType===o.D.region?(console.warn("Region viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.D.box?(console.warn("Bounding box viewerRequestVolume not yet supported"),!0):this.initialVolumeType===o.D.sphere&&(m.copy(this.volume.center),m.applyMatrix4(e),!(t.camera3D.position.distanceTo(m)<=this.volume.radius))}}},83214:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const i=class{registerExtension(t,e){this[t]=e}getExtension(t,e){if(this[t]&&this[t][e])return this[t][e];console.error(`No extension manager registered for extension ${t} and for class ${e}`)}isExtensionRegistered(t){return this[t]}parseExtensions(t,e){const r={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=new(this.getExtension(i,e))(t[i]));return r}}},84607:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var i=r(99477);function n(t){return t.batchTable?t.batchTable:t.parent?n(t.parent):null}const s=class{#t;constructor(t,e,r,i,n){this.object3d=n,this.batchId=e,this.groups=r,this.userData=i,this.tileId=t,this.#t=null}computeWorldBox3(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Box3;return t.max.x=-1/0,t.max.y=-1/0,t.max.z=-1/0,t.min.x=1/0,t.min.y=1/0,t.min.z=1/0,this.groups.forEach((e=>{const r=3*e.start,i=3*(e.start+e.count);for(let e=r;e{"use strict";r.d(e,{D:()=>n,h:()=>i});const i={tileset:"tileset",batchtable:"batchtable",boundingVolume:"boundingVolume"},n={region:"region",box:"box",sphere:"sphere"}},47274:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var i=r(99477),n=r(27245),s=r(39865);const o=new i.Matrix4,a=class{constructor(t,e,r){this.type=s.h.tileset,this.asset=t.asset,this.properties=t.properties,this.geometricError=t.geometricError,this.extensionsUsed=t.extensionsUsed,this.extensionsRequired=t.extensionsRequired,this.tiles=[],this.parseTiles(t.root,e,void 0,r),t.extensions&&(this.extensions=r.parseExtensions(t.extensions,this.type))}parseTiles(t,e,r,s){if(t.transform=t.transform?(new i.Matrix4).fromArray(t.transform):void 0,t._worldFromLocalTransform=t.transform,r&&r._worldFromLocalTransform&&(t.transform?t._worldFromLocalTransform=(new i.Matrix4).multiplyMatrices(r._worldFromLocalTransform,t.transform):t._worldFromLocalTransform=r._worldFromLocalTransform),(t.viewerRequestVolume&&t.viewerRequestVolume.region||t.boundingVolume&&t.boundingVolume.region)&&(t._worldFromLocalTransform?o.copy(t._worldFromLocalTransform).invert():o.identity()),t.viewerRequestVolume=t.viewerRequestVolume?new n.Z(t.viewerRequestVolume,o,s):null,t.boundingVolume=t.boundingVolume?new n.Z(t.boundingVolume,o,s):null,this.tiles.push(t),t.tileId=this.tiles.length-1,t.baseURL=e,t.children)for(const r of t.children)this.parseTiles(r,e,t,s)}extendTileset(t,e,r,i){this.parseTiles(t.root,r,this.tiles[e],i),this.tiles[e].children=[t.root],this.tiles[e].isTileset=!0}}},53175:(t,e,r)=>{"use strict";r.d(e,{Dx:()=>a,S_:()=>n,_F:()=>s,ie:()=>o});var i=r(5199);const n=t=>(t.fx&&(console.warn("ColorLayer fx is deprecated, use ColorLayer.effect_type and ColorLayer.effect_parameter instead."),t.fx>2?(t.effect_parameter=t.fx,t.effect_type=i.pO.removeLightColor):t.fx>0&&(t.effect_parameter=t.fx,t.effect_type=i.pO.removeWhiteColor)),t),s=t=>{if(t.crsOut||t.crsIn){console.warn("Parsing options with crsIn and crsOut are deprecated, use { in, out } structure.");const e={in:{},out:{}};return e.in.crs=t.crsIn,e.in.isInverted=t.isInverted,e.in.styles=t.styles,e.in.layers=t.layers,e.in.filter=t.filter,e.out.crs=t.crsOut,e.out.mergeFeatures=t.mergeFeatures,t.withAltitude&&t.withNormal?(console.warn("Parsing options withAltitude and withNormal is deprecated, use out.structure: 2d or 3d."),e.out.structure="3d"):e.out.structure="2d",e.out.filteringExtent=t.filteringExtent,e.out.style=t.style,void 0!==t.crsOut.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead"),e.out.filter=t.filter,e}return t.out&&(void 0===t.out.withAltitude&&void 0===t.out.withNormal||(console.warn("Parsing options out.withAltitude and out.withNormal is deprecated, use out.structure: 2d or 3d."),t.out.withAltitude&&t.out.withNormal?t.out.structure="3d":t.out.structure="2d"),void 0!==t.out.overrideAltitudeInToZero&&console.error("Parsing options out.overrideAltitudeInToZero is removed, use Style.xxx.base_altitude instead")),t},o=t=>{t.color&&console.error("Color convert option is removed, use Style.xxx.color"),t.extrude&&console.error("extrude convert option is removed, use Style.fill.extrusion_height instead"),t.altitude&&console.error("altitude convert option is removed, use Style.xxx.base_altitude instead")},a=t=>{!1===t.isWebGL2&&console.error("WebGL1 support ended in 2.43.0. Falling-back to the WebGL2 renderer.")}},5167:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>g,iL:()=>d,t1:()=>_,tg:()=>u});var i=r(99477),n=r(71440),s=r(62310),o=r(79323),a=r(49075);function l(t){return new n.ZP(t,1/0,-1/0,1/0,-1/0)}function c(t,e){t.normals&&e.geodesicNormal.toArray(t.normals,t._pos),t._pushValues(e.x,e.y,e.z)}const h=new s.Z("EPSG:4326",0,0,0),u={POINT:0,LINE:1,POLYGON:2};class d{#e;constructor(t){this.indices=[],this.properties={},this.size=t.size,t.extent&&(this.extent=l(t.extent.crs),this.#e=l(t.extent.crs))}startSubGeometry(t,e){const r=this.indices.length-1,i=this.extent?l(this.extent.crs):void 0,n=r>-1?this.indices[r].offset+this.indices[r].count:e.vertices.length/this.size;this.indices.push({offset:n,count:t,extent:i}),this.#e=i,function(t,e){t.vertices.length+=e*t.size,t.normals&&(t.normals.length=t.vertices.length)}(e,t)}closeSubGeometry(t,e){const r=this.indices.length-1,i=r>-1?this.indices[r].offset+this.indices[r].count:e.vertices.length/this.size-t;this.indices.push({offset:i,count:t,extent:this.#e}),this.extent&&(this.extent.union(this.#e),this.#e=l(this.extent.crs))}getLastSubGeometry(){const t=this.indices.length-1;return this.indices[t]}pushCoordinates(t,e){if(t.isCoordinates)return console.warn("Deprecated: change in arguments order, use pushCoordinates(feature, coordIn) instead"),void this.pushCoordinates(e,t);e.as(t.crs,h),t.transformToLocalSystem(h),c(t,h),this.#e&&this.#e.expandByCoordinates(t.useCrsOut?h:e)}pushCoordinatesValues(t,e,r){if((arguments.length<=3?0:arguments.length-3)>0)return console.warn("Deprecated: change in arguments, use pushCoordinatesValues(feature, {x: long, y: lat, normal}, coordProj) instead"),void this.pushCoordinatesValues(t,{x:e,y:r,normal:arguments.length<=3?void 0:arguments[3]},arguments.length<=4?void 0:arguments[4]);c(t,e),this.#e&&this.#e.expandByValuesCoordinates(e.x,e.y)}updateExtent(){if(this.extent){const t=this.indices[this.indices.length-1];t&&this.extent.union(t.extent)}}}function p(t,e){this.vertices[this._pos++]=t,this.vertices[this._pos++]=e}function f(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.vertices[this._pos++]=t,this.vertices[this._pos++]=e,this.vertices[this._pos++]=r}class m{constructor(t,e){if(!Object.keys(u).find((e=>u[e]===t)))throw new Error(`Unsupported Feature type: ${t}`);this.type=t,this.geometries=[],this.vertices=[],this.crs=e.crs,this.size=e.size,this.normals="EPSG:4978"==e.crs?[]:void 0,this.hasRawElevationData=!1,this.transformToLocalSystem=e.transformToLocalSystem.bind(e),e.extent&&(this.extent=l(e.extent.crs),this.useCrsOut=this.extent.crs==this.crs),this._pos=0,this._pushValues=(3===this.size?f:p).bind(this),this.style=a.ZP.setFromProperties}bindNewGeometry(){const t=new d(this);return this.geometries.push(t),t}updateExtent(t){this.extent&&this.extent.union(t.extent)}get geometryCount(){return this.geometries.length}}const g=m,A=()=>{},y=(t,e)=>(t.geodesicNormal.applyNormalMatrix(e.normalMatrixInverse),t.applyMatrix4(e.matrixWorldInverse)),v=(t,e)=>t.applyMatrix4(e.matrixWorldInverse),x=new i.Vector3(0,0,1),b=new i.Quaternion;class _ extends i.Object3D{#r=v;#i=A;constructor(t){var e;super(),this.isFeatureCollection=!0,this.crs=o.Z.formatToEPSG(t.accurate||null===(e=t.source)||void 0===e||!e.crs?t.crs:t.source.crs),this.features=[],this.mergeFeatures=void 0===t.mergeFeatures||t.mergeFeatures,this.size="3d"==t.structure?3:2,this.filterExtent=t.filterExtent,this.style=t.style,this.isInverted=!1,this.matrixWorldInverse=new i.Matrix4,this.center=new s.Z("EPSG:4326",0,0),2==this.size?(this.extent=!1===t.buildExtent?void 0:l(t.forcedExtentCrs||this.crs),this.#i=t=>{t.as(this.crs,this.center),this.position.copy(t),this.updateMatrixWorld(),this.#i=A}):(this.extent=t.buildExtent?l(t.forcedExtentCrs||this.crs):void 0,this.#i=t=>{t.as("EPSG:4326",this.center),"EPSG:4978"==this.crs&&(this.quaternion.setFromUnitVectors(x,t.geodesicNormal),b.setFromAxisAngle(x,i.MathUtils.degToRad(90+this.center.longitude)),this.quaternion.multiply(b)),this.position.copy(t),this.updateMatrixWorld(),this.normalMatrix.getNormalMatrix(this.matrix),this.normalMatrixInverse=(new i.Matrix3).copy(this.normalMatrix).invert(),this.#i=A},this.#r=y)}transformToLocalSystem(t){return this.#i(t),this.#r(t,this)}updateExtent(t){if(this.extent){const e=t?[t]:this.features.map((t=>t.extent));for(const t of e)this.extent.union(t)}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}removeEmptyFeature(){this.features=this.features.filter((t=>t.geometries.length))}pushFeature(t){this.features.push(t),this.updateExtent(t.extent)}requestFeature(t,e){const r=this.features.find(e);if(r&&this.mergeFeatures)return r;{const e=new m(t,this);return this.features.push(e),e}}requestFeatureByType(t){return this.requestFeature(t,(e=>e.type===t))}requestFeatureById(t,e){return this.requestFeature(e,(e=>e.id===t))}newFeatureByReference(t){const e=new m(t.type,this);return e.extent=t.extent,e.geometries=t.geometries,e.normals=t.normals,e.size=t.size,e.vertices=t.vertices,e._pos=t._pos,this.features.push(e),e}}},62310:(t,e,r)=>{"use strict";r.d(e,{Z:()=>f});var i=r(99477),n=r(24472),s=r(79323),o=r(2359);n.default.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const a=new o.Z,l={},c=new i.Vector3,h=new i.Vector3;let u,d;class p{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.isCoordinates=!0,s.Z.isValid(t),this.crs=t,this.x=0,this.y=0,this.z=0,this._normal=new i.Vector3,e.length>0?this.setFromArray(e):e.isVector3||e.isCoordinates?this.setFromVector3(e):this.setFromValues(e,r,n),this._normalNeedsUpdate=!0}setCrs(t){s.Z.isValid(t),this.crs=t}setFromValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.x=null==t?0:t,this.y=null==e?0:e,this.z=null==r?0:r,this._normalNeedsUpdate=!0,this}setFromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.setFromValues(t[e],t[e+1],t[e+2])}setFromVector3(t){return this.setFromValues(t.x,t.y,t.z)}clone(){return new p(this.crs,this)}copy(t){return this.crs=t.crs,this.setFromVector3(t)}get longitude(){return this.x}get latitude(){return this.y}get altitude(){return this.z}set altitude(t){this.z=t}get geodesicNormal(){return this._normalNeedsUpdate&&(this._normalNeedsUpdate=!1,s.Z.is4326(this.crs)?a.geodeticSurfaceNormalCartographic(this,this._normal):"EPSG:4978"==this.crs?a.geodeticSurfaceNormal(this,this._normal):this._normal.set(0,0,1)),this._normal}toVector3(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector3).copy(this)}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i.Vector3.prototype.toArray.call(this,t,e)}planarDistanceTo(t){return this.toVector3(c).setZ(0),t.toVector3(h).setZ(0),c.distanceTo(h)}geodeticDistanceTo(t){return this.as("EPSG:4326",u),t.as("EPSG:4326",d),a.geodesicDistance(u,d)}spatialEuclideanDistanceTo(t){return this.as("EPSG:4978",u).toVector3(c),t.as("EPSG:4978",d).toVector3(h),c.distanceTo(h)}applyMatrix4(t){return i.Vector3.prototype.applyMatrix4.call(this,t)}as(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new p(t);var r,o;return this.crs==t?e.copy(this):(s.Z.is4326(this.crs)&&"EPSG:3857"==t&&(this.y=i.MathUtils.clamp(this.y,-89.999999,89.999999)),e.setFromArray((r=this.crs,o=t,l[r]||(l[r]={}),l[r][o]||(l[r][o]=(0,n.default)(r,o)),l[r][o]).forward([this.x,this.y,this.z]))),e.crs=t,e}}u=new p("EPSG:4326",0,0,0),d=new p("EPSG:4326",0,0,0);const f=p},79323:(t,e,r)=>{"use strict";r.d(e,{Z:()=>p});var i=r(24472);function n(t){return"string"==typeof t||t instanceof String}function s(t){if(!n(t))throw new Error(`Crs parameter value must be a string: '${t}'`)}function o(t){return n(t)&&t.startsWith("TMS")}function a(t){return n(t)&&t.startsWith("EPSG")}function l(t){return s(t),a(t)?t:`EPSG:${t.match(/\d+/)[0]}`}i.default.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");const c={DEGREE:1,METER:2};function h(t){return"EPSG:4326"===t}function u(t){switch(s(t),t){case"EPSG:4326":return c.DEGREE;case"EPSG:4978":return c.METER;default:{const r=i.default.defs(l(t));if(!r)return;return"degrees"===(e=r.units)?c.DEGREE:"m"===e?c.METER:void 0}}var e}function d(t){s(t);const e=u(t);if(void 0===e)throw new Error(`No unit found for crs: '${t}'`);return e}const p={UNIT:c,isValid(t){d(t)},isGeographic:t=>d(t)==c.DEGREE,isMetricUnit:t=>u(t)==c.METER,toUnit:u,is4326:h,isGeocentric:function(t){s(t);const e=i.default.defs(t);return!!e&&"geocent"==e.projName},reasonnableEpsilon:t=>h(t)?.01:.001,formatToEPSG:l,formatToTms:function(t){return s(t),o(t)?t:`TMS:${t.match(/\d+/)[0]}`},isTms:o,isEpsg:a,tms_3857:"TMS:3857",tms_4326:"TMS:4326",defs:(t,e)=>i.default.defs(t,e)}},71440:(t,e,r)=>{"use strict";r.d(e,{Mh:()=>E,ZP:()=>R,dS:()=>M});var i=r(99477),n=r(62310),s=r(79323);const o=new i.Vector2,a=new i.Vector2,l=new i.Vector2,c=new i.Box3,h=new i.Vector2,u=new i.Vector2,d=new i.Vector2(2,2),p={row:0,col:0,invDiff:0},f=new n.Z("EPSG:4326",0,0,0),m=new n.Z("EPSG:4326",0,0,0),g=new n.Z("EPSG:4326",0,0,0),A=new i.Vector3,y=new i.Vector3;function v(t,e){const r=2**(t.zoom-e);return p.invDiff=1/r,p.row=(t.row-t.row%r)*p.invDiff,p.col=(t.col-t.col%r)*p.invDiff,p}let x,b;const _=new Array(8);for(let t=_.length-1;t>=0;t--)_[t]=new n.Z("EPSG:4326",0,0,0,0);const w=new n.Z("EPSG:4326",0,0),E=new Map,M=new Map;function S(t){const e=s.Z.formatToEPSG(t),r=E.get(e),i=r.planarDimensions(a),n=s.Z.formatToTms(t);return{epsg:e,globalExtent:r,globalDimension:i,sTs:M.get(n)||M.get("default"),isInverted:!n.includes(":NI")}}function C(t,e){const r=M.get(s.Z.formatToTms(t))||M.get("default"),i=2**e;return l.set(i,i).multiply(r),l}class T{constructor(t,e,r,i,n){if(s.Z.isGeocentric(t))throw new Error(`${t} is a geocentric projection, it doesn't make sense with a geographical extent`);this.isExtent=!0,this.crs=t,this.zoom=0,s.Z.isTms(this.crs)?(this.row=0,this.col=0):(this.west=0,this.east=0,this.south=0,this.north=0),this.set(e,r,i,n)}clone(){return s.Z.isTms(this.crs)?new T(this.crs,this.zoom,this.row,this.col):new T(this.crs,this.west,this.east,this.south,this.north)}tiledCovering(t){if("EPSG:4326"==this.crs&&t==s.Z.tms_3857){const e=[],r=x.copy(this).as(s.Z.formatToEPSG(t),b),{globalExtent:i,globalDimension:n,sTs:o}=S(s.Z.formatToEPSG(t));r.clampByExtent(i),r.planarDimensions(u);const a=this.zoom+1||Math.floor(Math.log2(Math.round(n.x/(u.x*o.x)))),l=C(t,a),c=r.center(w);h.x=c.x-i.west,h.y=i.north-r.north,h.divide(n).multiply(l).floor();for(let s=Math.ceil((i.north-r.south)/n.x*l.y)-1;s>=h.y;s--)e.push(new T(t,a,s,h.x));return e}{const e=new T(t,0,0,0),{globalExtent:r,globalDimension:i,sTs:n,isInverted:s}=S(this.crs),o=this.center(w);this.planarDimensions(u);const a=Math.floor(Math.log2(Math.round(i.x/(u.x*n.x)))),l=C(t,a);return h.x=o.x-r.west,h.y=s?r.north-o.y:o.y-r.south,h.divide(i).multiply(l).floor(),e.set(a,h.y,h.x),[e]}}as(t,e){if(s.Z.isValid(t),e=e||new T("EPSG:4326",[0,0,0,0]),s.Z.isTms(this.crs)){const{epsg:r,globalExtent:i,globalDimension:n}=S(this.crs),s=C(this.crs,this.zoom);return u.set(1,1).divide(s).multiply(n),e.west=i.west+(n.x-u.x*(s.x-this.col)),e.east=e.west+u.x,e.south=i.south+u.y*(s.y-this.row-1),e.north=e.south+u.y,e.crs=r,e.zoom=this.zoom,t==r?e:e.as(t,e)}if(s.Z.isEpsg(t)){if(this.crs!=t){const r=this.center(w);_[0].setFromValues(this.west,this.north),_[1].setFromValues(r.x,this.north),_[2].setFromValues(this.east,this.north),_[3].setFromValues(this.east,r.y),_[4].setFromValues(this.east,this.south),_[5].setFromValues(r.x,this.south),_[6].setFromValues(this.west,this.south),_[7].setFromValues(this.west,r.y),e.set(1/0,-1/0,1/0,-1/0);for(let r=0;r<_.length;r++)_[r].crs=this.crs,_[r].as(t,w),e.north=Math.max(e.north,w.y),e.south=Math.min(e.south,w.y),e.east=Math.max(e.east,w.x),e.west=Math.min(e.west,w.x);return e.zoom=this.zoom,e.crs=t,e}return e.crs=t,e.zoom=this.zoom,e.set(this.west,this.east,this.south,this.north),e}}center(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Z(this.crs);if(s.Z.isTms(this.crs))throw new Error("Invalid operation for WMTS bbox");return this.planarDimensions(o),t.crs=this.crs,t.setFromValues(this.west+.5*o.x,this.south+.5*o.y),t}dimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return console.warn("Extent.dimensions is deprecated, use planarDimensions, geodeticDimensions or spatialEuclideanDimensions"),t.x=Math.abs(this.east-this.west),t.y=Math.abs(this.north-this.south),t}planarDimensions(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2).set(Math.abs(this.east-this.west),Math.abs(this.north-this.south))}geodeticDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return f.crs=this.crs,m.crs=this.crs,g.crs=this.crs,f.setFromValues(this.west,this.north,0),m.setFromValues(this.west,this.south,0),g.setFromValues(this.east,this.north,0),t.set(f.geodeticDistanceTo(g),f.geodeticDistanceTo(m))}spatialEuclideanDimensions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector2;return f.crs=this.crs,m.crs=this.crs,g.crs=this.crs,f.setFromValues(this.west,this.north,0),m.setFromValues(this.west,this.south,0),g.setFromValues(this.east,this.north,0),t.set(f.spatialEuclideanDistanceTo(g),f.spatialEuclideanDistanceTo(m))}isPointInside(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.crs==t.crs?w.copy(t):t.as(this.crs,w),w.x<=this.east+e&&w.x>=this.west-e&&w.y<=this.north+e&&w.y>=this.south-e}isInside(t,e){return s.Z.isTms(this.crs)?this.zoom==t.zoom?this.row==t.row&&this.col==t.col:!(this.zoom1&&void 0!==arguments[1]?arguments[1]:new i.Vector4;if(this.crs!=t.crs)throw new Error("unsupported mix");if(s.Z.isTms(this.crs))return v(this,t.zoom),e.set(this.col*p.invDiff-p.col,this.row*p.invDiff-p.row,p.invDiff,p.invDiff);t.planarDimensions(o),this.planarDimensions(a);const r=(this.west-t.west)/o.x,n=(t.north-this.north)/o.y,l=a.x/o.x,c=a.y/o.y;return e.set(r,n,l,c)}tiledExtentParent(t){return t&&t=r.east||t.east<=r.west||t.south>=r.north||t.north<=r.south)}intersect(t){return this.intersectsExtent(t)?(t.crs!=this.crs&&(t=t.as(this.crs,x)),new T(this.crs,Math.max(this.west,t.west),Math.min(this.east,t.east),Math.max(this.south,t.south),Math.min(this.north,t.north))):new T(this.crs,0,0,0,0)}set(t,e,r,i){if(null==t)throw new Error("No values to set in the extent");return t.isExtent&&(s.Z.isTms(t.crs)?(e=t.row,r=t.col,t=t.zoom):(e=t.east,r=t.south,i=t.north,t=t.west)),s.Z.isTms(this.crs)?(this.zoom=t,this.row=e,this.col=r):t.isCoordinates?(this.west=t.x,this.east=e.x,this.south=t.y,this.north=e.y):void 0!==t.west?(this.west=t.west,this.east=t.east,this.south=t.south,this.north=t.north):4==t.length?(this.west=t[0],this.east=t[1],this.south=t[2],this.north=t[3]):void 0!==i&&(this.west=t,this.east=e,this.south=r,this.north=i),this}copy(t){return this.crs=t.crs,this.set(t)}union(t){if(t.crs!=this.crs)throw new Error("unsupported union between 2 diff crs");if(this.west===1/0)this.copy(t);else{const e=t.west;ethis.east&&(this.east=r);const i=t.south;ithis.north&&(this.north=n)}}expandByCoordinates(t){const e=t.crs==this.crs?t:t.as(this.crs,w);this.expandByValuesCoordinates(e.x,e.y)}expandByValuesCoordinates(t,e){tthis.east&&(this.east=t),ethis.north&&(this.north=e)}static fromBox3(t,e){return s.Z.isGeocentric(t)&&(t="EPSG:4326",e=c.copy(e),m.crs=t,m.setFromVector3(e.min).as(t,m).toVector3(e.min),g.crs=t,g.setFromVector3(e.max).as(t,g).toVector3(e.max)),new T(t,{west:e.min.x,east:e.max.x,south:e.min.y,north:e.max.y})}toString(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return s.Z.isTms(this.crs)?`${this.zoom}${t}${this.row}${t}${this.col}`:`${this.east}${t}${this.north}${t}${this.west}${t}${this.south}`}subdivision(){return this.subdivisionByScheme()}subdivisionByScheme(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;const e=[],r=this.planarDimensions(o).divide(t);for(let i=t.x-1;i>=0;i--)for(let n=t.y-1;n>=0;n--){const t=this.west+i*r.x,s=this.south+n*r.y;e.push(new T(this.crs,t,t+r.x,s,s+r.y))}return e}applyMatrix4(t){if(!s.Z.isTms(this.crs)){if(A.set(this.west,this.south,0).applyMatrix4(t),y.set(this.east,this.north,0).applyMatrix4(t),this.west=A.x,this.east=y.x,this.south=A.y,this.north=y.y,this.west>this.east){const t=this.west;this.west=this.east,this.east=t}if(this.south>this.north){const t=this.south;this.south=this.north,this.north=t}return this}}clampSouthNorth(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.south,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.north;return this.south=Math.max(this.south,t),this.north=Math.min(this.north,e),this}clampWestEast(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.west,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.east;return this.west=Math.max(this.west,t),this.east=Math.min(this.east,e),this}clampByExtent(t){return this.clampSouthNorth(t.south,t.north),this.clampWestEast(t.west,t.east)}}x=new T("EPSG:4326",[0,0,0,0]),b=new T("EPSG:4326",[0,0,0,0]),E.set("EPSG:4326",new T("EPSG:4326",-180,180,-90,90));const I=E.get("EPSG:4326").as("EPSG:3857");I.clampSouthNorth(I.west,I.east),E.set("EPSG:3857",I),M.set("default",new i.Vector2(1,1)),M.set(s.Z.tms_3857,M.get("default")),M.set(s.Z.tms_4326,new i.Vector2(2,1));const R=T},2362:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477),n=r(62310),s=r(79323);const o=new n.Z("EPSG:4326"),a=new i.Vector2,l=class{constructor(t,e,r){s.Z.isGeographic(t.crs),this.extent=t,this.step=new i.Vector2(e.x,e.y||e.x),this.dimensions=this.extent.planarDimensions(),this.dataSize=(new i.Vector2).addVectors(this.step,this.dimensions).divide(this.step).round(),this.getData=r}getHeightAtCoordinates(t){return t.as(this.extent.crs,o),a.set((this.dataSize.x-1)*(o.x-this.extent.west)/this.dimensions.x,(this.dataSize.y-1)*(o.y-this.extent.south)/this.dimensions.y),a.x<0||a.x>=this.dataSize.x-1||a.y<0||a.y>=this.dataSize.y-1?0:function(t,e){const r=Math.floor(t.x),i=Math.floor(t.y),n=t.x-r,s=t.y-i;return(1-n)*((1-s)*e(i,r)+s*e(i+1,r))+n*((1-s)*e(i,r+1)+s*e(i+1,r+1))}(a,this.getData)}}},59947:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var i=r(99477),n=r(86541);const s=new(r(62310).Z)("EPSG:4326");let o,a="";a=void 0!==document.documentElement.style.transform?"transform":void 0!==document.documentElement.style.webkitTransform?"webkitTransform":void 0!==document.documentElement.style.mozTransform?"mozTransform":void 0!==document.documentElement.style.oTransform?"oTransform":"transform";class l extends i.Object3D{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==e)throw new Error("coordinates are mandatory to add a Label");arguments.length>3&&console.warn("Deprecated argument sprites in Label constructor. Sprites must be configured in style argument."),super();let i=this.visible;Object.defineProperty(this,"visible",{set(t){t!=i&&(i=t,this.content.style.display=t?"block":"none")},get:()=>i}),this.isLabel=!0,this.coordinates=e,this.projectedPosition={x:0,y:0},this.boundaries={left:0,right:0,top:0,bottom:0},"string"==typeof t?(this.content=document.createElement("div"),this.content.textContent=r.text.field):this.content=t.cloneNode(!0),this.content.classList.add("itowns-label"),this.content.style.userSelect="none",this.content.style.position="absolute",r.isStyle?(this.anchor=r.getTextAnchorPosition(),this.styleOffset=r.text.offset,"string"==typeof t&&(r.text.haloWidth>0&&this.content.classList.add("itowns-stroke-single"),r.applyToHTML(this.content).then((t=>{t&&(this.icon=t)})))):(this.anchor=[0,0],this.styleOffset=[0,0]),this.iconOffset={left:0,right:0,top:0,bottom:0},this.zoom={min:r.zoom&&null!=r.zoom.min?r.zoom.min:2,max:r.zoom&&null!=r.zoom.max?r.zoom.max:24},this.order=r.order||0,this.padding=2}updateProjectedPosition(t,e){const r=Math.round(t),i=Math.round(e);r==this.projectedPosition.x&&i==this.projectedPosition.y||(this.projectedPosition.x=r,this.projectedPosition.y=i,this.boundaries.left=t+this.offset.left-this.padding,this.boundaries.right=t+this.offset.right+this.padding,this.boundaries.top=e+this.offset.top-this.padding,this.boundaries.bottom=e+this.offset.bottom+this.padding,0===this.iconOffset.left&&0===this.iconOffset.right&&0===this.iconOffset.top&&0===this.iconOffset.bottom||(this.boundaries.left=Math.min(this.boundaries.left,t+this.iconOffset.left),this.boundaries.right=Math.max(this.boundaries.right,t+this.iconOffset.right),this.boundaries.top=Math.min(this.boundaries.top,e+this.iconOffset.top),this.boundaries.bottom=Math.max(this.boundaries.bottom,e+this.iconOffset.bottom)))}updateCSSPosition(){this.content.style[a]=`translate(${this.projectedPosition.x+this.offset.left}px, ${this.projectedPosition.y+this.offset.top}px)`,this.icon&&(this.icon.style[a]=`translate(${-this.offset.left}px, ${-this.offset.top}px)`)}initDimensions(){if(!this.offset){o=this.content.getBoundingClientRect();const t=Math.round(o.width),e=Math.round(o.height);this.offset={left:t*this.anchor[0]+this.styleOffset[0],top:e*this.anchor[1]+this.styleOffset[1]},this.offset.right=this.offset.left+t,this.offset.bottom=this.offset.top+e,this.icon&&(o=this.icon.getBoundingClientRect(),this.iconOffset={left:Math.floor(o.x),top:Math.floor(o.y),right:Math.ceil(o.x+o.width),bottom:Math.ceil(o.y+o.height)})}}update3dPosition(t){this.coordinates.as(t,s).toVector3(this.position),this.updateMatrixWorld()}updateElevationFromLayer(t,e){if(0==t.attachedLayers.filter((t=>t.isElevationLayer)).length)return;let r=Math.max(0,n.Z.getElevationValueAt(t,this.coordinates,n.Z.FAST_READ_Z,e));isNaN(r)&&(r=Math.max(0,n.Z.getElevationValueAt(t,this.coordinates,n.Z.FAST_READ_Z))),isNaN(r)||r==this.coordinates.z||(this.coordinates.z=r)}updateHorizonCullingPoint(){this.horizonCullingPoint&&this.getWorldPosition(this.horizonCullingPoint)}}const c=l},99617:(t,e,r)=>{"use strict";r.d(e,{Ao:()=>s,HR:()=>n,ZP:()=>c});var i=r(99477);const n=0,s={UPDATE_START:"update_start",BEFORE_CAMERA_UPDATE:"before_camera_update",AFTER_CAMERA_UPDATE:"after_camera_update",BEFORE_LAYER_UPDATE:"before_layer_update",AFTER_LAYER_UPDATE:"after_layer_update",BEFORE_RENDER:"before_render",AFTER_RENDER:"after_render",UPDATE_END:"update_end"};function o(t,e,r){if(r)for(const i of r){const r=e.update(t,e,i),n=e.getObjectToUpdateForAttachedLayers(i);if(n)if(n.element)for(const r of e.attachedLayers)r.ready&&(r.update(t,r,n.element,n.parent),r.cache.flush());else if(n.elements)for(let r=0;r{t===e||t.isCamera?(e.info.clear(),r=!0):t.layer===e&&i.add(t)})),r?new Set([e]):i}class l extends i.EventDispatcher{#n=!1;#s=!0;#o=0;constructor(t,e){super(),this.renderingState=n,this.scheduler=t,this.gfxEngine=e}scheduleViewUpdate(t,e){this.#n|=e,1!==this.renderingState&&(this.renderingState=1,this.gfxEngine.renderer.xr.isPresenting||requestAnimationFrame((e=>{this.step(t,e)})))}#a(t,e,r){const i={camera:t.camera,engine:this.gfxEngine,scheduler:this.scheduler,view:t};e.forEach((t=>{const r=t.layer||t;r.isLayer&&r.parent&&e.add(r.parent)}));for(const n of t.getLayers(((t,e)=>!e)))if(i.geometryLayer=n,n.ready&&n.visible&&!n.frozen){t.execFrameRequesters(s.BEFORE_LAYER_UPDATE,r,this.#s,n);const l=a(e,n);if(l.size>0){for(const t of n.attachedLayers)t.ready&&t.preUpdate&&t.preUpdate(i,l);const t=n.preUpdate(i,l);o(i,n,t),n.postUpdate(i,n,e)}n.cache.flush(),t.execFrameRequesters(s.AFTER_LAYER_UPDATE,r,this.#s,n)}}step(t,e){const r=e-this.#o;t._executeFrameRequestersRemovals(),t.execFrameRequesters(s.UPDATE_START,r,this.#s);const i=this.#n;this.#o=e,this.#n=!1,this.renderingState=n;const o=new Set(t._changeSources);t._changeSources.clear();const a=this.gfxEngine.getWindowSize();t.execFrameRequesters(s.BEFORE_CAMERA_UPDATE,r,this.#s),t.camera.update(a.x,a.y),t.execFrameRequesters(s.AFTER_CAMERA_UPDATE,r,this.#s);const l=t.camera3D.matrixAutoUpdate;t.camera3D.matrixAutoUpdate=!1,this.#a(t,o,r),0==this.scheduler.commandsWaitingExecutionCount()&&this.dispatchEvent({type:"command-queue-empty"}),i&&this.#l(t,r),this.#s=this.renderingState===n,t.camera3D.matrixAutoUpdate=l,t.execFrameRequesters(s.UPDATE_END,r,this.#s)}#l(t,e){t.execFrameRequesters(s.BEFORE_RENDER,e,this.#s),t.render?t.render():this.gfxEngine.renderView(t),t.execFrameRequesters(s.AFTER_RENDER,e,this.#s)}}const c=l},2359:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l,c:()=>o});var i=r(99477),n=r(24472),s=r(62310);const o=new i.Vector3(n.default.WGS84.a,n.default.WGS84.a,n.default.WGS84.b),a=new i.Vector3,l=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;this.size=new i.Vector3,this._radiiSquared=new i.Vector3,this._invRadiiSquared=new i.Vector3,this.eccentricity=0,this.setSize(t)}geodeticSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;return t.toVector3(e).multiply(this._invRadiiSquared).normalize()}geodeticSurfaceNormalCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;const r=i.MathUtils.degToRad(t.longitude),n=i.MathUtils.degToRad(t.latitude),s=Math.cos(n);return e.set(s*Math.cos(r),s*Math.sin(r),Math.sin(n))}setSize(t){this.size.set(t.x,t.y,t.z),this._radiiSquared.multiplyVectors(t,t),this._invRadiiSquared.x=0==t.x?0:1/this._radiiSquared.x,this._invRadiiSquared.y=0==t.y?0:1/this._radiiSquared.y,this._invRadiiSquared.z=0==t.z?0:1/this._radiiSquared.z,this.eccentricity=Math.sqrt(this._radiiSquared.x-this._radiiSquared.z)/this.size.x}cartographicToCartesian(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;a.copy(t.geodesicNormal),e.multiplyVectors(this._radiiSquared,a);const r=Math.sqrt(a.dot(e));return e.divideScalar(r),a.multiplyScalar(t.altitude),e.add(a)}cartesianToCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new s.Z("EPSG:4326",0,0,0);const r=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),n=this.size.x,o=this.size.z,a=Math.abs((n*n-o*o)/(n*n)),l=1-Math.sqrt(1-a),c=Math.sqrt(t.x*t.x+t.y*t.y),h=Math.atan2(t.y,t.x),u=Math.atan(t.z/c*(1-l+a*n/r)),d=Math.sin(u),p=Math.cos(u),f=Math.atan((t.z*(1-l)+a*n*d*d*d)/((1-l)*(c-a*n*p*p*p))),m=c*Math.cos(f)+t.z*Math.sin(f)-n*Math.sqrt(1-a*Math.sin(f)*Math.sin(f));return e.setFromValues(i.MathUtils.radToDeg(h),i.MathUtils.radToDeg(f),m)}cartographicToCartesianArray(t){const e=[];for(let r=0;r{"use strict";r.d(e,{Z:()=>g});var i=r(99477),n=r(14625),s=r(5199),o=r(62310);const a=new i.Vector4;function l(t,e){let r;for(let i=0;i<=t;i++){const t=i*i;for(let n=-i;n<=i;n++){const s=n*n;for(let o=-i;o<=i;o++){const i=s+o*o;if(!(i>t||i<=r||!1!==e(n,o)))return}}r=t}}function c(t){return t.layer?t.layer:t.parent?c(t.parent):void 0}const h=new i.Raycaster,u=new i.Vector2,d=new i.Vector3,p=new o.Z("EPSG:4978"),f=new i.Vector3,m=new o.Z("EPSG:4978"),g={pickTilesAt(t,e,r,o){let c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const h=function(t,e,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const c=t.mainLoop.gfxEngine.getWindowSize();r=r||new i.Vector2(Math.floor(c.x/2),Math.floor(c.y/2));const h=e.level0Nodes.map((t=>n.Z.push(t,n.Z.MODES.ID))),u=t.mainLoop.gfxEngine.renderViewToBuffer({camera:t.camera,scene:e.object3d},{x:r.x-o,y:r.y-o,width:1+2*o,height:1+2*o});h.forEach((t=>t()));const d=[];return l(o,((t,e)=>{const r=4*(2*e*o+t),i=u.slice(r,r+4||void 0);a.fromArray(i).divideScalar(255);const n=(0,s.On)(a,256**3),l=Math.round(n);d.includes(l)||d.push(l)})),d}(t,o,e,r),u=t=>{h.includes(t.id)&&t.isTileMesh&&c.push({object:t,layer:o})};for(const t of o.level0Nodes)t.traverse(u);return c},pickPointsAt(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!i.root)return;i.object3d.traverse((t=>{t.isPoints&&t.baseId&&t.material.enablePicking(!0)}));const s=t.mainLoop.gfxEngine.renderViewToBuffer({camera:t.camera,scene:i.object3d},{x:e.x-r,y:e.y-r,width:1+2*r,height:1+2*r}),o=[];return l(r,((t,e)=>{const i=4*(2*e*r+t),n=s.slice(i,i+4),a={objId:n[0]<<8|n[1],index:n[2]<<8|n[3]};for(let t=0;t{if(e.isPoints&&e.baseId){e.material.enablePicking(!1);for(let r=0;r4&&void 0!==arguments[4]?arguments[4]:[];if(t.viewToNormalizedCoords(e,u),r<0){h.setFromCamera(u,t.camera3D);const e=h.intersectObject(n,!0);for(const t of e)t.layer=c(t.object),s.push(t);return s}const o={x:e.x-r,y:e.y-r,width:1+2*r,height:1+2*r},a=t.mainLoop.gfxEngine.renderViewToBuffer({scene:n,camera:t.camera},o),d=new i.Color;t.mainLoop.gfxEngine.renderer.getClearColor(d);const p=Math.round(255*d.r),f=Math.round(255*d.g),m=Math.round(255*d.b),g=u.clone();return l(r,((e,i)=>{const o=4*((i+r)*(2*r+1)+(e+r)),l=a[o],d=a[o+1],A=a[o+2];if(Math.abs(p-l)<=1&&Math.abs(f-d)<=1&&Math.abs(m-A)<=1)return;g.setX(u.x+e/t.camera.width).setY(u.y+i/t.camera.height),h.setFromCamera(g,t.camera3D);const y=h.intersectObject(n,!0);for(const t of y)t.layer=c(t.object),s.push(t);return 0==s.length})),s}}},51969:(t,e,r)=>{"use strict";r.d(e,{Z:()=>f});var i=r(99477),n=r(62310),s=r(71440);const o=Math.PI/4,a=1/(2*Math.PI),l=new i.Vector3(0,0,1),c=new i.Vector3(0,1,0),h=new i.Quaternion,u=new i.Quaternion,d=new i.Quaternion;function p(t){return 1-(.5-Math.log(Math.tan(o+.5*i.MathUtils.degToRad(t)))*a)}const f=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.tmp={coords:[new n.Z("EPSG:4326",0,0),new n.Z("EPSG:4326",0,0)],position:new i.Vector3,dimension:new i.Vector2},this.crs=t.crs,this.uvCount=t.uvCount,this.computeUvs=[()=>{},t=>{const e=p(t.projected.latitude)*t.nbRow;return(isFinite(e)?e:0)-t.deltaUV1}]}prepare(t){t.nbRow=2**(t.level+1);let e=p(t.extent.south);isFinite(e)||(e=0);const r=e%(1/t.nbRow);t.deltaUV1=(e-r)*t.nbRow,t.quatNormalToZ=d.setFromAxisAngle(c,-(.5*Math.PI-i.MathUtils.degToRad(t.extent.center().latitude))),t.projected={longitude:0,latitude:0},t.extent.planarDimensions(this.tmp.dimension)}center(t){return t.center(this.tmp.coords[0]).as(this.crs,this.tmp.coords[1]).toVector3()}vertexPosition(t){return this.tmp.coords[0].setFromValues(t.projected.longitude,t.projected.latitude),this.tmp.coords[0].as(this.crs,this.tmp.coords[1]).toVector3(this.tmp.position),this.tmp.position}vertexNormal(){return this.tmp.coords[1].geodesicNormal}uProjecte(t,e){e.projected.longitude=e.extent.west+t*this.tmp.dimension.x}vProjecte(t,e){e.projected.latitude=e.extent.south+t*this.tmp.dimension.y}computeSharableExtent(t){const e=Math.abs(t.west-t.east)/2,r=new s.ZP(t.crs,-e,e,t.south,t.north),n=i.MathUtils.degToRad(t.west-r.west),o=i.MathUtils.degToRad(90-t.center(this.tmp.coords[0]).latitude);return h.setFromAxisAngle(l,n),u.setFromAxisAngle(c,o),h.multiply(u),{sharableExtent:r,quaternion:h.clone(),position:this.center(t)}}}},49401:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(99477),n=r(96021),s=r(2359),o=r(71440),a=r(51969),l=r(81189),c=r(79323);const h=new i.Matrix4,u=new i.Vector3;let d=0;const p=new i.Vector3;class f extends n.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=o.dS.get(c.Z.tms_4326),l=o.Mh.get("EPSG:4326").subdivisionByScheme(n);r.tileMatrixSets=[c.Z.tms_4326,c.Z.tms_3857];const u=r.tileMatrixSets.length,d=new a.Z({crs:"EPSG:4978",uvCount:u});super(t,e||new i.Group,l,d,r),this.isGlobeLayer=!0,this.options.defaultPickingRadius=5,this.minSubdivisionLevel=null==this.minSubdivisionLevel?2:this.minSubdivisionLevel,this.maxSubdivisionLevel=null==this.maxSubdivisionLevel?19:this.maxSubdivisionLevel,this.maxDeltaElevationLevel=this.maxDeltaElevationLevel||4,this.extent=this.schemeTile[0].clone();for(let t=1;t0:d{"use strict";r.d(e,{b:()=>R,Z:()=>L});var i=r(99477),n=r(73502),s=r(61861),o=r(62310),a=r(49401),l=r(45222),c=r(2359);const h={getSunPosition(){const t=Math,e=t.PI,r=t.sin,i=t.cos,n=t.tan,s=t.asin,o=t.atan2,a=e/180,l=23.4397*a;function c(t,e,s){return o(r(t),i(t)*r(e)-n(s)*i(e))}function h(t,e,n){return s(r(e)*r(n)+i(e)*i(n)*i(t))}return function(t,u,d){const p=a*u,f=function(t){return function(t){return t.valueOf()/864e5-.5+2440588}(t)-2451545}(t),m=function(t){return a*(357.5291+.98560028*t)}(f),g=function(t){return a*(1.9148*r(t)+.02*r(2*t)+3e-4*r(3*t))}(m),A=function(t,r){return t+r+102.9372*a+e}(m,g),y=(v=A,s(r(0)*i(l)+i(0)*r(l)*r(v)));var v;const x=function(t,e){return o(r(t)*i(l)-n(0)*r(l),i(t))}(A),b=function(t,e){return a*(280.16+360.9856235*t)-e}(f,a*-d),_=b-x;return{EclipticLongitude:A,declinaison:y,ascension:x,H:_,SiderealTime:b,altitude:h(_,p,y),azimuth:c(_,p,y)+e/2}}},getSunPositionInScene(t,e,r){const i=864e5,n=h.getSunPosition()(t,e,r).ascension+t%i/i*-360+180;return new o.Z("EPSG:4326",n,e,5e7).as("EPSG:4978").toVector3()}},u=h,d={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},v3LightPosition:{type:"v3",value:new i.Vector3},up:{type:"v3",value:new i.Vector3(0,1,0)}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( cameraPosition + position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( cameraPosition + position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 v3LightPosition;","uniform vec3 up;","varying vec3 vWorldPosition;","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","vec3 up2 = normalize(cameraPosition.xyz);","float sunfade = 1.0-clamp(1.0-exp((v3LightPosition.y/450000.0)),0.0,1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(v3LightPosition);","float sunE = sunIntensity(dot(sunDirection, up2));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up2, normalize(vWorldPosition - cameraPosition))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPosition), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up2, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPosition);","float theta = acos(direction.y); // elevation --\x3e y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --\x3e x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPosition).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1. - ( (length(cameraPosition) - 6400000.) / 1000.);","}"].join("\n")};class p extends i.Mesh{constructor(){const t=i.UniformsUtils.clone(d.uniforms),e=new i.ShaderMaterial({fragmentShader:d.fragmentShader,vertexShader:d.vertexShader,uniforms:t,side:i.BackSide,transparent:!0,depthWrite:!1});super(new i.SphereGeometry(4e4,32,15),e)}}const f=p,m="#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvec4 glowColor = vec4(0.45, 0.74, 1. ,1.0);\n\nvoid main() {\n #include \n gl_FragColor = glowColor * intensity;\n}\n\n",g="#include \n#include \n\nuniform int atmoIN;\nvarying float intensity;\n\nvoid main()\n{\n vec3 normalES = normalize( normalMatrix * normal );\n vec3 normalCAMES = normalize( normalMatrix * cameraPosition );\n\n if(atmoIN == 0) {\n intensity = pow(0.666 - dot(normalES, normalCAMES), 4. );\n } else {\n intensity = pow( 1. - dot(normalES, normalCAMES), 0.8 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n #include \n}\n\n\n",A=new i.Vector3(1,0,0),y=new i.Vector3,v=new o.Z("EPSG:4326"),x=new o.Z("EPSG:4326"),b=new i.Color(9688568),_=new i.Color,w=new i.Color(197896),E=6e5,M=160*c.c.x;class S extends l.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"atmosphere",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.source=!1,super(t,new i.Object3D,e),this.isAtmosphere=!0;const r=new i.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:0},screenSize:{type:"v2",value:new i.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:i.BackSide,blending:i.AdditiveBlending,transparent:!0,wireframe:!1}),n=new i.SphereGeometry(1,64,64),s=new i.Mesh(n,r);s.scale.copy(c.c).multiplyScalar(1.14),this.basicAtmosphere=new i.Object3D,this.realisticAtmosphere=new i.Object3D,this.realisticAtmosphere.visible=!1,this.object3d.add(this.basicAtmosphere),this.object3d.add(this.realisticAtmosphere),this.basicAtmosphere.add(s);const o=new i.ShaderMaterial({uniforms:{atmoIN:{type:"i",value:1},screenSize:{type:"v2",value:new i.Vector2(window.innerWidth,window.innerHeight)}},vertexShader:g,fragmentShader:m,side:i.FrontSide,blending:i.AdditiveBlending,transparent:!0,depthWrite:!1}),a=new i.Mesh(n,o);a.scale.copy(c.c).multiplyScalar(1.002),this.basicAtmosphere.add(a),this.realisticLightingPosition={x:-.5,y:0,z:1},this.fog={enable:!0,distance:M},this.realisticAtmosphereInitParams=e.Kr?e:{Kr:.0025,Km:.0015,ESun:20,g:-.95,innerRadius:64e5,outerRadius:67e5,wavelength:[.65,.57,.475],scaleDepth:.25},this.object3d.updateMatrixWorld()}update(t,e,r){r.material.fogDistance=this.fog.distance,r.material.lightingEnabled=this.realisticAtmosphere.visible,r.material.lightPosition=this.realisticLightingPosition}preUpdate(t){const e=t.view.camera3D.position;if(this.fog.enable){y.setFromMatrixPosition(t.view.tileLayer.object3d.matrixWorld);const r=y.distanceTo(e);this.fog.distance=M*(.25*(r-.99*c.c.x)/c.c.x)**1.5}else this.fog.distance=1e11;const r=t.view.mainLoop.gfxEngine.renderer;v.crs=t.view.referenceCrs,v.setFromVector3(e).as("EPSG:4326",x);const i=x.altitude;it.material.uniforms.v3LightPosition.value.copy(this.realisticLightingPosition)))),this.basicAtmosphere.visible=!t,this.realisticAtmosphere.visible=t}}const C=S;var T=r(32533),I=r(79323);const R={GLOBE_INITIALIZED:n.b.INITIALIZED,LAYER_ADDED:n.b.LAYER_ADDED,LAYER_REMOVED:n.b.LAYER_REMOVED,COLOR_LAYERS_ORDER_CHANGED:n.b.COLOR_LAYERS_ORDER_CHANGED};class B extends n.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.Object3D.DEFAULT_UP.set(0,0,1),super("EPSG:4978",t,r),this.isGlobeView=!0,this.camera3D.near=Math.max(15,2352e-9*c.c.x),this.camera3D.far=10*c.c.x;const n=new a.Z("globe",r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=n.info;const l=new i.DirectionalLight;l.position.set(-.5,0,1),l.updateMatrixWorld(!0),this.scene.add(l),this.addLayer(n),this.tileLayer=n,e.isExtent||(e.coord=e.coord||new o.Z("EPSG:4326",0,0),e.tilt=e.tilt||89.5,e.heading=e.heading||0,e.range=e.range||2*c.c.x),r.noControls?T.ZP.transformCameraToLookAtTarget(this,this.camera3D,e):(this.controls=new s.Z(this,e,r.controls),this.controls.handleCollision=void 0===r.handleCollision||r.handleCollision),this.addLayer(new C("atmosphere",r.atmosphere)),this.camera.resize(t.clientWidth,t.clientHeight)}addLayer(t){if(!t||!t.isLayer)return Promise.reject(new Error("Add Layer type object"));if(t.isColorLayer){if(!this.tileLayer.tileMatrixSets.includes(I.Z.formatToTms(t.source.crs)))return t._reject(`Only ${this.tileLayer.tileMatrixSets} tileMatrixSet are currently supported for color layers`)}else if(t.isElevationLayer&&I.Z.formatToTms(t.source.crs)!==this.tileLayer.tileMatrixSets[0])return t._reject(`Only ${this.tileLayer.tileMatrixSets[0]} tileMatrixSet is currently supported for elevation layers`);return super.addLayer(t,this.tileLayer)}getPixelsToDegrees(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.getMetersToDegrees(this.getPixelsToMeters(t,e))}getPixelsToDegreesFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.getMetersToDegrees(this.getPixelsToMetersFromDistance(t,e))}getMetersToDegrees(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return i.MathUtils.radToDeg(2*Math.asin(t/(2*c.c.x)))}}const L=B},16670:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var i=r(99477),n=r(96021),s=r(71440),o=r(79323),a=r(62310);const l=new i.Quaternion,c=new i.Vector3;class h extends n.Z{constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const h=o.Z.formatToTms(e.crs);s.Mh.get(e.crs)||s.Mh.set(e.crs,e),n.tileMatrixSets=[h],super(t,r||new i.Group,[e],new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.projection&&(console.warn("PlanarTileBuilder projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs)throw new Error("options.crs is mandatory for PlanarTileBuilder");this.crs=t.crs,this.tmp={coords:new a.Z("EPSG:4326",0,0),position:new i.Vector3,normal:new i.Vector3(0,0,1)},this.uvCount=t.uvCount||1}prepare(t){t.nbRow=2**(t.zoom+1),t.projected=new i.Vector3}center(t){return t.center(this.tmp.coords),c.set(this.tmp.coords.x,this.tmp.coords.y,0),c}vertexPosition(t){return this.tmp.position.set(t.projected.x,t.projected.y,0),this.tmp.position}vertexNormal(){return this.tmp.normal}uProjecte(t,e){e.projected.x=e.extent.west+t*(e.extent.east-e.extent.west)}vProjecte(t,e){e.projected.y=e.extent.south+t*(e.extent.north-e.extent.south)}computeSharableExtent(t){return{sharableExtent:new s.ZP(t.crs,0,Math.abs(t.west-t.east),0,Math.abs(t.north-t.south)),quaternion:l,position:this.center(t).clone()}}}({crs:e.crs}),n),this.isPlanarLayer=!0,this.extent=e,this.minSubdivisionLevel=null==this.minSubdivisionLevel?0:this.minSubdivisionLevel,this.maxSubdivisionLevel=null==this.maxSubdivisionLevel?5:this.maxSubdivisionLevel,this.maxDeltaElevationLevel=this.maxDeltaElevationLevel||4}}const u=h},39510:(t,e,r)=>{"use strict";r.d(e,{Z:()=>c});var i=r(99477),n=r(73502),s=r(32533),o=r(29571),a=r(16670);class l extends n.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.Object3D.DEFAULT_UP.set(0,0,1),super(e.crs,t,r),this.isPlanarView=!0;const n=e.planarDimensions(),l=Math.max(n.x,n.y);this.camera3D.near=.1,this.camera3D.far=this.camera3D.isOrthographicCamera?2e3:2*l,this.camera3D.updateProjectionMatrix();const c=new a.Z("planar",e,r.object3d,r);this.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=c.info,this.addLayer(c);const h=r.placement||{};h.isExtent||(h.coord=h.coord||e.center(),h.tilt=h.tilt||90,h.heading=h.heading||0,h.range=h.range||l),s.ZP.transformCameraToLookAtTarget(this,this.camera3D,h),r.noControls||(this.controls=new o.ZP(this,r.controls)),this.tileLayer=c}addLayer(t){return super.addLayer(t,this.tileLayer)}}const c=l},74593:(t,e,r)=>{"use strict";r.d(e,{N:()=>n,Z:()=>s});var i=r(99477);function n(t,e){return 3*(t*t*2+(e?0:4*t*2))}function s(t){const e={index:null,position:null,normal:null,uvs:[]},r=[],s=t.builder,o=t.segments,a=(o+1)*(o+1)+(t.disableSkirt?0:4*o);if(a>2**32)throw new Error("Tile segments count is too big");e.position=new Float32Array(3*a),e.normal=new Float32Array(3*a);const l=t.builder.uvCount;l>1&&(e.uvs[1]=new Float32Array(a)),r[0]=()=>{};const c=n(o,t.disableSkirt);t.buildIndexAndUv_0&&(a<256?e.index=new Uint8Array(c):a<65536?e.index=new Uint16Array(c):a<2**32&&(e.index=new Uint32Array(c)),e.uvs[0]=new Float32Array(2*a),r[0]=(t,r,i)=>{e.uvs[0][2*t+0]=r,e.uvs[0][2*t+1]=i});const h=Math.max(2,Math.floor(o)||2),u=Math.max(2,Math.floor(o)||2);let d=0;const p=[];let f=[];const m=[];s.prepare(t);for(let i=0;i<=u;i++){const n=[],o=i/u;if(s.vProjecte(o,t),l>1){const i=s.computeUvs[1](t);r[1]=t=>{e.uvs[1][t]=i}}for(let a=0;a<=h;a++){const l=a/h,c=3*d;s.uProjecte(l,t);const p=s.vertexPosition(t,t.projected),g=s.vertexNormal(t);p.sub(t.center),t.quatNormalToZ&&(p.applyQuaternion(t.quatNormalToZ),g.applyQuaternion(t.quatNormalToZ)),p.toArray(e.position,c),g.toArray(e.normal,c);for(const t of r)t(d,l,o);t.disableSkirt||0!==i&&i!==u&&(a===h?f.push(d):0===a&&m.push(d)),n.push(d),d++}p.push(n),0===i?f=f.concat(n):i===u&&(f=f.concat(n.slice().reverse()))}function g(t,r,i,n){return e.index[n+0]=t,e.index[n+1]=r,e.index[n+2]=i,n+3}t.disableSkirt||(f=f.concat(m.reverse()));let A=0;if(t.buildIndexAndUv_0)for(let t=0;t1&&(e.uvs[1][d]=e.uvs[1][i]);const c=(t+1)%f.length;A=n(A,i,d,0===c?y:d+1,f[c]),d++}}return e}},55086:(t,e,r)=>{"use strict";let i;r.d(e,{D:()=>n,Z:()=>s});const n={INFINITE:1/0,TEXTURE:9e5,GEOMETRY:9e5},s=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.INFINITE;this.lifeTime=t,this.lastTimeFlush=Date.now(),this.data=new Map}getByArray(t){return this.get(t[0],t[1],t[2])}setByArray(t,e){return this.set(t,e[0],e[1],e[2])}get(t,e,r){const n=this.data.get(t);if(null!=n){if(null!=n.lastTimeUsed)i=n;else{const t=n.get(e);if(null==t)return;if(null!=t.lastTimeUsed)i=t;else{const e=t.get(r);if(null==e)return;i=e}}return i.value?(i.lastTimeUsed=Date.now(),i.value):void 0}}set(t,e,r,n){if(i={value:t,lastTimeUsed:Date.now()},null==r)return this.data.set(e,i),t;this.data.get(e)||this.data.set(e,new Map);const s=this.data.get(e);return null==n?(s.set(r,i),t):(s.get(r)||s.set(r,new Map),s.get(r).set(n,i),t)}delete(t,e,r){const i=this.data.get(t);if(void 0!==i)if(null!=i.lastTimeUsed)this.data.get(t),this.data.delete(t);else{const n=i.get(e);if(void 0===n)return;if(null!=n.lastTimeUsed)i.get(e),i.delete(e),0==i.size&&this.data.delete(t);else{if(void 0===n.get(r))return;n.get(r),n.delete(r),0==n.size&&(i.delete(e),0==i.size&&this.data.delete(t))}}}clear(){this.data.clear()}flush(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.lifeTime==n.INFINITE||this.lifeTime>t-this.lastTimeFlush||!this.data.size||(this.lastTimeFlush=1/0,this.data.forEach(((e,r)=>{this.lifeTime{this.lifeTime{this.lifeTime{"use strict";r.d(e,{uP:()=>_,ZP:()=>S,Lu:()=>m});var i=r(5167),n=r(55086),s=r(45340),o=r(92294),a=r(99477);function l(t){let e,r,i,n=t.r||t[0]/255,s=t.g||t[1]/255,o=t.b||t[2]/255;return n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,e=(.4124*n+.3576*s+.1805*o)/.95047,r=(.2126*n+.7152*s+.0722*o)/1,i=(.0193*n+.1192*s+.9505*o)/1.08883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(e-r),200*(r-i)]}function c(t,e){const r=l(t),i=l(e),n=r[0]-i[0],s=r[1]-i[1],o=r[2]-i[2],a=Math.sqrt(r[1]*r[1]+r[2]*r[2]),c=a-Math.sqrt(i[1]*i[1]+i[2]*i[2]);let h=s*s+o*o-c*c;h=h<0?0:Math.sqrt(h);const u=n/1,d=c/(1+.045*a),p=h/(1+.015*a),f=u*u+d*d+p*p;return f<0?0:Math.sqrt(f)}var h=r(62310);const u=new n.Z,d=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix(),p=document.createElement("canvas");function f(t,e){var r;return(null==e||null===(r=e.coordinates)||void 0===r?void 0:r.z)||0}function m(t,e){if(null!=t){if(t.expression)return t.expression.evaluate(e);if(t.stops){for(let r=t.stops.length-1;r>=0;r--){const i=t.stops[r];if(e.zoom>=i[0])return i[1]}return t.stops[0][1]}return("string"==typeof t||t instanceof String)&&(t=t.replace(/\{(.+?)\}/g,((t,r)=>e.properties[r]||"")).trim()),t instanceof Function?t(e.properties,e):t}}function g(t){if(!t)return{};if(t.stops||t.expression)return{color:t};if("string"==typeof t){const e=t.match(/(?:((hsl|rgb)a? *\(([\d.%]+(?:deg|g?rad|turn)?)[ ,]*([\d.%]+)[ ,]*([\d.%]+)[ ,/]*([\d.%]*)\))|(#((?:[\d\w]{3}){1,2})([\d\w]{1,2})?))/i);if(!e)return{color:t,opacity:1};if(e[7]){let t=1;return e[9]&&(t=.00392156862745098*parseInt(1==e[9].length?`${e[9]}${e[9]}`:e[9],16)),{color:`#${e[8]}`,opacity:t}}if(e[0])return{color:`${e[2]}(${e[3]},${e[4]},${e[5]})`,opacity:Number(e[6])||1}}}function A(t,e){if(null!=t)return o.th.isExpression(t)?o.th.createExpression(t,e).value:t}async function y(t){let e=u.get(t,"null");return e||(e=s.Z.texture(t,{crossOrigin:"anonymous"}),u.set(e,t,"null")),(await e).image}function v(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{width:t.naturalWidth,height:t.naturalHeight};p.width=e.width,p.height=e.height;const r=p.getContext("2d",{willReadFrequently:!0});return r.drawImage(t,e.x||0,e.y||0,e.width,e.height,0,0,e.width,e.height),r.getImageData(0,0,e.width,e.height)}const x={left:[0,-.5],right:[-1,-.5],top:[-.5,0],bottom:[-.5,-1],"top-right":[-1,0],"bottom-left":[0,-1],"bottom-right":[-1,-1],center:[-.5,-.5],"top-left":[0,0]};function b(t,e,r,i,n){let s;Object.defineProperty(t[e],r,{enumerable:!0,get:()=>{var o,a;if(null!=s)return s;if(null!=i)return m(i,t.context);const l=null===(o=t.context.featureStyle)||void 0===o||null===(a=o[e])||void 0===a?void 0:a[r];return null!=l?m(l,t.context):n instanceof Function?n(t.context.properties,t.context):n},set:t=>{s=t}})}class _{#c=new h.Z("EPSG:4326",0,0,0);#h=new h.Z("EPSG:4326",0,0,0);#u=!0;#d={};#p={};setZoom(t){this.zoom=t}setFeature(t){this.#d=t}setGeometry(t){this.#p=t}setCollection(t){this.collection=t,this.#h.setCrs(t.crs)}setLocalCoordinatesFromArray(t,e){return this.#u=!1,this.#h.setFromArray(t,e)}get properties(){return this.#p.properties}get type(){return this.#d.type}get featureStyle(){let t=this.#d.style;return t instanceof Function&&(t=t(this.properties,this)),t}get coordinates(){return this.#u||(this.#u=!0,this.#c.copy(this.#h).applyMatrix4(this.collection.matrixWorld),"EPSG:4978"!=this.#h.crs)?this.#c:this.#c.as("EPSG:4326",this.#c)}}class w{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isStyle=!0,this.context=new _,this.order=t.order||0,t.zoom=t.zoom||{},t.fill=t.fill||{},t.stroke=t.stroke||{},t.point=t.point||{},t.text=t.text||{},t.icon=t.icon||{},this.zoom={},b(this,"zoom","min",t.zoom.min),b(this,"zoom","max",t.zoom.max),this.fill={},b(this,"fill","color",t.fill.color),b(this,"fill","opacity",t.fill.opacity,1),b(this,"fill","pattern",t.fill.pattern),b(this,"fill","base_altitude",t.fill.base_altitude,f),t.fill.extrusion_height&&b(this,"fill","extrusion_height",t.fill.extrusion_height),this.stroke={},b(this,"stroke","color",t.stroke.color),b(this,"stroke","opacity",t.stroke.opacity,1),b(this,"stroke","width",t.stroke.width,1),b(this,"stroke","dasharray",t.stroke.dasharray,[]),b(this,"stroke","base_altitude",t.stroke.base_altitude,f),this.point={},b(this,"point","color",t.point.color),b(this,"point","line",t.point.line),b(this,"point","opacity",t.point.opacity,1),b(this,"point","radius",t.point.radius,2),b(this,"point","width",t.point.width,0),b(this,"point","base_altitude",t.point.base_altitude,f),t.point.model&&b(this,"point","model",t.point.model),this.text={},b(this,"text","field",t.text.field),b(this,"text","zOrder",t.text.zOrder,"auto"),b(this,"text","color",t.text.color,"#000000"),b(this,"text","anchor",t.text.anchor,"center"),b(this,"text","offset",t.text.offset,[0,0]),b(this,"text","padding",t.text.padding,2),b(this,"text","size",t.text.size,16),b(this,"text","placement",t.text.placement,"point"),b(this,"text","rotation",t.text.rotation,"auto"),b(this,"text","wrap",t.text.wrap,10),b(this,"text","spacing",t.text.spacing,0),b(this,"text","transform",t.text.transform,"none"),b(this,"text","justify",t.text.justify,"center"),b(this,"text","opacity",t.text.opacity,1),b(this,"text","font",t.text.font,["Open Sans Regular","Arial Unicode MS Regular","sans-serif"]),b(this,"text","haloColor",t.text.haloColor,"#000000"),b(this,"text","haloWidth",t.text.haloWidth,0),b(this,"text","haloBlur",t.text.haloBlur,0),this.icon={},b(this,"icon","source",t.icon.source),t.icon.key&&(console.warn("'icon.key' is deprecated: use 'icon.id' instead"),t.icon.id=t.icon.key),b(this,"icon","id",t.icon.id),b(this,"icon","cropValues",t.icon.cropValues),b(this,"icon","anchor",t.icon.anchor,"center"),b(this,"icon","size",t.icon.size,1),b(this,"icon","color",t.icon.color),b(this,"icon","opacity",t.icon.opacity,1)}copy(t){return Object.assign(this.fill,t.fill),Object.assign(this.stroke,t.stroke),Object.assign(this.point,t.point),Object.assign(this.text,t.text),Object.assign(this.icon,t.icon),this}clone(){return(new w).copy(this)}setContext(t){this.context=t}static setFromProperties(t,e){const r=e.type,n={};if(r===i.tg.POINT){const e={...void 0!==t.fill&&{color:t.fill},...void 0!==t["fill-opacity"]&&{opacity:t["fill-opacity"]},...void 0!==t.stroke&&{line:t.stroke},...void 0!==t.radius&&{radius:t.radius}};Object.keys(e).length&&(n.point=e);const r={...void 0!==t["label-color"]&&{color:t["label-color"]},...void 0!==t["label-opacity"]&&{opacity:t["label-opacity"]},...void 0!==t["label-size"]&&{size:t["label-size"]}};Object.keys(e).length&&(n.text=r);const i={...void 0!==t.icon&&{source:t.icon},...void 0!==t["icon-scale"]&&{size:t["icon-scale"]},...void 0!==t["icon-opacity"]&&{opacity:t["icon-opacity"]},...void 0!==t["icon-color"]&&{color:t["icon-color"]}};Object.keys(i).length&&(n.icon=i)}else{const e={...void 0!==t.stroke&&{color:t.stroke},...void 0!==t["stroke-width"]&&{width:t["stroke-width"]},...void 0!==t["stroke-opacity"]&&{opacity:t["stroke-opacity"]}};if(Object.keys(e).length&&(n.stroke=e),r!==i.tg.LINE){const e={...void 0!==t.fill&&{color:t.fill},...void 0!==t["fill-opacity"]&&{opacity:t["fill-opacity"]}};Object.keys(e).length&&(n.fill=e)}}return n}static setFromVectorTileLayer(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n={fill:{},stroke:{},point:{},text:{},icon:{}};if(t.layout=t.layout||{},t.paint=t.paint||{},n.order=r,"fill"===t.type){const{color:r,opacity:i}=g(A(t.paint["fill-color"]||t.paint["fill-pattern"],{type:"color"}));if(n.fill.color=r,n.fill.opacity=A(t.paint["fill-opacity"])||i,t.paint["fill-pattern"])try{n.fill.pattern={id:t.paint["fill-pattern"],source:e.source,cropValues:e[t.paint["fill-pattern"]]}}catch(e){throw e.message=`VTlayer '${t.id}': argument sprites must not be null when using layer.paint['fill-pattern']`,e}if(t.paint["fill-outline-color"]){const{color:e,opacity:r}=g(A(t.paint["fill-outline-color"],{type:"color"}));n.stroke.color=e,n.stroke.opacity=r,n.stroke.width=1,n.stroke.dasharray=[]}}else if("line"===t.type){const e=A(t.paint["line-color"],{type:"color"}),{color:r,opacity:i}=g(e);n.stroke.dasharray=A(t.paint["line-dasharray"]),n.stroke.color=r,n.stroke.lineCap=t.layout["line-cap"],n.stroke.width=A(t.paint["line-width"]),n.stroke.opacity=A(t.paint["line-opacity"])||i}else if("circle"===t.type||i){const{color:e,opacity:r}=g(A(t.paint["circle-color"],{type:"color"}));n.point.color=e,n.point.opacity=r,n.point.radius=A(t.paint["circle-radius"])}else if("symbol"===t.type){n.text.zOrder=A(t.layout["symbol-z-order"]),"auto"==n.text.zOrder?n.text.zOrder=A(t.layout["symbol-sort-key"])||"Y":"viewport-y"==n.text.zOrder?n.text.zOrder="Y":"source"==n.text.zOrder&&(n.text.zOrder=0),n.text.anchor=A(t.layout["text-anchor"]),n.text.offset=A(t.layout["text-offset"]),n.text.padding=A(t.layout["text-padding"]),n.text.size=A(t.layout["text-size"]),n.text.placement=A(t.layout["symbol-placement"]),n.text.rotation=A(t.layout["text-rotation-alignment"]),n.text.field=A(t.layout["text-field"]),n.text.wrap=A(t.layout["text-max-width"]),n.text.spacing=A(t.layout["text-letter-spacing"]),n.text.transform=A(t.layout["text-transform"]),n.text.justify=A(t.layout["text-justify"]);const{color:r,opacity:i}=g(A(t.paint["text-color"],{type:"color"}));n.text.color=r,n.text.opacity=A(t.paint["text-opacity"])||void 0!==i&&i,n.text.font=A(t.layout["text-font"]);const s=A(t.paint["text-halo-color"],{type:"color"});s&&(n.text.haloColor=s.color||s,n.text.haloWidth=A(t.paint["text-halo-width"]),n.text.haloBlur=A(t.paint["text-halo-blur"]));const o=A(t.layout["icon-image"]);if(o)try{n.icon.id=o,n.icon.source=e.source,n.icon.cropValues=e[o],n.icon.size=A(t.layout["icon-size"])||1;const{color:r,opacity:i}=g(A(t.paint["icon-color"],{type:"color"}));n.icon.color=r,n.icon.opacity=A(t.paint["icon-opacity"])||void 0!==i&&i}catch(e){throw e.message=`VTlayer '${t.id}': argument sprites must not be null when using layer.layout['icon-image']`,e}}return n.zoom={min:t.minzoom||0,max:t.maxzoom||24},n}applyToCanvasPolygon(t,e,r,i){const n=this.context;this.stroke&&this._applyStrokeToPolygon(t,r,e,n),i&&this.fill&&this._applyFillToPolygon(t,r,e,n)}_applyStrokeToPolygon(t,e,r){t.strokeStyle!==this.stroke.color&&(t.strokeStyle=this.stroke.color);const i=(this.stroke.width||2)*e;t.lineWidth!==i&&(t.lineWidth=i);const n=null==this.stroke.opacity?1:this.stroke.opacity;n!==t.globalAlpha&&"number"==typeof n&&(t.globalAlpha=n),t.lineCap!==this.stroke.lineCap&&(t.lineCap=this.stroke.lineCap),t.setLineDash(this.stroke.dasharray.map((t=>t*e*2))),t.stroke(r)}async _applyFillToPolygon(t,e,r){if(this.fill.pattern){let r=this.fill.pattern;const i=this.fill.pattern.cropValues;this.fill.pattern.source&&(r=await y(this.fill.pattern.source)),v(r,i),t.fillStyle=t.createPattern(p,"repeat"),t.fillStyle.setTransform?t.fillStyle.setTransform(d.scale(e)):console.warn("Raster pattern isn't completely supported on Ie and edge",t.fillStyle)}else t.fillStyle!==this.fill.color&&(t.fillStyle=this.fill.color);this.fill.opacity!==t.globalAlpha&&(t.globalAlpha=this.fill.opacity),t.fill(r)}async applyToHTML(t){if(arguments.length>1&&console.warn("Deprecated argument sprites. Sprites must be configured in style."),t.style.padding=`${this.text.padding}px`,t.style.maxWidth=`${this.text.wrap}em`,t.style.color=this.text.color,this.text.size>0&&(t.style.fontSize=`${this.text.size}px`),t.style.fontFamily=this.text.font.join(","),t.style.textTransform=this.text.transform,t.style.letterSpacing=`${this.text.spacing}em`,t.style.textAlign=this.text.justify,t.style["white-space"]="pre-line",this.text.haloWidth>0&&(t.style.setProperty("--text_stroke_display","block"),t.style.setProperty("--text_stroke_width",`${this.text.haloWidth}px`),t.style.setProperty("--text_stroke_color",this.text.haloColor),t.setAttribute("data-before",t.textContent)),!this.icon.source)return;const e=document.createElement("img"),r=new Promise(((r,i)=>{const n={size:this.icon.size,color:this.icon.color,opacity:this.icon.opacity,anchor:this.icon.anchor};e.onload=()=>r(function(t,e,r){const i=t.cloneNode();switch(i.setAttribute("class","itowns-icon"),i.width=t.width*r.size,i.height=t.height*r.size,i.style.color=r.color,i.style.opacity=r.opacity,i.style.position="absolute",i.style.top="0",i.style.left="0",r.anchor){case"left":i.style.top=-.5*i.height+"px";break;case"right":i.style.top=-.5*i.height+"px",i.style.left=-i.width+"px";break;case"top":i.style.left=-.5*i.width+"px";break;case"bottom":i.style.top=-i.height+"px",i.style.left=-.5*i.width+"px";break;case"bottom-left":i.style.top=-i.height+"px";break;case"bottom-right":i.style.top=-i.height+"px",i.style.left=-i.width+"px";break;case"top-left":break;case"top-right":i.style.left=-i.width+"px";break;default:i.style.top=-.5*i.height+"px",i.style.left=-.5*i.width+"px"}return i.style["z-index"]=-1,e.appendChild(i),i}(e,t,n)),e.onerror=t=>i(t)}));if(this.icon.cropValues||this.icon.color){const t=this.icon.cropValues,r=this.icon.color,i=this.icon.id||this.icon.source,n=function(t,e,r){if(!e)return t;const i=u.get(r,e);if(!i){const i=t.data,n=new a.Color(e),s=new a.Color("white");for(let t=0,e=i.length;t{M.innerHTML+=`${E[t]}\n\n`})),"undefined"!=typeof document&&document.getElementsByTagName("head")[0].appendChild(M);const S=w},28448:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});let i=!1,n=8,s=4096;function o(t,e,r){const i=t.getContext(),n=i.createShader(e);return i.shaderSource(n,r),i.compileShader(n),n}function a(){return navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}const l={isLogDepthBufferSupported:()=>i,isFirefox:a,getMaxTextureUnitsCount:()=>n,getMaxTextureSize:()=>s,updateCapabilities(t){const e=t.getContext();n=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),s=e.getParameter(e.MAX_TEXTURE_SIZE);const r=e.createProgram(),l=o(t,e.VERTEX_SHADER,"void main() {\n gl_Position = vec4( 0.0, 0.0, 0.0, 1.0 );\n}");let c=`#define SAMPLE ${n}\n`;c+="uniform sampler2D uni[SAMPLE];\nvoid main() {\n gl_FragColor += texture2D(uni[SAMPLE-1], vec2(0));\n}";const h=o(t,e.FRAGMENT_SHADER,c);if(e.attachShader(r,l),e.attachShader(r,h),e.linkProgram(r),!1===e.getProgramParameter(r,e.LINK_STATUS)){if(!(n>16))throw new Error(`The GPU capabilities could not be determined accurately.\n Impossible to link a shader with the Maximum texture units ${n}`);{const t=e.getProgramInfoLog(r);console.warn(`${t}: using a maximum of 16 texture units instead of the reported value (${n})`),a()&&console.warn("It can come from a Mesa/Firefox bug;\n the shader compiles to an error when using more than 16 sampler uniforms,\n see https://bugzilla.mozilla.org/show_bug.cgi?id=777028"),n=16}}e.deleteProgram(r),e.deleteShader(l),e.deleteShader(h),i=t.capabilities.logarithmicDepthBuffer}}},42423:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(99477),n=r(74593);class s extends i.BufferGeometry{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){t.buildIndexAndUv_0=!0,t.center=t.builder.center(t.extent).clone();const e=(0,n.Z)(t);e.index=new i.BufferAttribute(e.index,1),e.uvs[0]=new i.BufferAttribute(e.uvs[0],2),e.position=new i.BufferAttribute(e.position,3),e.normal=new i.BufferAttribute(e.normal,3);for(let r=1;r{"use strict";r.d(e,{b:()=>K,Z:()=>ct});var i=r(99477),n=r(232);var s=r(99617),o=r(28448),a=r(97112),l=r(5199);const c=class{static isWebGLAvailable(){try{const t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}static isWebGL2Available(){try{const t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(t){return!1}}static isColorSpaceAvailable(t){try{const e=document.createElement("canvas"),r=window.WebGL2RenderingContext&&e.getContext("webgl2");return r.drawingBufferColorSpace=t,r.drawingBufferColorSpace===t}catch(t){return!1}}static getWebGLErrorMessage(){return this.getErrorMessage(1)}static getWebGL2ErrorMessage(){return this.getErrorMessage(2)}static getErrorMessage(t){const e={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let r='Your $0 does not seem to support $1';const i=document.createElement("div");return i.id="webglmessage",i.style.fontFamily="monospace",i.style.fontSize="13px",i.style.fontWeight="normal",i.style.textAlign="center",i.style.background="#fff",i.style.color="#000",i.style.padding="1.5em",i.style.width="400px",i.style.margin="5em auto 0",r=e[t]?r.replace("$0","graphics card"):r.replace("$0","browser"),r=r.replace("$1",{1:"WebGL",2:"WebGL 2"}[t]),i.innerHTML=r,i}};var h=r(49652),u=r(53175);const d=new i.Vector4,p=class{constructor(t){let e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,u.Dx)(n),void 0===n.antialias&&(n.antialias=!0),void 0===n.alpha&&(n.alpha=!0),void 0===n.logarithmicDepthBuffer&&(n.logarithmicDepthBuffer=!0),t.domElement?(e=t,r=e.domElement instanceof HTMLDivElement?e.domElement:e.domElement.parentElement):r=t,this.width=r.clientWidth,this.height=r.clientHeight,this.positionBuffer=null,this._nextThreejsLayer=1,this.fullSizeRenderTarget=new i.WebGLRenderTarget(this.width,this.height),this.fullSizeRenderTarget.texture.minFilter=i.LinearFilter,this.fullSizeRenderTarget.texture.magFilter=i.NearestFilter,this.fullSizeRenderTarget.depthBuffer=!0,this.fullSizeRenderTarget.depthTexture=new i.DepthTexture,this.fullSizeRenderTarget.depthTexture.type=i.UnsignedShortType,this.renderView=function(t){this.renderer.clear(),this.renderer.render(t.scene,t.camera3D),t.tileLayer&&this.label2dRenderer.render(t.tileLayer.object3d,t.camera3D)}.bind(this),this.onWindowResize=function(t,e){this.width=t,this.height=e,this.fullSizeRenderTarget.setSize(this.width,this.height),this.renderer.setSize(this.width,this.height),this.label2dRenderer.setSize(this.width,this.height)}.bind(this);try{this.label2dRenderer=new h.Z,this.label2dRenderer.setSize(this.width,this.height),r.appendChild(this.label2dRenderer.domElement),this.renderer=e||new i.WebGLRenderer({canvas:document.createElement("canvas"),antialias:n.antialias,alpha:n.alpha,logarithmicDepthBuffer:n.logarithmicDepthBuffer}),this.renderer.domElement.style.position="relative",this.renderer.domElement.style.zIndex=0,this.renderer.domElement.style.top=0}catch(t){throw c.isWebGL2Available()||r.appendChild(c.getErrorMessage(2)),t}-1===this.renderer.domElement.tabIndex&&(this.renderer.domElement.tabIndex=-1),o.Z.updateCapabilities(this.renderer),this.renderer.setClearColor(197896),this.renderer.autoClear=!1,this.renderer.sortObjects=!0,this.renderer.debug.checkShaderErrors=!1,e||(this.renderer.setPixelRatio(r.devicePixelRatio),this.renderer.setSize(r.clientWidth,r.clientHeight),r.appendChild(this.renderer.domElement))}getWindowSize(){return new i.Vector2(this.width,this.height)}getRenderer(){return this.renderer}renderViewToBuffer(t,e){return e||(e={x:0,y:0,width:this.width,height:this.height}),e.buffer=e.buffer||new Uint8Array(4*e.width*e.height),this.renderViewToRenderTarget(t,this.fullSizeRenderTarget,e),this.renderer.readRenderTargetPixels(this.fullSizeRenderTarget,e.x,this.height-(e.y+e.height),e.width,e.height,e.buffer),e.buffer}renderViewToRenderTarget(t,e,r){e||(e=this.fullSizeRenderTarget);const i=this.renderer.getRenderTarget();return r&&(this.fullSizeRenderTarget.scissor.set(r.x,e.height-(r.y+r.height),r.width,r.height),this.fullSizeRenderTarget.scissorTest=!0),this.renderer.setRenderTarget(e),this.renderer.clear(!0,!0,!1),this.renderer.render(t.scene,t.camera.camera3D),this.renderer.setRenderTarget(i),this.fullSizeRenderTarget.scissorTest=!1,e}bufferToImage(t,e,r){const i=document.createElement("canvas"),n=i.getContext("2d",{willReadFrequently:!0});i.width=e,i.height=r;const s=n.getImageData(0,0,e,r);s.data.set(t),n.putImageData(s,0,0);const o=new Image;return o.src=i.toDataURL(),o}depthBufferRGBAValueToOrthoZ(t,e){if(d.fromArray(t).divideScalar(255),o.Z.isLogDepthBufferSupported()&&"PerspectiveCamera"==e.type)return 2**(2*(0,l.On)(d)/(2/(Math.log(e.far+1)/Math.LN2)));{let t=(0,l.On)(d);return t=2*t-1,t}}};var f=r(14625),m=r(79323),g=r(62310),A=r(29372),y=r(95307);const v={executeCommand(t){const e=t.layer,r=t.extentsSource,i=t.extentsDestination||r;return Promise.all(r.map(((t,r)=>e.getData(t,i[r]))))}},x=class{constructor(t){this.command=t,this.isCancelledCommandException=!0}toString(){return`Cancelled command ${this.command.requester.id}/${this.command.layer.id}`}},b={executeCommand(t){const e=[],r=t.layer,i=t.requester,n=t.extentsSource;if(i&&!i.material)return Promise.reject(new x(t));for(const t of n)e.push(r.convert(i,t));return Promise.all(e)}};var _=r(5626),w=r(59099),E=r(43195),M=r(61366),S=r(25542);const C=(new i.Matrix4).makeRotationX(-Math.PI/2),T=(new i.Matrix4).makeRotationZ(-Math.PI/2),I=new TextDecoder;function R(t){const e=["MODELVIEW","MODELVIEWINVERSETRANSPOSE","PROJECTION","JOINTMATRIX"];if(t.gltfShader){const r=[];for(const e in t.gltfShader.boundUniforms)r.push(e);for(const i of r){const r=t.gltfShader.boundUniforms[i].semantic;e.includes(r)||delete t.gltfShader.boundUniforms[i]}}}const B={parse(t,e){const r=!0===e.frustumCulled;if(!t)throw new Error("No array buffer provided.");const n=new DataView(t,4);let s=0;const a={};if(a.magic=I.decode(new Uint8Array(t,0,4)),a.magic){a.version=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.byteLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.FTJSONLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.FTBinaryLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.BTJSONLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT,a.BTBinaryLength=n.getUint32(s,!0),s+=Uint32Array.BYTES_PER_ELEMENT;const l=s+4,c=[];let h={};const u=new i.Vector3;if(a.FTJSONLength>0){const e=l,r=t.slice(e,a.FTJSONLength+e),i=I.decode(new Uint8Array(r));h=JSON.parse(i),h.RTC_CENTER?u.fromArray(h.RTC_CENTER):u.set(0,0,0)}if(a.FTBinaryLength>0&&console.warn("3D Tiles feature table binary not supported yet."),a.BTJSONLength>0){const r=l+a.FTJSONLength+a.FTBinaryLength,i=t.slice(r,r+a.BTJSONLength+a.BTBinaryLength);c.push(Promise.resolve(new _.Z(i,a.BTJSONLength,a.BTBinaryLength,h.BATCH_LENGTH,e.registeredExtensions)))}else c.push(Promise.resolve(new _.Z));const d=l+a.FTJSONLength+a.FTBinaryLength+a.BTJSONLength+a.BTBinaryLength,p=t.slice(d),f=new DataView(p,0,20),m=function(t){if(t.frustumCulled=r,t.material){if(e.overrideMaterials){const r=t.material;"object"==typeof e.overrideMaterials&&e.overrideMaterials.isMaterial?t.material=e.overrideMaterials:t.material=new i.MeshBasicMaterial,(0,w.Z)(r)}else o.Z.isLogDepthBufferSupported()&&t.material.isRawShaderMaterial&&!e.doNotPatchMaterial&&(E.Z.patchMaterialForLogDepthSupport(t.material),console.warn("glTF shader has been patched to add log depth buffer support"));(0,M.Z)(t.material,e.layer)}};return c.push(S.ZP.parse(p,e).then((t=>{for(const e of t.scenes)e.traverse(R);var r,i;r=t.scene,"Z"===(i=e.gltfUpAxis)?r.applyMatrix4(C):"X"===i&&(r.applyMatrix4(C),r.applyMatrix4(T));const n=o.Z.isLogDepthBufferSupported()&&!e.doNotPatchMaterial;(!1===e.frustumCulling||e.overrideMaterials||n||e.layer)&&t.scene.traverse(m),t.scene.position.copy(u);const s=new Uint8Array(p,20,f.getUint32(12,!0)),a=I.decode(new Uint8Array(s)),l=JSON.parse(a);return l.extensions&&l.extensions.CESIUM_RTC&&(t.scene.position.fromArray(l.extensions.CESIUM_RTC.center),t.scene.updateMatrixWorld(!0)),t})).catch((t=>{throw new Error(t)}))),Promise.all(c).then((t=>({gltf:t[1],batchTable:t[0]}))).catch((t=>{throw new Error(t)}))}throw new Error("Invalid b3dm file.")}},L=new TextDecoder,P=function(t,e){if(!t)throw new Error("No array buffer provided.");const r=new DataView(t);let n=0;const s={};let o={},a={};if(s.magic=L.decode(new Uint8Array(t,n,4)),n+=4,s.magic){s.version=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.byteLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.FTJSONLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.FTBinaryLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT,s.BTBinaryLength=r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT;let l={};if(s.FTJSONLength>0){const e=n,r=t.slice(e,s.FTJSONLength+e),i=L.decode(new Uint8Array(r));l=JSON.parse(i)}if(s.FTBinaryLength>0&&(a=function(t,e,r){const n=new i.BufferGeometry,s=L.decode(new Uint8Array(t,e,r)),o=JSON.parse(s);let a;if(o.POINTS_LENGTH&&(a=o.POINTS_LENGTH),o.POSITION){const r=o.POSITION.byteOffset+s.length+e,l=new Float32Array(t,r,3*a);n.setAttribute("position",new i.BufferAttribute(l,3))}if(o.RGB){const r=o.RGB.byteOffset+s.length+e,l=new Uint8Array(t,r,3*a);n.setAttribute("color",new i.BufferAttribute(l,3,!0))}if(o.POSITION_QUANTIZED)throw new Error("For pnts loader, POSITION_QUANTIZED: not yet managed");if(o.RGBA)throw new Error("For pnts loader, RGBA: not yet managed");if(o.RGB565)throw new Error("For pnts loader, RGB565: not yet managed");if(o.NORMAL)throw new Error("For pnts loader, NORMAL: not yet managed");if(o.NORMAL_OCT16P)throw new Error("For pnts loader, NORMAL_OCT16P: not yet managed");if(o.BATCH_ID)throw new Error("For pnts loader, BATCH_ID: not yet managed");return{geometry:n,offset:o.RTC_CENTER?(new i.Vector3).fromArray(o.RTC_CENTER):void 0}}(t,n,s.FTJSONLength)),s.BTJSONLength>0){const r=n+s.FTJSONLength+s.FTBinaryLength,c=t.slice(r,s.BTJSONLength+s.BTBinaryLength+r);o=new _.Z(c,s.BTJSONLength,s.BTBinaryLength,l.BATCH_ID&&l.BATCH_LENGTH?l.BATCH_LENGTH:l.POINTS_LENGTH,e),a=function(t,e){if(t.geometry)return e.content&&e.content.Classification&&t.geometry.setAttribute("classification",new i.BufferAttribute(new Uint8Array(e.content.Classification),1,!0)),t}(a,o)}const c={point:a,batchTable:o};return Promise.resolve(c)}throw new Error("Invalid pnts file.")};var D=r(45340),O=r(25033);const k=new TextDecoder;function U(t,e,r){const n=i.LoaderUtils.extractUrlBase(r),s={gltfUpAxis:e.tileset.asset.gltfUpAxis,urlBase:n,overrideMaterials:e.overrideMaterials,doNotPatchMaterial:e.doNotPatchMaterial,registeredExtensions:e.registeredExtensions,layer:e};return B.parse(t,s).then((t=>({batchTable:t.batchTable,object3d:t.gltf.scene})))}function N(t,e,r){const n=i.LoaderUtils.extractUrlBase(r);return S.ZP.parse(t,n).then((t=>({object3d:t.scene})))}function F(t,e){return P(t,e.registeredExtensions).then((t=>{const r=e.material?e.material.clone():new O.ZP({size:.05,mode:e.pntsMode,shape:e.pntsShape,classification:e.classification,sizeMode:e.pntsSizeMode,minAttenuatedSize:e.pntsMinAttenuatedSize,maxAttenuatedSize:e.pntsMaxAttenuatedSize});(0,M.Z)(r,e);const n=new i.Points(t.point.geometry,r);return t.point.offset&&n.position.copy(t.point.offset),{object3d:n,batchTable:t.batchTable}}))}const z={executeCommand:function(t){const e=t.layer,r=t.metadata,n=new i.Object3D;!function(t,e,r,i){t.frustumCulled=!1,t.layer=e,r.transform&&t.applyMatrix4(r.transform),t.geometricError=r.geometricError,t.tileId=r.tileId,r.refine?t.additiveRefinement="ADD"===r.refine.toUpperCase():t.additiveRefinement=!!i&&i.additiveRefinement,t.viewerRequestVolume=r.viewerRequestVolume,t.boundingVolume=r.boundingVolume,t.updateMatrixWorld()}(n,e,r,t.requester);const s=r.content&&(r.content.url||r.content.uri),o=t=>{t.userData.metadata=r,t.layer=e};if(s){let t=s.startsWith("http")?s:r.baseURL+s;e.source.isC3DTilesGoogleSource&&(t=e.source.getTileUrl(t));const i={b3dm:U,pnts:F,gltf:N};return D.Z.arrayBuffer(t,e.source.networkOptions).then((s=>{if(void 0!==s){let a;const l=k.decode(new Uint8Array(s,0,4));if("{"===l[0]){s=JSON.parse(k.decode(new Uint8Array(s)));const i=e.source.isC3DTilesGoogleSource?e.source.baseUrl:t.slice(0,t.lastIndexOf("/")+1);e.tileset.extendTileset(s,r.tileId,i,e.registeredExtensions)}else if("b3dm"==l)a=i.b3dm;else if("pnts"==l)a=i.pnts;else{if("glTF"!=l)return Promise.reject(`Unsupported magic code ${l}`);a=i.gltf}if(a)return a(s,e,t).then((t=>(n.content=t.object3d,t.batchTable&&(n.batchTable=t.batchTable),n.add(t.object3d),n.traverse(o),n)))}return n.traverse(o),n}))}return n.traverse(o),Promise.resolve(n)}};var G=r(71440);let Q=1;const j={executeCommand(t){const e=t.layer,r=t.requester;return r.load().then((n=>{const s=new i.Points(n,e.material);return function(t){const e=t.geometry.attributes.position.count,r=new Uint8Array(4*e),n=Q++;if(e>65535||n>65535)return console.warn("Currently picking is limited to Points with less than 65535 elements and less than 65535 Points instances"),t;for(let t=0;t>24,r[4*t+1]=(16711680&e)>>16,r[4*t+2]=(65280&e)>>8,r[4*t+3]=(255&e)>>0}t.baseId=n,t.geometry.setAttribute("unique_id",new i.BufferAttribute(r,4,!0))}(s),s.frustumCulled=!1,s.matrixAutoUpdate=!1,s.position.copy(n.userData.origin||r.bbox.min),s.scale.copy(e.scale),s.updateMatrix(),s.tightbbox=n.boundingBox.applyMatrix4(s.matrix),s.layer=e,s.extent=G.ZP.fromBox3(t.view.referenceCrs,r.bbox),s.userData.node=r,s}))}};var V=r(4380);function H(t,e){const r=e.priority-t.priority;return 0===r?e.timestamp-t.timestamp:r}function W(){return{queue(t){const e=t.layer;let r=this.storages.get(e.id);r||(r={q:new y({comparator:H}),priority:1,accumulator:0},this.storages.set(e.id,r)),r.priority=e.priority||1,r.q.queue(t),this.counters.pending++},storages:new Map,counters:{executing:0,executed:0,failed:0,cancelled:0,pending:0},execute(t,e){return this.counters.pending--,this.counters.executing++,e.executeCommand(t).then((e=>{this.counters.executing--,t.resolve(e),this.counters.executed++}),(e=>{this.counters.executing--,t.reject(e),this.counters.failed++}))}}}function q(){this.defaultQueue=W(),this.hostQueues=new Map,this.providers={},this.maxCommandsPerHost=6,this.initDefaultProviders()}q.prototype.constructor=q,q.prototype.initDefaultProviders=function(){this.addProtocolProvider("tile",b),this.addProtocolProvider("3d-tiles",z),this.addProtocolProvider("pointcloud",j)},q.prototype.runCommand=function(t,e,r){const i=this.getProtocolProvider(t.layer.protocol);if(!i)throw new Error(`No known provider for layer ${t.layer.id}`);e.execute(t,i,r).then((()=>{if(t.view.notifyChange(t.requester,t.redraw),e.counters.executing{t.resolve=e,t.reject=r})),r&&!this.hostQueues.has(r)&&this.hostQueues.set(r,W());const i=r?this.hostQueues.get(r):this.defaultQueue;return t.timestamp=Date.now(),i.queue(t),i.counters.executing{if(i.counters.executing0&&(i+=t.priority,t.accumulator+=t.priority,(!e||t.accumulator>r)&&(e=t,r=t.accumulator))}if(e)return e.accumulator-=i,e.q}(t.storages);for(;e&&e.length>0;){const r=e.dequeue();if(!r.earlyDropFunction||!r.earlyDropFunction(r))return r;t.counters.pending--,t.counters.cancelled++,r.reject(new x(r))}};const Z=q;var Y=r(98675),X=r(76257),J=r(70991);const K={LAYERS_INITIALIZED:"layers-initialized",LAYER_REMOVED:"layer-removed",LAYER_ADDED:"layer-added",INITIALIZED:"initialized",COLOR_LAYERS_ORDER_CHANGED:a.i,CAMERA_MOVED:"camera-moved"},$=new i.Vector2,tt=new i.Matrix4,et=new i.Vector2,rt=new i.Ray,it=new i.Vector3,nt=new i.Vector3,st=new g.Z("EPSG:4326"),ot=[];let at;class lt extends i.EventDispatcher{#f=[];#m=new Uint8Array(4);#g;constructor(t,e){let r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("Invalid viewerDiv parameter (must non be null/undefined)");super(),this.domElement=e,this.referenceCrs=t,r=o.renderer&&o.renderer.domElement?new p(o.renderer):new p(e,o.renderer),this.mainLoop=o.mainLoop||new s.ZP(new Z,r),this.scene=o.scene3D||new i.Scene,o.scene3D||(this.scene.matrixWorldAutoUpdate=!1),this.camera=new n.Z(this.referenceCrs,this.mainLoop.gfxEngine.getWindowSize().x,this.mainLoop.gfxEngine.getWindowSize().y,o.camera),this._frameRequesters={},this._resizeListener=()=>this.resize(),window.addEventListener("resize",this._resizeListener,!1),this._changeSources=new Set,this._delayedFrameRequesterRemoval=[],this._allLayersAreReadyCallback=()=>{this.getLayers().every((t=>t.ready))&&0==this.mainLoop.scheduler.commandsWaitingExecutionCount()&&this.mainLoop.renderingState==s.HR&&(this.dispatchEvent({type:K.LAYERS_INITIALIZED}),this.removeFrameRequester(s.Ao.UPDATE_END,this._allLayersAreReadyCallback))},this.camera.resize(this.domElement.clientWidth,this.domElement.clientHeight);const a=()=>{this.removeEventListener(K.LAYERS_INITIALIZED,a),this.dispatchEvent({type:K.INITIALIZED})};let l;this.addEventListener(K.LAYERS_INITIALIZED,a),this.#g=new Uint8Array(4*this.camera.width*this.camera.height),this.domElement.tabIndex=-1,o.disableFocusOnStart||this.domElement.focus(),this.domElement.addEventListener("mouseup",(t=>{2===t.button&&(l&&t.timeStamp-l<500&&this.domElement.dispatchEvent(new MouseEvent("dblclick-right",t)),l=t.timeStamp)})),ot.push(this),o.webXR&&((t,e)=>{const r=e.scale||1,n=t.mainLoop.gfxEngine.renderer.xr;n.addEventListener("sessionstart",(()=>{const e=t.camera.camera3D,s=i=>{"Escape"===i.key&&(document.removeEventListener("keydown",s),n.enabled=!1,t.camera.camera3D=e,t.scene.scale.multiplyScalar(1/r),t.scene.updateMatrixWorld(),async function(t){t&&await t.end()}(n.getSession()),t.notifyChange(t.camera.camera3D,!0))};t.scene.scale.multiplyScalar(r),t.scene.updateMatrixWorld(),n.enabled=!0,n.getReferenceSpace("local");const o=t.camera.position(),a=(new i.Quaternion).setFromUnitVectors(new i.Vector3(0,0,1),o.geodesicNormal).invert(),l=new i.Quaternion(-1,0,0,1).normalize().multiply(a),c=e.position.clone().multiplyScalar(-r).applyQuaternion(l),h=new XRRigidTransform(c,l),u=n.getReferenceSpace().getOffsetReferenceSpace(h);n.setReferenceSpace(u),t.camera.camera3D=n.getCamera(),t.camera.resize(t.camera.width,t.camera.height),document.addEventListener("keydown",s,!1),n.setAnimationLoop((e=>{n.isPresenting&&t.camera.camera3D.cameras[0]&&(t.camera.camera3D.updateMatrix(),t.camera.camera3D.updateMatrixWorld(!0),t.notifyChange(t.camera.camera3D,!0)),t.mainLoop.step(t,e)}))}))})(this,o.webXR)}get renderer(){var t,e;return null===(t=this.mainLoop)||void 0===t||null===(e=t.gfxEngine)||void 0===e?void 0:e.getRenderer()}get camera3D(){var t;return null===(t=this.camera)||void 0===t?void 0:t.camera3D}dispose(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=ot.indexOf(this);if(-1==e)return void console.warn("View already disposed");window.removeEventListener("resize",this._resizeListener),this.controls&&("function"==typeof this.controls.dispose&&this.controls.dispose(),delete this.controls),this.removeAllFrameRequesters(),this.removeAllEvents();const r=this.getLayers((t=>!t.isTiledGeometryLayer&&!t.isAtmosphere));for(const e of r)this.removeLayer(e.id,t);const i=this.getLayers((t=>t.isAtmosphere));for(const e of i)this.removeLayer(e.id,t);const n=this.getLayers((t=>t.isTiledGeometryLayer));for(const e of n)this.removeLayer(e.id,t);ot.splice(e,1),this.scene.traverse(J.Z.cleanup)}addLayer(t,e){if(!t||!t.isLayer)return Promise.reject(new Error("Add Layer type object"));if(this.getLayerById(t.id))return t._reject(new Error(`Invalid id '${t.id}': id already used`));if(t=function(t,e,r){const i=e.source;if(r&&!e.extent&&(e.extent=r.extent,i&&!i.extent&&(i.extent=r.extent)),e.isGeometryLayer&&!e.isLabelLayer?e.crs=t.referenceCrs:e.crs||(r&&r.tileMatrixSets&&r.tileMatrixSets.includes(m.Z.formatToTms(i.crs))?e.crs=i.crs:e.crs=r&&r.extent.crs),e.isLabelLayer)t.mainLoop.gfxEngine.label2dRenderer.registerLayer(e);else if(e.labelEnabled||e.addLabelLayer){e.labelEnabled&&console.info("layer.labelEnabled is deprecated use addLabelLayer, instead of"),e.buildExtent=!0,e.structure="3d";const r=new X.Z(`${e.id}-label`,{source:i,style:e.style,zoom:e.zoom,performance:e.addLabelLayer.performance,crs:i.crs,visible:e.visible,margin:15,forceClampToTerrain:e.addLabelLayer.forceClampToTerrain});e.addEventListener("visible-property-changed",(()=>{r.visible=e.visible}));const n=i=>{i.layerId===e.id&&t.removeLayer(r.id),t.removeEventListener(K.LAYER_REMOVED,n)};t.addEventListener(K.LAYER_REMOVED,n),e.whenReady=e.whenReady.then((()=>(t.addLayer(r),e)))}return e}(this,t,e),e)if(t.isColorLayer){const r=this.getLayers((t=>t.isColorLayer));if(t.sequence=r.length,!(e.countColorLayersTextures(...r,t)<=(0,l.dn)()))return t._reject(new Error(`Cant add color layer ${t.id}: the maximum layer is reached`));e.attach(t)}else e.attach(t);else{if("function"!=typeof t.update)return t._reject(new Error("Cant add GeometryLayer: missing a update function"));if("function"!=typeof t.preUpdate)return t._reject(new Error("Cant add GeometryLayer: missing a preUpdate function"));this.#f.push(t)}return t.object3d&&!t.object3d.parent&&t.object3d!==this.scene&&this.scene.add(t.object3d),Promise.all(t._promises).then((()=>{t._resolve(),this.notifyChange(e||t,!1),this._frameRequesters[s.Ao.UPDATE_END]&&this._frameRequesters[s.Ao.UPDATE_END].includes(this._allLayersAreReadyCallback)||this.addFrameRequester(s.Ao.UPDATE_END,this._allLayersAreReadyCallback),this.dispatchEvent({type:K.LAYER_ADDED,layerId:t.id})}),t._reject),t.whenReady}removeLayer(t,e){const r=this.getLayerById(t);if(r){const i=r.parent;if(r.delete(e),i&&!i.detach(r))throw new Error(`Error to detach ${t} from ${i.id}`);if(null==i&&this.#f.splice(this.#f.findIndex((e=>e.id==t)),1),r.isColorLayer){const t=this.getLayers((t=>t.isColorLayer));for(const e of t)e.sequence>r.sequence&&e.sequence--}let n=0;for(const t of ot)n+=t.getLayers((t=>t.source.uid==r.source.uid&&t.crs==r.crs)).length;return r.source.onLayerRemoved({unusedCrs:0==n?r.crs:void 0}),this.notifyChange(this.camera),this.dispatchEvent({type:K.LAYER_REMOVED,layerId:t}),!0}throw new Error(`${t} doesn't exist`)}notifyChange(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&(this._changeSources.add(t),this.mainLoop.gfxEngine.renderer.xr.isPresenting||!t.isTileMesh&&!t.isCamera||(this.#g.needsUpdate=!0)),this.mainLoop.scheduleViewUpdate(this,e)}getLayers(t){const e=[];for(const r of this.#f)if(t&&!t(r)||e.push(r),r.attachedLayers)for(const i of r.attachedLayers)t&&!t(i,r)||e.push(i);return e}getLayerById(t){return this.getLayers((e=>e.id===t))[0]}addFrameRequester(t,e){if("function"!=typeof e)throw new Error("frameRequester must be a function");this._frameRequesters[t]?this._frameRequesters[t].push(e):this._frameRequesters[t]=[e]}removeFrameRequester(t,e){this._frameRequesters[t].includes(e)?this._delayedFrameRequesterRemoval.push({when:t,frameRequester:e}):console.error("Invalid call to removeFrameRequester: frameRequester isn't registered")}removeAllFrameRequesters(){for(const t in this._frameRequesters)if(Object.prototype.hasOwnProperty.call(this._frameRequesters,t)){const e=this._frameRequesters[t];for(const r of e)this.removeFrameRequester(t,r)}this._executeFrameRequestersRemovals()}removeAllEvents(){if(void 0!==this._listeners){for(const t in this._listeners)Object.prototype.hasOwnProperty.call(this._listeners,t)&&delete this._listeners[t];this._listeners=void 0}}_executeFrameRequestersRemovals(){for(const t of this._delayedFrameRequesterRemoval){const e=this._frameRequesters[t.when].indexOf(t.frameRequester);e>=0?this._frameRequesters[t.when].splice(e,1):console.warn("FrameReq has already been removed")}this._delayedFrameRequesterRemoval.length=0}execFrameRequesters(t,e,r){if(this._frameRequesters[t]){this._delayedFrameRequesterRemoval.length>0&&this._executeFrameRequestersRemovals();for(var i=arguments.length,n=new Array(i>3?i-3:0),s=3;s1&&void 0!==arguments[1]?arguments[1]:$,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.domElement.getBoundingClientRect();if(t.touches&&t.touches.length)return e.set(t.touches[r].clientX-i.x,t.touches[r].clientY-i.y);if(void 0!==t.offsetX&&void 0!==t.offsetY){const r=t.target.getBoundingClientRect();return e.set(r.x+t.offsetX-i.x,r.y+t.offsetY-i.y)}}eventToNormalizedCoords(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewToNormalizedCoords(this.eventToViewCoords(t,$,e))}viewToNormalizedCoords(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$;return e.x=t.x/this.camera.width*2-1,e.y=t.y/this.camera.height*-2+1,e}normalizedToViewCoords(t){return $.x=.5*(t.x+1)*this.camera.width,$.y=-.5*(t.y-1)*this.camera.height,$}pickObjectsAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;const i=[];if(r&&0!==r.length||(r=this.getLayers((t=>t.isGeometryLayer))),Array.isArray(r)||(r=[r]),r.forEach((t=>{"string"==typeof t&&(t=this.getLayerById(t)),t&&(t.isGeometryLayer||t.isObject3D)&&i.push(t)})),0==i.length)return[];const n=[],s=t instanceof Event?this.eventToViewCoords(t):t;for(const t of i)if(!t.isAtmosphere)if(t.isGeometryLayer){if(!t.ready){console.warn("view.pickObjectAt : layer is not ready : ",t);continue}t.pickObjectsAt(this,s,e,n)}else Y.Z.pickObjectsAt(this,s,e,t,n);return n}getScale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28;return this.camera3D.isOrthographicCamera?.001*t/this.getPixelsToMeters():this.getScaleFromDistance(t,this.getDistanceFromCamera())}getScaleFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t/=1e3;const r=i.MathUtils.degToRad(this.camera3D.fov);return t*(this.camera.height/(2*e*Math.tan(.5*r)))}getDistanceFromCamera(t){return this.getPickingPositionFromDepth(t,nt),this.camera3D.position.distanceTo(nt)}getPixelsToMeters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(at=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,t*at/this.camera.width):this.getPixelsToMetersFromDistance(t,this.getDistanceFromCamera(e))}getPixelsToMetersFromDistance(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)/this.camera._preSSE}getMetersToPixels(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1?arguments[1]:void 0;return this.camera3D.isOrthographicCamera?(at=(this.camera3D.right-this.camera3D.left)/this.camera3D.zoom,t*this.camera.width/at):this.getMetersToPixelsFromDistance(t,this.getDistanceFromCamera(e))}getMetersToPixelsFromDistance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.camera._preSSE*t/e}pickFeaturesAt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;nt.isColorLayer||t.isGeometryLayer)):i).forEach((t=>{"string"==typeof t&&(t=this.getLayerById(t)),t&&t.isLayer&&(o[t.id]=[],t.isColorLayer&&s.push(t.id))}));const a=t instanceof Event?this.eventToViewCoords(t,$):t,l=this.pickObjectsAt(a,e,...i);if(l.length>0&&l.forEach((t=>o[t.layer.id].push(t))),0==s.length)return o;let c;this.getPickingPositionFromDepth(a,nt),st.crs=this.referenceCrs,st.setFromVector3(nt);const h={M:this.getPixelsToMeters(e,a),D:.001*e};this.isPlanarView?h.D=h.M:this.getPixelsToDegrees&&(h.D=this.getMetersToDegrees(h.M));const u=Y.Z.pickTilesAt(this,a,e,this.tileLayer);for(const t of u)if(t.object.material)for(const e of t.object.material.getLayers(s))for(const t of e.textures)t.features&&(c=m.Z.isMetricUnit(t.features.crs)?h.M:h.D,A.Z.filterFeaturesUnderCoordinate(st,t.features,c).forEach((t=>{o[e.id].find((e=>e.geometry===t.geometry))||o[e.id].push(t)})));return o}readDepthBuffer(t,e,r,i,n){const s=this.mainLoop.gfxEngine,o=this.tileLayer.wireframe,a=this.tileLayer.opacity,l=this.tileLayer.visible;o&&(this.tileLayer.wireframe=!1),a<1&&(this.tileLayer.opacity=1),l||(this.tileLayer.visible=!0);const c=this.tileLayer.level0Nodes.map((t=>f.Z.push(t,f.Z.MODES.DEPTH)));return n=s.renderViewToBuffer({camera:this.camera,scene:this.tileLayer.object3d},{x:t,y:e,width:r,height:i,buffer:n}),c.forEach((t=>t())),this.tileLayer.wireframe!==o&&(this.tileLayer.wireframe=o),this.tileLayer.opacity!==a&&(this.tileLayer.opacity=a),this.tileLayer.visible!==l&&(this.tileLayer.visible=l),n}getPickingPositionFromDepth(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3;if(!this.tileLayer||0==this.tileLayer.level0Nodes.length||!this.tileLayer.level0Nodes[0])return void(e=void 0);const r=this.mainLoop,n=0==r.scheduler.commandsWaitingExecutionCount()&&r.renderingState==s.HR,a=r.gfxEngine,l=a.getWindowSize();let c;if((t=t||l.clone().multiplyScalar(.5)).x=Math.floor(t.x),t.y=Math.floor(t.y),n){this.#g.needsUpdate&&(this.readDepthBuffer(0,0,l.x,l.y,this.#g),this.#g.needsUpdate=!1);const e=4*((l.y-t.y-1)*l.x+t.x);c=this.#g.slice(e,e+4)}else c=this.readDepthBuffer(t.x,t.y,1,1,this.#m);if(et.x=t.x/l.x*2-1,et.y=-t.y/l.y*2+1,o.Z.isLogDepthBufferSupported()&&"PerspectiveCamera"==this.camera3D.type){rt.origin.copy(this.camera3D.position),rt.direction.set(et.x,et.y,.5),tt.multiplyMatrices(this.camera3D.matrixWorld,tt.copy(this.camera3D.projectionMatrix).invert()),rt.direction.applyMatrix4(tt),rt.direction.sub(rt.origin),it.set(0,0,1),it.applyMatrix4(tt),it.sub(rt.origin);const t=it.angleTo(rt.direction),r=a.depthBufferRGBAValueToOrthoZ(c,this.camera3D)/Math.cos(t);e.addVectors(this.camera3D.position,rt.direction.setLength(r))}else{const t=a.depthBufferRGBAValueToOrthoZ(c,this.camera3D);e.set(et.x,et.y,t),e.unproject(this.camera3D)}return e.length()>1e7?void 0:e}pickTerrainCoordinates(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.Z(this.referenceCrs);return t instanceof Event?this.eventToViewCoords(t):t&&void 0!==t.x&&void 0!==t.y?$.copy(t):$.set(this.mainLoop.gfxEngine.width/2,this.mainLoop.gfxEngine.height/2),this.getPickingPositionFromDepth($,nt),st.crs=this.referenceCrs,st.setFromVector3(nt),st.as(e.crs,e),e}pickCoordinates(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new g.Z(this.referenceCrs);return console.warn("Deprecated, use View#pickTerrainCoordinates instead."),this.pickTerrainCoordinates(t,e)}resize(t,e){t<0||e<0?console.warn(`Trying to resize the View with negative height (${e}) or width (${t}). Skipping resize.`):(null==t&&(t=this.domElement.clientWidth),null==e&&(e=this.domElement.clientHeight),this.#g=new Uint8Array(4*t*e),this.mainLoop.gfxEngine.onWindowResize(t,e),0!==t&&0!==e&&(this.camera.resize(t,e),this.notifyChange(this.camera3D)))}}const ct=lt},11707:(t,e,r)=>{"use strict";r.d(e,{Z:()=>g,y:()=>u});var i=r(99477),n=r(45222),s=r(66014),o=r(47274),a=r(83214),l=r(25033),c=(r(49075),r(84607)),h=r(59099);const u={ON_TILE_CONTENT_LOADED:"on-tile-content-loaded",ON_TILE_REQUESTED:"on-tile-requested"},d=(0,s.Ti)();function p(t){let e=t,r=e.tileId;for(;isNaN(r)&&e.parent;)e=e.parent,r=e.tileId;return r}function f(t){return t.geometry&&t.geometry.attributes._BATCHID}class m extends n.Z{#A;constructor(t,e,r){super(t,new i.Group,{source:e.source}),this.isC3DTilesLayer=!0,this.sseThreshold=e.sseThreshold||16,this.cleanupDelay=e.cleanupDelay||1e3,this.protocol="3d-tiles",this.name=e.name,this.registeredExtensions=e.registeredExtensions||new a.Z,this.pntsMode=l.vj.COLOR,this.pntsShape=l.Uz.CIRCLE,this.classification=e.classification,this.pntsSizeMode=l.E7.VALUE,this.pntsMinAttenuatedSize=e.pntsMinAttenuatedSize||3,this.pntsMaxAttenuatedSize=e.pntsMaxAttenuatedSize||10,e.pntsMode&&(Object.values(l.vj).includes(e.pntsMode)?this.pntsMode=e.pntsMode:console.warn("The points cloud mode doesn't exist. Use 'COLOR' or 'CLASSIFICATION' instead.")),e.pntsShape&&(Object.values(l.Uz).includes(e.pntsShape)?this.pntsShape=e.pntsShape:console.warn("The points cloud point shape doesn't exist. Use 'CIRCLE' or 'SQUARE' instead.")),e.pntsSizeMode&&(Object.values(l.E7).includes(e.pntsSizeMode)?this.pntsSizeMode=e.pntsSizeMode:console.warn("The points cloud size mode doesn't exist. Use 'VALUE' or 'ATTENUATED' instead.")),this._style=e.style||null,this.#A=new Map,this.tilesC3DTileFeatures=new Map,e.onTileContentLoaded&&(console.warn("DEPRECATED onTileContentLoaded should not be passed at the contruction, use C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED event instead"),this.addEventListener(u.ON_TILE_CONTENT_LOADED,e.onTileContentLoaded)),e.overrideMaterials&&(console.warn("overrideMaterials is deprecated, use style API instead"),this.overrideMaterials=e.overrideMaterials),this._cleanableTiles=[];const n=this.addInitializationStep();this.source.whenReady.then((t=>{if(this.tileset=new o.Z(t,this.source.baseUrl,this.registeredExtensions),this.tileset.extensionsUsed)for(const t of this.tileset.extensionsUsed)this.registeredExtensions.isExtensionRegistered(t)||(this.tileset.extensionsRequired&&this.tileset.extensionsRequired.includes(t)?console.error(`3D Tiles tileset required extension "${t}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`):console.warn(`3D Tiles tileset used extension "${t}" must be registered to the 3D Tiles layer of iTowns to be parsed and used.`));(0,s.SR)(r,r.mainLoop.scheduler,this,t.root).then(n)}))}preUpdate(){return s.SY.bind(this)()}update(t,e,r){return d(t,e,r)}getObjectToUpdateForAttachedLayers(t){if(t.content){const e=[];t.content.traverse((r=>{r.isObject3D&&r.material&&r.layer==t.layer&&e.push(r)}));const r=t.parent;return r&&r.content?{elements:e,parent:r.content}:{elements:e}}}getC3DTileFeatureFromIntersectsArray(t){let e=null;for(let r=0;r{if(f(e)){const r=e.geometry.getAttribute("_BATCHID");let i=r.getX(0),n=0,s=0;const o=()=>{if(this.tilesC3DTileFeatures.get(t.tileId).has(i))this.tilesC3DTileFeatures.get(t.tileId).get(i).groups.push({start:n,count:s});else{const r=new c.Z(t.tileId,i,[{start:n,count:s}],{},e);this.tilesC3DTileFeatures.get(t.tileId).set(i,r)}},a=e.geometry.getAttribute("position"),l=a.count*a.itemSize;for(let t=0;t=l&&o()}}}))}updateStyle(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this._style)return!1;if(!this.object3d)return!1;const e=[],r=new Map;this.object3d.traverse((e=>{if(f(e)){const i=p(e);if(t&&!t.includes(i))return;r.has(i)||r.set(i,[]),r.get(i).push(e)}}));for(const[t,n]of r){const r=this.tilesC3DTileFeatures.get(t);n.forEach((t=>{t.geometry.clearGroups(),t.material=[];for(const[,e]of r){if(e.object3d!=t)continue;let r=null;r="function"==typeof this._style.fill.color?new i.Color(this._style.fill.color(e)):new i.Color(this._style.fill.color);let n=null;n="function"==typeof this._style.fill.opacity?this._style.fill.opacity(e):this._style.fill.opacity;const s=r.getHexString()+n;let o=null;this.#A.has(s)?o=this.#A.get(s):(o=new i.MeshStandardMaterial({color:r,opacity:n,transparent:n<1,alphaTest:.09}),this.#A.set(s,o));let a=-1;for(let e=0;e{t.geometry.addGroup(e.start,e.count,a)}))}(0,h.O)(t),t.material instanceof Array?t.material.forEach((t=>{e.includes(t)||e.push(t)})):e.includes(t.material)||e.push(t.material)}))}for(const[t,r]of this.#A)e.includes(r)||(r.dispose(),this.#A.delete(t));return!0}get materialCount(){return this.#A.size}set style(t){this._style=t,this.updateStyle()}get style(){return this._style}}const g=m},96836:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a,c:()=>s});var i=r(78025),n=r(81590);function s(t){var e;return null==t||null===(e=t.attachedLayers.filter((t=>t.isGeoidLayer))[0])||void 0===e?void 0:e.visible}class o extends i.Z{constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.isGeoidLayer=!0,this.defineLayerProperty("visible",!0)}updateNodeZ(t){t.material.geoidHeight=this.visible?t.geoidHeight:0,t.obb.updateZ({geoidHeight:t.material.geoidHeight})}update(t,e,r,i){if(!i||!r.material)return;const s=r.getExtentsByProjection(e.crs),o=s[0].zoom;if(!(o>e.zoom.max||othis.updateNodeZ(r);e.addEventListener("visible-property-changed",t),r.addEventListener("dispose",(()=>{e.removeEventListener("visible-property-changed",t)}))}if(!e.frozen&&e.visible&&r.material.visible&&r.layerUpdateState[e.id].canTryUpdate())return r.layerUpdateState[e.id].newTry(),this.getData(r.extent,s).then((t=>{r.geoidHeight=t.getHeightAtCoordinates(r.extent.center()),this.updateNodeZ(r),r.layerUpdateState[e.id].noMoreUpdatePossible()}))}}}const a=o},45222:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(78025),n=r(98675),s=r(55086),o=r(70991);class a extends i.Z{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.cacheLifeTime=r.cacheLifeTime??s.D.GEOMETRY;const i=r.visible;if(delete r.visible,super(t,r),this.isGeometryLayer=!0,!e||!e.isObject3D)throw new Error("Missing/Invalid object3d parameter (must be a\n three.js Object3D instance)");"Group"===e.type&&""===e.name&&(e.name=t),Object.defineProperty(this,"object3d",{value:e,writable:!1,configurable:!0}),this.opacity=1,this.wireframe=!1,this.attachedLayers=[],this.visible=i??!0,Object.defineProperty(this.zoom,"max",{value:1/0,writable:!1}),this.filteringExtent=!this.source.isFileSource,this.structure="3d"}get visible(){return this.object3d.visible}set visible(t){if(this.object3d.visible!==t){const e={type:"visible-property-changed",previous:{},new:{}};e.previous.visible=this.object3d.visible,e.new.visible=t,this.dispatchEvent(e),this.object3d.visible=t}}getObjectToUpdateForAttachedLayers(t){if(t.parent&&t.material)return{element:t,parent:t.parent}}postUpdate(){}culling(){return!0}attach(t){if(!t.update)throw new Error(`Missing 'update' function -> can't attach layer\n ${t.id}`);this.attachedLayers.push(t),t.parent=this}detach(t){const e=this.attachedLayers.length;return this.attachedLayers=this.attachedLayers.filter((e=>e.id!=t.id)),t.parent=void 0,this.attachedLayers.length2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return n.Z.pickObjectsAt(t,e,r,this.object3d,i)}}const l=a},81616:(t,e,r)=>{"use strict";r.d(e,{$:()=>s,Z:()=>n});var i=r(71440);class n{constructor(t){this.layer=t}clear(){}update(){}}class s extends n{constructor(t){super(t),this.displayed={tiles:new Set},Object.defineProperty(this.displayed,"layers",{get:()=>{let t=[];return this.displayed.tiles.forEach((e=>{const r=e.material;t=[...new Set([...t,...r.colorLayerIds.filter((t=>r.getLayer(t))),...r.elevationLayerIds])]})),this.layer.attachedLayers.filter((e=>t.includes(e.id)))}}),Object.defineProperty(this.displayed,"extent",{get:()=>{const t=new i.ZP(this.layer.extent.crs,1/0,-1/0,1/0,-1/0);return t.min=1/0,t.max=-1/0,this.displayed.tiles.forEach((e=>{t.union(e.extent),t.min=Math.min(e.obb.z.min,t.min),t.max=Math.max(e.obb.z.max,t.max)})),t}})}clear(){this.displayed.tiles.clear()}update(t){t.material.visible?this.displayed.tiles.add(t):this.displayed.tiles.delete(t)}}},76257:(t,e,r)=>{"use strict";r.d(e,{Z:()=>_});var i=r(99477),n=r(81590),s=r(70991),o=r(45222),a=r(62310),l=r(71440),c=r(59947),h=r(5167),u=r(49075),d=r(49652);const p=new u.uP,f=new a.Z("EPSG:4326",0,0,0),m=new l.ZP("EPSG:4326",0,0,0,0),g=new i.Vector2,A=new i.Vector2,y=new i.Vector2;class v{#y=!1;constructor(){this.dom=document.createElement("div"),this.dom.style.display="none",this.visible=!0}get visible(){return this.#y}set visible(t){t!==this.#y&&(this.#y=t,this.dom.style.display=t?"block":"none")}hide(){this.visible=!1}show(){this.visible=!0}add(t){this.dom.append(t.dom)}}class x extends i.Group{constructor(t){super(),this.nodeParent=t,this.needsUpdate=!0}initializeDom(){this.domElements=new v,this.domElements.labels=new v,this.domElements.add(this.domElements.labels),this.domElements.labels.dom.style.opacity="0"}addLabel(t){this.add(t),this.domElements.labels.dom.append(t.content),t.initDimensions(),this.nodeParent.layer.isGlobeLayer&&this.nodeParent.level<4&&(t.horizonCullingPoint=new i.Vector3)}removeLabel(t){this.remove(t),this.domElements.labels.dom.removeChild(t.content)}updatePosition(t){this.needsUpdate&&(this.needsAltitude&&t.updateElevationFromLayer(this.nodeParent.layer,[this.nodeParent]),t.update3dPosition(this.nodeParent.layer.crs),t.updateHorizonCullingPoint())}count(){return this.children.length}get labels(){return this.children}}class b extends o.Z{#v=new d.R;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.domElement;delete e.domElement,super(t,e.object3d||new i.Group,e),this.isLabelLayer=!0,this.domElement=new v,this.domElement.show(),this.domElement.dom.id=`itowns-label-${this.id}`,this.buildExtent=!0,this.crs=e.source.crs,this.performance=e.performance||!0,this.forceClampToTerrain=e.forceClampToTerrain||!1,this.toHide=new i.Group,this.labelDomelement=r,this.margin=e.margin}get visible(){return super.visible}set visible(t){var e,r;super.visible=t,t?null===(e=this.domElement)||void 0===e||e.show():null===(r=this.domElement)||void 0===r||r.hide()}get submittedLabelNodes(){return this.object3d.children}convert(t,e){const r=[];return e.as(t.crs,m),f.crs=t.crs,p.setZoom(e.zoom),t.features.forEach((e=>{var i,n,s,o;if(e.type!==h.tg.POINT)return;p.setFeature(e);const a=null===(i=e.style)||void 0===i||null===(n=i.text)||void 0===n?void 0:n.field,l=null===(s=e.style)||void 0===s||null===(o=s.point)||void 0===o?void 0:o.base_altitude,d=l instanceof Function&&"baseAltitudeDefault"==l.name;r.needsAltitude=r.needsAltitude||!0===this.forceClampToTerrain||d&&!e.hasRawElevationData,e.geometries.forEach((i=>{if(f.setFromArray(e.vertices,i.size*i.indices[0].offset),f.applyMatrix4(t.matrixWorld),!m.isPointInside(f))return;const n=i.properties.style&&i.properties.style.text&&i.properties.style.text.field;let s;p.setGeometry(i),this.style.setContext(p);const o=this.style.text&&this.style.text.field;if(this.labelDomelement)s=(0,u.Lu)(this.labelDomelement,p);else if(!(n||a||o||i.properties.style&&(i.properties.style.icon.source||i.properties.style.icon.key)||e.style&&e.style.icon&&(e.style.icon.source||e.style.icon.key)||this.style.icon&&(this.style.icon.source||this.style.icon.key)))return;const l=new c.Z(s,f.clone(),this.style);l.layerId=this.id,l.padding=this.margin||l.padding,r.push(l)}))})),r}preUpdate(t,e){e.has(this.parent)&&(this.object3d.clear(),this.#v.width=.5*this.parent.maxScreenSizeNode,this.#v.height=.5*this.parent.maxScreenSizeNode,this.#v.resize())}#x(t){this.object3d.add(t)}#b(t){this.toHide.add(t)}#_(t){var e,r;return null!==(e=t.parent)&&void 0!==e&&e.isTileMesh?(null===(r=t.parent.link[this.id])||void 0===r?void 0:r.domElements)||this.#_(t.parent):this.domElement}#w(t){return t.children.every((t=>{var e;return t.layerUpdateState&&(null===(e=t.layerUpdateState[this.id])||void 0===e?void 0:e.hasFinished())}))}#E(t){const e=t.children.slice();this.#v.reset(),e.sort(((t,e)=>e.order-t.order)),e.forEach((e=>{t.nodeParent.extent.planarDimensions(g),f.crs=t.nodeParent.extent.crs,f.setFromValues(t.nodeParent.extent.west,t.nodeParent.extent.north,0).toVector3(A),f.copy(e.coordinates).as(t.nodeParent.extent.crs,f).toVector3(y),y.sub(A),y.y+=g.y,y.divide(g).multiplyScalar(this.#v.width),e.updateProjectedPosition(y.x,y.y),this.#v.insert(e)||t.removeLabel(e)}))}update(t,e,r,i){if(!i&&r.link[e.id])return void s.Z.removeChildrenAndCleanupRecursively(this,r);const o=r.link[e.id]||new x(r);if(r.link[e.id]=o,this.frozen||!r.visible||!this.visible)return;if(!r.material.visible&&this.#w(r))return this.#b(o);const a=r.getExtentsByProjection(this.source.crs)||[r.extent],l=a[0].zoom;if(le.zoom.max)return this.#b(o);if(void 0===r.layerUpdateState[this.id]&&(r.layerUpdateState[this.id]=new n.Z),!this.source.extentInsideLimit(r.extent,l))return void r.layerUpdateState[this.id].noMoreUpdatePossible();if(this.#w(r.parent))return r.material.visible||(o.needsUpdate=!0),void this.#x(o);if(!r.layerUpdateState[this.id].canTryUpdate())return;r.layerUpdateState[this.id].newTry();const c={layer:this,extentsSource:a,view:t.view,requester:r};return t.scheduler.execute(c).then((e=>{if(!e)return;const i=t.view.mainLoop.gfxEngine.label2dRenderer;o.initializeDom(),this.#_(r).add(o.domElements),e.forEach((t=>{r.parent?(o.needsAltitude=o.needsAltitude||t.needsAltitude,t.forEach((t=>{r.extent.isPointInside(t.coordinates)&&o.addLabel(t)}))):t.forEach((t=>{s.Z.removeChildrenAndCleanupRecursively(this,t),i.removeLabelDOM(t)}))})),o.count()&&(o.domElements.labels.hide(),o.domElements.labels.dom.style.opacity="1.0",r.addEventListener("show",(()=>o.domElements.labels.show())),r.addEventListener("hidden",(()=>this.#b(o))),r.addEventListener("removed",(()=>this.removeNodeDomElement(r))),o.needsAltitude&&r.material.getElevationLayer()&&r.material.getElevationLayer().addEventListener("rasterElevationLevelChanged",(()=>{o.needsUpdate=!0})),this.performance&&this.#E(o)),r.layerUpdateState[this.id].noMoreUpdatePossible()}))}removeLabelsFromNodeRecursive(t){t.children.forEach((t=>{t.link[this.id]&&delete t.link[this.id],this.removeLabelsFromNodeRecursive(t)})),this.removeNodeDomElement(t)}removeNodeDomElement(t){var e;if(null!==(e=t.link[this.id])&&void 0!==e&&e.domElements){const e=t.link[this.id].domElements.dom;e.parentElement.removeChild(e),delete t.link[this.id].domElements}}delete(t){t&&this.cache.clear(),this.domElement.dom.parentElement.removeChild(this.domElement.dom),this.parent.level0Nodes.forEach((t=>this.removeLabelsFromNodeRecursive(t)))}}const _=b},78025:(t,e,r)=>{"use strict";r.d(e,{M:()=>u,Z:()=>h});var i=r(99477),n=r(60465),s=r(81616),o=r(72726),a=r(55086),l=r(49075);class c extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.projection&&(console.warn("Layer projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),void 0===e.source||!0===e.source)throw new Error(`Layer ${t} needs Source`);var r;super(),this.isLayer=!0,!e.style||e.style instanceof l.ZP||("string"==typeof(null===(r=e.style.fill)||void 0===r?void 0:r.pattern)&&(console.warn("Using style.fill.pattern = { source: Img|url } is adviced"),e.style.fill.pattern={source:e.style.fill.pattern}),e.style=new l.ZP(e.style)),this.style=e.style||new l.ZP,Object.assign(this,e),Object.defineProperty(this,"id",{value:t,writable:!1}),this.options=e.options||{},this.updateStrategy||(this.updateStrategy={type:n.R3,options:{}}),this.defineLayerProperty("frozen",!1),e.zoom?(this.zoom={max:e.zoom.max,min:e.zoom.min||0},null==this.zoom.max&&(this.zoom.max=1/0)):this.zoom={max:1/0,min:0},this.info=new s.Z(this),this.source=this.source||new o.Z({url:"none"}),this.ready=!1,this._promises=[],this.whenReady=new Promise(((t,e)=>{this._resolve=t,this._reject=e})).then((()=>(this.ready=!0,this.source.onLayerAdded({out:this}),this))),this._promises.push(this.source.whenReady),this.cache=new a.Z(e.cacheLifeTime),this.mergeFeatures=void 0===this.mergeFeatures||e.mergeFeatures,this.filter=this.filter||this.source.filter}addInitializationStep(){let t;return this._promises.push(new Promise((e=>{t=e}))),t}defineLayerProperty(t,e,r){const i=Object.getOwnPropertyDescriptor(this,t);if(!i||!i.set){let i=null==this[t]?e:this[t];Object.defineProperty(this,t,{get:()=>i,set:e=>{if(i!==e){const n={type:`${t}-property-changed`,previous:{},new:{}};n.previous[t]=i,n.new[t]=e,i=e,r&&r(this,t),this.dispatchEvent(n)}}})}}convert(t){return t}getData(t,e){const r=this.source.requestToKey(this.source.isVectorSource?e:t);let i=this.cache.getByArray(r);return i||(i=this.source.loadData(t,this).then((t=>this.convert(t,e)),(t=>{throw t})),this.cache.setByArray(i,r)),i}isValidData(){}delete(){console.warn("Function delete doesn't exist for this layer")}}const h=c,u={moveLayerToIndex:function(t,e,r){e=Math.min(e,r.length-1),e=Math.max(e,0);const i=t.sequence;for(const n of r)n.id===t.id?n.sequence=e:n.sequence>i&&n.sequence<=e?n.sequence--:n.sequence>=e&&n.sequence0&&this.moveLayerToIndex(t,t.sequence-1,e)},moveLayerUp:function(t,e){const r=e.length-1;t.sequencet.sequence-e.sequence)),e.map((t=>t.id))}}},81590:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=[1,3,7,60],n=class{constructor(){this.state=0,this.lastErrorTimestamp=0,this.errorCount=0,this.failureParams={lowestLevelError:1/0}}hasFinished(){return 4==this.state}canTryUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();switch(this.state){case 0:return!0;case 3:case 1:case 4:return!1;default:return 1e3*this.secondsUntilNextTry()<=t-this.lastErrorTimestamp}}secondsUntilNextTry(){if(2!==this.state)return 0;const t=Math.max(0,Math.min(this.errorCount,i.length)-1);return i[t]}newTry(){this.state=1}success(){this.lastErrorTimestamp=0,this.state=0}noMoreUpdatePossible(){this.state=4}noData(t){this.state=0,this.failureParams.lowestLevelError=Math.min(t.targetLevel,this.failureParams.lowestLevelError)}failure(t,e,r){r&&null!=r.targetLevel&&(this.failureParams.lowestLevelError=Math.min(r.targetLevel,this.failureParams.lowestLevelError)),this.lastErrorTimestamp=t,this.state=e?3:2,this.errorCount++}inError(){return 3==this.state||2==this.state}}},60465:(t,e,r)=>{"use strict";r.d(e,{AE:()=>s,ET:()=>a,R3:()=>n,c:()=>o,k5:()=>h});var i=r(43412);const n=0,s=1,o=2,a=3;function l(t,e){const r=e.groups.filter((e=>e<=t));return r.length?r[r.length-1]:e.groups[0]}function c(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e==i.pL?r.zoom?r.zoom.min:0:Math.min(t,Math.ceil((e+t)/2))}function h(t,e){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.level,n=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0;const d=h.source.zoom?h.source.zoom.max:1/0;if(u.lowestLevelError!=1/0)r=c(u.lowestLevelError,n,h.source),r=u.lowestLevelError==r?r-1:r,t==s&&(r=l(r,h.updateStrategy.options));else{switch(t){case s:r=l(i,h.updateStrategy.options);break;case o:r=function(t,e,r){return Math.min(t,e+(r.increment||1))}(i,n,h.updateStrategy.options);break;case a:r=c(i,n,h.source);break;default:r=function(t,e,r,i){return t.pendingSubdivision&&!i.isVectorTileSource?r:e}(e,i,n,h.source)}r=Math.min(r,d)}return r}},61366:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});const i=function(t,e){if(e&&e.isGeometryLayer){let r=t.transparent;t.layer=e,t.uniforms&&null!=t.uniforms.opacity?Object.defineProperty(t.uniforms.opacity,"value",{get:()=>t.layer.opacity}):null!=t.opacity&&Object.defineProperty(t,"opacity",{get:()=>t.layer.opacity}),t.uniforms&&null!=t.uniforms.mode&&Object.defineProperty(t.uniforms.mode,"value",{get:()=>t.layer.pntsMode}),t.uniforms&&null!=t.uniforms.shape&&Object.defineProperty(t.uniforms.shape,"value",{get:()=>t.layer.pntsShape}),t.uniforms&&null!=t.uniforms.sizeMode&&Object.defineProperty(t.uniforms.sizeMode,"value",{get:()=>t.layer.pntsSizeMode}),t.uniforms&&null!=t.uniforms.minAttenuatedSize&&Object.defineProperty(t.uniforms.minAttenuatedSize,"value",{get:()=>t.layer.pntsMinAttenuatedSize}),t.uniforms&&null!=t.uniforms.maxAttenuatedSize&&Object.defineProperty(t.uniforms.maxAttenuatedSize,"value",{get:()=>t.layer.pntsMaxAttenuatedSize}),Object.defineProperty(t,"wireframe",{get:()=>t.layer.wireframe}),Object.defineProperty(t,"transparent",{get:()=>(r!=t.layer.opacity<1&&(t.needsUpdate=!0,r=t.layer.opacity<1),r)})}return t}},96021:(t,e,r)=>{"use strict";r.d(e,{Z:()=>C});var i=r(99477),n=r(45222),s=r(81616),o=r(98675),a=r(79323),l=r(96836);class c extends i.Mesh{#M=new Map;#S=!0;constructor(t,e,r,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(super(t,e),!n)throw new Error("extent is mandatory to build a TileMesh");this.layer=r,this.extent=n,this.extent.zoom=s,this.level=s,this.material.objectId=this.id,this.obb=this.geometry.OBB.clone(),this.boundingSphere=new i.Sphere,this.obb.box3D.getBoundingSphere(this.boundingSphere);for(const t of r.tileMatrixSets)this.#M.set(t,this.extent.tiledCovering(t));this.frustumCulled=!1,this.matrixAutoUpdate=!1,this.rotationAutoUpdate=!1,this.layerUpdateState={},this.isTileMesh=!0,this.geoidHeight=0,this.link={},Object.defineProperty(this,"visible",{get(){return this.#S},set(t){this.#S!=t&&(this.#S=t,this.dispatchEvent({type:t?"shown":"hidden"}))}})}setBBoxZ(t){t.geoidHeight=(0,l.c)(this.layer)?this.geoidHeight:0,this.obb.updateZ(t),this.horizonCullingPointElevationScaled&&this.horizonCullingPointElevationScaled.setLength(this.obb.z.delta+this.horizonCullingPoint.length()),this.obb.box3D.getBoundingSphere(this.boundingSphere)}getExtentsByProjection(t){return this.#M.get(a.Z.formatToTms(t))}findCommonAncestor(t){if(t)return t.level==this.level?t.id==this.id?t:0!=t.level?this.parent.findCommonAncestor(t.parent):void 0:t.level{c=t})),A.set(l,o,e.level,a),e.extent=r,e.center=t.center(e.extent).clone();let h,u=g.get(a);e.buildIndexAndUv_0=!u,e.builder=t;try{h=(0,f.Z)(e)}catch(t){return Promise.reject(t)}u||(u={},u.index=new i.BufferAttribute(h.index,1),u.uv=new i.BufferAttribute(h.uvs[0],2),g.set(a,u)),h.index=u.index,h.uvs[0]=u.uv,h.position=new i.BufferAttribute(h.position,3),h.normal=new i.BufferAttribute(h.normal,3),e.builder.uvCount>1&&(h.uvs[1]=new i.BufferAttribute(h.uvs[1],1));const p=new d.Z(e,h);return p.OBB=new m.Z(p.boundingBox.min,p.boundingBox.max),p._count=0,p.dispose=()=>{p._count--,p._count<=0&&(p.index=null,delete p.attributes.uv,i.BufferGeometry.prototype.dispose.call(p),A.delete(o,e.level,a))},c(p),Promise.resolve({geometry:p,quaternion:n,position:s})}return l.then((t=>({geometry:t,quaternion:n,position:s})))}(n,a).then((t=>{t.geometry._count++;const a=r.tileMatrixSets.length,c=new u.ZP(r.materialOptions,a);(0,y.Z)(c,r);const d=new h(t.geometry,c,r,e,o);if(s&&s.isTileMesh){const e=n.computeSharableExtent(s.extent);t.position.sub(e.position).applyQuaternion(e.quaternion.invert()),t.quaternion.premultiply(e.quaternion)}if(d.position.copy(t.position),d.quaternion.copy(t.quaternion),d.visible=!1,d.updateMatrix(),function(t,e){if(e.diffuse&&(t.material.diffuse=e.diffuse),e.isGlobeLayer){t.horizonCullingPoint=t.extent.center().as("EPSG:4978").toVector3(),t.extent.planarDimensions(v).multiplyScalar(i.MathUtils.DEG2RAD);const e=v.length(),r=Math.abs(1/Math.cos(.5*e));t.horizonCullingPoint.setLength(r*t.horizonCullingPoint.length()),t.horizonCullingPointElevationScaled=t.horizonCullingPoint.clone()}}(d,r),s){d.geoidHeight=s.geoidHeight;const t=(0,l.c)(r)?d.geoidHeight:0;d.setBBoxZ({min:s.obb.z.min,max:s.obb.z.max,geoidHeight:t}),d.material.geoidHeight=t}return d}))}};var b=r(70991),_=r(81189),w=r(78025);const E=new i.Vector3,M=new i.Vector3;class S extends n.Z{constructor(t,e,r,i,n){if(n.cacheLifeTime=p.D.INFINITE,n.source=!1,super(t,e,n),this.isTiledGeometryLayer=!0,this.object3d.geoidHeight=0,this.protocol="tile",this._hideSkirt=!1,this.sseSubdivisionThreshold=this.sseSubdivisionThreshold||1,this.schemeTile=r,this.builder=i,this.info=new s.$(this),!this.schemeTile)throw new Error(`Cannot init tiled layer without schemeTile for layer ${this.id}`);if(!this.builder)throw new Error(`Cannot init tiled layer without builder for layer ${this.id}`);this.level0Nodes=[];const o=[];for(const t of this.schemeTile)o.push(this.convert(void 0,t));this._promises.push(Promise.all(o).then((t=>{this.level0Nodes=t,this.object3d.add(...t),this.object3d.updateMatrixWorld()}))),this.maxScreenSizeNode=this.sseSubdivisionThreshold*(2*_.kE)}get hideSkirt(){return this._hideSkirt}set hideSkirt(t){this._hideSkirt=t;for(const e of this.level0Nodes)e.traverse((e=>{e.isTileMesh&&(e.geometry.hideSkirt=t)}))}pickObjectsAt(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return o.Z.pickTilesAt(t,e,r,this,i)}preUpdate(t,e){if(e.has(void 0)||0==e.size)return this.level0Nodes;t.colorLayers=t.view.getLayers(((t,e)=>e&&e.id==this.id&&t.isColorLayer)),t.elevationLayers=t.view.getLayers(((t,e)=>e&&e.id==this.id&&t.isElevationLayer)),t.maxElevationLevel=-1;for(const e of t.elevationLayers)t.maxElevationLevel=Math.max(e.source.zoom.max,t.maxElevationLevel);let r;-1==t.maxElevationLevel&&(t.maxElevationLevel=1/0),this.colorLayersOrder=w.M.getColorLayersIdOrderedBySequence(t.colorLayers);for(const t of e.values()){if(t.isCamera)return this.level0Nodes;if(t.layer===this){if(r){if(r=t.findCommonAncestor(r),!r)return this.level0Nodes}else r=t;null==r.material&&(r=void 0)}}return r?[r]:this.level0Nodes}update(t,e,r){if(!r.parent)return b.Z.removeChildrenAndCleanup(this,r);if(r.parent.pendingSubdivision)return r.visible=!1,r.material.visible=!1,void this.info.update(r);if(r.visible=!this.culling(r,t.camera),r.visible){let e=!1;return r.material.visible=!0,this.info.update(r),(r.pendingSubdivision||S.hasEnoughTexturesToSubdivide(t,r)&&this.subdivision(t,this,r))&&(this.subdivideNode(t,r),r.material.visible=r.pendingSubdivision,this.info.update(r),e=!0),r.material.visible&&!e?b.Z.removeChildren(this,r):e?r.children.filter((t=>t.layer==this)):void 0}return r.material.visible=!1,this.info.update(r),b.Z.removeChildren(this,r)}convert(t,e){return x.convert(t,e,this)}countColorLayersTextures(){return arguments.length}culling(t,e){return!e.isBox3Visible(t.obb.box3D,t.matrixWorld)}static hasEnoughTexturesToSubdivide(t,e){const r=e.layerUpdateState||{};let i=e.material.getElevationLayer();for(const n of t.elevationLayers){const t=e.getExtentsByProjection(n.crs)[0].zoom;if(!(t>n.zoom.max||tn.zoom.max||tt.layer==this))){const r=e.extent.subdivision();e.pendingSubdivision=!0;const i={view:t.view,requester:e,layer:this,priority:1e4,extentsSource:r,redraw:!1};return t.scheduler.execute(i).then((r=>{for(const t of r)e.add(t),t.updateMatrixWorld(!0);e.pendingSubdivision=!1,t.view.notifyChange(e,!1)}),(t=>{if(e.pendingSubdivision=!1,!t.isCancelledCommandException)throw new Error(t)}))}}subdivision(t,e,r){if(r.level{"use strict";r.r(e),r.d(e,{$3dTilesCulling:()=>Li.y,$3dTilesSubdivisionControl:()=>Li.Y0,C3DTBatchTable:()=>Ti.Z,C3DTBatchTableHierarchyExtension:()=>Bi,C3DTBoundingVolume:()=>Ci.Z,C3DTExtensions:()=>Ii.Z,C3DTFeature:()=>Mi.Z,C3DTILES_LAYER_EVENTS:()=>Xe.y,C3DTilesBoundingVolumeTypes:()=>Ri.D,C3DTilesGoogleSource:()=>hi,C3DTilesIonSource:()=>li,C3DTilesLayer:()=>Xe.Z,C3DTilesSource:()=>ai,C3DTilesTypes:()=>Ri.h,C3DTileset:()=>Si.Z,CAMERA_TYPE:()=>te.P,CONTROL_EVENTS:()=>C.Q,CRS:()=>l.Z,CameraCalibrationParser:()=>lr,CameraUtils:()=>Zt.ZP,Capabilities:()=>$t.Z,ClassificationScheme:()=>S.wy,ColorLayer:()=>Se,ColorLayersOrdering:()=>fr.Z,Coordinates:()=>o.Z,DEMUtils:()=>qt.Z,ElevationLayer:()=>Ce,Ellipsoid:()=>c.Z,EntwinePointTileLayer:()=>Sr,EntwinePointTileSource:()=>gi,Extent:()=>s.ZP,FEATURE_TYPES:()=>lt.tg,Feature:()=>lt.ZP,Feature2Mesh:()=>Ht,FeatureCollection:()=>lt.t1,FeatureGeometry:()=>lt.iL,FeatureGeometryLayer:()=>Re,FeatureProcessing:()=>x,FeaturesUtils:()=>Wt.Z,Fetcher:()=>d.Z,FileSource:()=>Ir,FirstPersonControls:()=>Z,FlyControls:()=>U,GDFParser:()=>_i.Z,GLOBE_VIEW_EVENTS:()=>h.b,GLTFParser:()=>Ei.ZP,GTXParser:()=>wi.ZP,GeoJsonParser:()=>sr.Z,GeoidGrid:()=>a.Z,GeoidLayer:()=>y.Z,GeometryLayer:()=>Te.Z,GlobeControls:()=>C.Z,GlobeLayer:()=>mr.Z,GlobeView:()=>h.Z,GpxParser:()=>Ai.Z,ISGParser:()=>bi.Z,ImageryLayers:()=>re.M,KMLParser:()=>yi.Z,LASParser:()=>fi,Label:()=>ee.Z,LabelLayer:()=>Ar.Z,Layer:()=>re.Z,MAIN_LOOP_EVENTS:()=>p.Ao,OrientationUtils:()=>xt,OrientedImageCamera:()=>M,OrientedImageLayer:()=>dr,OrientedImageSource:()=>ti,PLANAR_CONTROL_EVENT:()=>ot.uZ,PNTS_MODE:()=>S.vj,PNTS_SHAPE:()=>S.Uz,PNTS_SIZE_MODE:()=>S.E7,PlanarControls:()=>ot.ZP,PlanarLayer:()=>gr.Z,PlanarView:()=>u.Z,PointCloudLayer:()=>Ge,PointsMaterial:()=>S.ZP,PotreeLayer:()=>Ye,PotreeSource:()=>si,REVISION:()=>Pi,STRATEGY_DICHOTOMY:()=>pr.ET,STRATEGY_GROUP:()=>pr.AE,STRATEGY_MIN_NETWORK_TRAFFIC:()=>pr.R3,STRATEGY_PROGRESSIVE:()=>pr.c,ShaderChunk:()=>Jt,ShapefileParser:()=>xi,Source:()=>Cr.Z,StreetControls:()=>st,Style:()=>bt.ZP,THREE:()=>i,TMSSource:()=>Pr,TiledGeometryLayer:()=>Je.Z,VIEW_EVENTS:()=>f.b,VectorTilesSource:()=>Kr,View:()=>f.Z,WFSSource:()=>Or,WMSSource:()=>Ur,WMTSSource:()=>Nr,colorLayerEffects:()=>Kt.pO,ellipsoidSizes:()=>c.c,enableDracoLoader:()=>Ei.qw,enableKtx2Loader:()=>Ei.hu,getMaxColorSamplerUnitsCount:()=>Kt.dn,glTFLoader:()=>Ei.zL,legacyGLTFLoader:()=>Ei.mp,process3dTilesNode:()=>Li.Ti,proj4:()=>n.default,updateLayeredMaterialNodeElevation:()=>b.pN,updateLayeredMaterialNodeImagery:()=>b.XP});var i=r(99477),n=r(24472),s=r(71440),o=r(62310),a=r(2362),l=r(79323),c=r(2359),h=r(70378),u=r(39510),d=r(45340),p=r(99617),f=r(73502),m=r(81590),g=r(70991),A=r(79159),y=r(96836);const v=new o.Z("EPSG:4326",0,0,0),x={update(t,e,r){if(!r.parent&&r.children.length)return void g.Z.removeChildrenAndCleanupRecursively(e,r);if(!r.visible)return;if(void 0===r.layerUpdateState[e.id])r.layerUpdateState[e.id]=new m.Z;else if(!r.layerUpdateState[e.id].canTryUpdate()){var i;return void(null===(i=r.link[e.id])||void 0===i||i.forEach((t=>{t.layer.object3d.add(t),t.meshes.position.z=(0,y.c)(e.parent)?r.geoidHeight:0,t.meshes.updateMatrixWorld()})))}const n=r.getExtentsByProjection(e.source.crs)||[r.extent],s=n[0].zoom;if(s!=e.zoom.min||!this.source.extentInsideLimit(r.extent,s)||e.source.isFileSource&&!r.extent.isPointInside(e.source.extent.center(v)))return void r.layerUpdateState[e.id].noMoreUpdatePossible();r.layerUpdateState[e.id].newTry();const o={layer:e,extentsSource:n,view:t.view,requester:r};return t.scheduler.execute(o).then((i=>{r.layerUpdateState[e.id].noMoreUpdatePossible(),i.forEach((i=>{i?(r.link[e.id]=r.link[e.id]||[],i.as(t.view.referenceCrs),i.meshes.position.z=(0,y.c)(e.parent)?r.geoidHeight:0,i.updateMatrixWorld(),e.onMeshCreated&&e.onMeshCreated(i,t),r.parent?(e.object3d.add(i),r.link[e.id].push(i)):g.Z.removeChildrenAndCleanupRecursively(e,i),i.layer=e):r.layerUpdateState[e.id].failure(1,!0)}))}),(i=>(0,A.Z)(i,r,e,r.level,t.view)))}};var b=r(81189);class _{constructor(t){this.size=t,this.pps=null,this.polynom=null,this.l1l2=null}setFromMicmacCalibration(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.pps=(new i.Vector2).fromArray(t.pps),this.polynom=(new i.Vector4).fromArray(t.poly357),this.l1l2=new i.Vector3,this.pps.y=e?this.size.y-this.pps.y:this.pps.y,this.polynom.w=t.limit**2,t.l1l2&&(this.l1l2.fromArray(t.l1l2),this.l1l2.z=t.etats)}clone(){const t=new _(this.size.clone());return t.pps=this.pps.clone(),t.polynom=this.polynom.clone(),t.l1l2=this.l1l2.clone(),t}}const w=new i.Vector3;class E extends i.PerspectiveCamera{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1024,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e4,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;t=t.isVector2?t:new i.Vector2(t,t),a=a||t.x/t.y,super(void 0,a,n,s),this.size=t,this.focal=e.isVector2?e:new i.Vector2(e,e),this.center=r||t.clone().multiplyScalar(.5),this.skew=o||0,this.textureMatrixWorldInverse=new i.Matrix4,Object.defineProperty(this,"fov",{get:()=>2*i.MathUtils.radToDeg(Math.atan2(this.size.y,2*this.focal.y)),set:t=>{const e=.5*this.size.y/Math.tan(i.MathUtils.degToRad(.5*t));this.focal.x=e,this.focal.y=e}}),this.distortion=new _(this.size),this.maskPath=void 0,this.mask=void 0,this.updateProjectionMatrix()}updateProjectionMatrix(){if(!this.focal)return;const t=this.near,e=t/this.focal.x,r=t/this.focal.y,i=-e*this.center.x,n=-r*this.center.y,s=i+e*this.size.x,o=n+r*this.size.y;this.projectionMatrix.makePerspective(i,s,o,n,t,this.far),this.projectionMatrix.elements[4]=2*this.skew/this.size.x;const a=this.size.x/this.size.y,l=this.aspect/a;w.set(this.zoom,this.zoom,1),l>1?w.x/=l:w.y*=l,this.projectionMatrix.scale(w)}copy(t,e){return super.copy(t,e),this.size=t.size.clone(),this.focal=t.focal.clone(),this.center=t.center.clone(),this.distortion=t.distortion.clone(),this.textureMatrixWorldInverse=t.textureMatrixWorldInverse.clone(),this.skew=t.skew,this.maskPath=t.maskPath,this.mask=t.mask,this}}const M=E;var S=r(25033),C=r(61861);const T={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"rotateZ",sign:1,noSpeed:!0},34:{method:"rotateZ",sign:-1,noSpeed:!0},wheelup:{method:"translateZ",sign:1,oneshot:!0},wheeldown:{method:"translateZ",sign:-1,oneshot:!0}};function I(t){t.preventDefault(),this._isMouseDown=!0;const e=this.view.eventToViewCoords(t);this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y}function R(t){t.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=t.touches[0].pageX,this._onMouseDownMouseY=t.touches[0].pageY}function B(t){if(!0===this._isMouseDown){const e=this.view.eventToViewCoords(t),r=i.MathUtils.degToRad(this._camera3D.fov)/this.view.mainLoop.gfxEngine.height;this._camera3D.rotateY((e.x-this._onMouseDownMouseX)*r),this._camera3D.rotateX((e.y-this._onMouseDownMouseY)*r),this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y,this.view.notifyChange(this._camera3D,!1)}}function L(){this._isMouseDown=!1}function P(t){const e=T[t.keyCode];e&&(this.moves.delete(e),t.preventDefault())}function D(t){const e=T[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(this._camera3D,!1),t.preventDefault())}function O(t){-t.deltaY<0?this.moves.add(T.wheelup):this.moves.add(T.wheeldown),this.view.notifyChange(this._camera3D,!1)}class k extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.view=t,this.options=e,this._camera3D=t.camera3D,this.moves=new Set,this.moveSpeed=10,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._isMouseDown=!1,t.domElement.addEventListener("mousedown",I.bind(this),!1),t.domElement.addEventListener("touchstart",R.bind(this),!1);const r=B.bind(this);t.domElement.addEventListener("mousemove",r,!1),t.domElement.addEventListener("touchmove",r,!1),t.domElement.addEventListener("mouseup",L.bind(this),!1),t.domElement.addEventListener("touchend",L.bind(this),!1),t.domElement.addEventListener("wheel",O.bind(this),!1),t.domElement.addEventListener("keyup",P.bind(this),!0),t.domElement.addEventListener("keydown",D.bind(this),!0),this.view.addFrameRequester(p.Ao.AFTER_CAMERA_UPDATE,this.update.bind(this)),e.focusOnMouseOver&&t.domElement.addEventListener("mouseover",(()=>t.domElement.focus())),e.focusOnClick&&t.domElement.addEventListener("click",(()=>t.domElement.focus()))}isUserInteracting(){return 0!==this.moves.size||this._isMouseDown}update(t,e){e&&(t=16);for(const e of this.moves)this._camera3D[e.method](e.sign*(e.noSpeed?1:this.moveSpeed)*t/1e3);if(this.moves.size>0||this._isMouseDown){this.view.notifyChange(this._camera3D);for(const t of this.moves)t.oneshot&&this.moves.delete(t)}}}const U=k;function N(t,e,r){const n=.5*i.MathUtils.degToRad(r-t.fov);return i.MathUtils.clamp(e,-n,n)}const F=new i.Vector3(0,1,0);function z(t,e,r){e.quaternion.setFromUnitVectors(F,e.up),e.rotateY(r.rotateY),e.rotateX(r.rotateX),t.notifyChange(t.camera3D)}const G={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"translateY",sign:1},34:{method:"translateY",sign:-1}};function Q(t){this.camera.position.z+=t}const j=new i.Vector3,V=new i.Quaternion,H=new i.Euler(0,0,0,"YXZ");function W(t){j.copy(this.camera.position),j.normalize(),this.camera.position.add(j.multiplyScalar(t))}class q extends i.EventDispatcher{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.isFirstPersonControls=!0,this.camera=t.camera3D,this.view=t,this.moves=new Set,e.panoramaRatio){const t=200*e.panoramaRatio/(2*Math.PI);e.verticalFOV=2==e.panoramaRatio?180:i.MathUtils.radToDeg(2*Math.atan(200/(2*t)))}e.verticalFOV=e.verticalFOV||180,e.moveSpeed=void 0===e.moveSpeed?10:e.moveSpeed,this.options=e,this._isMouseDown=!1,this._onMouseDownMouseX=0,this._onMouseDownMouseY=0,this._state={rotateX:0,rotateY:0,snapshot(){return{rotateX:this.rotateX,rotateY:this.rotateY}}},this.reset(),this.eventListeners=e.disableEventListeners,e.disableEventListeners||(this._onMouseDown=this.onMouseDown.bind(this),this._onMouseMove=this.onMouseMove.bind(this),this._onMouseUp=this.onMouseUp.bind(this),this._onMouseWheel=this.onMouseWheel.bind(this),this._onKeyUp=this.onKeyUp.bind(this),this._onKeyDown=this.onKeyDown.bind(this),this._onContextMenu=this.onContextMenu.bind(this),t.domElement.addEventListener("mousedown",this._onMouseDown,!1),t.domElement.addEventListener("touchstart",this._onMouseDown,!1),t.domElement.addEventListener("mousemove",this._onMouseMove,!1),t.domElement.addEventListener("touchmove",this._onMouseMove,!1),t.domElement.addEventListener("mouseup",this._onMouseUp,!1),t.domElement.addEventListener("touchend",this._onMouseUp,!1),t.domElement.addEventListener("wheel",this._onMouseWheel,!1),t.domElement.addEventListener("contextmenu",this._onContextMenu,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)),this.view.addFrameRequester(p.Ao.AFTER_CAMERA_UPDATE,this.update.bind(this)),this._onFocus=()=>t.domElement.focus(),this.focusOnMouseOver=e.focusOnMouseOver,e.focusOnMouseOver&&t.domElement.addEventListener("mouseover",this._onFocus),this.focusOnClick=e.focusOnClick,e.focusOnClick&&t.domElement.addEventListener("click",this._onFocus),"EPSG:4978"==t.referenceCrs?this.moveCameraVertical=W:this.moveCameraVertical=Q}isUserInteracting(){return 0!==this.moves.size&&!this._isMouseDown}reset(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];V.setFromUnitVectors(F,this.camera.up),V.invert(),V.multiply(this.camera.quaternion),H.setFromQuaternion(V),t||(this._state.rotateX=H.x),this._state.rotateY=H.y}update(t,e,r){if(0!=this.enabled){e&&(t=16);for(const e of this.moves)"translateY"===e.method?this.moveCameraVertical(e.sign*this.options.moveSpeed*t/1e3):this.camera[e.method](e.sign*this.options.moveSpeed*t/1e3);!0!==this._isMouseDown&&!0!==r||z(this.view,this.camera,this._state),this.moves.size&&this.view.notifyChange(this.camera)}}onMouseDown(t){if(0==this.enabled)return;this._isMouseDown=!0;const e=this.view.eventToViewCoords(t);this._onMouseDownMouseX=e.x,this._onMouseDownMouseY=e.y,this._stateOnMouseDown=this._state.snapshot()}onMouseUp(){0!=this.enabled&&(this._isMouseDown=!1)}onMouseMove(t){if(0!=this.enabled&&!0===this._isMouseDown){const e=i.MathUtils.degToRad(this.camera.fov)/this.view.mainLoop.gfxEngine.height,r=this.view.eventToViewCoords(t);this._state.rotateY=(r.x-this._onMouseDownMouseX)*e+this._stateOnMouseDown.rotateY,this._state.rotateX=N(this.camera,(r.y-this._onMouseDownMouseY)*e+this._stateOnMouseDown.rotateX,this.options.verticalFOV),z(this.view,this.camera,this._state)}}onMouseWheel(t){if(0==this.enabled)return;const e=t.deltaY;this.camera.fov=i.MathUtils.clamp(this.camera.fov+Math.sign(e),10,Math.min(100,this.options.verticalFOV)),this.camera.updateProjectionMatrix(),this._state.rotateX=N(this.camera,this._state.rotateX,this.options.verticalFOV),z(this.view,this.camera,this._state)}onKeyUp(t){if(0==this.enabled)return;const e=G[t.keyCode];e&&(this.moves.delete(e),this.view.notifyChange(void 0,!1),t.preventDefault())}onKeyDown(t){if(0==this.enabled)return;const e=G[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(void 0,!1),t.preventDefault())}onContextMenu(t){t.preventDefault()}dispose(){this.eventListeners||(this.view.domElement.removeEventListener("mousedown",this._onMouseDown,!1),this.view.domElement.removeEventListener("touchstart",this._onMouseDown,!1),this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("touchmove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("touchend",this._onMouseUp,!1),this.view.domElement.removeEventListener("wheel",this._onMouseWheel,!1),this.view.domElement.removeEventListener("contextmenu",this._onContextMenu,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)),this.focusOnMouseOver&&this.view.domElement.removeEventListener("mouseover",this._onFocus),this.focusOnClick&&this.view.domElement.removeEventListener("click",this._onFocus),this.dispatchEvent({type:"dispose"})}}const Z=q;var Y=r(36194);const X=new i.MeshBasicMaterial({color:16777215,depthTest:!1,transparent:!0,opacity:.5});function J(t,e,r){t.position.copy(e),t.up.copy(e).normalize(),t.lookAt(r),t.updateMatrixWorld(!0)}const K=new i.Vector3,$=new i.Vector3,tt=new i.Matrix3,et=new i.Vector3,rt=new i.Quaternion;function it(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{},n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{};e.getPickingPositionFromDepth(e.eventToViewCoords(t),K);const o=e.camera3D.position.distanceTo(K),a=r?e.pickObjectsAt(t,-1,r):[];a.length&&a[0].distance1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.isStreetControls=!0,this._onMouseOut=super.onMouseUp.bind(this),t.domElement.addEventListener("mouseout",this._onMouseOut),this.previousPosition=void 0,this.currentPosition=void 0,this.nextPosition=void 0,this.keyGoToNextPosition=90,this.keyGoToPreviousPosition=83,this.keySetCameraToCurrentPositionAndLookAtNext=65,this.keySetCameraToCurrentPositionAndLookAtPrevious=81,this.tweenGroup=new Y.ZP.Group,this.surfaceGround=e.surfaceGround||function(){const t=new i.CircleGeometry(1,32);return new i.Mesh(t,X)}(),this.surfaceWall=e.surfaceWall||function(){const t=new i.PlaneGeometry(4,2,1),e=new i.Mesh(t,X);return e.rotateX(.5*-Math.PI),e}(),this.surfaces=new i.Object3D,this.surfaces.add(this.surfaceGround),this.surfaces.add(this.surfaceWall),this.view.scene.add(this.surfaces),this.wallMaxDistance=e.wallMaxDistance||1e3,this.animationDurationWall=e.animationDurationWall||200,this.buildingsLayer=e.buildingsLayer,this.computeTime=e.computeTime||nt,this.offset=e.offset||4,this.transformationPositionPickOnTheGround=e.transformationPositionPickOnTheGround||(t=>t),this.end=this.camera.clone()}setCurrentPosition(t){this.currentPosition=t}setNextPosition(t){this.nextPosition=t}setPreviousPosition(t){this.previousPosition=t}onMouseUp(t){0!=this.enabled&&(super.onMouseUp(),this._stateOnMouseDrag?this._stateOnMouseDrag=!1:it(t,this.view,this.buildingsLayer,this.onClickOnGround.bind(this),this.onClickOnWall.bind(this)))}onMouseMove(t){0!=this.enabled&&(super.onMouseMove(t),this._isMouseDown?(this._stateOnMouseDrag=!0,this.stopAnimations()):this.tween||(it(t,this.view,this.buildingsLayer,((t,e)=>{J(this.surfaces,t,e),this.surfaceGround.visible=!0,this.surfaceWall.visible=!1}),((t,e)=>{J(this.surfaces,t,e),this.surfaceWall.visible=!0,this.surfaceGround.visible=!1})),this.view.notifyChange(this.surfaces)))}setCameraToCurrentPosition(t){t?this.setCameraOnPosition(this.currentPosition,this.previousPosition):this.setCameraOnPosition(this.currentPosition,this.nextPosition)}setCameraOnPosition(t,e){t&&e&&(this.camera.position.copy(t),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?this.camera.up.copy(t).normalize():this.camera.up.set(0,0,1),this.camera.lookAt(e),this.camera.updateMatrixWorld(),this.reset())}onClickOnGround(t){t=this.transformationPositionPickOnTheGround(t),this.view.tileLayer&&this.view.tileLayer.isGlobeLayer?et.copy(t).normalize():et.set(0,0,1),t.add(et.multiplyScalar(this.offset));const e=this.camera.position.distanceTo(t),r=this.computeTime(e);this.moveCameraTo(t,r)}onClickOnWall(t){this.camera.position.distanceTo(t){this.stopAnimations()})).onUpdate((t=>{this.camera.quaternion.slerpQuaternions(rt,this.end.quaternion,t.t)})).start(),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.reset(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera)}moveCameraTo(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;if(!t)return Promise.resolve();const i=new Promise((t=>{e=t}));return this.stopAnimations(),this.tween=new Y.ZP.Tween(this.camera.position,this.tweenGroup).to(t.clone(),r).easing(Y.ZP.Easing.Quadratic.Out).onComplete((()=>{this.stopAnimations(),e()})).start(),this.animationFrameRequester=()=>{this.tweenGroup.update(),this.view.notifyChange(this.camera)},this.view.addFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.view.notifyChange(this.camera),i}stopAnimations(){this.tween&&(this.tween.stop(),this.tween=void 0),this.animationFrameRequester&&(this.view.removeFrameRequester(p.Ao.BEFORE_RENDER,this.animationFrameRequester),this.animationFrameRequester=null)}moveCameraToCurrentPosition(){this.moveCameraTo(this.currentPosition)}onKeyDown(t){0!=this.enabled&&(super.onKeyDown(t),t.keyCode==this.keyGoToNextPosition&&this.moveCameraTo(this.nextPosition),t.keyCode==this.keyGoToPreviousPosition&&this.moveCameraTo(this.previousPosition),t.keyCode==this.keySetCameraToCurrentPositionAndLookAtNext&&(this.setCameraToCurrentPosition(),this.view.notifyChange(this.view.camera3D)),t.keyCode==this.keySetCameraToCurrentPositionAndLookAtPrevious&&(this.setCameraToCurrentPosition(!0),this.view.notifyChange(this.view.camera3D)))}dispose(){this.view.domElement.removeEventListener("mouseout",this._onMouseOut,!1),super.dispose()}};var ot=r(29571),at=r(9187),lt=r(5167),ct=r(61366),ht=r(53175);const ut=i.MathUtils.DEG2RAD,dt=new i.Matrix4,pt=new i.Vector3,ft=new i.Vector3,mt=(new i.Vector3).set(0,0,1),gt=new o.Z("EPSG:4326",0,0,0),At=new i.Euler,yt=new i.Quaternion;function vt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return t?e.set(0,0,0,1):vt}const xt={quaternionFromRollPitchHeading(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;return t*=ut,e*=ut,r*=ut,n.setFromEuler(At.set(-e,-t,-r,"YXZ"))},quaternionFromOmegaPhiKappa(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;return t*=ut,e*=ut,r*=ut,n.setFromEuler(At.set(t,e,r,"XYZ")),n.set(n.w,n.z,-n.y,-n.x),n},quaternionFromAttitude(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return void 0!==t.roll||void 0!==t.pitch||void 0!==t.heading?this.quaternionFromRollPitchHeading(t.roll,t.pitch,t.heading,e):void 0!==t.omega||void 0!==t.phi||void 0!==t.kappa?this.quaternionFromOmegaPhiKappa(t.omega,t.phi,t.kappa,e):e.set(0,0,0,1)},quaternionFromEnuToGeocent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return t?this.quaternionFromEnuToGeocent()(t,e):function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;const r=t.geodesicNormal;return 0==r.x&&0==r.y?e.set(0,0,0,1):(ft.set(-r.y,r.x,0).normalize(),pt.crossVectors(r,ft),dt.makeBasis(ft,pt,r),e.setFromRotationMatrix(dt))}},quaternionFromGeocentToEnu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;if(t)return this.quaternionFromGeocentToEnu()(t,e);const r=this.quaternionFromEnuToGeocent();return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return r(t,e).conjugate()}},quaternionFromLCCToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromLCCToEnu(t)(e,r);const n=Math.sin(t.lat0);return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;const s=e.as(gt.crs,gt).longitude*ut;return r.setFromAxisAngle(mt,n*(t.long0-s))}},quaternionFromEnuToLCC(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToLCC(t)(e,r);const n=this.quaternionFromLCCToEnu(t);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return n(t,e).conjugate()}},quaternionFromTMercToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromTMercToEnu(t)(e,r);const n=t.a*t.a,s=t.b*t.b,o=t.e*t.e,a=t.e?o/(1-o):n/s-1;return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;e.as(gt.crs,gt);const n=gt.longitude*ut,s=gt.latitude*ut,o=t.long0-n,l=Math.cos(s),c=Math.sin(s),h=l*l,u=o*o*h,d=a*h;return r.setFromAxisAngle(mt,o*c*(1+u/3*(1+3*d+2*d*d)+u*u*(2-c/l)/15))}},quaternionFromEnuToTMerc(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToTMerc(t)(e,r);const n=this.quaternionFromTMercToEnu(t);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return n(t,e).conjugate()}},quaternionFromLongLatToEnu(t){return vt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion)},quaternionFromEnuToLongLat(t){return vt(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion)},quaternionUnimplemented(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;return console.warn("This quaternion function is not implemented for projections of type",t.projName),vt(e,r)},quaternionFromEnuToCRS(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromEnuToCRS(t)(e,r);const s=t.projName?t:n.default.defs(t);switch(s.projName){case"geocent":return this.quaternionFromEnuToGeocent();case"lcc":return this.quaternionFromEnuToLCC(s);case"tmerc":return this.quaternionFromEnuToTMerc(s);case"longlat":return this.quaternionFromEnuToLongLat();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToEnu(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new i.Quaternion;if(e)return this.quaternionFromCRSToEnu(t)(e,r);const s=t.projName?t:n.default.defs(t);switch(s.projName){case"geocent":return this.quaternionFromGeocentToEnu();case"lcc":return this.quaternionFromLCCToEnu(s);case"tmerc":return this.quaternionFromTMercToEnu(s);case"longlat":return this.quaternionFromLongLatToEnu();default:return this.quaternionUnimplemented(s)}},quaternionFromCRSToCRS(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new i.Quaternion;if(r)return this.quaternionFromCRSToCRS(t,e)(r,n);if(t==e)return function(){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion).set(0,0,0,1)};const s=this.quaternionFromCRSToEnu(t),o=this.quaternionFromEnuToCRS(e);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Quaternion;return o(t,e).multiply(s(t,yt))}}};var bt=r(49075);const _t=new o.Z("EPSG:4326",0,0,0),wt=new bt.uP,Et=new bt.ZP;let Mt;const St=new i.Vector2,Ct=new i.Vector2,Tt=new i.Vector3,It=new i.Vector3,Rt=new i.Vector3,Bt=new i.Vector3,Lt=new s.ZP("EPSG:4326",0,0,0,0),Pt=new i.Color,Dt=255,Ot=65535,kt="EPSG:4326";class Ut extends i.Group{#C;#T;#I=new i.Group;#R=new i.Group;constructor(t,e){super(),this.meshes=(new i.Group).add(...t),this.#I=(new i.Group).add(this.meshes),this.#I.quaternion.copy(e.quaternion),this.#I.position.copy(e.position),this.#I.scale.copy(e.scale),this.#I.updateMatrix(),this.#T=e.crs,this.#C=this.#T,this.extent=e.extent,this.add(this.#R.add(this.#I))}as(t){if(this.#C!==t)if(this.#C=t,t==this.#T)this.place.position.set(0,0,0),this.position.set(0,0,0),this.scale.set(1,1,1),this.quaternion.identity();else{_t.crs=l.Z.formatToEPSG(this.#T),Lt.copy(this.extent).applyMatrix4(this.#I.matrix),Lt.as(_t.crs,Lt),Lt.spatialEuclideanDimensions(St),Lt.planarDimensions(Ct),Ct.x&&Ct.y&&this.scale.copy(St).divide(Ct).setZ(1),this.#R.position.copy(this.#I.position).negate(),_t.setFromVector3(this.#I.position);const e="EPSG:3857"==this.#T?kt:this.#T;xt.quaternionFromCRSToCRS(e,t)(_t.as(kt),this.quaternion),_t.as(t,_t).toVector3(this.position)}return this}}function Nt(t){return t?"Color"==t.type?t:Pt.set(t):Pt.set(16777215*Math.random())}function Ft(t,e){return e<=Dt?new Uint8Array(t):e<=Ot?new Uint16Array(t):new Uint32Array(t)}function zt(t,e,r,i,n){const s=t.length;t.length+=6*(i-1);for(let o=r,a=s;oe);let a=0;const l=new Float32Array(r);Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);const c=[];wt.setFeature(t);for(const e of t.geometries){const r=e.indices[0].offset,i=e.indices[0].count,h=o(e.properties,a);wt.setGeometry(e);for(let e=3*r,o=r;o1&&console.warn("Too many differents point.radius, only the first one will be used"),new i.Points(h,e.pointMaterial)}function Qt(t,e,r){const i=(e*=3)+3*r;let n=0;for(let r=i-3,s=e;s{t instanceof i.Mesh&&(t.updateMatrixWorld(),t.geometry.applyMatrix4(t.matrixWorld),e.push(t))})),e}(n).forEach((i=>t.add(jt(i,r,e)))),t}throw new Error("The format of the model object provided in the style (layer.style.point.model.object) is not supported. Only THREE.Mesh or THREE.Object3D are supported.")}(t),s.isInstancedMesh=!0}catch(r){s=Gt(t,e)}else s=Gt(t,e);break;case lt.tg.LINE:s=function(t,e){const r=t.vertices,n=new Uint8Array(r.length),s=r.length/3,o=new Uint32Array(s),a=e.batchId||((t,e)=>e);let l=0;const c=new Float32Array(r.length),h=new i.BufferGeometry,u=[];wt.setFeature(t);const d=Ft(2*(s-t.geometries.length),s);let p=0;Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);for(const e of t.geometries){wt.setGeometry(e);const r=a(e.properties,l),i=e.indices[0].offset;if(i>65535){console.warn("Feature to Line: integer overflow, too many points in lines");break}const s=i+e.indices[0].count;for(let e=3*i,a=i;a1&&console.warn("Too many differents stroke.width, only the first one will be used"),h.setAttribute("position",new i.BufferAttribute(c,3)),h.setAttribute("color",new i.BufferAttribute(n,3,!0)),h.setAttribute("batchId",new i.BufferAttribute(o,1)),h.setIndex(new i.BufferAttribute(d,1)),new i.LineSegments(h,e.lineMaterial)}(t,e);break;case lt.tg.POLYGON:s=Mt.fill&&Object.keys(Mt.fill).includes("extrusion_height")?function(t,e){const r=t.vertices,n=new Float32Array(2*r.length),s=r.length/3,o=new Uint8Array(2*r.length),a=[],l=new Uint32Array(n.length/3),c=e.batchId||((t,e)=>e);let h=0;wt.setFeature(t),Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt),_t.setCrs(wt.collection.crs);for(const e of t.geometries){wt.setGeometry(e);const i=e.indices[0].offset,u=e.indices.slice(-1)[0],d=u.offset+u.count,p=d-i,f=e.indices[0].ccw??Qt(r,i,p)<0,m=3*i,g=i+s,A=c(e.properties,h);for(let e=m,a=m+r.length,c=i;et.offset-i)).slice(1),x=at(y,v,3),b=a.length;a.length+=x.length;for(let t=0;te);wt.setFeature(t),Bt.setFromMatrixScale(wt.collection.matrixWorldInverse),Tt.set(0,0,1).multiply(Bt);let l=0;for(const e of t.geometries){const i=e.indices[0].offset;if(i>4294967295){console.warn("Feature to Polygon: integer overflow, too many points in polygons");break}wt.setGeometry(e);const c=e.indices.slice(-1)[0],h=c.offset+c.count,u=3*i,d=a(e.properties,l);for(let e=u,s=i;et.offset-i)).slice(1),m=at(p,f,3),g=s.length;s.length+=m.length;for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{};return(0,ht.ie)(t),function(e){if(!e)return;t.pointMaterial||(t.pointMaterial=(0,ct.Z)(new i.PointsMaterial,this),t.lineMaterial=(0,ct.Z)(new i.LineBasicMaterial,this),t.polygonMaterial=(0,ct.Z)(new i.MeshBasicMaterial,this)),Mt=(null==this?void 0:this.style)||(t.style?new bt.ZP(t.style):Et),wt.setCollection(e);const r=e.features;if(!r||0==r.length)return;const n=r.map((e=>{const r=Vt(e,t);return r.layer=this,r}));return new Ut(n,e)}}};var Wt=r(29372),qt=r(86541),Zt=r(32533);const Yt={color_layers_pars_fragment:"struct Layer {\n int textureOffset;\n int crs;\n int effect_type;\n float effect_parameter;\n float opacity;\n bool transparent;\n};\n\n#include \n\nuniform sampler2D colorTextures[NUM_FS_TEXTURES];\nuniform vec4 colorOffsetScales[NUM_FS_TEXTURES];\nuniform Layer colorLayers[NUM_FS_TEXTURES];\nuniform int colorTextureCount;\n\nvec3 uvs[NUM_CRS];\n\nfloat getBorderDistance(vec2 uv) {\n vec2 p2 = min(uv, 1. -uv);\n return min(p2.x, p2.y);\n}\n\nfloat tolerance = 0.99;\n\nvec4 applyWhiteToInvisibleEffect(vec4 color) {\n float a = dot(color.rgb, vec3(0.333333333));\n if (a >= tolerance) {\n color.a = 0.0;\n }\n return color;\n}\n\nvec4 applyLightColorToInvisibleEffect(vec4 color, float intensity) {\n float a = max(0.05,1. - length(color.xyz - 1.));\n color.a *= 1.0 - pow(abs(a), intensity);\n color.rgb *= color.rgb * color.rgb;\n return color;\n}\n\n#if defined(DEBUG)\nuniform bool showOutline;\nuniform vec3 outlineColors[NUM_CRS];\nuniform float outlineWidth;\n\nvec4 getOutlineColor(vec3 outlineColor, vec2 uv) {\n float alpha = 1. - clamp(getBorderDistance(uv) / outlineWidth, 0., 1.);\n return vec4(outlineColor, alpha);\n}\n#endif\n\nuniform float minBorderDistance;\nvec4 getLayerColor(int textureOffset, sampler2D tex, vec4 offsetScale, Layer layer) {\n if ( textureOffset >= colorTextureCount ) return vec4(0);\n\n vec3 uv;\n // #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++ ) {\n if ( i == layer.crs ) uv = uvs[ i ];\n }\n\n float borderDistance = getBorderDistance(uv.xy);\n if (textureOffset != layer.textureOffset + int(uv.z) || borderDistance < minBorderDistance ) return vec4(0);\n vec4 color = texture2D(tex, pitUV(uv.xy, offsetScale));\n if (layer.effect_type == 3) {\n #include \n } else {\n if (layer.transparent && color.a != 0.0) {\n color.rgb /= color.a;\n }\n\n if (layer.effect_type == 1) {\n color = applyLightColorToInvisibleEffect(color, layer.effect_parameter);\n } else if (layer.effect_type == 2) {\n color = applyWhiteToInvisibleEffect(color);\n }\n }\n color.a *= layer.opacity;\n return color;\n}\n",custom_body_colorLayer:"// no custom body",custom_header_colorLayer:"// no custom header",elevation_pars_vertex:"#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n uniform float geoidHeight;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n return texture2D( tex, uv ).r;\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n // Elevation textures are inverted along the y-axis\n uv = vec2(uv.x, 1.0 - uv.y);\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = clamp(getElevationMode(uv, tex, layer.mode), layer.zmin, layer.zmax);\n return d * layer.scale + layer.bias;\n }\n#endif\n",elevation_vertex:"#if NUM_VS_TEXTURES > 0\n if(elevationTextureCount > 0) {\n float elevation = getElevation(uv, elevationTextures[0], elevationOffsetScales[0], elevationLayers[0]);\n transformed += elevation * normal;\n }\n#endif\n",geoid_vertex:"transformed += geoidHeight * normal;\n",fog_fragment:"#if defined(USE_FOG)\n float fogFactor = 1. - min( exp(-vFogDepth / fogDistance), 1.);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n",fog_pars_fragment:"#if defined(USE_FOG)\nuniform vec3 fogColor;\nuniform float fogDistance;\nvarying float vFogDepth;\n#endif\n",lighting_fragment:"if (lightingEnabled) {\n float light = min(2. * dot(vNormal, lightPosition), 1.);\n gl_FragColor.rgb *= light;\n}\n",lighting_pars_fragment:"uniform bool lightingEnabled;\nuniform vec3 lightPosition;\nvarying vec3 vNormal;\n",mode_depth_fragment:"#if defined(USE_LOGDEPTHBUF)\ngl_FragColor = packDepthToRGBA(gl_FragDepthEXT);\n#else\nfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\ngl_FragColor = packDepthToRGBA(fragCoordZ);\n#endif\n",mode_id_fragment:"// 16777216.0 == 256.0 * 256.0 * 256.0\ngl_FragColor = packDepthToRGBA(float(objectId) / 16777216.0);\n",mode_pars_fragment:"#if MODE == MODE_ID || MODE == MODE_DEPTH\n#include \n#endif\n\n#if MODE == MODE_ID\nuniform int objectId;\n#endif\n",overlay_fragment:"gl_FragColor.rgb = mix(gl_FragColor.rgb, overlayColor, overlayAlpha);\n",overlay_pars_fragment:"uniform vec3 overlayColor;\nuniform float overlayAlpha;\n",pitUV:"vec2 pitUV(vec2 uv, vec4 pit)\n{\n return uv * pit.zw + vec2(pit.x, 1.0 - pit.w - pit.y);\n}\n\n",precision_qualifier:"precision highp float;\nprecision highp int;\n",projective_texturing_vertex:"for(int i = 0; i < ORIENTED_IMAGES_COUNT; ++i)\n projectiveTextureCoords[i] = projectiveTextureMatrix[i] * mvPosition;\n",projective_texturing_pars_vertex:"uniform mat4 projectiveTextureMatrix[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\n",projective_texturing_pars_fragment:"uniform sampler2D projectiveTexture[ORIENTED_IMAGES_COUNT];\nuniform sampler2D mask[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\nuniform float projectiveTextureAlphaBorder;\nuniform float opacity;\nuniform bool boostLight;\n\nstruct Distortion {\n vec2 size;\n#if USE_DISTORTION\n vec2 pps;\n vec4 polynom;\n vec3 l1l2;\n#endif\n};\n\nuniform Distortion projectiveTextureDistortion[ORIENTED_IMAGES_COUNT];\n\nfloat getAlphaBorder(vec2 p)\n{\n vec2 d = clamp(projectiveTextureAlphaBorder * min(p, 1. - p), 0., 1.);\n return min(d.x, d.y);\n}\n\n#if USE_DISTORTION\nvoid distort(inout vec2 p, vec4 polynom, vec2 pps)\n{\n vec2 v = p - pps;\n float v2 = dot(v, v);\n if (v2 > polynom.w) {\n p = vec2(-1.);\n }\n else {\n p += (v2 * (polynom.x + v2 * (polynom.y + v2 * polynom.z) ) ) * v;\n }\n}\n\nvoid distort(inout vec2 p, vec4 polynom, vec3 l1l2, vec2 pps)\n{\n if ((l1l2.x == 0.) && (l1l2.y == 0.)) {\n distort(p, polynom, pps);\n } else {\n vec2 AB = (p - pps) / l1l2.z;\n float R = length(AB);\n float lambda = atan(R) / R;\n vec2 ab = lambda * AB;\n float rho2 = dot(ab, ab);\n float r357 = 1. + rho2* (polynom.x + rho2* (polynom.y + rho2 * polynom.z));\n p = pps + l1l2.z * (r357 * ab + vec2(dot(l1l2.xy, ab), l1l2.y * ab.x));\n }\n}\n#endif\n\nvec4 mixBaseColor(vec4 aColor, vec4 baseColor) {\n #ifdef USE_BASE_MATERIAL\n baseColor.rgb = aColor.a == 1.0 ? aColor.rgb : mix(baseColor, aColor, aColor.a).rgb;\n baseColor.a = min(1.0, aColor.a + baseColor.a);\n #else\n baseColor.rgb += aColor.rgb * aColor.a;\n baseColor.a += aColor.a;\n #endif\n return baseColor;\n}\n\nvec4 projectiveTextureColor(vec4 coords, Distortion distortion, sampler2D tex, sampler2D mask, vec4 baseColor) {\n vec3 p = coords.xyz / coords.w;\n if(p.z * p.z < 1.) {\n#if USE_DISTORTION\n p.xy *= distortion.size;\n distort(p.xy, distortion.polynom, distortion.l1l2, distortion.pps);\n p.xy /= distortion.size;\n#endif\n\n float d = getAlphaBorder(p.xy) * texture2D(mask, p.xy).r;\n\n if(d > 0.) {\n\n#if DEBUG_ALPHA_BORDER\n vec3 r = texture2D(tex, p.xy).rgb;\n return mixBaseColor(vec4( r.r * d, r.g, r.b, 1.0), baseColor);\n#else\n vec4 color = texture2D(tex, p.xy);\n color.a *= d;\n if (boostLight) {\n return mixBaseColor(vec4(sqrt(color.rgb), color.a), baseColor);\n } else {\n return mixBaseColor(color, baseColor);\n }\n#endif\n\n }\n }\n return mixBaseColor(vec4(0.), baseColor);\n}\n"},Xt=new class{constructor(t,e){this.path=e,this.target=t,this.install()}customHeaderColorLayer(t){Yt.custom_header_colorLayer=t,this.target[`${this.path}custom_header_colorLayer`]=t}customBodyColorLayer(t){Yt.custom_body_colorLayer=t,this.target[`${this.path}custom_body_colorLayer`]=t}install(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.target,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.path;return Object.keys(e).forEach((i=>{Object.defineProperty(this,i,{get:()=>e[i]}),t[r+i]=e[i]})),t}}(i.ShaderChunk,"itowns/"),Jt=Xt;var Kt=r(5199),$t=r(28448),te=r(232),ee=r(59947),re=r(78025);const ie=new bt.ZP,ne=new bt.uP;let se;function oe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{offset:0,count:1}],i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;if(0===e.length)return;const l=new Path2D;for(const t of r)if(t.extent&&s.ZP.intersectsExtent(t.extent,n)){const r=t.offset*i,n=r+t.count*i;l.moveTo(e[r],e[r+1]);for(let t=r+i;t(t.generateMipmaps=!1,t.magFilter=e.magFilter||i.LinearFilter,t.minFilter=e.minFilter||i.LinearFilter,t),be={convert(t,e,r){let n;if(t.isFeatureCollection){const s=r.source.backgroundLayer,o=s&&s.paint?new i.Color(s.paint["background-color"]):void 0;e.as(l.Z.formatToEPSG(r.crs),ve),n=ye.createTextureFromFeature(t,ve,256,r.style,o),n.features=t,n.extent=e}else{if(!t.isTexture)throw new Error("Data type is not supported to convert into texture");n=t}return r.isColorLayer?function(t,e){return t.anisotropy=16,t.premultiplyAlpha=e.transparent,xe(t,e)}(n,r):r.isElevationLayer?(n.flipY&&(n.flipY=!1),xe(n,r)):void 0}};var _e=r(55086);class we extends re.Z{constructor(t,e){e.cacheLifeTime=e.cacheLifeTime??_e.D.TEXTURE,super(t,e)}convert(t,e){return be.convert(t,e,this)}delete(t){t&&this.cache.clear();for(const t of this.parent.level0Nodes)t.traverse((0,b.U8)(this.id))}}const Ee=we;var Me=r(43412);const Se=class extends Ee{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,ht.S_)(e),super(t,e),this.isColorLayer=!0,this.defineLayerProperty("visible",!0),this.defineLayerProperty("opacity",1),this.defineLayerProperty("sequence",0),this.transparent=e.transparent||this.opacity<1,this.noTextureParentOutsideLimit=!!e.source&&e.source.isFileSource,this.effect_type=e.effect_type??0,this.effect_parameter=e.effect_parameter??1,this.buildExtent=!0,this.structure="2d"}setupRasterNode(t){const e=new Me.AN(t.material,this);return t.material.addLayer(e),t.material.setSequence(this.parent.colorLayersOrder),e}update(t,e,r,i){return(0,b.XP)(t,this,r,i)}},Ce=class extends Ee{constructor(t){var e,r;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,i),(i.zmin||i.zmax)&&console.warn("Config using zmin and zmax are deprecated, use {clampValues: {min, max}} structure."),this.zmin=(null===(e=i.clampValues)||void 0===e?void 0:e.min)??i.zmin,this.zmax=(null===(r=i.clampValues)||void 0===r?void 0:r.max)??i.zmax,this.isElevationLayer=!0,this.defineLayerProperty("scale",this.scale||1)}setupRasterNode(t){const e=new Me.NO(t.material,this);t.material.addLayer(e),t.material.setSequenceElevation(this.id);const r=()=>t.setBBoxZ({min:e.min,max:e.max,scale:this.scale});return r(),e.addEventListener("rasterElevationLevelChanged",r),this.addEventListener("scale-property-changed",r),t.addEventListener("dispose",(()=>{this.removeEventListener("scale-property-changed",r)})),e}update(t,e,r,i){return(0,b.pN)(t,this,r,i)}};var Te=r(45222);class Ie extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.update=x.update,e.convert=Ht.convert({batchId:e.batchId}),super(t,e.object3d||new i.Group,e),this.isFeatureGeometryLayer=!0,this.accurate=e.accurate??!0,this.buildExtent=!this.accurate}preUpdate(t,e){e.has(this.parent)&&this.object3d.clear()}}const Re=Ie;var Be=r(98675);const Le=new i.Vector3,Pe=new i.Mesh,De=new i.Box3;function Oe(t,e,r,n,s){return t.camera.camera3D.isOrthographicCamera?function(t,e,r,n){const s=r/2**n.depth,o=new i.Vector4(s);o.applyMatrix4(t.camera.camera3D.projectionMatrix);const a=.5*o.x*t.camera.width,l=.5*o.y*t.camera.height,c=Math.sqrt(a*a+l*l);return Math.max(0,c-e)}(t,e,r,n):function(t,e,r,i,n){if(n<=0)return 1/0;const s=r/2**i.depth,o=t.camera.preSSE*s/n;return Math.max(0,o-e)}(t,e,r,n,s)}function ke(t){t.obj&&(t.obj.visible=!1),t.notVisibleSince||(t.notVisibleSince=Date.now(),t.sse=-1);for(const e of t.children)ke(e)}function Ue(t){var e;null===(e=t.material.intensityRange)||void 0===e||e.set(t.minIntensityRange,t.maxIntensityRange)}function Ne(t){var e;null===(e=t.material.elevationRange)||void 0===e||e.set(t.minElevationRange,t.maxElevationRange)}function Fe(t){var e;null===(e=t.material.angleRange)||void 0===e||e.set(t.minAngleRange,t.maxAngleRange)}Pe.geometry.boundingBox=De;class ze extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,new i.Group,e),this.isPointCloudLayer=!0,this.protocol="pointcloud",this.group=e.group||new i.Group,this.object3d.add(this.group),this.bboxes=e.bboxes||new i.Group,this.bboxes.visible=!1,this.object3d.add(this.bboxes),this.group.updateMatrixWorld(),this.octreeDepthLimit=e.octreeDepthLimit||-1,this.pointBudget=e.pointBudget||2e6,this.pointSize=0!==e.pointSize&&isNaN(e.pointSize)?4:e.pointSize,this.sseThreshold=e.sseThreshold||2,this.defineLayerProperty("minIntensityRange",e.minIntensityRange||1,Ue),this.defineLayerProperty("maxIntensityRange",e.maxIntensityRange||65536,Ue),this.defineLayerProperty("minElevationRange",e.minElevationRange||0,Ne),this.defineLayerProperty("maxElevationRange",e.maxElevationRange||1e3,Ne),this.defineLayerProperty("minAngleRange",e.minAngleRange||-90,Fe),this.defineLayerProperty("maxAngleRange",e.maxAngleRange||90,Fe),this.material=e.material||{},this.material.isMaterial||(e.material=e.material||{},e.material.intensityRange=new i.Vector2(this.minIntensityRange,this.maxIntensityRange),e.material.elevationRange=new i.Vector2(this.minElevationRange,this.maxElevationRange),e.material.angleRange=new i.Vector2(this.minAngleRange,this.maxAngleRange),this.material=new S.ZP(e.material)),this.material.defines=this.material.defines||{},this.mode=e.mode||S.vj.COLOR}preUpdate(t,e){let r;t.camera.preSSE=t.camera.height/(2*Math.tan(.5*i.MathUtils.degToRad(t.camera.camera3D.fov))),this.material&&(this.material.visible=this.visible,this.material.opacity=this.opacity,this.material.transparent=this.opacity<1,this.material.size=this.pointSize,this.material.scale=t.camera.preSSE,this.material.updateUniforms&&this.material.updateUniforms());for(const t of e.values()){if(t.isCamera||t==this)return[this.root];if(void 0!==t.obj&&t.obj.isPoints&&t.obj.layer==this)if(r){if(r=t.findCommonAncestor(r),!r)return[this.root]}else r=t}return r?[r]:[this.root]}update(t,e,r){if(r.visible=!1,this.octreeDepthLimit>=0&&this.octreeDepthLimit!t.requester.visible||!this.visible}).then((t=>{this.onPointsCreated&&this.onPointsCreated(e,t),r.obj=t,r.tightbbox=t.tightbbox,this.group.add(r.obj),r.obj.updateMatrixWorld(!0),r.promise=null}),(t=>{t.isCancelledCommandException&&(r.promise=null)}))}if(r.children&&r.children.length){const n=i.distanceToPoint(Le);if(r.sse=Oe(t,e.pointSize,e.spacing,r,n)/this.sseThreshold,r.sse>=1)return r.children;for(const t of r.children)ke(t)}}else ke(r)}postUpdate(){this.displayedCount=0;for(const t of this.group.children)if(t.visible){const e=t.geometry.attributes.position.count;t.geometry.setDrawRange(0,e),this.displayedCount+=e}if(this.displayedCount>this.pointBudget)if(this.supportsProgressiveDisplay){const t=this.pointBudget/this.displayedCount;for(const e of this.group.children)if(e.visible){const r=Math.floor(e.geometry.drawRange.count*t);r>0?e.geometry.setDrawRange(0,r):e.visible=!1}this.displayedCount*=t}else{this.group.children.sort(((t,e)=>e.userData.node.sse-t.userData.node.sse));let t=!1;this.displayedCount=0;for(const e of this.group.children){const r=e.geometry.attributes.position.count;t||this.displayedCount+r>this.pointBudget?(e.visible=!1,t=!0):this.displayedCount+=r}}const t=Date.now();for(let e=this.group.children.length-1;e>=0;e--){const r=this.group.children[e];!r.visible&&t-r.userData.node.notVisibleSince>1e4&&(this.group.children.splice(e,1),r.geometry.dispose(),r.material=null,r.geometry=null,r.userData.node.obj=null)}}pickObjectsAt(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Be.Z.pickPointsAt(t,e,r,this,i)}getObjectToUpdateForAttachedLayers(t){if(t.obj){const e=t.parent;return e&&e.obj?{element:t.obj,parent:e.obj}:{element:t.obj}}}}const Ge=ze;class Qe extends i.EventDispatcher{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;super(),this.numPoints=t,this.layer=e,this.children=[],this.bbox=new i.Box3,this.sse=-1}add(t,e){this.children.push(t),t.parent=this,this.createChildAABB(t,e)}load(){return this.octreeIsLoaded||this.loadOctree(),this.layer.source.fetcher(this.url,this.layer.source.networkOptions).then((t=>this.layer.source.parse(t,{out:this.layer,in:this.layer.source})))}findCommonAncestor(t){return t.depth!=this.depth?t.depth1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e),this.childrenBitField=t,this.id="",this.depth=0,this.baseurl=e.source.baseurl}add(t,e,r){super.add(t,e),t.id=this.id+e,t.depth=t.id.length,t.id.length%this.layer.hierarchyStepSize==0?t.baseurl=`${r.baseurl}/${t.id.substr(r.id.length)}`:t.baseurl=r.baseurl}createChildAABB(t,e){t.bbox.copy(this.bbox),this.bbox.getCenter(t.bbox.max),Ve.copy(t.bbox.max).sub(this.bbox.min),1===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z):3===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z,t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y):0===e||(2===e?(t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y):5===e?(t.bbox.min.z+=Ve.z,t.bbox.max.z+=Ve.z,t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x):7===e?(t.bbox.min.add(Ve),t.bbox.max.add(Ve)):4===e?(t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x):6===e&&(t.bbox.min.y+=Ve.y,t.bbox.max.y+=Ve.y,t.bbox.min.x+=Ve.x,t.bbox.max.x+=Ve.x))}get octreeIsLoaded(){return!(this.childrenBitField&&0===this.children.length)}get url(){return`${this.baseurl}/r${this.id}.${this.layer.source.extension}`}loadOctree(){const t=`${this.baseurl}/r${this.id}.${this.layer.source.extensionOctree}`;return this.layer.source.fetcher(t,this.layer.source.networkOptions).then((t=>{const e=new DataView(t),r=[];let i=0;for(this.childrenBitField=e.getUint8(0),i+=1,this.numPoints=e.getUint32(1,!0),i+=4,r.push(this);r.length&&i{this.scale=(new i.Vector3).addScalar(t.scale),this.spacing=t.spacing,this.hierarchyStepSize=t.hierarchyStepSize;const e=Array.isArray(t.pointAttributes)&&t.pointAttributes.find((t=>t.startsWith("NORMAL")));return e&&(this.material.defines[e]=1),this.supportsProgressiveDisplay="cin"===this.source.extension,this.root=new We(0,0,this),this.root.bbox.min.set(t.boundingBox.lx,t.boundingBox.ly,t.boundingBox.lz),this.root.bbox.max.set(t.boundingBox.ux,t.boundingBox.uy,t.boundingBox.uz),this.extent=s.ZP.fromBox3(this.source.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r)}))}};var Xe=r(11707),Je=r(96021),Ke=r(43195);const $e=new i.Matrix4(1,0,0,1,0,1,0,1,0,0,2,0,0,0,0,2),tr=new i.DataTexture(new Uint8Array([255,255,255,255]),1,1,i.RGBAFormat,i.UnsignedByteType);tr.needsUpdate=!0;const er=new i.Texture,rr=new i.ShaderMaterial;class ir extends i.ShaderMaterial{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.side=e.side??i.DoubleSide,e.transparent=e.transparent??!0,e.opacity=e.opacity??1;const r={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&void 0!==rr[t]&&(r[t]=e[t]);super(r),this.defines.ORIENTED_IMAGES_COUNT=e.OrientedImagesCount??t.length;const n=$t.Z.getMaxTextureUnitsCount();this.defines.ORIENTED_IMAGES_COUNT>n&&(console.warn(`OrientedImageMaterial: Can't project ${t.length} textures, because it's more than GPU capabilities maximum texture units (${n})`),this.defines.ORIENTED_IMAGES_COUNT=n-1,console.warn(`OrientedImageMaterial: We'll use only the first ${this.defines.ORIENTED_IMAGES_COUNT} cameras.`)),e.useBaseMaterial&&(this.defines.USE_BASE_MATERIAL=!0),this.defines.USE_DISTORTION=Number(t.some((t=>null!==t.distortion.pps))),this.alphaBorder=20|e.alphaBorder,this.defines.DEBUG_ALPHA_BORDER=0|e.debugAlphaBorder,this.cameras=t;const s=[],o=[],a=[],l=[];this.group=new i.Group;for(let e=0;e\n#include \n#include \nvarying vec3 vNormal;\n\n#ifdef USE_BASE_MATERIAL\nstruct noPT {\n vec3 lightDirection;\n vec3 ambient;\n float opacity;\n};\n\nuniform noPT noProjectiveMaterial;\n#endif\n\nvoid main(void)\n{\n #include \n #ifdef USE_BASE_MATERIAL\n float nDotVP = (max(0.1, dot(vNormal, normalize(noProjectiveMaterial.lightDirection))));\n vec4 color = vec4(noProjectiveMaterial.ambient + nDotVP, 0.0);\n #else\n vec4 color = vec4(0.0);\n #endif\n\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n\n #ifdef USE_BASE_MATERIAL\n color.a = color.a < 1.0 ? max(noProjectiveMaterial.opacity, color.a) : 1.0 ;\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n #else\n gl_FragColor = vec4(color.rgb / color.a, opacity);\n #endif\n\n}\n",this.defines)}setTextures(t,e,r){if(t){this.group.position.copy(e.position),this.group.quaternion.copy(e.quaternion);for(let e=0;et.name===r[e]));this.uniforms.mask.value[e]=t.maskTexture||tr,this.uniforms.mask.value[e].needsUpdate=!0,this.uniforms.projectiveTextureDistortion.value[e]=t.distortion,this.group.children[e]=t,t.parent=this.group}}this.group.children[e].needsUpdate=!0}this.group.updateMatrixWorld(!0)}}updateUniforms(t){for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=JSON.parse(t)),Promise.all(t.map((t=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=null==e.useMask||e.useMask,n=null==e.imageYDown||e.imageYDown,s=t.projection,o=(new i.Vector2).fromArray(t.size),a=new i.Vector2(s[0],s[4]),l=new i.Vector2(s[2],n?o.y-s[5]:s[5]),c=s[1],h=new M(o,a,l,e.near,e.far,c);h.position.fromArray(t.position);const u=ar.fromArray(t.rotation);let d;h.matrix.setFromMatrix3(u),h.quaternion.setFromRotationMatrix(h.matrix),h.rotateX(Math.PI),t.distortion&&h.distortion.setFromMicmacCalibration(t.distortion,n),h.maskPath=t.mask,h.name=t.id;const p=new Promise((t=>{d=t}));return r&&h.maskPath?or.load(h.maskPath,(t=>{h.maskTexture=t,d(h)})):d(h),p}(t,e))))}},cr=new o.Z("EPSG:4978",0,0,0),hr=t=>t.requester.id!==t.layer.currentPano.id;class ur extends Te.Z{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.projection&&(console.warn("OrientedImageLayer projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),super(t,new i.Group,e),this.isOrientedImageLayer=!0,this.background=e.background||function(t){if(!t||t<=0)return;const e=new i.SphereGeometry(t,32,32),r=new i.MeshPhongMaterial({color:7829503,side:i.DoubleSide,transparent:!0,opacity:.5,wireframe:!0}),n=new i.Mesh(e,r);return n.visible=!0,n.name="OrientedImageBackground",n}(e.backgroundDistance),this.background&&(this.background.layer=this.background.layer??{},this.background.layer.id=this.background.layer.id??t,this.object3d.add(this.background)),this.currentPano=void 0,this.onPanoChanged=e.onPanoChanged||(()=>{}),this.getCamerasNameFromFeature=e.getCamerasNameFromFeature||(()=>{});const r=this.addInitializationStep();this.mergeFeatures=!1,this.filteringExtent=!1,this.accurate=!0;const n={out:this};this.source.whenReady.then((t=>sr.Z.parse(e.orientation||t.orientation,n).then((t=>{this.panos=t.features;const r=n.in.crs,s=e.crs,o=xt.quaternionFromCRSToCRS(r,s),a=new i.Quaternion;let l=0;for(const e of this.panos)cr.crs=e.crs,cr.setFromArray(e.vertices).applyMatrix4(t.matrix),e.position=cr.toVector3(),o(cr,a),e.quaternion=xt.quaternionFromAttitude(e.geometries[0].properties).premultiply(a),e.id=e.geometries[0].properties.id,e.index=l++})).then((()=>{lr.parse(e.calibration||t.calibration,e).then((t=>{this.cameras=t,this.material=new nr(this.cameras,e),r()}))}))))}update(){}set boostLight(t){this.material.uniforms.boostLight.value=t}get boostLight(){return this.material.uniforms.boostLight.value}preUpdate(t){var e;!function(t,e,r){const i=r.mostNearPano(e.position),n=r.currentPano?r.currentPano.id:void 0;if(i&&n!=i.id){r.currentPano=i,r.onPanoChanged({previousPanoPosition:r.getPreviousPano()?r.getPreviousPano().position:void 0,currentPanoPosition:r.getCurrentPano().position,nextPanoPosition:r.getNextPano().position});const e=i.geometries[0].properties.idSensors,n=r.cameras.map((t=>({cameraId:t.name,panoId:i.id,as:()=>{}}))).filter((t=>!e||e.includes(t.cameraId))),s={layer:r,extentsSource:n,view:t.view,requester:i,earlyDropFunction:hr};t.scheduler.execute(s).then((e=>{i.id===r.currentPano.id&&(r.material.setTextures(e,i,r.getCamerasNameFromFeature(i)),r.material.updateUniforms(t.camera.camera3D),t.view.notifyChange(r,!0))}),(()=>{}))}}(t,t.camera.camera3D,this),this.material.updateUniforms(t.camera.camera3D),(e=this).background&&e.currentPano&&(e.background.position.copy(e.currentPano.position),e.background.updateMatrixWorld(),e.background.material=e.material||e.background.material)}getNextPano(){const t=(this.currentPano.index+1)%this.panos.length;return this.panos[t]}getCurrentPano(){return this.currentPano}getPreviousPano(){const t=(this.currentPano.index-1)%this.panos.length;return this.panos[t]}delete(t){this.background&&super.delete(),t&&this.cache.clear(),this.material.visible=!1,console.warn("You need to replace OrientedImageLayer.material applied on each object. This issue will be fixed when OrientedImageLayer will be a ColorLayer. the material visibility is set to false. To follow issue see https://github.com/iTowns/itowns/issues/1018")}mostNearPano(t){let e,r=1/0;for(const i of this.panos){const n=t.distanceTo(i.position);n5&&void 0!==arguments[5]?arguments[5]:0,n),this.isEntwinePointTileNode=!0,this.depth=t,this.x=e,this.y=r,this.z=i,this.id=br(t,e,r,i),this.url=`${this.layer.source.url}/ept-data/${this.id}.${this.layer.source.extension}`}createChildAABB(t){const e=2**(t.depth-this.depth);this.bbox.getSize(yr).divideScalar(e),t.bbox.min.copy(this.bbox.min),vr.copy(this).multiplyScalar(e),xr.subVectors(t,vr).multiply(yr),t.bbox.min.add(xr),t.bbox.max.copy(t.bbox.min).add(yr)}get octreeIsLoaded(){return this.numPoints>=0}loadOctree(){return d.Z.json(`${this.layer.source.url}/ept-hierarchy/${this.id}.json`,this.layer.source.networkOptions).then((t=>{this.numPoints=t[this.id];const e=[];for(e.push(this);e.length;){const r=e.shift(),i=r.depth+1,n=2*r.x,s=2*r.y,o=2*r.z;r.findAndCreateChild(i,n,s,o,t,e),r.findAndCreateChild(i,n+1,s,o,t,e),r.findAndCreateChild(i,n,s+1,o,t,e),r.findAndCreateChild(i,n+1,s+1,o,t,e),r.findAndCreateChild(i,n,s,o+1,t,e),r.findAndCreateChild(i,n+1,s,o+1,t,e),r.findAndCreateChild(i,n,s+1,o+1,t,e),r.findAndCreateChild(i,n+1,s+1,o+1,t,e)}}))}findAndCreateChild(t,e,r,i,n,s){const o=n[br(t,e,r,i)];if("number"==typeof o){const n=new _r(t,e,r,i,this.layer,o);this.add(n),s.push(n)}}}const wr=_r,Er=new i.Mesh,Mr=new i.Box3;Er.geometry.boundingBox=Mr;const Sr=class extends Ge{constructor(t,e){super(t,e),this.isEntwinePointTileLayer=!0,this.scale=new i.Vector3(1,1,1);const r=this.addInitializationStep();this.whenReady=this.source.whenReady.then((()=>(this.root=new wr(0,0,0,0,this,-1),this.root.bbox.min.fromArray(this.source.boundsConforming,0),this.root.bbox.max.fromArray(this.source.boundsConforming,3),this.minElevationRange=this.source.boundsConforming[2],this.maxElevationRange=this.source.boundsConforming[5],this.extent=s.ZP.fromBox3(e.crs||"EPSG:4326",this.root.bbox),this.root.loadOctree().then(r))))}get spacing(){return this.source.spacing}};var Cr=r(72726);class Tr extends Cr.Z{constructor(t){if(t.parsedData&&(console.warn("FileSource parsedData parameter is deprecated, use features instead of."),t.features=t.features||t.parsedData),t.projection&&(console.warn("FileSource projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs){if(!t.features||!t.features.crs)throw new Error("source.crs is required in FileSource");t.crs=t.features.crs}if(!t.url&&!t.fetchedData&&!t.features)throw new Error("url, fetchedData and features are not set in\n FileSource; at least one needs to be present");t.url=t.url||"fake-file-url",super(t),this.isFileSource=!0,this.fetchedData=t.fetchedData,this.fetchedData||t.features?t.features&&(this._featuresCaches[t.features.crs]=new _e.Z,this._featuresCaches[t.features.crs].setByArray(Promise.resolve(t.features),[0])):this.whenReady=this.fetcher(this.urlFromExtent(),this.networkOptions).then((t=>{this.fetchedData=t})),this.whenReady.then((()=>this.fetchedData)),this.zoom={min:0,max:1/0}}urlFromExtent(){return this.url}onLayerAdded(t){t.in=this,super.onLayerAdded(t);let e=this._featuresCaches[t.out.crs].getByArray([0]);e||(t.out.buildExtent="EPSG:4978"!=this.crs,t.out.buildExtent&&(t.out.forcedExtentCrs="EPSG:4978"!=t.out.crs?t.out.crs:l.Z.formatToEPSG(this.crs)),e=this.parser(this.fetchedData,t),this._featuresCaches[t.out.crs].setByArray(e,[0])),e.then((t=>{t.extent&&(this.extent=t.extent.clone(),this.extent.crs==t.crs&&this.extent.applyMatrix4(t.matrixWorld))}))}loadData(t,e){return this._featuresCaches[e.crs].getByArray([0])}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Ir=Tr;var Rr=r(4380);const Br=new s.ZP(l.Z.tms_4326,0,0,0);class Lr extends Cr.Z{constructor(t){if(t.format=t.format||"image/png",super(t),!t.crs)throw new Error("New TMSSource/WMTSSource: crs is required");if(this.isTMSSource=!0,t.extent||(this.extent=s.Mh.get(t.crs)),this.zoom=t.zoom,this.isInverted=t.isInverted||!1,this.crs=l.Z.formatToTms(t.crs),this.tileMatrixSetLimits=t.tileMatrixSetLimits,this.extentSetlimits={},this.tileMatrixCallback=t.tileMatrixCallback||(t=>t),!this.zoom)if(this.tileMatrixSetLimits){const t=Object.keys(this.tileMatrixSetLimits),e=t.length,r=Number(t[e-1]);this.zoom={min:r-e+1,max:r}}else this.zoom={min:0,max:1/0}}urlFromExtent(t){return Rr.Z.xyz(t,this)}onLayerAdded(t){super.onLayerAdded(t);const e=t.out.parent,r=e?e.extent.crs:t.out.crs;if(this.tileMatrixSetLimits&&!this.extentSetlimits[r]){this.extentSetlimits[r]={},Br.crs=this.crs;for(let t=this.zoom.max;t>=this.zoom.min;t--){const e=this.tileMatrixSetLimits[t],{west:i,north:n}=Br.set(t,e.minTileRow,e.minTileCol).as(r),{east:o,south:a}=Br.set(t,e.maxTileRow,e.maxTileCol).as(r);this.extentSetlimits[r][t]=new s.ZP(r,i,o,a,n)}}}extentInsideLimit(t,e){return e>=this.zoom.min&&e<=this.zoom.max&&(null==this.extentSetlimits[t.crs]||this.extentSetlimits[t.crs][e].intersectsExtent(t))}}const Pr=Lr;class Dr extends Cr.Z{constructor(t){if(t.projection&&(console.warn("WFSSource projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.typeName)throw new Error("source.typeName is required in wfs source.");if(!t.crs)throw new Error("source.crs is required in wfs source");t.format=t.format||"application/json",super(t),this.isWFSSource=!0,this.typeName=t.typeName,this.version=t.version||"2.0.2",this.bboxDigits=t.bboxDigits,this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${t.url}SERVICE=WFS&REQUEST=GetFeature&typeName=${this.typeName}&VERSION=${this.version}&SRSNAME=${this.crs}&outputFormat=${this.format}&BBOX=%bbox,${this.crs}`,this.zoom={min:0,max:1/0},this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}handlingError(t){return t.response&&400==t.response.status?t.response.text().then((e=>{const r=`${this.url}SERVICE=WFS&REQUEST=GetCapabilities&VERSION=${this.version}`,i=(new DOMParser).parseFromString(e,"application/xml").querySelector("Exception"),n=i.getAttribute("exceptionCode"),s=i.querySelector("ExceptionText").textContent;console.error(`Source ${this.typeName}: bad request when fetching data. Server says: "${n}: ${s}". \nReviewing ${r} may help.`,t)})):super.handlingError(t)}requestToKey(t){return l.Z.isTms(t.crs)?super.requestToKey(t):[t.zoom,t.south,t.west]}urlFromExtent(t){return Rr.Z.bbox(t,this)}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Or=Dr;class kr extends Cr.Z{constructor(t){if(!t.name)throw new Error("source.name is required.");if(!t.extent)throw new Error("source.extent is required");if(!t.crs&&!t.projection)throw new Error("source.crs is required");t.format=t.format||"image/png",super(t),this.isWMSSource=!0,this.name=t.name,this.zoom={min:0,max:1/0},this.style=t.style||"",this.width=t.width||t.height||256,this.height=t.height||t.width||256,this.version=t.version||"1.3.0",this.transparent=t.transparent||!1,this.bboxDigits=t.bboxDigits,t.axisOrder||("EPSG:4326"==this.crs?this.axisOrder="1.1.0"===this.version?"wsen":"swne":this.axisOrder="wsen");const e="1.3.0"===this.version?"CRS":"SRS";this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${this.url}SERVICE=WMS&REQUEST=GetMap&LAYERS=${this.name}&VERSION=${this.version}&STYLES=${this.style}&FORMAT=${this.format}&TRANSPARENT=${this.transparent}&BBOX=%bbox&${e}=${this.crs}&WIDTH=${this.width}&HEIGHT=${this.height}`,this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}urlFromExtent(t){return Rr.Z.bbox(t,this)}extentInsideLimit(t){return this.extent.intersectsExtent(t)}}const Ur=kr,Nr=class extends Pr{constructor(t){if(!t.name)throw new Error("New WMTSSource: name is required");super(t),this.isWMTSSource=!0,this.url.endsWith("?")||(this.url=`${this.url}?`),this.url=`${this.url}LAYER=${t.name}&FORMAT=${this.format}&SERVICE=WMTS&VERSION=${t.version||"1.0.0"}&REQUEST=GetTile&STYLE=${t.style||"normal"}&TILEMATRIXSET=${t.tileMatrixSet}&TILEMATRIX=%TILEMATRIX&TILEROW=%ROW&TILECOL=%COL`,this.vendorSpecific=t.vendorSpecific;for(const t in this.vendorSpecific)Object.prototype.hasOwnProperty.call(this.vendorSpecific,t)&&(this.url=`${this.url}&${t}=${this.vendorSpecific[t]}`)}};var Fr=r(92294);const zr=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/,Gr="https://api.mapbox.com",Qr=!0,jr=null;function Vr(t){const e=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${e}`}function Hr(t,e){const r=qr(Gr);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){const e=t.params.indexOf("secure");e>=0&&t.params.splice(e,1)}if("/"!==r.path&&(t.path=`${r.path}${t.path}`),!Qr)return Vr(t);if(!(e=e||jr))throw new Error("An API access token is required");if("s"===e[0])throw new Error("Use a public access token (pk.*), not a secret access token (sk.*).");return t.params=t.params.filter((t=>-1===t.indexOf("access_token"))),t.params.push(`access_token=${e}`),Vr(t)}function Wr(t){return 0===t.indexOf("mapbox:")}function qr(t){const e=t.match(zr);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}const Zr=function(t,e){if(!Wr(t))return t;const r=qr(t);return r.path=`/styles/v1${r.path}`,Hr(r,e)},Yr=function(t,e){if(!Wr(t))return t;const r=qr(t);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),Hr(r,e)},Xr=function(t,e,r,i){const n=qr(t);return Wr(t)?(n.path=`/styles/v1${n.path}/sprite${e}${r}`,Hr(n,i)):(n.path+=`${e}${r}`,Vr(n))};function Jr(t){return t.replace(/\{/g,"${")}const Kr=class extends Pr{constructor(t){t.format="application/x-protobuf;type=mapbox-vector",t.crs="EPSG:3857",t.isInverted=!0,t.url=t.url||".",super(t);const e=t.filter||(()=>!0);let r;if(this.urls=[],this.layers={},this.styles={},this.isVectorTileSource=!0,this.accessToken=t.accessToken,!t.style)throw new Error("New VectorTilesSource: style is required");if("string"==typeof t.style){const e=Zr(t.style,this.accessToken);r=d.Z.json(e,this.networkOptions)}else r=Promise.resolve(t.style);this.whenReady=r.then((e=>{this.jsonStyle=e;const r=t.sprite||e.sprite;if(r){const t=Xr(r,"",".json",this.accessToken);return d.Z.json(t,this.networkOptions).then((t=>{this.sprites=t;const i=Xr(r,"",".png",this.accessToken);return this.sprites.source=i,e}))}return e})).then((t=>{if(t.layers.forEach(((t,r)=>{if(t.sourceUid=this.uid,"background"===t.type)this.backgroundLayer=t;else if(e(t)){const e=bt.ZP.setFromVectorTileLayer(t,this.sprites,r,this.symbolToCircle);this.styles[t.id]=e,this.layers[t["source-layer"]]||(this.layers[t["source-layer"]]=[]),this.layers[t["source-layer"]].push({id:t.id,order:r,filterExpression:(0,Fr.TE)(t.filter),zoom:{min:t.minzoom||0,max:t.maxzoom||24}})}})),"."==this.url){const e=Object.values(t.sources).map((t=>{if(t.url){const e=Yr(t.url,this.accessToken);return d.Z.json(e,this.networkOptions).then((t=>{if(t.tiles[0])return Jr(t.tiles[0])}))}return t.tiles?Promise.resolve(Jr(t.tiles[0])):Promise.reject()}));return Promise.all(e)}return Promise.resolve([this.url])})).then((t=>{this.urls=Array.from(new Set(t))}))}urlFromExtent(t,e){return Rr.Z.xyz(t,{tileMatrixCallback:this.tileMatrixCallback,url:e})}onLayerAdded(t){super.onLayerAdded(t),t.out.style&&t.out.isFeatureGeometryLayer&&t.out.accurate&&(console.warn("With VectorTilesSource and FeatureGeometryLayer, the accurate option is always false"),t.out.accurate=!1)}loadData(t,e){const r=this._featuresCaches[e.crs],i=this.requestToKey(t);let n=r.getByArray(i);return n||(n=r.setByArray(Promise.all(this.urls.map((r=>this.fetcher(this.urlFromExtent(t,r),this.networkOptions).then((r=>this.parser(r,{out:e,in:this,extent:t})))))).then((t=>function(t){const e=t[0];return t.forEach(((t,r)=>{0!==r&&t.features.forEach((t=>{e.features.push(t)}))})),e}(t))).catch((t=>this.handlingError(t))),i),this.onParsedFile&&n.then((t=>(this.onParsedFile(t),console.warn("Source.onParsedFile was deprecated"),t)))),n}};class $r extends Cr.Z{constructor(t){super(t),this.isOrientedImageSource=!0;const e=[];e.push(t.orientationsUrl?d.Z.json(t.orientationsUrl,this.networkOptions):Promise.resolve()),e.push(t.calibrationUrl?d.Z.json(t.calibrationUrl,this.networkOptions):Promise.resolve()),this.whenReady=Promise.all(e).then((t=>({orientation:t[0],calibration:t[1]})))}urlFromExtent(t){return this.imageUrl(t.cameraId,t.panoId)}requestToKey(t){return[t.cameraId,t.panoId]}imageUrl(t,e){return this.url.replace("{cameraId}",t).replace("{panoId}",e)}}const ti=$r,ei={POSITION_CARTESIAN:{numElements:3,arrayType:Float32Array,attributeName:"position"},COLOR_PACKED:{numElements:4,arrayType:Uint8Array,attributeName:"color",normalized:!0},INTENSITY:{numElements:1,numByte:2,arrayType:Uint16Array,attributeName:"intensity",normalized:!0},CLASSIFICATION:{numElements:1,arrayType:Uint8Array,attributeName:"classification",normalized:!0},NORMAL_SPHEREMAPPED:{numElements:2,arrayType:Uint8Array,attributeName:"sphereMappedNormal"},NORMAL_OCT16:{numElements:2,arrayType:Uint8Array,attributeName:"oct16Normal"},NORMAL:{numElements:3,arrayType:Float32Array,attributeName:"normal"}};for(const t of Object.keys(ei)){const e=ei[t];e.potreeName=t,e.numByte=e.numByte||e.arrayType.BYTES_PER_ELEMENT,e.byteSize=e.numElements*e.numByte,e.normalized=e.normalized||!1;const r="getUint"+8*e.numByte;e.getValue=1===e.numByte?function(t,e){return t[r](e)}:function(t,e){return t[r](e,!0)}}const ri={parse:function(t,e){if(!t)throw new Error("No array buffer provided.");const r=new DataView(t);let n=0;for(const t of e.in.pointAttributes)n+=ei[t].byteSize;const s=Math.floor(t.byteLength/n),o=new i.BufferGeometry;let a=0,l=0;for(const t of e.in.pointAttributes){const e=ei[t],c=e.numElements*s,h=new e.arrayType(c);for(let t=0;t(this.pointAttributes=t.pointAttributes,this.baseurl=`${this.url}/${t.octreeDir}/r`,this.extension="CIN"===t.pointAttributes?"cin":"bin",this.parse="cin"===this.extension?ii.parse:ri.parse,t)))}}const si=ni;class oi extends Cr.Z{constructor(t){super(t),this.isC3DTilesSource=!0,this.baseUrl=this.url.slice(0,this.url.lastIndexOf("/")+1),this.whenReady=d.Z.json(this.url,this.networkOptions)}}const ai=oi,li=class extends ai{constructor(t){if(!t.accessToken)throw new Error("New 3D Tiles Ion Source: access token is required");if(!t.assetId)throw new Error("New 3D Tiles Ion Source: asset id is required");t.url=`https://api.cesium.com/v1/assets/${t.assetId}/endpoint?access_token=${t.accessToken}`,super(t),this.isC3DTilesIonSource=!0,this.accessToken=t.accessToken,this.assetId=t.assetId,this.whenReady=d.Z.json(t.url,this.networkOptions).then((t=>{if("3DTILES"!==t.type)throw new Error(`${t.type} datasets from Cesium ion are not supported with C3DTilesIonSource. Only 3D Tiles datasets are supported.`);return this.url=t.url,this.baseUrl=t.url.slice(0,t.url.lastIndexOf("/")+1),this.networkOptions.headers={},this.networkOptions.headers.Authorization=`Bearer ${t.accessToken}`,this.attribution=t.attributions,d.Z.json(this.url,this.networkOptions)}))}};function ci(t){if(!t)return null;if(t.content&&t.content.uri)return new URLSearchParams(t.content.uri.slice(t.content.uri.indexOf("?")+1)).get("session");if(t.children&&t.children.length>0)for(const e of t.children){const t=ci(e);if(t)return t}return null}const hi=class extends ai{constructor(t){if(!t.key)throw new Error("[C3DTilesGoogleSource]: A API key for the google map tiles API is required");t.url=`https://tile.googleapis.com/v1/3dtiles/root.json?key=${t.key}`,super(t),this.isC3DTilesGoogleSource=!0,this.baseUrl="https://tile.googleapis.com",this.key=t.key,this.whenReady=d.Z.json(t.url,this.networkOptions).then((t=>{if(t&&t.root&&(this.sessionId=ci(t.root),null===this.sessionId))throw new Error("[C3DTilesGoogleSource]: Cannot find sessionId from the tileset while it is mandatory to request tiles.");return t}))}getTileUrl(t){const e=`key=${this.key}&session=${this.sessionId}`;return/\?/.test(t)?`${t}&${e}`:`${t}?${e}`}};var ui=r(42622),di=r(37830);const pi=new class{constructor(){this._wasmPath="https://cdn.jsdelivr.net/npm/laz-perf@0.0.6/lib/",this._wasmPromise=null}_initDecoder(){return this._wasmPromise||(this._wasmPromise=ui.LazPerf.create({locateFile:t=>`${this._wasmPath}/${t}`})),this._wasmPromise}_parseView(t,e){const r=e.colorDepth??16,i=["X","Y","Z"].map(t.getter),n=t.getter("Intensity"),s=t.getter("ReturnNumber"),o=t.getter("NumberOfReturns"),a=t.getter("Classification"),l=t.getter("PointSourceId"),c=t.dimensions.Red?["Red","Green","Blue"].map(t.getter):void 0,h=t.getter("ScanAngle"),u=new Float32Array(3*t.pointCount),d=new Uint16Array(t.pointCount),p=new Uint8Array(t.pointCount),f=new Uint8Array(t.pointCount),m=new Uint8Array(t.pointCount),g=new Uint16Array(t.pointCount),A=c?new Uint8Array(4*t.pointCount):void 0,y=new Float32Array(t.pointCount),v=i.map((t=>t(0))).map((t=>Math.floor(t)));for(let e=0;et(e)));if(u[3*e]=t-v[0],u[3*e+1]=x-v[1],u[3*e+2]=b-v[2],d[e]=n(e),p[e]=s(e),f[e]=o(e),c){let[t,i,n]=c.map((t=>t(e)));16===r&&(t/=256,i/=256,n/=256),A[4*e]=t,A[4*e+1]=i,A[4*e+2]=n,A[4*e+3]=255}m[e]=a(e),g[e]=l(e),y[e]=h(e)}return{position:u,intensity:d,returnNumber:p,numberOfReturns:f,classification:m,pointSourceID:g,color:A,scanAngle:y,origin:v}}set lazPerf(t){this._wasmPath=t,this._wasmPromise=null}async parseFile(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=new Uint8Array(t),i=await di.Las.PointData.decompressFile(r,this._initDecoder()),n=di.Las.Header.parse(r),s=e.colorDepth??(1===n.majorVersion&&n.minorVersion<=2?8:16),o=async(t,e)=>r.slice(t,e),a=await di.Las.Vlr.walk(o,n),l=di.Las.Vlr.find(a,"LASF_Spec",4),c=l&&di.Las.ExtraBytes.parse(await di.Las.Vlr.fetch(o,l)),h=di.Las.View.create(i,n,c);return{header:n,attributes:this._parseView(h,{colorDepth:s})}}},fi={enableLazPerf(t){if(!t)throw new Error("Path to laz-perf is mandatory");pi.lazPerf=t},parse(t){var e,r;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null!==(e=n.out)&&void 0!==e&&e.skip&&console.warn("Warning: options 'skip' not supported anymore"),pi.parseFile(t,{colorDepth:null===(r=n.in)||void 0===r?void 0:r.colorDepth}).then((t=>{const e=new i.BufferGeometry,r=t.attributes;e.userData=t.header;const n=new i.BufferAttribute(r.position,3);e.setAttribute("position",n);const s=new i.BufferAttribute(r.intensity,1);e.setAttribute("intensity",s);const o=new i.BufferAttribute(r.returnNumber,1);e.setAttribute("returnNumber",o);const a=new i.BufferAttribute(r.numberOfReturns,1);e.setAttribute("numberOfReturns",a);const l=new i.BufferAttribute(r.classification,1);e.setAttribute("classification",l);const c=new i.BufferAttribute(r.pointSourceID,1);if(e.setAttribute("pointSourceID",c),r.color){const t=new i.BufferAttribute(r.color,4,!0);e.setAttribute("color",t)}const h=new i.BufferAttribute(r.scanAngle,1);return e.setAttribute("scanAngle",h),e.computeBoundingBox(),e.userData.origin=(new i.Vector3).fromArray(r.origin),e}))}};class mi extends Cr.Z{constructor(t){super(t),this.isEntwinePointTileSource=!0,this.colorDepth=t.colorDepth,this.url=this.url.replace("/ept.json",""),this.whenReady=d.Z.json(`${this.url}/ept.json`,this.networkOptions).then((t=>(this.parse="laszip"===t.dataType?fi.parse:ri.parse,this.extension="laszip"===t.dataType?"laz":"bin",t.srs&&t.srs.authority&&t.srs.horizontal&&(this.crs=`${t.srs.authority}:${t.srs.horizontal}`,n.default.defs(this.crs)||n.default.defs(this.crs,t.srs.wkt),t.srs.vertical&&t.srs.vertical!==t.srs.horizontal&&console.warn("EntwinePointTileSource: Vertical coordinates system code is not yet supported.")),this.spacing=(Math.abs(t.boundsConforming[3]-t.boundsConforming[0])+Math.abs(t.boundsConforming[4]-t.boundsConforming[1]))/(2*t.span),this.boundsConforming=t.boundsConforming,this.span=t.span,this))),this.fetcher=d.Z.arrayBuffer}}const gi=mi;var Ai=r(50810),yi=r(56178),vi=r(79003);const xi={parse(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=(0,ht._F)(r),t.zip?e=vi.parseZip(t.zip):t.shp&&t.shx&&t.dbf&&(e=Promise.all([vi.parseShp(t.shp,t.prj),vi.parseDbf(t.dbf)]).then(vi.combine)),r.in=r.in||{},r.in.crs=t.prj?(0,n.default)(t.prj).oProj.datumName:r.in.crs,Promise.resolve(e).then((t=>sr.Z.parse(t,r)))}};var bi=r(4090),_i=r(84612),wi=r(15344),Ei=r(25542),Mi=r(84607),Si=r(47274),Ci=r(27245),Ti=r(5626),Ii=r(83214),Ri=r(39865);const Bi=class{constructor(t){this.classes=t.classes,this.inverseHierarchy={},this.instancesIdxs=[];const e={};let r=0,i=t.parentCounts;void 0===i&&(i=new Array(t.instancesLength),i.fill(1));for(let n=0;n{"use strict";r.d(e,{S:()=>a,Z:()=>l});var i=r(99477),n=r(2362),s=r(71440),o=r(15344);function a(t,e){const r=t[t.indexOf(t.find((t=>t.includes(e))))].split(" ").filter((t=>""!==t));return parseFloat(r[r.length-1])}const l={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.split("\n"),l=r.indexOf(r.find((t=>t.includes("end_of_head"))))+1,c=r.slice(0,l),h={minX:a(c,"longlimit_west"),maxX:a(c,"longlimit_east"),minY:a(c,"latlimit_south"),maxY:a(c,"latlimit_north"),stepX:a(c,"gridstep"),stepY:a(c,"gridstep"),nRows:a(c,"latitude_parallels"),nColumns:a(c,"longitude_parallels")},u=new DataView(new ArrayBuffer(o.h8*h.nRows*h.nColumns));let d=0;for(let t of r.slice(l,r.length))t=t.split(" ").filter((t=>""!==t)),t.length&&(u.setFloat64(d*o.h8,parseFloat(t[2])),d++);const p=new s.ZP(e.in.crs||"EPSG:4326",h.minX,h.maxX,h.minY,h.maxY),f=new i.Vector2(h.stepX,h.stepY);return Promise.resolve(new n.Z(p,f,((t,e)=>u.getFloat64((h.nColumns*(h.nRows-t-1)+e)*o.h8))))}}},25542:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>Mt,qw:()=>wt,hu:()=>Et,zL:()=>bt,mp:()=>_t});var i=r(99477);function n(t,e){if(e===i.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===i.TriangleFanDrawMode||e===i.TriangleStripDrawMode){let r=t.getIndex();if(null===r){const e=[],i=t.getAttribute("position");if(void 0===i)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t=2.0 are supported.")));const h=new Z(n,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let t=0;t=0&&void 0===o[e]&&console.warn('THREE.GLTFLoader: Unknown extension "'+e+'".')}}h.setExtensions(s),h.setPlugins(o),h.parse(r,i)}parseAsync(t,e){const r=this;return new Promise((function(i,n){r.parse(t,e,i,n)}))}}function o(){let t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const a={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class l{constructor(t){this.parser=t,this.name=a.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let r=0,i=e.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,n.source,s)}}class b{constructor(t){this.parser=t,this.name=a.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,r=this.parser,i=r.json,n=i.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=i.images[s.source];let a=r.textureLoader;if(o.uri){const t=r.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(t,s.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class _{constructor(t){this.parser=t,this.name=a.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){const e=this.name,r=this.parser,i=r.json,n=i.textures[t];if(!n.extensions||!n.extensions[e])return null;const s=n.extensions[e],o=i.images[s.source];let a=r.textureLoader;if(o.uri){const t=r.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(n){if(n)return r.loadTextureImage(t,s.source,a);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class w{constructor(t){this.name=a.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,r=e.bufferViews[t];if(r.extensions&&r.extensions[this.name]){const t=r.extensions[this.name],i=this.parser.getDependency("buffer",t.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return i.then((function(e){const r=t.byteOffset||0,i=t.byteLength||0,s=t.count,o=t.byteStride,a=new Uint8Array(e,r,i);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(s,o,a,t.mode,t.filter).then((function(t){return t.buffer})):n.ready.then((function(){const e=new ArrayBuffer(s*o);return n.decodeGltfBuffer(new Uint8Array(e),s,o,a,t.mode,t.filter),e}))}))}return null}}class E{constructor(t){this.name=a.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){const e=this.parser.json,r=e.nodes[t];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;const n=e.meshes[r.mesh];for(const t of n.primitives)if(t.mode!==P.TRIANGLES&&t.mode!==P.TRIANGLE_STRIP&&t.mode!==P.TRIANGLE_FAN&&void 0!==t.mode)return null;const s=r.extensions[this.name].attributes,o=[],a={};for(const t in s)o.push(this.parser.getDependency("accessor",s[t]).then((e=>(a[t]=e,a[t]))));return o.length<1?null:(o.push(this.parser.createNodeMesh(t)),Promise.all(o).then((t=>{const e=t.pop(),r=e.isGroup?e.children:[e],n=t[0].count,s=[];for(const t of r){const e=new i.Matrix4,r=new i.Vector3,o=new i.Quaternion,l=new i.Vector3(1,1,1),c=new i.InstancedMesh(t.geometry,t.material,n);for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new o,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,s=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=navigator.userAgent.indexOf("Firefox")>-1,s=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||n&&s<98?this.textureLoader=new i.TextureLoader(this.options.manager):this.textureLoader=new i.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new i.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const r=this,i=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(t){return t._markDefs&&t._markDefs()})),Promise.all(this._invokeAll((function(t){return t.beforeRoot&&t.beforeRoot()}))).then((function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])})).then((function(e){const s={scene:e[0][i.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:i.asset,parser:r,userData:{}};return G(n,s,i),Q(s,i),Promise.all(r._invokeAll((function(t){return t.afterRoot&&t.afterRoot(s)}))).then((function(){t(s)}))})).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[];for(let r=0,i=e.length;r{const r=this.associations.get(t);null!=r&&this.associations.set(e,r);for(const[r,i]of t.children.entries())n(i,e.children[r])};return n(r,i),i.name+="_instance_"+t.uses[e]++,i}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let r=0;r=2&&p.setY(e,u[t*o+1]),o>=3&&p.setZ(e,u[t*o+2]),o>=4&&p.setW(e,u[t*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(t){const e=this.json,r=this.options,i=e.textures[t].source,n=e.images[i];let s=this.textureLoader;if(n.uri){const t=r.manager.getHandler(n.uri);null!==t&&(s=t)}return this.loadTextureImage(t,i,s)}loadTextureImage(t,e,r){const n=this,s=this.json,o=s.textures[t],a=s.images[e],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(e,r).then((function(e){e.flipY=!1,e.name=o.name||a.name||"",""===e.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(e.name=a.uri);const r=(s.samplers||{})[o.sampler]||{};return e.magFilter=O[r.magFilter]||i.LinearFilter,e.minFilter=O[r.minFilter]||i.LinearMipmapLinearFilter,e.wrapS=k[r.wrapS]||i.RepeatWrapping,e.wrapT=k[r.wrapT]||i.RepeatWrapping,n.associations.set(e,{textures:t}),e})).catch((function(){return null}));return this.textureCache[l]=c,c}loadImageSource(t,e){const r=this.json,n=this.options;if(void 0!==this.sourceCache[t])return this.sourceCache[t].then((t=>t.clone()));const s=r.images[t],o=self.URL||self.webkitURL;let a=s.uri||"",l=!1;if(void 0!==s.bufferView)a=this.getDependency("bufferView",s.bufferView).then((function(t){l=!0;const e=new Blob([t],{type:s.mimeType});return a=o.createObjectURL(e),a}));else if(void 0===s.uri)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const c=Promise.resolve(a).then((function(t){return new Promise((function(r,s){let o=r;!0===e.isImageBitmapLoader&&(o=function(t){const e=new i.Texture(t);e.needsUpdate=!0,r(e)}),e.load(i.LoaderUtils.resolveURL(t,n.path),o,void 0,s)}))})).then((function(t){var e;return!0===l&&o.revokeObjectURL(a),t.userData.mimeType=s.mimeType||((e=s.uri).search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"),t})).catch((function(t){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),t}));return this.sourceCache[t]=c,c}assignTexture(t,e,r,i){const n=this;return this.getDependency("texture",r.index).then((function(s){if(!s)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((s=s.clone()).channel=r.texCoord),n.extensions[a.KHR_TEXTURE_TRANSFORM]){const t=void 0!==r.extensions?r.extensions[a.KHR_TEXTURE_TRANSFORM]:void 0;if(t){const e=n.associations.get(s);s=n.extensions[a.KHR_TEXTURE_TRANSFORM].extendTexture(s,t),n.associations.set(s,e)}}return void 0!==i&&(s.colorSpace=i),t[e]=s,s}))}assignFinalMaterial(t){const e=t.geometry;let r=t.material;const n=void 0===e.attributes.tangent,s=void 0!==e.attributes.color,o=void 0===e.attributes.normal;if(t.isPoints){const t="PointsMaterial:"+r.uuid;let e=this.cache.get(t);e||(e=new i.PointsMaterial,i.Material.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,e.sizeAttenuation=!1,this.cache.add(t,e)),r=e}else if(t.isLine){const t="LineBasicMaterial:"+r.uuid;let e=this.cache.get(t);e||(e=new i.LineBasicMaterial,i.Material.prototype.copy.call(e,r),e.color.copy(r.color),e.map=r.map,this.cache.add(t,e)),r=e}if(n||s||o){let t="ClonedMaterial:"+r.uuid+":";n&&(t+="derivative-tangents:"),s&&(t+="vertex-colors:"),o&&(t+="flat-shading:");let e=this.cache.get(t);e||(e=r.clone(),s&&(e.vertexColors=!0),o&&(e.flatShading=!0),n&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(t,e),this.associations.set(e,this.associations.get(r))),r=e}t.material=r}getMaterialType(){return i.MeshStandardMaterial}loadMaterial(t){const e=this,r=this.json,n=this.extensions,s=r.materials[t];let o;const l={},c=[];if((s.extensions||{})[a.KHR_MATERIALS_UNLIT]){const t=n[a.KHR_MATERIALS_UNLIT];o=t.getMaterialType(),c.push(t.extendParams(l,s,e))}else{const r=s.pbrMetallicRoughness||{};if(l.color=new i.Color(1,1,1),l.opacity=1,Array.isArray(r.baseColorFactor)){const t=r.baseColorFactor;l.color.setRGB(t[0],t[1],t[2],i.LinearSRGBColorSpace),l.opacity=t[3]}void 0!==r.baseColorTexture&&c.push(e.assignTexture(l,"map",r.baseColorTexture,i.SRGBColorSpace)),l.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,l.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(c.push(e.assignTexture(l,"metalnessMap",r.metallicRoughnessTexture)),c.push(e.assignTexture(l,"roughnessMap",r.metallicRoughnessTexture))),o=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),c.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,l)}))))}!0===s.doubleSided&&(l.side=i.DoubleSide);const h=s.alphaMode||"OPAQUE";if("BLEND"===h?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,"MASK"===h&&(l.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&o!==i.MeshBasicMaterial&&(c.push(e.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new i.Vector2(1,1),void 0!==s.normalTexture.scale)){const t=s.normalTexture.scale;l.normalScale.set(t,t)}if(void 0!==s.occlusionTexture&&o!==i.MeshBasicMaterial&&(c.push(e.assignTexture(l,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(l.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&o!==i.MeshBasicMaterial){const t=s.emissiveFactor;l.emissive=(new i.Color).setRGB(t[0],t[1],t[2],i.LinearSRGBColorSpace)}return void 0!==s.emissiveTexture&&o!==i.MeshBasicMaterial&&c.push(e.assignTexture(l,"emissiveMap",s.emissiveTexture,i.SRGBColorSpace)),Promise.all(c).then((function(){const r=new o(l);return s.name&&(r.name=s.name),Q(r,s),e.associations.set(r,{materials:t}),s.extensions&&G(n,r,s),r}))}createUniqueName(t){const e=i.PropertyBinding.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){const e=this,r=this.extensions,n=this.primitiveCache;function s(t){return r[a.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(r){return Y(r,t,e)}))}const o=[];for(let r=0,l=t.length;r0&&j(p,o),p.name=e.createUniqueName(o.name||"mesh_"+t),Q(p,o),d.extensions&&G(s,p,d),e.assignFinalMaterial(p),h.push(p)}for(let r=0,i=h.length;r1?new i.Group:1===e.length?e[0]:new i.Object3D,a!==e[0])for(let t=0,r=e.length;t{const e=new Map;for(const[t,r]of n.associations)(t instanceof i.Material||t instanceof i.Texture)&&e.set(t,r);return t.traverse((t=>{const r=n.associations.get(t);null!=r&&e.set(t,r)})),e})(s),s}))}_createAnimationTracks(t,e,r,n,s){const o=[],a=t.name?t.name:t.uuid,l=[];let c;switch(F[s.path]===F.weights?t.traverse((function(t){t.morphTargetInfluences&&l.push(t.name?t.name:t.uuid)})):l.push(a),F[s.path]){case F.weights:c=i.NumberKeyframeTrack;break;case F.rotation:c=i.QuaternionKeyframeTrack;break;case F.position:case F.scale:c=i.VectorKeyframeTrack;break;default:c=1===r.itemSize?i.NumberKeyframeTrack:i.VectorKeyframeTrack}const h=void 0!==n.interpolation?z[n.interpolation]:i.InterpolateLinear,u=this._getArrayFromAccessor(r);for(let t=0,r=l.length;t{this.parse(t,e,n)}),r,n)}parse(t,e,r){this.decodeDracoFile(t,e,null,null,i.SRGBColorSpace).catch(r)}decodeDracoFile(t,e,r,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.LinearSRGBColorSpace;const o={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r,vertexColorSpace:s};return this.decodeGeometry(t,o).then(e)}decodeGeometry(t,e){const r=JSON.stringify(e);if(X.has(t)){const e=X.get(t);if(e.key===r)return e.promise;if(0===t.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const n=this.workerNextTaskID++,s=t.byteLength,o=this._getWorker(n,s).then((r=>(i=r,new Promise(((r,s)=>{i._callbacks[n]={resolve:r,reject:s},i.postMessage({type:"decode",id:n,taskConfig:e,buffer:t},[t])}))))).then((t=>this._createGeometry(t.geometry)));return o.catch((()=>!0)).then((()=>{i&&n&&this._releaseTask(i,n)})),X.set(t,{key:r,promise:o}),o}_createGeometry(t){const e=new i.BufferGeometry;t.index&&e.setIndex(new i.BufferAttribute(t.index.array,1));for(let r=0;r{r.load(t,e,void 0,i)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const t="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,e=[];return t?e.push(this._loadLibrary("draco_decoder.js","text")):(e.push(this._loadLibrary("draco_wasm_wrapper.js","text")),e.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(e).then((e=>{const r=e[0];t||(this.decoderConfig.wasmBinary=e[1]);const i=K.toString(),n=["/* draco decoder */",r,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))})),this.decoderPending}_getWorker(t,e){return this._initDecoder().then((()=>{if(this.workerPool.lengthe._taskLoad?-1:1}));const r=this.workerPool[this.workerPool.length-1];return r._taskCosts[t]=e,r._taskLoad+=e,r}))}_releaseTask(t,e){t._taskLoad-=t._taskCosts[e],delete t._callbacks[e],delete t._taskCosts[e]}debug(){console.log("Task load: ",this.workerPool.map((t=>t._taskLoad)))}dispose(){for(let t=0;t{const e=t.draco,o=new e.Decoder;try{const t=function(t,e,i,n){const s=n.attributeIDs,o=n.attributeTypes;let a,l;const c=e.GetEncodedGeometryType(i);if(c===t.TRIANGULAR_MESH)a=new t.Mesh,l=e.DecodeArrayToMesh(i,i.byteLength,a);else{if(c!==t.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new t.PointCloud,l=e.DecodeArrayToPointCloud(i,i.byteLength,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const i in s){const l=self[o[i]];let c,u;if(n.useUniqueIDs)u=s[i],c=e.GetAttributeByUniqueId(a,u);else{if(u=e.GetAttributeId(a,t[s[i]]),-1===u)continue;c=e.GetAttribute(a,u)}const d=r(t,e,a,i,l,c);"color"===i&&(d.vertexColorSpace=n.vertexColorSpace),h.attributes.push(d)}return c===t.TRIANGULAR_MESH&&(h.index=function(t,e,r){const i=3*r.num_faces(),n=4*i,s=t._malloc(n);e.GetTrianglesUInt32Array(r,n,s);const o=new Uint32Array(t.HEAPF32.buffer,s,i).slice();return t._free(s),{array:o,itemSize:1}}(t,e,a)),t.destroy(a),h}(e,o,new Int8Array(i),s),a=t.attributes.map((t=>t.array.buffer));t.index&&a.push(t.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:t},a)}catch(t){console.error(t),self.postMessage({type:"error",id:n.id,error:t.message})}finally{e.destroy(o)}}))}}}class ${constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;this.pool=t,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(t){if(!this.workers[t]){const e=this.workerCreator();e.addEventListener("message",this._onMessage.bind(this,t)),this.workers[t]=e}}_getIdleWorker(){for(let t=0;t{const i=this._getIdleWorker();-1!==i?(this._initWorker(i),this.workerStatus|=1<t.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}class tt{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class et{constructor(t,e,r,i){this._dataView=new DataView(t.buffer,t.byteOffset+e,r),this._littleEndian=i,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_nextInt32(){const t=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,t}_skip(t){return this._offset+=t,this}_scan(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==e&&it.arrayBuffer())).then((t=>WebAssembly.instantiate(t,at))).then(this._init):WebAssembly.instantiate(Buffer.from(ct,"base64"),at).then(this._init),nt)}_init(t){st=t.instance,at.env.emscripten_notify_memory_growth(0)}decode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!st)throw new Error("ZSTDDecoder: Await .init() before decoding.");const r=t.byteLength,i=st.exports.malloc(r);ot.set(t,i),e=e||Number(st.exports.ZSTD_findDecompressedSize(i,r));const n=st.exports.malloc(e),s=st.exports.ZSTD_decompress(n,e,i,r),o=ot.slice(n,n+s);return st.exports.free(i),st.exports.free(n),o}}const ct="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",ht=new WeakMap;let ut,dt=0;class pt extends i.Loader{constructor(t){super(t),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new $,this.workerSourceURL="",this.workerConfig=null,"undefined"!=typeof MSC_TRANSCODER&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(t){return this.transcoderPath=t,this}setWorkerLimit(t){return this.workerPool.setWorkerLimit(t),this}detectSupport(t){return!0===t.isWebGPURenderer?this.workerConfig={astcSupported:t.hasFeature("texture-compression-astc"),etc1Supported:!1,etc2Supported:t.hasFeature("texture-compression-etc2"),dxtSupported:t.hasFeature("texture-compression-bc"),bptcSupported:!1,pvrtcSupported:!1}:(this.workerConfig={astcSupported:t.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:t.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:t.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:t.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:t.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:t.extensions.has("WEBGL_compressed_texture_pvrtc")||t.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},t.capabilities.isWebGL2&&(this.workerConfig.etc1Supported=!1)),this}init(){if(!this.transcoderPending){const t=new i.FileLoader(this.manager);t.setPath(this.transcoderPath),t.setWithCredentials(this.withCredentials);const e=t.loadAsync("basis_transcoder.js"),r=new i.FileLoader(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);const n=r.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([e,n]).then((t=>{let[e,r]=t;const i=pt.BasisWorker.toString(),n=["/* constants */","let _EngineFormat = "+JSON.stringify(pt.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(pt.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(pt.BasisFormat),"/* basis_transcoder.js */",e,"/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n])),this.transcoderBinary=r,this.workerPool.setWorkerCreator((()=>{const t=new Worker(this.workerSourceURL),e=this.transcoderBinary.slice(0);return t.postMessage({type:"init",config:this.workerConfig,transcoderBinary:e},[e]),t}))})),dt>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),dt++}return this.transcoderPending}load(t,e,r,n){if(null===this.workerConfig)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new i.FileLoader(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(t,(t=>{if(ht.has(t))return ht.get(t).promise.then(e).catch(n);this._createTexture(t).then((t=>e?e(t):null)).catch(n)}),r,n)}_createTextureFrom(t,e){const{faces:r,width:n,height:s,format:o,type:a,error:l,dfdFlags:c}=t;if("error"===a)return Promise.reject(l);let h;if(6===e.faceCount)h=new i.CompressedCubeTexture(r,o,i.UnsignedByteType);else{const t=r[0].mipmaps;h=e.layerCount>1?new i.CompressedArrayTexture(t,n,s,e.layerCount,o,i.UnsignedByteType):new i.CompressedTexture(t,n,s,o,i.UnsignedByteType)}return h.minFilter=1===r[0].mipmaps.length?i.LinearFilter:i.LinearMipmapLinearFilter,h.magFilter=i.LinearFilter,h.generateMipmaps=!1,h.needsUpdate=!0,h.colorSpace=At(e),h.premultiplyAlpha=!!(1&c),h}async _createTexture(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(t){const e=new Uint8Array(t.buffer,t.byteOffset,rt.length);if(e[0]!==rt[0]||e[1]!==rt[1]||e[2]!==rt[2]||e[3]!==rt[3]||e[4]!==rt[4]||e[5]!==rt[5]||e[6]!==rt[6]||e[7]!==rt[7]||e[8]!==rt[8]||e[9]!==rt[9]||e[10]!==rt[10]||e[11]!==rt[11])throw new Error("Missing KTX 2.0 identifier.");const r=new tt,i=17*Uint32Array.BYTES_PER_ELEMENT,n=new et(t,rt.length,i,!0);r.vkFormat=n._nextUint32(),r.typeSize=n._nextUint32(),r.pixelWidth=n._nextUint32(),r.pixelHeight=n._nextUint32(),r.pixelDepth=n._nextUint32(),r.layerCount=n._nextUint32(),r.faceCount=n._nextUint32();const s=n._nextUint32();r.supercompressionScheme=n._nextUint32();const o=n._nextUint32(),a=n._nextUint32(),l=n._nextUint32(),c=n._nextUint32(),h=n._nextUint64(),u=n._nextUint64(),d=new et(t,rt.length+i,3*s*8,!0);for(let e=0;e{const e=new lt;await e.init(),t(e)}))),r=await ut);const n=[];for(let s=0;s>s),a=Math.max(1,t.pixelHeight>>s),l=t.pixelDepth?Math.max(1,t.pixelDepth>>s):0,c=t.levels[s];let h,u;if(0===t.supercompressionScheme)h=c.levelData;else{if(2!==t.supercompressionScheme)throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");h=r.decode(c.levelData,c.uncompressedByteLength)}u=gt[e]===i.FloatType?new Float32Array(h.buffer,h.byteOffset,h.byteLength/Float32Array.BYTES_PER_ELEMENT):gt[e]===i.HalfFloatType?new Uint16Array(h.buffer,h.byteOffset,h.byteLength/Uint16Array.BYTES_PER_ELEMENT):h,n.push({data:u,width:o,height:a,depth:l})}let s;if(ft.has(mt[e]))s=0===t.pixelDepth?new i.DataTexture(n[0].data,t.pixelWidth,t.pixelHeight):new i.Data3DTexture(n[0].data,t.pixelWidth,t.pixelHeight,t.pixelDepth);else{if(t.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");s=new i.CompressedTexture(n,t.pixelWidth,t.pixelHeight)}return s.mipmaps=n,s.type=gt[e],s.format=mt[e],s.colorSpace=At(t),s.needsUpdate=!0,Promise.resolve(s)}(r);const n=this.init().then((()=>this.workerPool.postMessage({type:"transcode",buffer:t,taskConfig:e},[t]))).then((t=>this._createTextureFrom(t.data,r)));return ht.set(t,{promise:n}),n}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),dt--,this}}pt.BasisFormat={ETC1S:0,UASTC_4x4:1},pt.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},pt.EngineFormat={RGBAFormat:i.RGBAFormat,RGBA_ASTC_4x4_Format:i.RGBA_ASTC_4x4_Format,RGBA_BPTC_Format:i.RGBA_BPTC_Format,RGBA_ETC2_EAC_Format:i.RGBA_ETC2_EAC_Format,RGBA_PVRTC_4BPPV1_Format:i.RGBA_PVRTC_4BPPV1_Format,RGBA_S3TC_DXT5_Format:i.RGBA_S3TC_DXT5_Format,RGB_ETC1_Format:i.RGB_ETC1_Format,RGB_ETC2_Format:i.RGB_ETC2_Format,RGB_PVRTC_4BPPV1_Format:i.RGB_PVRTC_4BPPV1_Format,RGB_S3TC_DXT1_Format:i.RGB_S3TC_DXT1_Format},pt.BasisWorker=function(){let t,e,r;const i=_EngineFormat,n=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",(function(o){const u=o.data;switch(u.type){case"init":t=u.config,d=u.transcoderBinary,e=new Promise((t=>{r={wasmBinary:d,onRuntimeInitialized:t},BASIS(r)})).then((()=>{r.initializeBasis(),void 0===r.KTX2File&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")}));break;case"transcode":e.then((()=>{try{const{faces:e,buffers:o,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g}=function(e){const o=new r.KTX2File(new Uint8Array(e));function u(){o.close(),o.delete()}if(!o.isValid())throw u(),new Error("THREE.KTX2Loader:\tInvalid or unsupported .ktx2 file");const d=o.isUASTC()?s.UASTC_4x4:s.ETC1S,p=o.getWidth(),f=o.getHeight(),m=o.getLayers()||1,g=o.getLevels(),A=o.getFaces(),y=o.getHasAlpha(),v=o.getDFDFlags(),{transcoderFormat:x,engineFormat:b}=function(e,r,o,h){let u,d;const p=e===s.ETC1S?a:l;for(let i=0;i1?(n=a.origWidth,s=a.origHeight):(n=a.width,s=a.height);const l=new Uint8Array(o.getImageTranscodedSizeInBytes(r,e,0,x));if(!o.transcodeImage(l,r,e,t,x,0,-1,-1))throw u(),new Error("THREE.KTX2Loader: .transcodeImage failed.");i.push(l)}const a=h(i);e.push({data:a,width:n,height:s}),w.push(a.buffer)}_.push({mipmaps:e,width:p,height:f,format:b})}return u(),{faces:_,buffers:w,width:p,height:f,hasAlpha:y,format:b,dfdFlags:v}}(u.buffer);self.postMessage({type:"transcode",id:u.id,faces:e,width:d,height:p,hasAlpha:f,format:m,dfdFlags:g},o)}catch(t){console.error(t),self.postMessage({type:"error",id:u.id,error:t.message})}}))}var d}));const o=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[n.ASTC_4x4,n.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.BC7_M5,n.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.BC1,n.BC3],engineFormat:[i.RGB_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.ETC1,n.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.ETC1],engineFormat:[i.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[n.PVRTC1_4_RGB,n.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],a=o.sort((function(t,e){return t.priorityETC1S-e.priorityETC1S})),l=o.sort((function(t,e){return t.priorityUASTC-e.priorityUASTC}));function c(t){return t<=2||0==(t&t-1)&&0!==t}function h(t){if(1===t.length)return t[0];let e=0;for(let r=0;r=0&&(c[n.KHR_MATERIALS_COMMON]=new s(h)),new C(h,c,{crossOrigin:this.crossOrigin,manager:this.manager,path:e||this.resourcePath||""}).parse((function(t,e,i,n){r({scene:t,scenes:e,cameras:i,animations:n})}))}}function e(){var t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}},update:function(e,r){for(var i in t){var n=t[i];n.update&&n.update(e,r)}}}}function r(t,e){var r={},n=t.material.uniforms;for(var s in n){var o=n[s];if(o.semantic){var a=o.node,l=t;a&&(l=e[a]),r[s]={semantic:o.semantic,sourceNode:l,targetNode:t,uniform:o}}}this.boundUniforms=r,this._m4=new i.Matrix4}t.Shaders={update:function(){console.warn("threeExamples.LegacyGLTFLoader.Shaders has been deprecated, and now updates automatically.")}},r.prototype.update=function(t,e){var r=this.boundUniforms;for(var i in r){var n=r[i];switch(n.semantic){case"MODELVIEW":n.uniform.value.multiplyMatrices(e.matrixWorldInverse,n.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var s=n.uniform.value;this._m4.multiplyMatrices(e.matrixWorldInverse,n.sourceNode.matrixWorld),s.getNormalMatrix(this._m4);break;case"PROJECTION":n.uniform.value.copy(e.projectionMatrix);break;case"JOINTMATRIX":for(var o=n.uniform.value,a=0;anew Promise(((r,i)=>{if(!t||!e)return void i(new Error("[GLTFParser]: Buffer and path are mandatory to parse a glTF."));const n=t=>{t.scene.applyMatrix4(xt),r(t)},s=t=>{i(new Error(`[GLTFParser]: Failed to parse gltf with error: ${t}`))};1===new DataView(t,0,20).getUint32(4,!0)?_t.parse(t,e,n,s):bt.parse(t,e,n,s)}))}},15344:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>a,h8:()=>o});var i=r(99477),n=r(2362),s=r(71440);const o=8,a={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=e.in.dataType||"float";if(!["float","double"].includes(r))throw new Error("`dataType` parameter is incorrect for GTXParser.parse method. This parameter must be either `double` or `float`.");const a=new DataView(t,0,40),l={minX:a.getFloat64(8),minY:a.getFloat64(0),stepX:a.getFloat64(24),stepY:a.getFloat64(16),nColumns:a.getInt32(36),nRows:a.getInt32(32)},c=new DataView(t,40),h=l.minX+l.stepX*(l.nColumns-1),u=l.minY+l.stepY*(l.nRows-1),d=new s.ZP(e.in.crs||"EPSG:4326",l.minX,h,l.minY,u),p=new i.Vector2(l.stepX,l.stepY);return Promise.resolve(new n.Z(d,p,((t,e)=>"float"===r?c.getFloat32(4*(l.nColumns*t+e)):"double"===r?c.getFloat64((l.nColumns*t+e)*o):void 0)))}}},12679:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(62310),n=r(5167),s=r(53175);const o=new i.Z("EPSG:4978",0,0,0),a=new i.Z("EPSG:4978",0,0,0),l=new i.Z("EPSG:4978",0,0,0),c=(t,e,r)=>(o.crs=r,o.setFromArray(e[0]),!t.isPointInside(o)),h={populateGeometry(t,e,r,i){r.startSubGeometry(e.length,i),o.crs=t;for(const t of e)o.setFromValues(t[0],t[1],t[2]),r.pushCoordinates(i,o);r.updateExtent()},populateGeometryWithCCW(t,e,r,i){r.startSubGeometry(e.length,i),o.crs=t;let n=0;l.setFromValues(e[0][0],e[0][1],e[0][2]),a.copy(l);for(let t=0;tvoid 0===t||Array.isArray(t)&&!isNaN(t[0])?t:d(t[0]);function p(t,e,r){var i,s;if(null===(i=e.geometry)||void 0===i||!i.type)return console.warn("No geometry provided"),null;const o=e.geometry.type.toLowerCase(),a=function(t){switch(t){case"point":case"multipoint":return n.tg.POINT;case"linestring":case"multilinestring":return n.tg.LINE;case"polygon":case"multipolygon":return n.tg.POLYGON;default:throw new Error(`Unhandled geometry type ${t}`)}}(o),l=r.requestFeatureByType(a),c="point"!=o?e.geometry.coordinates:[e.geometry.coordinates],p=e.properties||{};l.hasRawElevationData=3===(null===(s=d(c))||void 0===s?void 0:s.length);for(const t of Object.keys(e))u.includes(t.toLowerCase())||(p.geojson=p.geojson||{},p.geojson[t]=e[t]);return function(t,e,r,i,n,s){if(0!=i.length)switch(t){case"point":case"linestring":return h.default(e,r,i,n,s);case"multipoint":return h.multi("point",e,r,i,n,s);case"multilinestring":return h.multi("default",e,r,i,n,s);case"polygon":return h.polygon(e,r,i,n,s);case"multipolygon":return h.multi("polygon",e,r,i,n,s);default:throw new Error(`Unhandled geojson type ${e.type}`)}}(o,l,t,c,r,p),l}function f(t,e,r){const i=new n.t1(r),s=r.filter||(()=>!0);for(const r of e)s(r.properties,r.geometry)&&p(t,r,i);return i.removeEmptyFeature(),i.updateExtent(),i}const m={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=(0,s._F)(e),e.in=e.in||{};const r=e.out,i=e.in;switch("string"==typeof t&&(t=JSON.parse(t)),i.crs=i.crs||function(t){if(t.crs){if("epsg"==t.crs.type.toLowerCase())return`EPSG:${t.crs.properties.code}`;if("name"==t.crs.type.toLowerCase()){if(t.crs.properties.name.toLowerCase().includes("epsg:")){const e=t.crs.properties.name.lastIndexOf(":");if(e>0)return`EPSG:${t.crs.properties.name.substr(e+1)}`}throw new Error(`Unsupported CRS authority '${t.crs.properties.name}'`)}throw new Error(`Unsupported CRS type '${t.crs}'`)}return"EPSG:4326"}(t),r.filteringExtent&&("boolean"==typeof r.filteringExtent?r.filterExtent=e.extent.as(i.crs):r.filteringExtent.isExtent&&(r.filterExtent=r.filteringExtent)),t.type.toLowerCase()){case"featurecollection":return Promise.resolve(f(i.crs,t.features,r));case"feature":return Promise.resolve(f(i.crs,[t],r));default:throw new Error(`Unsupported GeoJSON type: '${t.type}`)}}}},50810:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(75153),n=r(12679),s=r(53175);const o={parse:(t,e)=>(e=(0,s._F)(e),n.Z.parse((0,i.ng)(t),e))}},4090:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(99477),n=r(2362),s=r(71440),o=r(84612),a=r(15344);const l={parse(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{in:{}};const r=t.split("\n"),l=r.indexOf(r.find((t=>t.includes("end_of_head"))))+1,c=r.slice(0,l),h={minX:(0,o.S)(c,"lon min"),maxX:(0,o.S)(c,"lon max"),minY:(0,o.S)(c,"lat min"),maxY:(0,o.S)(c,"lat max"),stepX:(0,o.S)(c,"delta lon"),stepY:(0,o.S)(c,"delta lat"),nRows:(0,o.S)(c,"nrows"),nColumns:(0,o.S)(c,"ncols")},u=new DataView(new ArrayBuffer(a.h8*h.nRows*h.nColumns));let d=0;for(let t of r.slice(l,r.length))if(t=t.split(" ").filter((t=>""!==t)),t.length)for(const e of t)u.setFloat64(d*a.h8,parseFloat(e)),d++;const p=new s.ZP(e.in.crs||"EPSG:4326",h.minX+h.stepX/2,h.maxX-h.stepX/2,h.minY+h.stepY/2,h.maxY-h.stepY/2),f=new i.Vector2(h.stepX,h.stepY);return Promise.resolve(new n.Z(p,f,((t,e)=>u.getFloat64((h.nColumns*t+e)*a.h8))))}}},56178:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var i=r(75153),n=r(12679),s=r(53175);const o={parse:(t,e)=>(e=(0,s._F)(e),n.Z.parse((0,i.DS)(t),e))}},66014:(t,e,r)=>{"use strict";r.d(e,{SR:()=>m,SY:()=>d,Ti:()=>y,Y0:()=>v,y:()=>h});var i=r(99477),n=r(70991),s=r(39865),o=r(11707);function a(t,e,r,i,n,s){const a={view:t,requester:n,layer:r,priority:n?1/(n.distance+1):100,metadata:i,redraw:s};return r.dispatchEvent({type:o.y.ON_TILE_REQUESTED,metadata:i}),e.execute(a)}function l(t){return t.children.filter((e=>e.layer==t.layer&&e.tileId))}const c=new i.Matrix4;function h(t,e,r,i){return!(!r.viewerRequestVolume||!r.viewerRequestVolume.viewerRequestVolumeCulling(e,i))||!(!r.boundingVolume||!r.boundingVolume.boundingVolumeCulling(e,i))}function u(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=e.additiveRefinement||r>0;for(let s=0;sthis.cleanupDelay){this.root.cleanableSince=void 0;let e=0;for(;ethis.cleanupDelay))break;u(this,r)}this._cleanableTiles.splice(0,e)}return[this.root]}const p=new i.Box3,f=new i.Sphere;function m(t,e,r,i){return a(t,e,r,i,void 0,!0).then((t=>{r.object3d.add(t),t.updateMatrixWorld(),r.tileset.tiles[t.tileId].loaded=!0,r.root=t,r.onTileContentLoaded(t)}))}function g(t,e){t.content&&(t.content.visible=e)}function A(t,e){e.cleanableSince||(e.cleanableSince=Date.now(),t._cleanableTiles.push(e))}function y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v;return function(r,i,n){if(n.parent.pendingSubdivision&&!n.parent.additiveRefinement)return void(n.visible=!1);const s=!t||!t(i,r.camera,n,n.matrixWorld);if(n.visible=s,s){let s;if(n.cleanableSince&&(i._cleanableTiles.splice(i._cleanableTiles.indexOf(n),1),n.cleanableSince=void 0),n.pendingSubdivision||e(r,i,n))(function(t,e,r,i){r.additiveRefinement?function(t,e,r,i){for(const n of e.tileset.tiles[r.tileId].children){if(n.promise||n.loaded)continue;let s=r.matrixWorld;n.transform&&(s=c.multiplyMatrices(r.matrixWorld,n.transform)),(!i||!i(e,t.camera,n,s))&&(n.promise=a(t.view,t.scheduler,e,n,r,!0).then((i=>{r.add(i),i.updateMatrixWorld(),e.onTileContentLoaded(i),t.view.notifyChange(n),n.loaded=!0,delete n.promise})))}}(t,e,r,i):function(t,e,r){if(!r.pendingSubdivision&&0==l(r).length){const i=e.tileset.tiles[r.tileId].children;if(void 0===i||0===i.length)return;r.pendingSubdivision=!0;const n=[];for(let s=0;s{i[s].loaded=!0,r.add(n),n.updateMatrixWorld(),r.additiveRefinement&&t.view.notifyChange(r),e.tileset.tiles[n.tileId].loaded=!0,e.onTileContentLoaded(n)})));Promise.all(n).then((()=>{r.pendingSubdivision=!1,t.view.notifyChange(r)}))}}(t,e,r)})(r,i,n,t),g(n,n.pendingSubdivision||n.additiveRefinement),s=l(n);else{g(n,!0);for(const t of l(n))t.visible=!1,A(i,t)}return s}A(i,n)}}function v(t,e,r){if(void 0===e.tileset.tiles[r.tileId].children)return!1;if(e.tileset.tiles[r.tileId].isTileset)return!0;const i=function(t,e){if(e.distance=0,e.boundingVolume.initialVolumeType===s.D.box)p.copy(e.boundingVolume.volume),p.applyMatrix4(e.matrixWorld),e.distance=p.distanceToPoint(t.camera3D.position);else{if(e.boundingVolume.initialVolumeType!==s.D.sphere&&e.boundingVolume.initialVolumeType!==s.D.region)return 1/0;f.copy(e.boundingVolume.volume),f.applyMatrix4(e.matrixWorld),e.distance=Math.max(0,f.distanceToPoint(t.camera3D.position))}return 0===e.distance?1/0:t._preSSE*(e.geometricError/e.distance)}(t.camera,r);return i>e.sseThreshold}},81189:(t,e,r)=>{"use strict";r.d(e,{U8:()=>u,XP:()=>c,kE:()=>o,pN:()=>h});var i=r(60465),n=r(81590),s=r(79159);const o=131072**.5;function a(t){return!(t.requester.parent&&t.requester.material&&!(t.layer.isElevationLayer&&t.requester.material.getElevationLayer()&&t.targetLevel<=t.requester.material.getElevationLayer().level)&&t.requester.layerUpdateState[t.layer.id]&&t.layer.source._featuresCaches[t.layer.crs]&&t.requester.material.visible)}function l(t,e,r,i,n){return{view:t,layer:e,extentsSource:r,extentsDestination:i,requester:n,priority:(s=n.material,s.visible?100:10),earlyDropFunction:a};var s}function c(t,e,r,o){const a=r.material;if(!o||!a)return;const c=r.getExtentsByProjection(e.crs),h=c[0].zoom;if(h>e.zoom.max||h=e.source.zoom.min)return void t.view.notifyChange(r,!1)}if(!a.visible)return;if(!e.visible||!r.layerUpdateState[e.id].canTryUpdate())return;if(u.level>=c[0].zoom)return void r.layerUpdateState[e.id].noMoreUpdatePossible();if(e.frozen)return;const p=r.layerUpdateState[e.id].failureParams,f=c[0].zoom||r.level,m=(0,i.k5)(e.updateStrategy.type,r,f,u.level,e,p);if(!e.source.isVectorSource&&m<=u.level||m>f)return void(p.lowestLevelError!=1/0&&r.layerUpdateState[e.id].noMoreUpdatePossible());if(!e.source.extentInsideLimit(r.extent,m))return r.layerUpdateState[e.id].noData({targetLevel:m}),void t.view.notifyChange(r,!1);const g=c.map((t=>t.tiledExtentParent(m)));r.layerUpdateState[e.id].newTry();const A=l(t.view,e,g,c,r);return t.scheduler.execute(A).then((t=>{if(!r.layerUpdateState[e.id])return;const i=c.map(((e,r)=>e.offsetToParent(t[r].extent,u.offsetScales[r])));u.setTextures(t,i),r.layerUpdateState[e.id].success()}),(i=>(0,s.Z)(i,r,e,m,t.view)))}function h(t,e,r,o){const a=r.material;if(!o||!a)return;const c=r.getExtentsByProjection(e.crs),h=c[0].zoom;if(h>e.zoom.max||h=e.source.zoom.min)return void t.view.notifyChange(r,!1)}if(e.frozen||!a.visible||!r.layerUpdateState[e.id].canTryUpdate())return;const p=r.layerUpdateState[e.id].failureParams,f=(0,i.k5)(e.updateStrategy.type,r,c[0].zoom,u.level,e,p);if(f<=u.level||f>c[0].zoom)return void r.layerUpdateState[e.id].noMoreUpdatePossible();if(!e.source.extentInsideLimit(r.extent,f))return r.layerUpdateState[e.id].noData({targetLevel:f}),void t.view.notifyChange(r,!1);const m=c.map((t=>t.tiledExtentParent(f)));r.layerUpdateState[e.id].newTry();const g=l(t.view,e,m,c,r);return t.scheduler.execute(g).then((t=>{if(!r.layerUpdateState[e.id])return;if(f<=u.level)return void r.layerUpdateState[e.id].noMoreUpdatePossible();const i=c.map(((e,r)=>e.offsetToParent(t[r].extent,u.offsetScales[r])));u.setTextures(t,i),r.layerUpdateState[e.id].success()}),(i=>(0,s.Z)(i,r,e,f,t.view)))}function u(t){return function(e){var r;null!==(r=e.material)&&void 0!==r&&r.removeLayer&&(e.material.elevationLayerIds.indexOf(t)>-1&&e.setBBoxZ({min:0,max:0}),e.material.removeLayer(t)),e.layerUpdateState&&e.layerUpdateState[t]&&delete e.layerUpdateState[t]}}},70991:(t,e,r)=>{"use strict";function i(t){t.dispose();for(const e of Object.keys(t)){const r=t[e];r&&r.isTexture&&r.dispose()}}r.d(e,{Z:()=>n});const n={cleanup(t){if(t.layer=null,t.isScene||"function"!=typeof t.dispose){if(t.geometry&&t.geometry.dispose(),t.material)if(Array.isArray(t.material))for(const e of t.material)i(e);else i(t.material);t.dispatchEvent({type:"dispose"})}else t.dispose()},removeChildren(t,e){const r=e.children.filter((e=>(e.layer&&e.layer.id)===t.id));return e.remove(...r),r},removeChildrenAndCleanup(t,e){const r=e.children.filter((e=>(e.layer&&e.layer.id)===t.id));return e.remove(...r),e.layer===t&&this.cleanup(e),r},removeChildrenAndCleanupRecursively(t,e){let r=e.children.filter((e=>e.layer&&e.layer.id===t.id));const i=e.link&&e.link[t.id];null!=i&&i.children.length&&(r=r.concat(i.children),delete e.link[t.id]);for(const e of r)this.removeChildrenAndCleanupRecursively(t,e);return e.remove(...r),e.layer&&e.layer.id===t.id&&this.cleanup(e),r}}},79159:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i=4;function n(t,e,r,n,s){if(e.layerUpdateState[r.id])if(t.isCancelledCommandException)e.layerUpdateState[r.id].success();else if(t instanceof SyntaxError)e.layerUpdateState[r.id].failure(0,!0);else{const t=e.layerUpdateState[r.id].errorCount>i;e.layerUpdateState[r.id].failure(Date.now(),t,{targetLevel:n}),t||window.setTimeout((()=>{s.notifyChange(e,!1)}),1e3*e.layerUpdateState[r.id].secondsUntilNextTry())}}},45340:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var i=r(99477);const n=new i.TextureLoader;function s(t){if(!t.ok){const e=new Error(`Error loading ${t.url}: status ${t.status}`);throw e.response=t,e}}const o=function(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.arrayBuffer())))},a={text(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.text())))},json(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.json())))},xml(t){return fetch(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>(s(t),t.text()))).then((t=>(new window.DOMParser).parseFromString(t,"text/xml")))},texture(t){let e,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.crossOrigin=i.crossOrigin;const s=new Promise(((t,i)=>{e=t,r=i}));return n.load(t,e,(()=>{}),r),s},arrayBuffer:o,textureFloat(t){return o(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).then((t=>{const e=function(t){const e=new i.DataTexture(t,256,256,i.RedFormat,i.FloatType);return e.internalFormat="R32F",e.needsUpdate=!0,e}(new Float32Array(t));return e}))},multiple(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[];let n;for(const s in e){if(!this[s])throw new Error(`${s} is not a valid Fetcher method.`);for(const o of e[s])n=`${t}.${o}`,i.push(this[s](n,r).then((t=>({type:o,result:t}))))}return Promise.all(i).then((t=>{const e={};for(const r of t)e[r.type]=r.result;return Promise.resolve(e)}))},get(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const[e,r]=t.split("/");switch(e){case"application":switch(r){case"geo+json":case"json":return this.json;case"kml":case"gpx":return this.xml;case"x-protobuf;type=mapbox-vector":case"gtx":return this.arrayBuffer;default:return this.text}case"image":return"x-bil;bits=32"===r?this.textureFloat:this.texture;default:return this.texture}}}},4380:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});const i=new(r(71440).ZP)("EPSG:4326",[0,0,0,0]);let n=0;function s(t){const e=/\$\{u:([\w-_.|]+)\}/.exec(t);if(!e)return t;const r=e[1].split("|");return t.replace(e[0],r[n++%r.length])}const o={subDomains:s,xyz:function(t,e){return s(e.url.replace(/(\$\{z\}|%TILEMATRIX)/,e.tileMatrixCallback(t.zoom)).replace(/(\$\{y\}|%ROW)/,t.row).replace(/(\$\{x\}|%COL)/,t.col))},bbox:function(t,e){let r="EPSG:4326"==e.crs?9:2;void 0!==e.bboxDigits&&(r=e.bboxDigits),t.as(e.crs,i);const n=i.west.toFixed(r),o=i.south.toFixed(r),a=i.east.toFixed(r),l=i.north.toFixed(r);let c=e.axisOrder||"wsen";return c=c.replace("w",`${n},`).replace("s",`${o},`).replace("e",`${a},`).replace("n",`${l},`).slice(0,-1),s(e.url.replace("%bbox",c))}}},232:(t,e,r)=>{"use strict";r.d(e,{P:()=>o,Z:()=>u});var i=r(99477),n=r(62310),s=r(86541);const o={PERSPECTIVE:0,ORTHOGRAPHIC:1},a={frustum:new i.Frustum,matrix:new i.Matrix4,box3:new i.Box3},l=new i.Box3(new i.Vector3(-1,-1,-1),new i.Vector3(1,1,1));function c(t,e,r){if(t.camera3D.isOrthographicCamera)t._preSSE=e;else{const n=i.MathUtils.degToRad(r);t._preSSE=e/(2*Math.tan(.5*n))}}const h=[new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3,new i.Vector3],u=class{#B=!0;#L=new i.Matrix4;constructor(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(this.crs=t,n.isCamera)console.warn("options.camera parameter is deprecated. Use options.camera.cameraThree to place a custom camera as a parameter. See the documentation of Camera."),this.camera3D=n;else if(n.cameraThree)this.camera3D=n.cameraThree;else switch(n.type){case o.ORTHOGRAPHIC:this.camera3D=new i.OrthographicCamera;break;case o.PERSPECTIVE:default:this.camera3D=new i.PerspectiveCamera(30)}if(this.camera3D.aspect=this.camera3D.aspect??1,this.width=e,this.height=r,this.resize(e,r),this._preSSE=1/0,this.camera3D.isPerspectiveCamera){let t=this.camera3D.fov;Object.defineProperty(this.camera3D,"fov",{get:()=>t,set:e=>{t=e,c(this,this.height,t)}})}}resize(t,e){if(!t||t<=0||!e||e<=0)return void console.warn(`Trying to resize the Camera with invalid height (${e}) or width (${t}). Skipping resize.`);const r=t/e;if(this.camera3D.aspect!==r){if(this.camera3D.isOrthographicCamera){this.camera3D.zoom*=this.width/t;const e=this.camera3D.top*this.camera3D.aspect/r;this.camera3D.bottom=-e,this.camera3D.top=e}else this.camera3D.isPerspectiveCamera&&(this.camera3D.fov=2*i.MathUtils.radToDeg(Math.atan(e/this.height*Math.tan(i.MathUtils.degToRad(this.camera3D.fov)/2))));this.camera3D.aspect=r}this.width=t,this.height=e,c(this,this.height,this.camera3D.fov),this.camera3D.updateProjectionMatrix&&(this.camera3D.updateProjectionMatrix(),this.#B=!0)}update(){this.camera3D.updateMatrixWorld(),this.#B=!0}position(t){return new n.Z(this.crs,this.camera3D.position).as(t||this.crs)}setPosition(t){this.camera3D.position.copy(t.as(this.crs))}isBox3Visible(t,e){return this.box3SizeOnScreen(t,e).intersectsBox(l)}isSphereVisible(t,e){return this.#B&&(this.#L.multiplyMatrices(this.camera3D.projectionMatrix,this.camera3D.matrixWorldInverse),this.#B=!1),e?(a.matrix.multiplyMatrices(this.#L,e),a.frustum.setFromProjectionMatrix(a.matrix)):a.frustum.setFromProjectionMatrix(this.#L),a.frustum.intersectsSphere(t)}box3SizeOnScreen(t,e){const r=function(t,e,r){let i=t.camera3D.matrixWorldInverse;r&&(i=a.matrix.multiplyMatrices(t.camera3D.matrixWorldInverse,r)),h[0].set(e.min.x,e.min.y,e.min.z).applyMatrix4(i),h[1].set(e.min.x,e.min.y,e.max.z).applyMatrix4(i),h[2].set(e.min.x,e.max.y,e.min.z).applyMatrix4(i),h[3].set(e.min.x,e.max.y,e.max.z).applyMatrix4(i),h[4].set(e.max.x,e.min.y,e.min.z).applyMatrix4(i),h[5].set(e.max.x,e.min.y,e.max.z).applyMatrix4(i),h[6].set(e.max.x,e.max.y,e.min.z).applyMatrix4(i),h[7].set(e.max.x,e.max.y,e.max.z).applyMatrix4(i);let n=!1;for(let e=0;e<8;e++)h[e].z<=-t.camera3D.near?n=!0:h[e].z=-t.camera3D.near;return n?h:void 0}(this,t,e);if(!r)return a.box3.makeEmpty();for(let t=0;t<8;t++)r[t].applyMatrix4(this.camera3D.projectionMatrix);return a.box3.setFromPoints(r)}adjustAltitudeToAvoidCollisionWithLayer(t,e,r){const i=t.camera.position().as("EPSG:4326");if(void 0!==e){const n=s.Z.getElevationValueAt(e,i);void 0!==n&&i.altitude-(n+r)<0&&(i.altitude=n+r,t.camera3D.position.copy(i.as(t.referenceCrs)),t.notifyChange(this.camera3D))}}}},97112:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o,i:()=>s});var i=r(78025);function n(t,e){const r=i.M.getColorLayersIdOrderedBySequence(e),n=function(t){var e;null!==(e=t.material)&&void 0!==e&&e.setSequence&&t.material.setSequence(r)};for(const e of t.level0Nodes)e.traverse(n)}const s="layers-order-changed",o={moveLayerUp(t,e){const r=t.getLayers((t=>t.isColorLayer)),o=t.getLayerById(e);if(!o)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(r);i.M.moveLayerUp(o,r),n(t.tileLayer,r),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(t.tileLayer)}},moveLayerDown(t,e){const r=t.getLayers((t=>t.isColorLayer)),o=t.getLayerById(e);if(!o)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(r);i.M.moveLayerDown(o,r),n(t.tileLayer,r),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(t.tileLayer)}},moveLayerToIndex(t,e,r){const o=t.getLayers((t=>t.isColorLayer)),a=t.getLayerById(e);if(!a)throw new Error(`${e} isn't color layer`);{const e=i.M.getColorLayersIdOrderedBySequence(o);i.M.moveLayerToIndex(a,r,o),n(t.tileLayer,o),t.dispatchEvent({type:s,previous:{sequence:e},new:{sequence:i.M.getColorLayersIdOrderedBySequence(o)}}),t.notifyChange(t.tileLayer)}}}},3725:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});var i=r(99477);const n={setDefineMapping(t,e,r){Object.keys(r).forEach((i=>{t.defines[`${e}_${i}`]=r[i]}))},setDefineProperty(t,e,r,i){t.defines[r]=i,Object.defineProperty(t,e,{get:()=>t.defines[r],set:e=>{t.defines[r]!=e&&(t.defines[r]=e,t.needsUpdate=!0)}})},setUniformProperty(t,e,r){t.uniforms[e]=new i.Uniform(r),Object.defineProperty(t,e,{get:()=>t.uniforms[e].value,set:r=>{t.uniforms[e].value!=r&&(t.uniforms[e].value=r)}})}}},49652:(t,e,r)=>{"use strict";r.d(e,{R:()=>o,Z:()=>l});var i=r(99477),n=r(49401);const s=new i.Frustum;class o{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=t,this.y=e,this.grid=[],this.visible=[],this.resize(),this.reset(),this.width=r,this.height=i}reset(){for(let t=0;t0&&this.grid[s][e].some((e=>{return r=e.boundaries,i=t.boundaries,!(r.left>i.right||r.righti.bottom||r.bottomt.isLabelLayer&&t.visible));0!=r.length&&(this.grid.reset(),s.setFromProjectionMatrix(e.projectionMatrix),r.forEach((t=>{t.submittedLabelNodes.forEach((t=>{t.labels.forEach((r=>{t.updatePosition(r),this.culling(r,e)})),t.domElements.labels.show(),t.needsUpdate=!1}))})),this.grid.visible.sort(((t,e)=>{const r=e.order-t.order;return 0==r?!t.visible&&e.visible?1:-1:r})),this.grid.visible.forEach((t=>{this.grid.insert(t)?(t.visible=!0,t.updateCSSPosition()):t.visible=!1})),r.forEach((t=>{t.toHide.children.forEach((t=>{var e;return null===(e=t.domElements)||void 0===e?void 0:e.labels.hide()})),t.toHide.clear()})))}culling(t,e){t.getWorldPosition(a),!s.containsPoint(a.applyMatrix4(e.matrixWorldInverse))||t.horizonCullingPoint&&n.Z.horizonCulling(t.horizonCullingPoint)||this.grid.visible.some((e=>{const r=t.content.textContent;return""!==r&&e.content.textContent.toLowerCase()==r.toLowerCase()}))?t.visible=!1:(a.applyMatrix4(e.projectionMatrix),t.updateProjectedPosition(a.x*this.halfWidth+this.halfWidth,-a.y*this.halfHeight+this.halfHeight),this.grid.visible.push(t))}removeLabelDOM(t){this.garbage.appendChild(t.content),this.garbage.innerHTML=""}}},5199:(t,e,r)=>{"use strict";r.d(e,{On:()=>d,ZP:()=>w,dn:()=>m,pO:()=>g,zQ:()=>v});var i=r(99477),n=r(43195),s=r(28448),o=r(14625),a=r(3725);const l=new i.Vector4(0,0,1,1),c=new i.Texture,h=255/256,u=new i.Vector4(5.9371814131736755e-8,h/65536,.0038909912109375,h);function d(t,e){return e?u.dot(t)*e:u.dot(t)}const p=15,f=1;function m(){const t=s.Z.getMaxTextureUnitsCount();return Math.min(t-f,p)}const g={noEffect:0,removeLightColor:1,removeWhiteColor:2,customEffect:3},A={bias:0,noDataValue:-99999,zmin:0,zmax:0,scale:0,mode:0,textureOffset:0,opacity:0,crs:0,effect_parameter:0,effect_type:g.noEffect,transparent:!1};function y(t,e,r){const i=t.layers.value,n=t.textures.value,s=t.offsetScales.value,o=t.textureCount;let a=0;for(const t of e){t.textureOffset=a;for(let e=0,o=t.textures.length;er&&console.warn(`LayeredMaterial: Not enough texture units (${r} < ${a}), excess textures have been discarded.`),o.value=a;for(let t=a;t1?arguments[1]:void 0;super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),x=x||[f,m()],this.defines.NUM_VS_TEXTURES=x[0],this.defines.NUM_FS_TEXTURES=x[1],this.defines.USE_FOG=1,this.defines.NUM_CRS=t,a.Z.setDefineMapping(this,"ELEVATION",v),a.Z.setDefineMapping(this,"MODE",o.Z.MODES),a.Z.setDefineProperty(this,"mode","MODE",o.Z.MODES.FINAL),this.vertexShader="#include \n#include \n#include \n#include \n#if NUM_CRS > 1\nattribute float uv_1;\n#endif\n\nuniform bool lightingEnabled;\nvarying vec2 vHighPrecisionZW;\n\n#if MODE == MODE_FINAL\n#include \nvarying vec3 vUv;\nvarying vec3 vNormal;\n#endif\nvoid main() {\n #include \n #include \n #include \n #include \n #include \n vHighPrecisionZW = gl_Position.zw;\n#if MODE == MODE_FINAL\n #include \n #if NUM_CRS > 1\n vUv = vec3(uv, (uv_1 > 0.) ? uv_1 : uv.y); // set uv_1 = uv if uv_1 is undefined\n #else\n vUv = vec3(uv, 0.0);\n #endif\n vNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\n#endif\n}\n",b[t]=b[t]||n.Z.unrollLoops("#include \n#include \n#include \n#include \n#if MODE == MODE_FINAL\n#include \n#include \n#include \n#endif\n#include \n\nuniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vUv; // uv.x/uv_1.x, uv.y, uv_1.y\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n #include \n\n#if MODE == MODE_ID\n\n #include \n\n#elif MODE == MODE_DEPTH\n\n #include \n\n#else\n\n gl_FragColor = vec4(diffuse, opacity);\n\n uvs[0] = vec3(vUv.xy, 0.);\n\n#if NUM_CRS > 1\n uvs[1] = vec3(vUv.x, fract(vUv.z), floor(vUv.z));\n#endif\n\n vec4 color;\n #pragma unroll_loop\n for ( int i = 0; i < NUM_FS_TEXTURES; i ++ ) {\n color = getLayerColor( i , colorTextures[ i ], colorOffsetScales[ i ], colorLayers[ i ]);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n\n #if defined(DEBUG)\n if (showOutline) {\n #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++) {\n color = getOutlineColor( outlineColors[ i ], uvs[ i ].xy);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n }\n #endif\n\n #include \n #include \n #include \n\n#endif\n}\n",this.defines),this.fragmentShader=b[t],a.Z.setUniformProperty(this,"diffuse",new i.Color(.04,.23,.35)),a.Z.setUniformProperty(this,"opacity",this.opacity),a.Z.setUniformProperty(this,"lightingEnabled",!1),a.Z.setUniformProperty(this,"lightPosition",new i.Vector3(-.5,0,1)),a.Z.setUniformProperty(this,"fogDistance",1e9),a.Z.setUniformProperty(this,"fogColor",new i.Color(.76,.85,1)),a.Z.setUniformProperty(this,"overlayAlpha",0),a.Z.setUniformProperty(this,"overlayColor",new i.Color(1,.3,0)),a.Z.setUniformProperty(this,"objectId",0),a.Z.setUniformProperty(this,"geoidHeight",0),a.Z.setUniformProperty(this,"minBorderDistance",-.01),this.layers=[],this.elevationLayerIds=[],this.colorLayerIds=[],this.uniforms.elevationLayers=new i.Uniform(new Array(x[0]).fill(A)),this.uniforms.elevationTextures=new i.Uniform(new Array(x[0]).fill(c)),this.uniforms.elevationOffsetScales=new i.Uniform(new Array(x[0]).fill(l)),this.uniforms.elevationTextureCount=new i.Uniform(0),this.uniforms.colorLayers=new i.Uniform(new Array(x[1]).fill(A)),this.uniforms.colorTextures=new i.Uniform(new Array(x[1]).fill(c)),this.uniforms.colorOffsetScales=new i.Uniform(new Array(x[1]).fill(l)),this.uniforms.colorTextureCount=new i.Uniform(0),Object.defineProperty(this,"visible",{get(){return this.#P},set(t){this.#P!=t&&(this.#P=t,this.dispatchEvent({type:t?"shown":"hidden"}))}})}getUniformByType(t){return{layers:this.uniforms[`${t}Layers`],textures:this.uniforms[`${t}Textures`],offsetScales:this.uniforms[`${t}OffsetScales`],textureCount:this.uniforms[`${t}TextureCount`]}}updateLayersUniforms(){const t=this.layers.filter((t=>this.colorLayerIds.includes(t.id)&&t.visible&&t.opacity>0));if(t.sort(((t,e)=>this.colorLayerIds.indexOf(t.id)-this.colorLayerIds.indexOf(e.id))),y(this.getUniformByType("color"),t,this.defines.NUM_FS_TEXTURES),this.elevationLayerIds.some((t=>this.getLayer(t)))||this.uniforms.elevationTextureCount.value&&!this.elevationLayerIds.length){const t=this.getElevationLayer()?[this.getElevationLayer()]:[];y(this.getUniformByType("elevation"),t,this.defines.NUM_VS_TEXTURES)}this.layersNeedUpdate=!1}dispose(){this.dispatchEvent({type:"dispose"}),this.layers.forEach((t=>t.dispose(!0))),this.layers.length=0,this.layersNeedUpdate=!0}setSequence(t){this.colorLayerIds=t,this.layersNeedUpdate=!0}setSequenceElevation(t){this.elevationLayerIds[0]=t,this.layersNeedUpdate=!0}removeLayer(t){const e=this.layers.findIndex((e=>e.id===t));if(e>-1){this.layers[e].dispose(),this.layers.splice(e,1);const r=this.colorLayerIds.indexOf(t);r>-1?this.colorLayerIds.splice(r,1):this.elevationLayerIds=[]}}addLayer(t){t.layer.id in this.layers&&console.warn('The "{layer.id}" layer was already present in the material, overwritting.'),this.layers.push(t)}getLayer(t){return this.layers.find((e=>e.id===t))}getLayers(t){return this.layers.filter((e=>t.includes(e.id)))}getElevationLayer(){return this.layers.find((t=>t.id===this.elevationLayerIds[0]))}setElevationScale(t){this.elevationLayerIds.length&&(this.getElevationLayer().scale=t)}}const w=_},67490:(t,e,r)=>{"use strict";r.d(e,{Z:()=>m});var i=r(99477),n=r(42423),s=r(51969),o=r(62310),a=r(79323);const l=new s.Z({crs:"EPSG:4978",uvCount:1}),c=new i.Vector3,h=new i.Vector2,u=new i.Vector3,d=new o.Z("EPSG:4326",0,0,0);let p;class f extends i.Object3D{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new i.Vector3(1/0,1/0,1/0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new i.Vector3(-1/0,-1/0,-1/0);super(),this.box3D=new i.Box3(t.clone(),e.clone()),this.natBox=this.box3D.clone(),this.z={min:0,max:0,scale:1}}clone(){return(new f).copy(this)}copy(t){return super.copy(t),this.box3D.copy(t.box3D),this.natBox.copy(t.natBox),this.z.min=t.z.min,this.z.max=t.z.max,this.z.scale=t.z.scale,this}updateZ(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.z.min=t.min??this.z.min,this.z.max=t.max??this.z.max,this.z.scale=t.scale>0?t.scale:this.z.scale,this.z.delta=Math.abs(this.z.max-this.z.min)*this.z.scale;const e=t.geoidHeight||0;this.box3D.min.z=this.natBox.min.z+this.z.min*this.z.scale+e,this.box3D.max.z=this.natBox.max.z+this.z.max*this.z.scale+e}isSphereAboveXYBox(t){const e=this.worldToLocal(t.center),r=Math.max(this.box3D.min.x,Math.min(e.x,this.box3D.max.x)),i=Math.max(this.box3D.min.y,Math.min(e.y,this.box3D.max.y));return Math.sqrt((r-e.x)*(r-e.x)+(i-e.y)*(i-e.y))1&&void 0!==arguments[1]?arguments[1]:t.min||0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.max||0;if("EPSG:4326"==t.crs){const{sharableExtent:i,quaternion:s,position:o}=l.computeSharableExtent(t),a=Math.max(Math.floor(i.planarDimensions(h).x/90+1),2),c=new n.Z({extent:i,level:0,segments:a,disableSkirt:!0,builder:l});p.box3D.copy(c.boundingBox),p.natBox.copy(c.boundingBox),this.copy(p),this.updateZ({min:e,max:r}),this.position.copy(o),this.quaternion.copy(s),this.updateMatrixWorld(!0)}else{if(a.Z.isTms(t.crs)||!a.Z.isMetricUnit(t.crs))throw new Error("Unsupported extent crs");t.center(d).toVector3(this.position),t.planarDimensions(h),c.set(h.x,h.y,Math.abs(r-e)),this.box3D.setFromCenterAndSize(u,c),this.updateMatrixWorld(!0)}return this}}p=new f;const m=f},25033:(t,e,r)=>{"use strict";r.d(e,{wy:()=>d,vj:()=>l,Uz:()=>c,E7:()=>h,ZP:()=>g});var i=r(99477),n=r(43195),s=r(3725);const o={SPECTRAL:[[0,new i.Color(.3686,.3098,.6353)],[.1,new i.Color(.1961,.5333,.7412)],[.2,new i.Color(.4,.7608,.6471)],[.3,new i.Color(.6706,.8667,.6431)],[.4,new i.Color(.902,.9608,.5961)],[.5,new i.Color(1,1,.749)],[.6,new i.Color(.9961,.8784,.5451)],[.7,new i.Color(.9922,.6824,.3804)],[.8,new i.Color(.9569,.4275,.2627)],[.9,new i.Color(.8353,.2431,.3098)],[1,new i.Color(.6196,.0039,.2588)]],PLASMA:[[0,new i.Color(.241,.015,.61)],[.1,new i.Color(.387,.001,.654)],[.2,new i.Color(.524,.025,.653)],[.3,new i.Color(.651,.125,.596)],[.4,new i.Color(.752,.227,.513)],[.5,new i.Color(.837,.329,.431)],[.6,new i.Color(.907,.435,.353)],[.7,new i.Color(.963,.554,.272)],[.8,new i.Color(.992,.681,.195)],[.9,new i.Color(.987,.822,.144)],[1,new i.Color(.94,.975,.131)]],YELLOW_GREEN:[[0,new i.Color(.1647,.2824,.3451)],[.1,new i.Color(.1338,.3555,.4227)],[.2,new i.Color(.061,.4319,.4864)],[.3,new i.Color(0,.5099,.5319)],[.4,new i.Color(0,.5881,.5569)],[.5,new i.Color(.137,.665,.5614)],[.6,new i.Color(.2906,.7395,.5477)],[.7,new i.Color(.4453,.8099,.5201)],[.8,new i.Color(.6102,.8748,.485)],[.9,new i.Color(.7883,.9323,.4514)],[1,new i.Color(.9804,.9804,.4314)]],VIRIDIS:[[0,new i.Color(.267,.005,.329)],[.1,new i.Color(.283,.141,.458)],[.2,new i.Color(.254,.265,.53)],[.3,new i.Color(.207,.372,.553)],[.4,new i.Color(.164,.471,.558)],[.5,new i.Color(.128,.567,.551)],[.6,new i.Color(.135,.659,.518)],[.7,new i.Color(.267,.749,.441)],[.8,new i.Color(.478,.821,.318)],[.9,new i.Color(.741,.873,.15)],[1,new i.Color(.993,.906,.144)]],INFERNO:[[0,new i.Color(.077,.042,.206)],[.1,new i.Color(.225,.036,.388)],[.2,new i.Color(.373,.074,.432)],[.3,new i.Color(.522,.128,.42)],[.4,new i.Color(.665,.182,.37)],[.5,new i.Color(.797,.255,.287)],[.6,new i.Color(.902,.364,.184)],[.7,new i.Color(.969,.516,.063)],[.8,new i.Color(.988,.683,.072)],[.9,new i.Color(.961,.859,.298)],[1,new i.Color(.988,.998,.645)]],GRAYSCALE:[[0,new i.Color(0,0,0)],[1,new i.Color(1,1,1)]],TURBO:[[0,new i.Color(.18995,.07176,.23217)],[.07,new i.Color(.25107,.25237,.63374)],[.13,new i.Color(.27628,.42118,.89123)],[.2,new i.Color(.25862,.57958,.99876)],[.27,new i.Color(.15844,.73551,.92305)],[.33,new i.Color(.09267,.86554,.7623)],[.4,new i.Color(.19659,.94901,.59466)],[.47,new i.Color(.42778,.99419,.38575)],[.53,new i.Color(.64362,.98999,.23356)],[.6,new i.Color(.80473,.92452,.20459)],[.67,new i.Color(.93301,.81236,.22667)],[.73,new i.Color(.99314,.67408,.20348)],[.8,new i.Color(.9836,.49291,.12849)],[.87,new i.Color(.92105,.31489,.05475)],[.93,new i.Color(.81608,.18462,.01809)],[1,new i.Color(.66449,.08436,.00424)]],RAINBOW:[[0,new i.Color(.278,0,.714)],[1/6,new i.Color(0,0,1)],[2/6,new i.Color(0,1,1)],[.5,new i.Color(0,1,0)],[4/6,new i.Color(1,1,0)],[5/6,new i.Color(1,.64,0)],[1,new i.Color(1,0,0)]],CONTOUR:[[0,new i.Color(0,0,0)],[.03,new i.Color(0,0,0)],[.04,new i.Color(1,1,1)],[1,new i.Color(1,1,1)]]},a="#include \n#include \n#if defined(USE_TEXTURES_PROJECTIVE)\n#include \n#endif\n\nvarying vec4 vColor;\nuniform bool picking;\nuniform int shape;\n\nvoid main() {\n #include \n //square shape does not require any change.\n if (shape == PNTS_SHAPE_CIRCLE) {\n //circular rendering in glsl\n if ((length(gl_PointCoord - 0.5) > 0.5) || (vColor.a == 0.0)) {\n discard;\n }\n }\n\n#if defined(USE_TEXTURES_PROJECTIVE)\n vec4 color = vColor;\n if (!picking) {\n #pragma unroll_loop\n for (int i = 0; i < ORIENTED_IMAGES_COUNT; i++) {\n color = projectiveTextureColor(projectiveTextureCoords[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTextureDistortion[ ORIENTED_IMAGES_COUNT - 1 - i ], projectiveTexture[ ORIENTED_IMAGES_COUNT - 1 - i ], mask[ORIENTED_IMAGES_COUNT - 1 - i], color);\n }\n gl_FragColor = vec4(color.rgb, color.a * opacity);\n } else {\n gl_FragColor = color;\n }\n#else\n gl_FragColor = vColor;\n#endif\n}\n",l={COLOR:0,INTENSITY:1,CLASSIFICATION:2,ELEVATION:3,RETURN_NUMBER:4,RETURN_TYPE:5,RETURN_COUNT:6,POINT_SOURCE_ID:7,SCAN_ANGLE:8,NORMAL:9},c={CIRCLE:0,SQUARE:1},h={VALUE:0,ATTENUATED:1},u=new i.Color(1,1,1),d={DEFAULT:{0:{visible:!0,name:"never classified",color:new i.Color(.5,.5,.5),opacity:1},1:{visible:!0,name:"unclassified",color:new i.Color(.5,.5,.5),opacity:1},2:{visible:!0,name:"ground",color:new i.Color(.63,.32,.18),opacity:1},3:{visible:!0,name:"low vegetation",color:new i.Color(0,1,0),opacity:1},4:{visible:!0,name:"medium vegetation",color:new i.Color(0,.8,0),opacity:1},5:{visible:!0,name:"high vegetation",color:new i.Color(0,.6,0),opacity:1},6:{visible:!0,name:"building",color:new i.Color(1,.66,0),opacity:1},7:{visible:!0,name:"low point(noise)",color:new i.Color(1,0,1),opacity:1},8:{visible:!0,name:"key-point",color:new i.Color(1,0,0),opacity:1},9:{visible:!0,name:"water",color:new i.Color(0,0,1),opacity:1},10:{visible:!0,name:"rail",color:new i.Color(.8,.8,1),opacity:1},11:{visible:!0,name:"road Surface",color:new i.Color(.4,.4,.7),opacity:1},12:{visible:!0,name:"overlap",color:new i.Color(1,1,0),opacity:1},DEFAULT:{visible:!0,name:"default",color:new i.Color(.3,.6,.6),opacity:.5}}},p={DEFAULT:{0:{visible:!0,name:"0",color:new i.Color("rgb(67, 99, 216)"),opacity:1},1:{visible:!0,name:"1",color:new i.Color("rgb(60, 180, 75);"),opacity:1},2:{visible:!0,name:"2",color:new i.Color("rgb(255, 255, 25)"),opacity:1},3:{visible:!0,name:"3",color:new i.Color("rgb(145, 30, 180)"),opacity:1},4:{visible:!0,name:"4",color:new i.Color("rgb(245, 130, 49)"),opacity:1},5:{visible:!0,name:"5",color:new i.Color("rgb(230, 25, 75)"),opacity:1},6:{visible:!0,name:"6",color:new i.Color("rgb(66, 212, 244)"),opacity:1},7:{visible:!0,name:"7",color:new i.Color("rgb(240, 50, 230)"),opacity:1},DEFAULT:{visible:!0,name:"default",color:u,opacity:.5}}};function f(t,e,r){const i=e.image.data,n=e.image.width;r||(r=Object.keys(t).length);for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:{};const e=t.intensityRange||new i.Vector2(1,65536),r=t.elevationRange||new i.Vector2(0,1e3),u=t.angleRange||new i.Vector2(-90,90),f=t.orientedImageMaterial,m=t.classification||d.DEFAULT,g=t.discreteScheme||p.DEFAULT,A=null!=t.applyOpacityClassication&&t.applyOpacityClassication,y=t.size||0,v=t.mode||l.COLOR,x=t.shape||c.CIRCLE,b=0===y?h.ATTENUATED:t.sizeMode||h.VALUE,_=t.minAttenuatedSize||3,w=t.maxAttenuatedSize||10;let E=o;t.gradient&&(E={...t.gradient,...o}),delete t.intensityRange,delete t.elevationRange,delete t.angleRange,delete t.orientedImageMaterial,delete t.classificationScheme,delete t.discreteScheme,delete t.applyOpacityClassication,delete t.size,delete t.mode,delete t.shape,delete t.sizeMode,delete t.minAttenuatedSize,delete t.maxAttenuatedSize,delete t.gradient,super(t),this.gradients=E,this.gradientTexture=new i.CanvasTexture,this.vertexShader="#include \n#if defined(USE_TEXTURES_PROJECTIVE)\n#include \n#endif\n#include \n#include \n\n#define NB_CLASS 8.\n\nuniform float size;\nuniform float scale;\n\nuniform bool picking;\nuniform int mode;\nuniform float opacity;\nuniform vec4 overlayColor;\n\nuniform vec2 elevationRange;\nuniform vec2 intensityRange;\nuniform vec2 angleRange;\n\nuniform bool applyOpacityClassication;\n\nuniform sampler2D classificationTexture;\nuniform sampler2D discreteTexture;\nuniform sampler2D gradientTexture;\nuniform int sizeMode;\nuniform float minAttenuatedSize;\nuniform float maxAttenuatedSize;\n\nattribute vec3 color;\nattribute vec2 range;\nattribute vec4 unique_id;\nattribute float intensity;\nattribute float classification;\nattribute float pointSourceID;\n\nattribute float returnNumber;\nattribute float numberOfReturns;\nattribute float scanAngle;\n\n#if defined(NORMAL_OCT16)\nattribute vec2 oct16Normal;\n#elif defined(NORMAL_SPHEREMAPPED)\nattribute vec2 sphereMappedNormal;\n#endif\n\nvarying vec4 vColor;\n\n// see https://web.archive.org/web/20150303053317/http://lgdv.cs.fau.de/get/1602\n// and implementation in PotreeConverter (BINPointReader.cpp) and potree (BinaryDecoderWorker.js)\n#if defined(NORMAL_OCT16)\nvec3 decodeOct16Normal(vec2 encodedNormal) {\n vec2 nNorm = 2. * (encodedNormal / 255.) - 1.;\n vec3 n;\n n.z = 1. - abs(nNorm.x) - abs(nNorm.y);\n if (n.z >= 0.) {\n n.x = nNorm.x;\n n.y = nNorm.y;\n } else {\n n.x = sign(nNorm.x) - sign(nNorm.x) * sign(nNorm.y) * nNorm.y;\n n.y = sign(nNorm.y) - sign(nNorm.y) * sign(nNorm.x) * nNorm.x;\n }\n return normalize(n);\n}\n#elif defined(NORMAL_SPHEREMAPPED)\n// see http://aras-p.info/texts/CompactNormalStorage.html method #4\n// or see potree's implementation in BINPointReader.cpp\nvec3 decodeSphereMappedNormal(vec2 encodedNormal) {\n vec2 fenc = 2. * encodedNormal / 255. - 1.;\n float f = dot(fenc,fenc);\n float g = 2. * sqrt(1. - f);\n vec3 n;\n n.xy = fenc * g;\n n.z = 1. - 2. * f;\n return n;\n}\n#endif\n\nvoid main() {\n\n#if defined(NORMAL_OCT16)\n vec3 normal = decodeOct16Normal(oct16Normal);\n#elif defined(NORMAL_SPHEREMAPPED)\n vec3 normal = decodeSphereMappedNormal(sphereMappedNormal);\n#elif defined(NORMAL)\n // nothing to do\n#else\n // default to color\n vec3 normal = color;\n#endif\n\n if (picking) {\n vColor = unique_id;\n } else {\n vColor.a = opacity;\n if (applyOpacityClassication || mode == PNTS_MODE_CLASSIFICATION) {\n vec2 uv = vec2(classification/255., 0.5);\n vColor = texture2D(classificationTexture, uv);\n vColor.a *= opacity;\n }\n\n if (mode == PNTS_MODE_NORMAL) {\n vColor.rgb = abs(normal);\n } else if (mode == PNTS_MODE_COLOR) {\n // default to color mode\n vColor.rgb = mix(color, overlayColor.rgb, overlayColor.a);\n } else if (mode == PNTS_MODE_RETURN_NUMBER) {\n vec2 uv = vec2(returnNumber/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_TYPE) {\n float returnType;\n if (returnNumber > numberOfReturns) {\n returnType = 4.;\n } else if (returnNumber == 1.) {\n if (numberOfReturns == 1.) {\n // single\n returnType = 0.;\n } else {\n // first\n returnType = 1.;\n }\n } else {\n if (returnNumber == numberOfReturns) {\n // last\n returnType = 3.;\n } else {\n // intermediate\n returnType = 2.;\n }\n }\n vec2 uv = vec2(returnType/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_RETURN_COUNT) {\n vec2 uv = vec2(numberOfReturns/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_POINT_SOURCE_ID) {\n vec2 uv = vec2(mod(pointSourceID, NB_CLASS)/255., 0.5);\n vColor = texture2D(discreteTexture, uv);\n } else if (mode == PNTS_MODE_SCAN_ANGLE) {\n float i = (scanAngle - angleRange.x) / (angleRange.y - angleRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_INTENSITY) {\n float i = (intensity - intensityRange.x) / (intensityRange.y - intensityRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n } else if (mode == PNTS_MODE_ELEVATION) {\n float i = (position.z - elevationRange.x) / (elevationRange.y - elevationRange.x);\n vec2 uv = vec2(i, (1. - i));\n vColor = texture2D(gradientTexture, uv);\n }\n }\n\n #include \n #include \n\n gl_PointSize = size;\n\n if (sizeMode == PNTS_SIZE_MODE_ATTENUATED) {\n bool isPerspective = isPerspectiveMatrix(projectionMatrix);\n\n if (isPerspective) {\n gl_PointSize *= scale / -mvPosition.z;\n gl_PointSize = clamp(gl_PointSize, minAttenuatedSize, maxAttenuatedSize);\n }\n }\n\n#if defined(USE_TEXTURES_PROJECTIVE)\n #include \n#endif\n #include \n}\n";const M=t.scale||.025/Math.tan(.5);s.Z.setDefineMapping(this,"PNTS_MODE",l),s.Z.setDefineMapping(this,"PNTS_SHAPE",c),s.Z.setDefineMapping(this,"PNTS_SIZE_MODE",h),s.Z.setUniformProperty(this,"size",y),s.Z.setUniformProperty(this,"mode",v),s.Z.setUniformProperty(this,"shape",x),s.Z.setUniformProperty(this,"picking",!1),s.Z.setUniformProperty(this,"opacity",this.opacity),s.Z.setUniformProperty(this,"overlayColor",t.overlayColor||new i.Vector4(0,0,0,0)),s.Z.setUniformProperty(this,"intensityRange",e),s.Z.setUniformProperty(this,"elevationRange",r),s.Z.setUniformProperty(this,"angleRange",u),s.Z.setUniformProperty(this,"applyOpacityClassication",A),s.Z.setUniformProperty(this,"sizeMode",b),s.Z.setUniformProperty(this,"scale",M),s.Z.setUniformProperty(this,"minAttenuatedSize",_),s.Z.setUniformProperty(this,"maxAttenuatedSize",w);const S=new Uint8Array(1024),C=new i.DataTexture(S,256,1,i.RGBAFormat);C.needsUpdate=!0,C.magFilter=i.NearestFilter,s.Z.setUniformProperty(this,"classificationTexture",C);const T=new Uint8Array(1024),I=new i.DataTexture(T,256,1,i.RGBAFormat);I.needsUpdate=!0,I.magFilter=i.NearestFilter,s.Z.setUniformProperty(this,"discreteTexture",I),this.classificationScheme=m,this.discreteScheme=g,this.recomputeClassification(),this.recomputeDiscreteTexture(),this.gradient=Object.values(E)[0],s.Z.setUniformProperty(this,"gradientTexture",this.gradientTexture),f?(this.uniforms.projectiveTextureAlphaBorder=f.uniforms.projectiveTextureAlphaBorder,this.uniforms.projectiveTextureDistortion=f.uniforms.projectiveTextureDistortion,this.uniforms.projectiveTextureMatrix=f.uniforms.projectiveTextureMatrix,this.uniforms.projectiveTexture=f.uniforms.projectiveTexture,this.uniforms.mask=f.uniforms.mask,this.uniforms.boostLight=f.uniforms.boostLight,this.defines.ORIENTED_IMAGES_COUNT=f.defines.ORIENTED_IMAGES_COUNT,this.defines.USE_DISTORTION=f.defines.USE_DISTORTION,this.defines.DEBUG_ALPHA_BORDER=f.defines.DEBUG_ALPHA_BORDER,this.defines.USE_TEXTURES_PROJECTIVE=!0,this.defines.USE_BASE_MATERIAL=!0,this.fragmentShader=n.Z.unrollLoops(a,this.defines)):this.fragmentShader=a}recomputeClassification(){f(this.classificationScheme,this.classificationTexture,32),this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}recomputeDiscreteTexture(){f(this.discreteScheme,this.discreteTexture),this.dispatchEvent({type:"material_property_changed",target:this.uniforms})}copy(t){return super.copy(t),t.uniforms.projectiveTextureAlphaBorder&&(this.uniforms.projectiveTextureAlphaBorder=t.uniforms.projectiveTextureAlphaBorder,this.uniforms.projectiveTextureDistortion=t.uniforms.projectiveTextureDistortion,this.uniforms.projectiveTextureMatrix=t.uniforms.projectiveTextureMatrix,this.uniforms.projectiveTexture=t.uniforms.projectiveTexture,this.uniforms.mask=t.uniforms.mask,this.uniforms.boostLight=t.uniforms.boostLight),this}enablePicking(t){this.picking=t,this.blending=t?i.NoBlending:i.NormalBlending}update(t){return this.visible=t.visible,this.opacity=t.opacity,this.transparent=t.transparent,this.size=t.size,this.mode=t.mode,this.shape=t.shape,this.sizeMode=t.sizeMode,this.minAttenuatedSize=t.minAttenuatedSize,this.maxAttenuatedSize=t.maxAttenuatedSize,this.picking=t.picking,this.scale=t.scale,this.overlayColor.copy(t.overlayColor),this.intensityRange.copy(t.intensityRange),this.elevationRange.copy(t.elevationRange),this.angleRange.copy(t.angleRange),Object.assign(this.defines,t.defines),this}set gradient(t){this.gradientTexture=function(t){const e=64,r=document.createElement("canvas");r.width=e,r.height=e;const n=r.getContext("2d");n.rect(0,0,e,e);const s=n.createLinearGradient(0,0,e,e);for(let e=0;e{"use strict";r.d(e,{pL:()=>a,AN:()=>h,NO:()=>u});var i=r(99477),n=r(5199),s=r(86541);var o=r(79323);const a=-1,l=new i.Vector4;class c extends i.EventDispatcher{constructor(t,e){super(),this.layer=e,this.crs=e.parent.tileMatrixSets.indexOf(o.Z.formatToTms(e.crs)),-1==this.crs&&console.error("Unknown crs:",e.crs),this.textures=[],this.offsetScales=[],this.level=a,this.material=t,this._handlerCBEvent=()=>{this.material.layersNeedUpdate=!0},e.addEventListener("visible-property-changed",this._handlerCBEvent),e.addEventListener("opacity-property-changed",this._handlerCBEvent)}get id(){return this.layer.id}get opacity(){return this.layer.opacity}get visible(){return this.layer.visible}initFromParent(t,e){if(t&&t.level>this.level){let r=0;for(const i of e)for(const e of t.textures)if(i.isInside(e.extent)){this.setTexture(r++,e,i.offsetToParent(e.extent));break}}}dispose(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.layer.removeEventListener("visible-property-changed",this._handlerCBEvent),this.layer.removeEventListener("opacity-property-changed",this._handlerCBEvent),this._listeners={});for(const t of this.textures)t.isTexture&&t.dispose();this.level=a,this.textures=[],this.offsetScales=[],this.material.layersNeedUpdate=!0}setTexture(t,e,r){this.level=e&&e.extent&&0==t?e.extent.zoom:this.level,this.textures[t]=e||null,this.offsetScales[t]=r,this.material.layersNeedUpdate=!0}setTextures(t,e){this.dispose(!1);for(let r=0,i=t.length;rnull!=t));return a.length?{min:Math.min(...a),max:Math.max(...a)}:{min:1/0,max:-1/0}}(t,e,r);const c=Math.floor(e.z*i);if(c>2){const t=Math.floor(e.z*n),s=Math.floor(e.x*i),h=Math.floor(e.y*n),u=Math.max(Math.floor(c/32),2);for(let e=h;ea&&(a=r.zmin),r.zmaxe&&t[r-1]>e&&t[Math.sqrt(r)-1]>e&&t[r-Math.sqrt(r)]>e}(n,e)&&function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0,r=arguments.length>2?arguments[2]:void 0;for(let i=0,n=t.length;ir[function(t,e,r){const i=Math.floor(t/r)/r,n=e.x+t%r/r*e.z,s=e.y+i*e.w;return Math.floor(s*r)*r+Math.floor(n*r)}(t,i,256)]}(t,r,i,l),e)}}},14625:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const i={FINAL:0,DEPTH:1,ID:2},n={MODES:i,push:function(t,e){const r=t.mode??i.FINAL;if(r==e)return()=>{};const n=t=>e=>{const r=e.material;r&&(r.mode=t)};return t.traverse(n(e)),()=>{t.traverse(n(r))}}}},43195:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});const i=new RegExp("gl_Position.*(?![^]*gl_Position)"),n=new RegExp("[^\\w]*main[^\\w]*(void)?[^\\w]*{"),s={patchMaterialForLogDepthSupport(t){if(t.vertexShader.includes("USE_LOGDEPTHBUF")||t.vertexShader.includes("logdepthbuf_pars_vertex"))return;t.vertexShader=`#include \n#define EPSILON 1e-6\n${t.vertexShader}`;let e=i.exec(t.vertexShader),r=e[0].length+e.index;t.vertexShader=`${t.vertexShader.slice(0,r)}\n#include \n${t.vertexShader.slice(r)}`,t.fragmentShader=`#include \n${t.fragmentShader}`,e=n.exec(t.fragmentShader),r=e[0].length+e.index,t.fragmentShader=`${t.fragmentShader.slice(0,r)}\n#include \n${t.fragmentShader.slice(r)}`,t.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}},unrollLoops:(t,e)=>t.replace(/#pragma unroll_loop\s+for\s*\(\s*int\s+i\s*=\s*([\w\d]+);\s*i\s+<\s+([\w\d]+);\s*i\s*\+\+\s*\)\s*\{\n([^}]*)\}/g,(function(t,r,i,n){let s="";r=r in e?e[r]:parseInt(r,10),i=i in e?e[i]:parseInt(i,10);for(let t=r;t{"use strict";r.d(e,{Z:()=>R});var i=r(71440),n=r(12679),s=r(56178),o=r(84612),a=r(50810),l=r(15344),c=r(4090),h=r(99477),u=r(3614),d=r(38929),p=r(5167),f=r(53175),m=r(62310);const g=i.Mh.get("EPSG:3857").planarDimensions(),A=new h.Vector3(g.x,g.y,1),y=new h.Vector2,v=new h.Vector2;function x(t,e,r,i){const n=i*2**r.z,s=i*r.x,o=i*r.y;return new m.Z("EPSG:4326",360*(t+s)/n-180,360/Math.PI*Math.atan(Math.exp((180-360*(e+o)/n)*Math.PI/180))-90)}function b(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.bindNewGeometry();const n=e.type===p.tg.POLYGON;r=r&&n,i.properties=t.properties;const s=t._pbf;s.pos=t._geometry;const o=s.readVarint()+s.pos;let a=1,l=0,c=0,h=0,u=0,d=0;for(;s.pos>3}if(l--,1===a||2===a){c+=s.readSVarint(),h+=s.readSVarint(),1===a&&(u&&(r&&d>0&&i.indices.length>0&&(e.updateExtent(i),i=e.bindNewGeometry(),i.properties=t.properties),i.closeSubGeometry(u,e),i.getLastSubGeometry().ccw=d<0),u=0,d=0),u++;const o=x(c,h,t.tileNumbers,t.extent);i.pushCoordinatesValues(e,{x:c,y:h},o),1==u?(v.set(c,h),v.coordProj=o,y.set(c,h)):n&&u>1&&(d+=(y.x-c)*(y.y+h),y.set(c,h))}else{if(7!==a)throw new Error(`unknown command ${a}`);u&&(u++,i.pushCoordinatesValues(e,{x:v.x,y:v.y},v.coordProj),n&&(d+=(y.x-v.x)*(y.y+v.y)))}}u&&(r&&d>0&&i.indices.length>0&&(e.updateExtent(i),i=e.bindNewGeometry(),i.properties=t.properties),i.closeSubGeometry(u,e),i.getLastSubGeometry().ccw=d<0),e.updateExtent(i)}const _={parse:(t,e)=>(e=(0,f._F)(e),Promise.resolve(function(t,e){e.out=e.out||{};const r=new d.VectorTile(new u(t)),i=Object.keys(r.layers);if(i.length<1)return;const n=e.extent.col,s=e.extent.zoom,o=e.in.isInverted?e.extent.row:(1<{if(!e.in.layers[t])return;const i=r.layers[t];for(let r=i.length-1;r>=0;r--){const o=i.feature(r);o.tileNumbers={x:n,y:e.extent.row,z:s};const l=e.in.layers[t].filter((t=>t.filterExpression.filter({zoom:s},o)&&s>=t.zoom.min&&se.id===t.id))||(c=a.newFeatureByReference(c),c.id=t.id,c.order=t.order,c.style=e.in.styles[c.id]):(c=a.requestFeatureById(t.id,o.type-1),c.id=t.id,c.order=t.order,c.style=e.in.styles[c.id],b(o,c))}})),a.removeEmptyFeature(),a.features.sort(((t,e)=>t.order-e.order)),a.updateExtent(),a.extent=e.extent,a.isInverted=e.in.isInverted,Promise.resolve(a)}(t,e)))};var w=r(45340),E=r(55086),M=r(79323);const S=new Map([["application/geo+json",n.Z.parse],["application/json",n.Z.parse],["application/kml",s.Z.parse],["application/gpx",a.Z.parse],["application/x-protobuf;type=mapbox-vector",_.parse],["application/gtx",l.ZP.parse],["application/isg",c.Z.parse],["application/gdf",o.Z.parse]]),C={getByArray:()=>{},setByArray:t=>t,clear:()=>{}};class T{constructor(t){t.projection&&(console.warn("Source projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),t.crs&&M.Z.isValid(t.crs),this.crs=t.crs}}let I=0;const R=class extends T{constructor(t){if(super(t),this.isSource=!0,!t.url)throw new Error("New Source: url is required");this.uid=I++,this.url=t.url,this.format=t.format,this.fetcher=t.fetcher||w.Z.get(t.format),this.parser=t.parser||S.get(t.format)||((t,e)=>(t.extent=e.extent,t)),this.isVectorSource=null!=(t.parser||S.get(t.format)),this.networkOptions=t.networkOptions||{crossOrigin:"anonymous"},this.attribution=t.attribution,this.whenReady=Promise.resolve(),this._featuresCaches={},t.extent&&!t.extent.isExtent?this.extent=new i.ZP(this.crs,t.extent):this.extent=t.extent}handlingError(t){throw new Error(t)}urlFromExtent(){throw new Error("In extended Source, you have to implement the method urlFromExtent!")}requestToKey(t){return[t.zoom,t.row,t.col]}loadData(t,e){const r=this._featuresCaches[e.crs],i=this.requestToKey(t);let n=r.getByArray(i);return n||(n=r.setByArray(this.fetcher(this.urlFromExtent(t),this.networkOptions).then((r=>this.parser(r,{out:e,in:this,extent:t}))).catch((t=>this.handlingError(t))),i),this.onParsedFile&&n.then((t=>(this.onParsedFile(t),console.warn("Source.onParsedFile was deprecated"),t)))),n}onLayerAdded(t){this._featuresCaches[t.out.crs]||(this._featuresCaches[t.out.crs]=this.isVectorSource?new E.Z:C)}onLayerRemoved(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._featuresCaches[t.unusedCrs];e&&(e.clear(),delete this._featuresCaches[t.unusedCrs])}extentInsideLimit(){throw new Error("In extented Source, you have to implement the method extentInsideLimit!")}}},32533:(t,e,r)=>{"use strict";r.d(e,{ZP:()=>b});var i=r(99477),n=r(36194),s=r(86541),o=r(99617),a=r(62310),l=r(2359),c=r(67490),h=r(73502);i.Object3D.DEFAULT_UP.set(0,0,1);const u=new i.Vector3,d=new a.Z("EPSG:4326",0,0,0),p=new l.Z,f=[],m=new c.Z,g=new i.Vector3;function A(t){return t-360*Math.floor((t+180)/360)}function y(t){return t.getLayers((t=>t.isTiledGeometryLayer))[0]}class v extends i.Object3D{constructor(){super(),this.seaLevel=new i.Object3D,this.target=new i.Object3D,this.target.rotation.order="ZXY",this.camera=new i.Camera,this.add(this.seaLevel),this.seaLevel.add(this.target),this.target.add(this.camera),this.coord=new a.Z("EPSG:4978",0,0),this.targetWorldPosition=new i.Vector3,this.removeAll=()=>{},this._onChangeCallback=null}applyTransformToCamera(t,e){this.proxy?(e.quaternion._onChange(this._onChangeCallback),this.camera.matrixWorld.decompose(this.proxy.position,e.quaternion,e.scale),e.quaternion._onChange((()=>this.removeProxy(t,e)))):this.camera.matrixWorld.decompose(e.position,e.quaternion,e.scale),t.dispatchEvent({type:h.b.CAMERA_MOVED,coord:this.coord,range:this.range,heading:this.heading,tilt:this.tilt})}setProxy(t,e){!this.proxy&&t&&e&&(this.proxy={position:new i.Vector3},Object.keys(e.position).forEach((r=>function(t,e,r,i){r.proxy.position[i]=e.position[i],Object.defineProperty(e.position,i,{get:()=>r.proxy.position[i],set:n=>{r.removeProxy(t,e),e.position[i]=n}})}(t,e,this,r))),this._onChangeCallback=e.quaternion._onChangeCallback,e.quaternion._onChange((()=>this.removeProxy(t,e))))}removeProxy(t,e){this.stop(t),this.proxy&&t&&e&&(Object.keys(e.position).forEach((t=>Object.defineProperty(e.position,t,{value:this.proxy.position[t],writable:!0}))),e.quaternion._onChange(this._onChangeCallback),this.proxy=null)}setTargetFromCoordinate(t,e){e.as(y(t).extent.crs,this.coord);const r=Math.max(0,s.Z.getElevationValueAt(y(t),this.coord,s.Z.PRECISE_READ_Z)||this.coord.z);this.coord.z=r,this.coord.as(t.referenceCrs).toVector3(u),"EPSG:4978"==t.referenceCrs?(this.lookAt(u),this.seaLevel.position.set(0,0,u.length()-r)):(this.position.set(u.x,u.y,0),this.seaLevel.position.set(0,0,0)),this.target.position.set(0,0,r)}setFromPositions(t,e){this.setTargetFromCoordinate(t,new a.Z(t.referenceCrs,u)),this.target.rotation.set(0,0,0),this.updateMatrixWorld(!0),this.camera.position.copy(e),this.target.worldToLocal(this.camera.position);const r=this.camera.position.length();this.target.rotation.x=Math.asin(this.camera.position.z/r);const n=i.MathUtils.clamp(this.camera.position.y/(Math.cos(this.target.rotation.x)*r),-1,1);this.target.rotation.z=Math.sign(-this.camera.position.x||1)*Math.acos(n),this.camera.position.set(0,r,0)}applyParams(t,e){e.coord&&this.setTargetFromCoordinate(t,e.coord),null!=e.tilt&&(this.target.rotation.x=i.MathUtils.degToRad(e.tilt)),null!=e.heading&&(this.target.rotation.z=i.MathUtils.degToRad(-A(e.heading+180))),e.range&&this.camera.position.set(0,e.range,0),this.camera.rotation.set(.5*-Math.PI,0,Math.PI),this.updateMatrixWorld(!0),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld)}getParams(){return{coord:this.coord.clone(),tilt:this.tilt,heading:this.heading,range:this.range,targetWorldPosition:this.targetWorldPosition}}setfromCamera(t,e,r){e.updateMatrixWorld(!0),null==r&&(r=t.getPickingPositionFromDepth()||function(t,e){const r=new i.Vector3(0,0,.5);if(r.unproject(e),r.sub(e.position).normalize(),"EPSG:4978"==t.referenceCrs)return p.intersection({direction:r,origin:e.position});{const t=e.position.z/r.z;return r.multiplyScalar(t).add(e.position)}}(t,e));const n=r&&!isNaN(r.x)?e.position.distanceTo(r):100;e.localToWorld(u.set(0,0,-n)),this.setFromPositions(t,e.position)}copyObject3D(t){return this.copy(t,!1),this.seaLevel.copy(t.seaLevel,!1),this.target.copy(t.target,!1),this.camera.copy(t.camera),this}animateCameraToLookAtTarget(t,e,r){r.easing=r.easing||n.ZP.Easing.Quartic.InOut,this.setfromCamera(t,e);const s=new n.ZP.Group;this.start=(this.start||new v).copyObject3D(this),this.end=(this.end||new v).copyObject3D(this);const a=r.time||2500,l={t:0},c=[],h=(()=>{let t,e;return{promise:new Promise(((r,i)=>{t=r,e=i})),resolve:t,reject:e}})();this.addPlaceTargetOnGround(t,e,r.coord,l),this.end.applyParams(t,r);const u=this.end.target.rotation.z-this.start.target.rotation.z;return Math.abs(u)>Math.PI&&(this.end.target.rotation.z=this.start.target.rotation.z+u-2*Math.sign(u)*Math.PI),c.push(new n.ZP.Tween(l,s).to({t:1},a).easing(r.easing).onUpdate((e=>{"EPSG:4978"==t.referenceCrs&&this.quaternion.slerpQuaternions(this.start.quaternion,this.end.quaternion,e.t),this.camera.quaternion.slerpQuaternions(this.start.camera.quaternion,this.end.camera.quaternion,e.t),this.target.rotation.set(0,0,0),this.target.rotateZ(i.MathUtils.lerp(this.start.target.rotation.z,this.end.target.rotation.z,e.t)),this.target.rotateX(i.MathUtils.lerp(this.start.target.rotation.x,this.end.target.rotation.x,e.t))}))),"EPSG:4978"!=t.referenceCrs&&c.push(new n.ZP.Tween(this.position,s).to(this.end.position,a).easing(r.easing)),c.push(new n.ZP.Tween(this.seaLevel.position,s).to(this.end.seaLevel.position,a).easing(r.easing)),c.push(new n.ZP.Tween(this.camera.position,s).to(this.end.camera.position,a).easing(r.easing)),this.animationFrameRequester=()=>{s.update(),this.updateMatrixWorld(!0),this.applyTransformToCamera(t,e),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld),r.callback&&r.callback(this),d.crs=t.referenceCrs,d.setFromVector3(this.targetWorldPosition).as(y(t).extent.crs,this.coord),t.notifyChange(e)},this.removeAll=function(e){this.removeAll=()=>{},s.removeAll(),this.animationFrameRequester&&t.removeFrameRequester(o.Ao.BEFORE_RENDER,this.animationFrameRequester),h.resolve(void 0!==e),this.animationFrameRequester=null},c[c.length-1].onComplete(this.removeAll),c.forEach((t=>t.start())),t.addFrameRequester(o.Ao.BEFORE_RENDER,this.animationFrameRequester),t.notifyChange(e),h}stop(t){this.removePlaceTargetOnGround(t),this.removeAll()}addPlaceTargetOnGround(t,e,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{t:1};if(this.removePlaceTargetOnGround(t),t&&e){const n=this.target.position.z;this.placeTargetOnGround=()=>{const o=Math.max(0,s.Z.getElevationValueAt(y(t),r||this.coord,s.Z.PRECISE_READ_Z)||0);this.target.position.z=n*(1-i.t)+o*i.t,this.target.updateMatrixWorld(!0),this.applyTransformToCamera(t,e)},this.placeTargetOnGround(),t.addFrameRequester(o.Ao.BEFORE_RENDER,this.placeTargetOnGround)}}removePlaceTargetOnGround(t){t&&this.placeTargetOnGround&&(t.removeFrameRequester(o.Ao.BEFORE_RENDER,this.placeTargetOnGround),this.placeTargetOnGround=null)}get tilt(){return i.MathUtils.radToDeg(this.target.rotation.x)}get heading(){return-A(i.MathUtils.radToDeg(this.target.rotation.z)+180)}get range(){return this.camera.position.y}}function x(t){return f[t.uuid]=f[t.uuid]||new v,f[t.uuid]}const b={defaultStopPlaceOnGroundAtEnd:!1,Easing:n.ZP.Easing,stop(t,e){x(e).stop(t)},getTransformCameraLookingAtTarget(t,e,r){const i=x(e);return i.setfromCamera(t,e,r),i.getParams()},transformCameraToLookAtTarget(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.isExtent&&(r=this.getCameraTransformOptionsFromExtent(t,e,r)),r.proxy=void 0===r.proxy||r.proxy;const i=x(e);return i.stop(t),i.setfromCamera(t,e),r.proxy&&i.setProxy(t,e),i.applyParams(t,r),i.addPlaceTargetOnGround(t,e,r.coord),i.applyTransformToCamera(t,e),t.notifyChange(e),Promise.resolve(i.getParams())},getCameraTransformOptionsFromExtent(t,e,r){const n={coord:new a.Z(r.crs,0,0,0),heading:0,tilt:t.isPlanarView?90:89.9};let s;if(t.isGlobeView?(r=r.as("EPSG:4326"),m.setFromExtent(r),m.box3D.getSize(g),s={x:g.y,y:g.x}):s=(r=r.as(t.referenceCrs)).planarDimensions(),r.center(n.coord),e.isOrthographicCamera)s.x/s.y>e.aspect?e.zoom=(e.right-e.left)/s.x:e.zoom=(e.top-e.bottom)/s.y,e.updateProjectionMatrix(),n.range=1e3;else if(e.isPerspectiveCamera){const r=i.MathUtils.degToRad(e.fov);if(s.x/s.y>e.aspect){const e=.5*t.domElement.clientHeight/Math.tan(.5*r),i=2*Math.atan(.5*t.domElement.clientWidth/e);n.range=s.x/(2*Math.tan(.5*i))}else n.range=s.y/(2*Math.tan(.5*r))}return n},animateCameraToLookAtTarget(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.proxy=void 0===r.proxy||r.proxy;const i=x(e);return i.stop(t),r.proxy&&i.setProxy(t,e),i.animateCameraToLookAtTarget(t,e,r).promise.then((e=>{const n=void 0===r.stopPlaceOnGroundAtEnd?this.defaultStopPlaceOnGroundAtEnd:r.stopPlaceOnGroundAtEnd,s=i.getParams();return n&&i.stop(t),s.finished=e,s}))},sequenceAnimationsToLookAtTarget(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{}]).map((r=>()=>this.animateCameraToLookAtTarget(t,e,r))).reduce(((t,e)=>t.then((t=>!t.length||t[t.length-1].finished?e().then(Array.prototype.concat.bind(t)):Promise.resolve([{finished:!1}])))),Promise.resolve([]))},getDiffParams(t,e){if(!t||!e)return;let r;return Math.abs(t.range-e.range)/t.range>.001&&(r=r||{},r.range={previous:t.range,new:e.range}),Math.abs(t.tilt-e.tilt)>.1&&(r=r||{},r.tilt={previous:t.tilt,new:e.tilt}),Math.abs(t.heading-e.heading)>.1&&(r=r||{},r.heading={previous:t.heading,new:e.heading}),(Math.abs(t.coord.x-e.coord.x)>1e-6||Math.abs(t.coord.y-e.coord.y)>1e-6)&&(r=r||{},r.coord={previous:t.coord,new:e.coord}),r}}},86541:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a,P:()=>p});var i=r(99477),n=r(62310);const s={v:new i.Vector3,coord1:new n.Z("EPSG:4978"),coord2:new n.Z("EPSG:4978"),offset:new i.Vector2};function o(t,e,r,i,o,l){let c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},h=arguments.length>8?arguments[8]:void 0;const u=(arguments.length>7?arguments[7]:void 0)||new n.Z(i);c.worldFromLocal?u.setFromVector3(s.v.copy(o).applyMatrix4(c.worldFromLocal)):u.setFromVector3(o);const d=a.getTerrainObjectAt(t,u,e,r,h);if(d)return d.coord.z+=l,d.coord.as(i,s.coord2).toVector3(o),c.localFromWorld&&o.applyMatrix4(c.localFromWorld),{id:d.texture.id,version:d.texture.version,tile:d.tile}}const a={getElevationValueAt(t,e){const r=A(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e,(arguments.length>3?arguments[3]:void 0)||t.level0Nodes);if(r)return r.coord.z},getTerrainObjectAt(t,e){let r=arguments.length>4?arguments[4]:void 0;return A(t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e,(arguments.length>3?arguments[3]:void 0)||t.level0Nodes,r)},FAST_READ_Z:0,PRECISE_READ_Z:1,placeObjectOnGround:function(t,e,r){let s,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0;if(console.warn("placeObjectOnGround has been deprecated because it needs review and test"),s=c?c.concat(t.level0Nodes):t.level0Nodes,l.modifyGeometry){const c={worldFromLocal:r.matrixWorld,localFromWorld:(new i.Matrix4).copy(r.matrixWorld).invert()},h=r.geometry;if(h.vertices){l.cache&&(l.cache.length=h.vertices.length);let r=!0;const i=new n.Z(e);for(let n=0;n=0?e:void 0}}let c;function h(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s2&&void 0!==arguments[2]?arguments[2]:new i.Vector2;if(t.crs!=e.crs)throw new Error(`Unsupported mix: ${t.crs} and ${e.crs}`);e.planarDimensions(g);const n=(t.x-e.west)/g.x,s=(e.north-t.y)/g.y;r.set(n,s)}(a,c.extent,m.offset),a.z=1==e?function(t,e,r,n,s){const o=n.x/s.x/16;let a=Math.floor(r.x/o)*o,l=Math.floor(r.y/o)*o;1==a&&(a-=o),1==l&&(l-=o);const c=a,h=a+o,u=l,d=l+o,m=(r.x-a)/o,g=(r.y-l)/o,A=new i.Triangle(new i.Vector3(c,d),new i.Vector3(h,u),1==g||m/(1-g)>=1?new i.Vector3(h,d):new i.Vector3(c,u));A.getBarycoord(new i.Vector3(r.x,r.y),f);const y=t.attachedLayers.filter((t=>t.isElevationLayer))[0],v=p(y,e,A.a.x,A.a.y),x=p(y,e,A.b.x,A.b.y),b=p(y,e,A.c.x,A.c.y);return v*f.x+x*f.y+b*f.z}(t,y,m.offset,d.extent.planarDimensions(),c.extent.planarDimensions()):function(t,e,r){return function(t,e,r,i){const n=u(e,r,i);return h(t,e,n.wu<=0?n.u1:n.u2,n.wv<=0?n.v1:n.v2)}(t.attachedLayers.filter((t=>t.isElevationLayer))[0],e,r.x,r.y)}(t,y,m.offset),null!=a.z?{coord:a,texture:y,tile:d}:void 0}},29372:(t,e,r)=>{"use strict";r.d(e,{Z:()=>l});var i=r(5167);function n(t,e,r,i,n,s){const o=t.x,a=t.y;for(let t=i+s,l=i;t=-r&&p<=d+r&&Math.abs(u*o-h*a+s*n-c*i)/d<=r)return!0}return!1}function s(t,e,r,s,o,a,l){if(e==i.tg.LINE&&n(t,r,s,o,a,l))return!0;if(e==i.tg.POLYGON&&function(t,e,r,i,s,o){const a=t.x,l=t.y;let c=!1;for(let h=i,u=i+s-o;hl!=d>l&&a<(o-i)*(l-s)/(d-s)+i&&(c=!c)}return c}(t,r,s,o,a,l))return!0;if(e==i.tg.POINT){const e=function(t,e,r,i,n,s){const o=t.x,a=t.y;let l,c=r*r;for(let t=i;t2&&void 0!==arguments[2]?arguments[2]:.1;const i=[];if(t.as(e.crs,a),a.applyMatrix4(e.matrixWorldInverse),e.extent.isPointInside(a,r))if(e.isFeatureCollection){r*=Math.sqrt(e.scale.x**2+e.scale.y**2);for(const t of e.features)t.extent&&!t.extent.isPointInside(a,r)||o(a,t,r,i)}else e.geometries&&o(a,e,r,i);return i}}},59099:(t,e,r)=>{"use strict";function i(t){const e=function(t){const e=[];return t.alphaMap&&e.push(t.map),t.aoMap&&e.push(t.map),t.bumpMap&&e.push(t.bumpMap),t.displacementMap&&e.push(t.bumpMap),t.emissiveMap&&e.push(t.emissiveMap),t.envMap&&e.push(t.envMap),t.lightMap&&e.push(t.envMap),t.map&&e.push(t.map),t.metalnessMap&&e.push(t.map),t.normalMap&&e.push(t.map),t.roughnessMap&&e.push(t.map),t.specularMap&&e.push(t.specularMap),e}(t);if(Array.isArray(t))for(const e of t)e.dispose();else t.dispose();for(let t=0;t-1*(t.start-e.start)));const e=t.geometry.groups.length-1;let r=t.geometry.groups[e].materialIndex;const i=[r];for(let n=e-1;n>=0;n--){const e=t.geometry.groups[n];e.materialIndex===r?(t.geometry.groups[n+1].count+=e.count,t.geometry.groups.splice(n,1)):(r=e.materialIndex,i.push(r))}for(let e=t.material.length-1;e>=0;e--)i.includes(e)||(t.geometry.groups.forEach((t=>{t.materialIndex>e&&(t.materialIndex-=1)})),t.material.splice(e,1))}r.d(e,{O:()=>n,Z:()=>i})},99477:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ACESFilmicToneMapping:()=>st,AddEquation:()=>E,AddOperation:()=>tt,AdditiveAnimationBlendMode:()=>Ne,AdditiveBlending:()=>x,AlphaFormat:()=>Ft,AlwaysCompare:()=>Sr,AlwaysDepth:()=>H,AlwaysStencilFunc:()=>yr,AmbientLight:()=>op,AnimationAction:()=>Yp,AnimationClip:()=>Rd,AnimationLoader:()=>Fd,AnimationMixer:()=>Jp,AnimationObjectGroup:()=>Zp,AnimationUtils:()=>Ad,ArcCurve:()=>kh,ArrayCamera:()=>jl,ArrowHelper:()=>jf,AttachedBindMode:()=>at,Audio:()=>Pp,AudioAnalyser:()=>Fp,AudioContext:()=>xp,AudioListener:()=>Lp,AudioLoader:()=>bp,AxesHelper:()=>Vf,BackSide:()=>m,BasicDepthPacking:()=>Ve,BasicShadowMap:()=>h,BatchedMesh:()=>ch,Bone:()=>Pc,BooleanKeyframeTrack:()=>wd,Box2:()=>hf,Box3:()=>Ui,Box3Helper:()=>Nf,BoxGeometry:()=>Ys,BoxHelper:()=>Uf,BufferAttribute:()=>us,BufferGeometry:()=>Is,BufferGeometryLoader:()=>pp,ByteType:()=>It,Cache:()=>Ld,Camera:()=>eo,CameraHelper:()=>Df,CanvasTexture:()=>Ph,CapsuleGeometry:()=>iu,CatmullRomCurve3:()=>Qh,CineonToneMapping:()=>nt,CircleGeometry:()=>nu,ClampToEdgeWrapping:()=>gt,Clock:()=>Sp,Color:()=>$n,ColorKeyframeTrack:()=>Ed,ColorManagement:()=>mi,CompressedArrayTexture:()=>Bh,CompressedCubeTexture:()=>Lh,CompressedTexture:()=>Rh,CompressedTextureLoader:()=>zd,ConeGeometry:()=>ou,ConstantAlphaFactor:()=>Q,ConstantColorFactor:()=>z,CubeCamera:()=>no,CubeReflectionMapping:()=>ht,CubeRefractionMapping:()=>ut,CubeTexture:()=>so,CubeTextureLoader:()=>Qd,CubeUVReflectionMapping:()=>ft,CubicBezierCurve:()=>Wh,CubicBezierCurve3:()=>qh,CubicInterpolant:()=>vd,CullFaceBack:()=>a,CullFaceFront:()=>l,CullFaceFrontBack:()=>c,CullFaceNone:()=>o,Curve:()=>Dh,CurvePath:()=>tu,CustomBlending:()=>w,CustomToneMapping:()=>ot,CylinderGeometry:()=>su,Cylindrical:()=>lf,Data3DTexture:()=>Ri,DataArrayTexture:()=>Ti,DataTexture:()=>Dc,DataTextureLoader:()=>jd,DataUtils:()=>ls,DecrementStencilOp:()=>ar,DecrementWrapStencilOp:()=>cr,DefaultLoadingManager:()=>Dd,DepthFormat:()=>jt,DepthStencilFormat:()=>Vt,DepthTexture:()=>Ko,DetachedBindMode:()=>lt,DirectionalLight:()=>sp,DirectionalLightHelper:()=>Bf,DiscreteInterpolant:()=>bd,DisplayP3ColorSpace:()=>Je,DodecahedronGeometry:()=>lu,DoubleSide:()=>g,DstAlphaFactor:()=>O,DstColorFactor:()=>U,DynamicCopyUsage:()=>Dr,DynamicDrawUsage:()=>Tr,DynamicReadUsage:()=>Br,EdgesGeometry:()=>pu,EllipseCurve:()=>Oh,EqualCompare:()=>br,EqualDepth:()=>Z,EqualStencilFunc:()=>pr,EquirectangularReflectionMapping:()=>dt,EquirectangularRefractionMapping:()=>pt,Euler:()=>bn,EventDispatcher:()=>Gr,ExtrudeGeometry:()=>Qu,FileLoader:()=>Nd,Float16BufferAttribute:()=>vs,Float32BufferAttribute:()=>xs,Float64BufferAttribute:()=>bs,FloatType:()=>Dt,Fog:()=>$l,FogExp2:()=>Kl,FramebufferTexture:()=>Ih,FrontSide:()=>f,Frustum:()=>fo,GLBufferAttribute:()=>rf,GLSL1:()=>kr,GLSL3:()=>Ur,GreaterCompare:()=>wr,GreaterDepth:()=>X,GreaterEqualCompare:()=>Mr,GreaterEqualDepth:()=>Y,GreaterEqualStencilFunc:()=>Ar,GreaterStencilFunc:()=>mr,GridHelper:()=>Sf,Group:()=>Vl,HalfFloatType:()=>Ot,HemisphereLight:()=>Wd,HemisphereLightHelper:()=>Mf,IcosahedronGeometry:()=>Vu,ImageBitmapLoader:()=>yp,ImageLoader:()=>Gd,ImageUtils:()=>vi,IncrementStencilOp:()=>or,IncrementWrapStencilOp:()=>lr,InstancedBufferAttribute:()=>Nc,InstancedBufferGeometry:()=>dp,InstancedInterleavedBuffer:()=>ef,InstancedMesh:()=>Wc,Int16BufferAttribute:()=>ms,Int32BufferAttribute:()=>As,Int8BufferAttribute:()=>ds,IntType:()=>Lt,InterleavedBuffer:()=>ec,InterleavedBufferAttribute:()=>ic,Interpolant:()=>yd,InterpolateDiscrete:()=>Be,InterpolateLinear:()=>Le,InterpolateSmooth:()=>Pe,InvertStencilOp:()=>hr,KeepStencilOp:()=>nr,KeyframeTrack:()=>_d,LOD:()=>_c,LatheGeometry:()=>ru,Layers:()=>_n,LessCompare:()=>xr,LessDepth:()=>W,LessEqualCompare:()=>_r,LessEqualDepth:()=>q,LessEqualStencilFunc:()=>fr,LessStencilFunc:()=>dr,Light:()=>Hd,LightProbe:()=>cp,Line:()=>gh,Line3:()=>pf,LineBasicMaterial:()=>hh,LineCurve:()=>Zh,LineCurve3:()=>Yh,LineDashedMaterial:()=>ud,LineLoop:()=>xh,LineSegments:()=>vh,LinearDisplayP3ColorSpace:()=>Ke,LinearEncoding:()=>Qe,LinearFilter:()=>wt,LinearInterpolant:()=>xd,LinearMipMapLinearFilter:()=>Ct,LinearMipMapNearestFilter:()=>Mt,LinearMipmapLinearFilter:()=>St,LinearMipmapNearestFilter:()=>Et,LinearSRGBColorSpace:()=>Xe,LinearToneMapping:()=>rt,LinearTransfer:()=>$e,Loader:()=>Od,LoaderUtils:()=>up,LoadingManager:()=>Pd,LoopOnce:()=>Te,LoopPingPong:()=>Re,LoopRepeat:()=>Ie,LuminanceAlphaFormat:()=>Qt,LuminanceFormat:()=>Gt,MOUSE:()=>n,Material:()=>rs,MaterialLoader:()=>hp,MathUtils:()=>ti,Matrix3:()=>ri,Matrix4:()=>un,MaxEquation:()=>T,Mesh:()=>qs,MeshBasicMaterial:()=>is,MeshDepthMaterial:()=>Ul,MeshDistanceMaterial:()=>Nl,MeshLambertMaterial:()=>cd,MeshMatcapMaterial:()=>hd,MeshNormalMaterial:()=>ld,MeshPhongMaterial:()=>od,MeshPhysicalMaterial:()=>sd,MeshStandardMaterial:()=>nd,MeshToonMaterial:()=>ad,MinEquation:()=>C,MirroredRepeatWrapping:()=>At,MixOperation:()=>$,MultiplyBlending:()=>_,MultiplyOperation:()=>K,NearestFilter:()=>yt,NearestMipMapLinearFilter:()=>_t,NearestMipMapNearestFilter:()=>xt,NearestMipmapLinearFilter:()=>bt,NearestMipmapNearestFilter:()=>vt,NeverCompare:()=>vr,NeverDepth:()=>V,NeverStencilFunc:()=>ur,NoBlending:()=>y,NoColorSpace:()=>Ze,NoToneMapping:()=>et,NormalAnimationBlendMode:()=>Ue,NormalBlending:()=>v,NotEqualCompare:()=>Er,NotEqualDepth:()=>J,NotEqualStencilFunc:()=>gr,NumberKeyframeTrack:()=>Md,Object3D:()=>kn,ObjectLoader:()=>fp,ObjectSpaceNormalMap:()=>qe,OctahedronGeometry:()=>Hu,OneFactor:()=>R,OneMinusConstantAlphaFactor:()=>j,OneMinusConstantColorFactor:()=>G,OneMinusDstAlphaFactor:()=>k,OneMinusDstColorFactor:()=>N,OneMinusSrcAlphaFactor:()=>D,OneMinusSrcColorFactor:()=>L,OrthographicCamera:()=>To,P3Primaries:()=>rr,PCFShadowMap:()=>u,PCFSoftShadowMap:()=>d,PMREMGenerator:()=>No,Path:()=>eu,PerspectiveCamera:()=>ro,Plane:()=>ho,PlaneGeometry:()=>Ao,PlaneHelper:()=>Ff,PointLight:()=>ip,PointLightHelper:()=>bf,Points:()=>Sh,PointsMaterial:()=>bh,PolarGridHelper:()=>Cf,PolyhedronGeometry:()=>au,PositionalAudio:()=>Np,PropertyBinding:()=>qp,PropertyMixer:()=>zp,QuadraticBezierCurve:()=>Xh,QuadraticBezierCurve3:()=>Jh,Quaternion:()=>Pi,QuaternionKeyframeTrack:()=>Cd,QuaternionLinearInterpolant:()=>Sd,RED_GREEN_RGTC2_Format:()=>Se,RED_RGTC1_Format:()=>Ee,REVISION:()=>i,RGBADepthPacking:()=>He,RGBAFormat:()=>zt,RGBAIntegerFormat:()=>Yt,RGBA_ASTC_10x10_Format:()=>ye,RGBA_ASTC_10x5_Format:()=>me,RGBA_ASTC_10x6_Format:()=>ge,RGBA_ASTC_10x8_Format:()=>Ae,RGBA_ASTC_12x10_Format:()=>ve,RGBA_ASTC_12x12_Format:()=>xe,RGBA_ASTC_4x4_Format:()=>ae,RGBA_ASTC_5x4_Format:()=>le,RGBA_ASTC_5x5_Format:()=>ce,RGBA_ASTC_6x5_Format:()=>he,RGBA_ASTC_6x6_Format:()=>ue,RGBA_ASTC_8x5_Format:()=>de,RGBA_ASTC_8x6_Format:()=>pe,RGBA_ASTC_8x8_Format:()=>fe,RGBA_BPTC_Format:()=>be,RGBA_ETC2_EAC_Format:()=>oe,RGBA_PVRTC_2BPPV1_Format:()=>ie,RGBA_PVRTC_4BPPV1_Format:()=>re,RGBA_S3TC_DXT1_Format:()=>Jt,RGBA_S3TC_DXT3_Format:()=>Kt,RGBA_S3TC_DXT5_Format:()=>$t,RGB_BPTC_SIGNED_Format:()=>_e,RGB_BPTC_UNSIGNED_Format:()=>we,RGB_ETC1_Format:()=>ne,RGB_ETC2_Format:()=>se,RGB_PVRTC_2BPPV1_Format:()=>ee,RGB_PVRTC_4BPPV1_Format:()=>te,RGB_S3TC_DXT1_Format:()=>Xt,RGFormat:()=>qt,RGIntegerFormat:()=>Zt,RawShaderMaterial:()=>id,Ray:()=>hn,Raycaster:()=>nf,Rec709Primaries:()=>er,RectAreaLight:()=>ap,RedFormat:()=>Ht,RedIntegerFormat:()=>Wt,ReinhardToneMapping:()=>it,RenderTarget:()=>Si,RepeatWrapping:()=>mt,ReplaceStencilOp:()=>sr,ReverseSubtractEquation:()=>S,RingGeometry:()=>Wu,SIGNED_RED_GREEN_RGTC2_Format:()=>Ce,SIGNED_RED_RGTC1_Format:()=>Me,SRGBColorSpace:()=>Ye,SRGBTransfer:()=>tr,Scene:()=>tc,ShaderChunk:()=>yo,ShaderLib:()=>xo,ShaderMaterial:()=>to,ShadowMaterial:()=>rd,Shape:()=>fu,ShapeGeometry:()=>qu,ShapePath:()=>Hf,ShapeUtils:()=>Fu,ShortType:()=>Rt,Skeleton:()=>Uc,SkeletonHelper:()=>vf,SkinnedMesh:()=>Lc,Source:()=>bi,Sphere:()=>en,SphereGeometry:()=>Zu,Spherical:()=>af,SphericalHarmonics3:()=>lp,SplineCurve:()=>Kh,SpotLight:()=>Kd,SpotLightHelper:()=>mf,Sprite:()=>yc,SpriteMaterial:()=>nc,SrcAlphaFactor:()=>P,SrcAlphaSaturateFactor:()=>F,SrcColorFactor:()=>B,StaticCopyUsage:()=>Pr,StaticDrawUsage:()=>Cr,StaticReadUsage:()=>Rr,StereoCamera:()=>Mp,StreamCopyUsage:()=>Or,StreamDrawUsage:()=>Ir,StreamReadUsage:()=>Lr,StringKeyframeTrack:()=>Td,SubtractEquation:()=>M,SubtractiveBlending:()=>b,TOUCH:()=>s,TangentSpaceNormalMap:()=>We,TetrahedronGeometry:()=>Yu,Texture:()=>Ei,TextureLoader:()=>Vd,TorusGeometry:()=>Xu,TorusKnotGeometry:()=>Ju,Triangle:()=>Zn,TriangleFanDrawMode:()=>Ge,TriangleStripDrawMode:()=>ze,TrianglesDrawMode:()=>Fe,TubeGeometry:()=>Ku,TwoPassDoubleSide:()=>A,UVMapping:()=>ct,Uint16BufferAttribute:()=>gs,Uint32BufferAttribute:()=>ys,Uint8BufferAttribute:()=>ps,Uint8ClampedBufferAttribute:()=>fs,Uniform:()=>Kp,UniformsGroup:()=>tf,UniformsLib:()=>vo,UniformsUtils:()=>$s,UnsignedByteType:()=>Tt,UnsignedInt248Type:()=>Nt,UnsignedIntType:()=>Pt,UnsignedShort4444Type:()=>kt,UnsignedShort5551Type:()=>Ut,UnsignedShortType:()=>Bt,VSMShadowMap:()=>p,Vector2:()=>ei,Vector3:()=>Di,Vector4:()=>Mi,VectorKeyframeTrack:()=>Id,VideoTexture:()=>Th,WebGL1Renderer:()=>Jl,WebGL3DRenderTarget:()=>Bi,WebGLArrayRenderTarget:()=>Ii,WebGLCoordinateSystem:()=>Fr,WebGLCubeRenderTarget:()=>oo,WebGLMultipleRenderTargets:()=>Li,WebGLRenderTarget:()=>Ci,WebGLRenderer:()=>Xl,WebGLUtils:()=>Ql,WebGPUCoordinateSystem:()=>zr,WireframeGeometry:()=>$u,WrapAroundEnding:()=>ke,ZeroCurvatureEnding:()=>De,ZeroFactor:()=>I,ZeroSlopeEnding:()=>Oe,ZeroStencilOp:()=>ir,_SRGBAFormat:()=>Nr,createCanvasElement:()=>li,sRGBEncoding:()=>je});const i="159",n={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,l=2,c=3,h=0,u=1,d=2,p=3,f=0,m=1,g=2,A=2,y=0,v=1,x=2,b=3,_=4,w=5,E=100,M=101,S=102,C=103,T=104,I=200,R=201,B=202,L=203,P=204,D=205,O=206,k=207,U=208,N=209,F=210,z=211,G=212,Q=213,j=214,V=0,H=1,W=2,q=3,Z=4,Y=5,X=6,J=7,K=0,$=1,tt=2,et=0,rt=1,it=2,nt=3,st=4,ot=5,at="attached",lt="detached",ct=300,ht=301,ut=302,dt=303,pt=304,ft=306,mt=1e3,gt=1001,At=1002,yt=1003,vt=1004,xt=1004,bt=1005,_t=1005,wt=1006,Et=1007,Mt=1007,St=1008,Ct=1008,Tt=1009,It=1010,Rt=1011,Bt=1012,Lt=1013,Pt=1014,Dt=1015,Ot=1016,kt=1017,Ut=1018,Nt=1020,Ft=1021,zt=1023,Gt=1024,Qt=1025,jt=1026,Vt=1027,Ht=1028,Wt=1029,qt=1030,Zt=1031,Yt=1033,Xt=33776,Jt=33777,Kt=33778,$t=33779,te=35840,ee=35841,re=35842,ie=35843,ne=36196,se=37492,oe=37496,ae=37808,le=37809,ce=37810,he=37811,ue=37812,de=37813,pe=37814,fe=37815,me=37816,ge=37817,Ae=37818,ye=37819,ve=37820,xe=37821,be=36492,_e=36494,we=36495,Ee=36283,Me=36284,Se=36285,Ce=36286,Te=2200,Ie=2201,Re=2202,Be=2300,Le=2301,Pe=2302,De=2400,Oe=2401,ke=2402,Ue=2500,Ne=2501,Fe=0,ze=1,Ge=2,Qe=3e3,je=3001,Ve=3200,He=3201,We=0,qe=1,Ze="",Ye="srgb",Xe="srgb-linear",Je="display-p3",Ke="display-p3-linear",$e="linear",tr="srgb",er="rec709",rr="p3",ir=0,nr=7680,sr=7681,or=7682,ar=7683,lr=34055,cr=34056,hr=5386,ur=512,dr=513,pr=514,fr=515,mr=516,gr=517,Ar=518,yr=519,vr=512,xr=513,br=514,_r=515,wr=516,Er=517,Mr=518,Sr=519,Cr=35044,Tr=35048,Ir=35040,Rr=35045,Br=35049,Lr=35041,Pr=35046,Dr=35050,Or=35042,kr="100",Ur="300 es",Nr=1035,Fr=2e3,zr=2001;class Gr{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>8&255]+Qr[t>>16&255]+Qr[t>>24&255]+"-"+Qr[255&e]+Qr[e>>8&255]+"-"+Qr[e>>16&15|64]+Qr[e>>24&255]+"-"+Qr[63&r|128]+Qr[r>>8&255]+"-"+Qr[r>>16&255]+Qr[r>>24&255]+Qr[255&i]+Qr[i>>8&255]+Qr[i>>16&255]+Qr[i>>24&255]).toLowerCase()}function qr(t,e,r){return Math.max(e,Math.min(r,t))}function Zr(t,e){return(t%e+e)%e}function Yr(t,e,r){return(1-r)*t+r*e}function Xr(t){return 0==(t&t-1)&&0!==t}function Jr(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Kr(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function $r(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const ti={DEG2RAD:Vr,RAD2DEG:Hr,generateUUID:Wr,clamp:qr,euclideanModulo:Zr,mapLinear:function(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)},inverseLerp:function(t,e,r){return t!==e?(r-t)/(e-t):0},lerp:Yr,damp:function(t,e,r,i){return Yr(t,e,1-Math.exp(-r*i))},pingpong:function(t,e=1){return e-Math.abs(Zr(t,2*e)-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(jr=t);let e=jr+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*Vr},radToDeg:function(t){return t*Hr},isPowerOfTwo:Xr,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Jr,setQuaternionFromProperEuler:function(t,e,r,i,n){const s=Math.cos,o=Math.sin,a=s(r/2),l=o(r/2),c=s((e+i)/2),h=o((e+i)/2),u=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,l*u,l*d,a*c);break;case"YZY":t.set(l*d,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*d,a*h,a*c);break;case"XZX":t.set(a*h,l*f,l*p,a*c);break;case"YXY":t.set(l*p,a*h,l*f,a*c);break;case"ZYZ":t.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}},normalize:$r,denormalize:Kr};class ei{constructor(t=0,e=0){ei.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}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(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(qr(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}}class ri{constructor(t,e,r,i,n,s,o,a,l){ri.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,l)}set(t,e,r,i,n,s,o,a,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=o,c[3]=e,c[4]=n,c[5]=a,c[6]=r,c[7]=s,c[8]=l,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],l=r[1],c=r[4],h=r[7],u=r[2],d=r[5],p=r[8],f=i[0],m=i[3],g=i[6],A=i[1],y=i[4],v=i[7],x=i[2],b=i[5],_=i[8];return n[0]=s*f+o*A+a*x,n[3]=s*m+o*y+a*b,n[6]=s*g+o*v+a*_,n[1]=l*f+c*A+h*x,n[4]=l*m+c*y+h*b,n[7]=l*g+c*v+h*_,n[2]=u*f+d*A+p*x,n[5]=u*m+d*y+p*b,n[8]=u*g+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],l=t[7],c=t[8];return e*s*c-e*o*l-r*n*c+r*o*a+i*n*l-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],l=t[7],c=t[8],h=c*s-o*l,u=o*a-c*n,d=l*n-s*a,p=e*h+r*u+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*l-c*r)*f,t[2]=(o*r-i*s)*f,t[3]=u*f,t[4]=(c*e-i*a)*f,t[5]=(i*n-o*e)*f,t[6]=d*f,t[7]=(r*a-l*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),l=Math.sin(n);return this.set(r*a,r*l,-r*(a*s+l*o)+s+t,-i*l,i*a,-i*(-l*s+a*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(ii.makeScale(t,e)),this}rotate(t){return this.premultiply(ii.makeRotation(-t)),this}translate(t,e){return this.premultiply(ii.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):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 ii=new ri;function ni(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const si={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function oi(t,e){return new si[t](e)}function ai(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function li(){const t=ai("canvas");return t.style.display="block",t}const ci={};function hi(t){t in ci||(ci[t]=!0,console.warn(t))}const ui=(new ri).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),di=(new ri).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),pi={[Xe]:{transfer:$e,primaries:er,toReference:t=>t,fromReference:t=>t},[Ye]:{transfer:tr,primaries:er,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Ke]:{transfer:$e,primaries:rr,toReference:t=>t.applyMatrix3(di),fromReference:t=>t.applyMatrix3(ui)},[Je]:{transfer:tr,primaries:rr,toReference:t=>t.convertSRGBToLinear().applyMatrix3(di),fromReference:t=>t.applyMatrix3(ui).convertLinearToSRGB()}},fi=new Set([Xe,Ke]),mi={enabled:!0,_workingColorSpace:Xe,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 this._workingColorSpace},set workingColorSpace(t){if(!fi.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,r){if(!1===this.enabled||e===r||!e||!r)return t;const i=pi[e].toReference;return(0,pi[r].fromReference)(i(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return pi[t].primaries},getTransfer:function(t){return t===Ze?$e:pi[t].transfer}};function gi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ai(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let yi;class vi{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===yi&&(yi=ai("canvas")),yi.width=t.width,yi.height=t.height;const r=yi.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),e=yi}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=ai("canvas");e.width=t.width,e.height=t.height;const r=e.getContext("2d");r.drawImage(t,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height),n=i.data;for(let t=0;t0&&(r.userData=this.userData),e||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==ct)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case mt:t.x=t.x-Math.floor(t.x);break;case gt:t.x=t.x<0?0:1;break;case At: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 mt:t.y=t.y-Math.floor(t.y);break;case gt:t.y=t.y<0?0:1;break;case At: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 hi("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Ye?je:Qe}set encoding(t){hi("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===je?Ye:Ze}}Ei.DEFAULT_IMAGE=null,Ei.DEFAULT_MAPPING=ct,Ei.DEFAULT_ANISOTROPY=1;class Mi{constructor(t=0,e=0,r=0,i=1){Mi.prototype.isVector4=!0,this.x=t,this.y=e,this.z=r,this.w=i}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,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)a&&t>A?tA?a=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+u*n,l=l*t+d*n,c=c*t+p*n,h=h*t+f*n,t===1-o){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,r,i,n,s){const o=r[i],a=r[i+1],l=r[i+2],c=r[i+3],h=n[s],u=n[s+1],d=n[s+2],p=n[s+3];return t[e]=o*p+c*h+a*d-l*u,t[e+1]=a*p+c*u+l*h-o*d,t[e+2]=l*p+c*d+o*u-a*h,t[e+3]=c*p-o*h-a*u-l*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,l=o(r/2),c=o(i/2),h=o(n/2),u=a(r/2),d=a(i/2),p=a(n/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*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],l=e[2],c=e[6],h=e[10],u=r+o+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=(s-i)*t}else if(r>o&&r>h){const t=2*Math.sqrt(1+r-o-h);this._w=(c-a)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(n+l)/t}else if(o>h){const t=2*Math.sqrt(1+o-r-h);this._w=(n-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-r-o);this._w=(s-i)/t,this._x=(n+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let r=t.dot(e)+1;return rMath.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(qr(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()}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 r=t._x,i=t._y,n=t._z,s=t._w,o=e._x,a=e._y,l=e._z,c=e._w;return this._x=r*c+s*o+i*l-n*a,this._y=i*c+s*a+n*o-r*l,this._z=n*c+s*l+r*a-i*o,this._w=s*c-r*o-i*a-n*l,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 l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=r*h+this._x*u,this._y=i*h+this._y*u,this._z=n*h+this._z*u,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}}class Di{constructor(t=0,e=0,r=0){Di.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(ki.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ki.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,l=2*(s*i-o*r),c=2*(o*e-n*i),h=2*(n*r-s*e);return this.x=e+a*l+s*h-o*c,this.y=r+a*c+o*l-n*h,this.z=i+a*h+n*c-s*l,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(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 Oi.copy(this).projectOnVector(t),this.sub(Oi)}reflect(t){return this.sub(Oi.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(qr(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 Oi=new Di,ki=new Pi;class Ui{constructor(t=new Di(1/0,1/0,1/0),e=new Di(-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;ethis.max.x||t.ythis.max.y||t.zthis.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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Fi),Fi.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(qi),Zi.subVectors(this.max,qi),Gi.subVectors(t.a,qi),Qi.subVectors(t.b,qi),ji.subVectors(t.c,qi),Vi.subVectors(Qi,Gi),Hi.subVectors(ji,Qi),Wi.subVectors(Gi,ji);let e=[0,-Vi.z,Vi.y,0,-Hi.z,Hi.y,0,-Wi.z,Wi.y,Vi.z,0,-Vi.x,Hi.z,0,-Hi.x,Wi.z,0,-Wi.x,-Vi.y,Vi.x,0,-Hi.y,Hi.x,0,-Wi.y,Wi.x,0];return!!Ji(e,Gi,Qi,ji,Zi)&&(e=[1,0,0,0,1,0,0,0,1],!!Ji(e,Gi,Qi,ji,Zi)&&(Yi.crossVectors(Vi,Hi),e=[Yi.x,Yi.y,Yi.z],Ji(e,Gi,Qi,ji,Zi)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Fi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Fi).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()||(Ni[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ni[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ni[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ni[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ni[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ni[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ni[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ni[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ni)),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 Ni=[new Di,new Di,new Di,new Di,new Di,new Di,new Di,new Di],Fi=new Di,zi=new Ui,Gi=new Di,Qi=new Di,ji=new Di,Vi=new Di,Hi=new Di,Wi=new Di,qi=new Di,Zi=new Di,Yi=new Di,Xi=new Di;function Ji(t,e,r,i,n){for(let s=0,o=t.length-3;s<=o;s+=3){Xi.fromArray(t,s);const o=n.x*Math.abs(Xi.x)+n.y*Math.abs(Xi.y)+n.z*Math.abs(Xi.z),a=e.dot(Xi),l=r.dot(Xi),c=i.dot(Xi);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const Ki=new Ui,$i=new Di,tn=new Di;class en{constructor(t=new Di,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):Ki.setFromPoints(t).getCenter(r);let i=0;for(let e=0,n=t.length;ethis.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;$i.subVectors(t,this.center);const e=$i.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),r=.5*(t-this.radius);this.center.addScaledVector($i,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):(tn.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint($i.copy(t.center).add(tn)),this.expandByPoint($i.copy(t.center).sub(tn))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const rn=new Di,nn=new Di,sn=new Di,on=new Di,an=new Di,ln=new Di,cn=new Di;class hn{constructor(t=new Di,e=new Di(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,rn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const r=e.dot(this.direction);return r<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=rn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(rn.copy(this.origin).addScaledVector(this.direction,e),rn.distanceToSquared(t))}distanceSqToSegment(t,e,r,i){nn.copy(t).add(e).multiplyScalar(.5),sn.copy(e).sub(t).normalize(),on.copy(this.origin).sub(nn);const n=.5*t.distanceTo(e),s=-this.direction.dot(sn),o=on.dot(this.direction),a=-on.dot(sn),l=on.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*a-o,u=s*o-a,p=n*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-s*n+o)),u=h>0?-n:Math.min(Math.max(-n,-a),n),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-n,-a),n),d=u*(u+2*a)+l):(h=Math.max(0,-(s*n+o)),u=h>0?n:Math.min(Math.max(-n,-a),n),d=-h*h+u*(u+2*a)+l);else u=s>0?-n:n,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return r&&r.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(nn).addScaledVector(sn,u),d}intersectSphere(t,e){rn.subVectors(t.center,this.origin);const r=rn.dot(this.direction),i=rn.dot(rn)-r*r,n=t.radius*t.radius;if(i>n)return null;const s=Math.sqrt(n-i),o=r-s,a=r+s;return a<0?null:o<0?this.at(a,e):this.at(o,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 r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null}intersectPlane(t,e){const r=this.distanceToPlane(t);return null===r?null:this.at(r,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let r,i,n,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(r=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(r=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(n=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(n=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),r>s||n>i?null:((n>r||isNaN(r))&&(r=n),(s=0?(o=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(o=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),r>a||o>i?null:((o>r||r!=r)&&(r=o),(a=0?r:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,rn)}intersectTriangle(t,e,r,i,n){an.subVectors(e,t),ln.subVectors(r,t),cn.crossVectors(an,ln);let s,o=this.direction.dot(cn);if(o>0){if(i)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}on.subVectors(this.origin,t);const a=s*this.direction.dot(ln.crossVectors(on,ln));if(a<0)return null;const l=s*this.direction.dot(an.cross(on));if(l<0)return null;if(a+l>o)return null;const c=-s*on.dot(cn);return c<0?null:this.at(c/o,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)}}class un{constructor(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m){un.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m)}set(t,e,r,i,n,s,o,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=r,g[12]=i,g[1]=n,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new un).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/dn.setFromMatrixColumn(t,0).length(),n=1/dn.setFromMatrixColumn(t,1).length(),s=1/dn.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]*s,e[9]=r[9]*s,e[10]=r[10]*s,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),l=Math.sin(i),c=Math.cos(n),h=Math.sin(n);if("XYZ"===t.order){const t=s*c,r=s*h,i=o*c,n=o*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=r+i*l,e[5]=t-n*l,e[9]=-o*a,e[2]=n-t*l,e[6]=i+r*l,e[10]=s*a}else if("YXZ"===t.order){const t=a*c,r=a*h,i=l*c,n=l*h;e[0]=t+n*o,e[4]=i*o-r,e[8]=s*l,e[1]=s*h,e[5]=s*c,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*c,r=a*h,i=l*c,n=l*h;e[0]=t-n*o,e[4]=-s*h,e[8]=i+r*o,e[1]=r+i*o,e[5]=s*c,e[9]=n-t*o,e[2]=-s*l,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*c,r=s*h,i=o*c,n=o*h;e[0]=a*c,e[4]=i*l-r,e[8]=t*l+n,e[1]=a*h,e[5]=n*l+t,e[9]=r*l-i,e[2]=-l,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,r=s*l,i=o*a,n=o*l;e[0]=a*c,e[4]=n-t*h,e[8]=i*h+r,e[1]=h,e[5]=s*c,e[9]=-o*c,e[2]=-l*c,e[6]=r*h+i,e[10]=t-n*h}else if("XZY"===t.order){const t=s*a,r=s*l,i=o*a,n=o*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+n,e[5]=s*c,e[9]=r*h-i,e[2]=i*h-r,e[6]=o*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(fn,t,mn)}lookAt(t,e,r){const i=this.elements;return yn.subVectors(t,e),0===yn.lengthSq()&&(yn.z=1),yn.normalize(),gn.crossVectors(r,yn),0===gn.lengthSq()&&(1===Math.abs(r.z)?yn.x+=1e-4:yn.z+=1e-4,yn.normalize(),gn.crossVectors(r,yn)),gn.normalize(),An.crossVectors(yn,gn),i[0]=gn.x,i[4]=An.x,i[8]=yn.x,i[1]=gn.y,i[5]=An.y,i[9]=yn.y,i[2]=gn.z,i[6]=An.z,i[10]=yn.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],l=r[12],c=r[1],h=r[5],u=r[9],d=r[13],p=r[2],f=r[6],m=r[10],g=r[14],A=r[3],y=r[7],v=r[11],x=r[15],b=i[0],_=i[4],w=i[8],E=i[12],M=i[1],S=i[5],C=i[9],T=i[13],I=i[2],R=i[6],B=i[10],L=i[14],P=i[3],D=i[7],O=i[11],k=i[15];return n[0]=s*b+o*M+a*I+l*P,n[4]=s*_+o*S+a*R+l*D,n[8]=s*w+o*C+a*B+l*O,n[12]=s*E+o*T+a*L+l*k,n[1]=c*b+h*M+u*I+d*P,n[5]=c*_+h*S+u*R+d*D,n[9]=c*w+h*C+u*B+d*O,n[13]=c*E+h*T+u*L+d*k,n[2]=p*b+f*M+m*I+g*P,n[6]=p*_+f*S+m*R+g*D,n[10]=p*w+f*C+m*B+g*O,n[14]=p*E+f*T+m*L+g*k,n[3]=A*b+y*M+v*I+x*P,n[7]=A*_+y*S+v*R+x*D,n[11]=A*w+y*C+v*B+x*O,n[15]=A*E+y*T+v*L+x*k,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],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+n*a*h-i*l*h-n*o*u+r*l*u+i*o*d-r*a*d)+t[7]*(+e*a*d-e*l*u+n*s*u-i*s*d+i*l*c-n*a*c)+t[11]*(+e*l*h-e*o*d-n*s*h+r*s*d+n*o*c-r*l*c)+t[15]*(-i*o*c-e*a*h+e*o*u+i*s*h-r*s*u+r*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,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],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],A=h*m*l-f*u*l+f*a*d-o*m*d-h*a*g+o*u*g,y=p*u*l-c*m*l-p*a*d+s*m*d+c*a*g-s*u*g,v=c*f*l-p*h*l+p*o*d-s*f*d-c*o*g+s*h*g,x=p*h*a-c*f*a-p*o*u+s*f*u+c*o*m-s*h*m,b=e*A+r*y+i*v+n*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/b;return t[0]=A*_,t[1]=(f*u*n-h*m*n-f*i*d+r*m*d+h*i*g-r*u*g)*_,t[2]=(o*m*n-f*a*n+f*i*l-r*m*l-o*i*g+r*a*g)*_,t[3]=(h*a*n-o*u*n-h*i*l+r*u*l+o*i*d-r*a*d)*_,t[4]=y*_,t[5]=(c*m*n-p*u*n+p*i*d-e*m*d-c*i*g+e*u*g)*_,t[6]=(p*a*n-s*m*n-p*i*l+e*m*l+s*i*g-e*a*g)*_,t[7]=(s*u*n-c*a*n+c*i*l-e*u*l-s*i*d+e*a*d)*_,t[8]=v*_,t[9]=(p*h*n-c*f*n-p*r*d+e*f*d+c*r*g-e*h*g)*_,t[10]=(s*f*n-p*o*n+p*r*l-e*f*l-s*r*g+e*o*g)*_,t[11]=(c*o*n-s*h*n-c*r*l+e*h*l+s*r*d-e*o*d)*_,t[12]=x*_,t[13]=(c*f*i-p*h*i+p*r*u-e*f*u-c*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-c*o*i+c*r*a-e*h*a-s*r*u+e*o*u)*_,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 t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):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,l=n*s,c=n*o;return this.set(l*s+r,l*o-i*a,l*a+i*o,0,l*o+i*a,c*o+r,c*a-i*s,0,l*a-i*o,c*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,l=n+n,c=s+s,h=o+o,u=n*l,d=n*c,p=n*h,f=s*c,m=s*h,g=o*h,A=a*l,y=a*c,v=a*h,x=r.x,b=r.y,_=r.z;return i[0]=(1-(f+g))*x,i[1]=(d+v)*x,i[2]=(p-y)*x,i[3]=0,i[4]=(d-v)*b,i[5]=(1-(u+g))*b,i[6]=(m+A)*b,i[7]=0,i[8]=(p+y)*_,i[9]=(m-A)*_,i[10]=(1-(u+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=dn.set(i[0],i[1],i[2]).length();const s=dn.set(i[4],i[5],i[6]).length(),o=dn.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],pn.copy(this);const a=1/n,l=1/s,c=1/o;return pn.elements[0]*=a,pn.elements[1]*=a,pn.elements[2]*=a,pn.elements[4]*=l,pn.elements[5]*=l,pn.elements[6]*=l,pn.elements[8]*=c,pn.elements[9]*=c,pn.elements[10]*=c,e.setFromRotationMatrix(pn),r.x=n,r.y=s,r.z=o,this}makePerspective(t,e,r,i,n,s,o=Fr){const a=this.elements,l=2*n/(e-t),c=2*n/(r-i),h=(e+t)/(e-t),u=(r+i)/(r-i);let d,p;if(o===Fr)d=-(s+n)/(s-n),p=-2*s*n/(s-n);else{if(o!==zr)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);d=-s/(s-n),p=-s*n/(s-n)}return a[0]=l,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,r,i,n,s,o=Fr){const a=this.elements,l=1/(e-t),c=1/(r-i),h=1/(s-n),u=(e+t)*l,d=(r+i)*c;let p,f;if(o===Fr)p=(s+n)*h,f=-2*h;else{if(o!==zr)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);p=n*h,f=-1*h}return a[0]=2*l,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=f,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[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 dn=new Di,pn=new un,fn=new Di(0,0,0),mn=new Di(1,1,1),gn=new Di,An=new Di,yn=new Di,vn=new un,xn=new Pi;class bn{constructor(t=0,e=0,r=0,i=bn.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],l=i[5],c=i[9],h=i[2],u=i[6],d=i[10];switch(e){case"XYZ":this._y=Math.asin(qr(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-s,n)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-qr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-h,n),this._z=0);break;case"ZXY":this._x=Math.asin(qr(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(a,n));break;case"ZYX":this._y=Math.asin(-qr(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(a,n)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(qr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,n)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-qr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(u,l),this._y=Math.atan2(o,n)):(this._x=Math.atan2(-c,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 vn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(vn,e,r)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return xn.setFromEuler(this),this.setFromQuaternion(xn,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}}bn.DEFAULT_ORDER="XYZ";class _n{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let t=0;t1){for(let t=0;t0&&(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.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),null!==this.boundingBox&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()})),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;e0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(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),l.length>0&&(r.skeletons=l),c.length>0&&(r.animations=c),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.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,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.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e0?i.multiplyScalar(1/Math.sqrt(n)):i.set(0,0,0)}static getBarycoord(t,e,r,i,n){Un.subVectors(i,e),Nn.subVectors(r,e),Fn.subVectors(t,e);const s=Un.dot(Un),o=Un.dot(Nn),a=Un.dot(Fn),l=Nn.dot(Nn),c=Nn.dot(Fn),h=s*l-o*o;if(0===h)return n.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,p=(s*c-o*a)*u;return n.set(1-d-p,p,d)}static containsPoint(t,e,r,i){return this.getBarycoord(t,e,r,i,zn),zn.x>=0&&zn.y>=0&&zn.x+zn.y<=1}static getUV(t,e,r,i,n,s,o,a){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),this.getInterpolation(t,e,r,i,n,s,o,a)}static getInterpolation(t,e,r,i,n,s,o,a){return this.getBarycoord(t,e,r,i,zn),a.setScalar(0),a.addScaledVector(n,zn.x),a.addScaledVector(s,zn.y),a.addScaledVector(o,zn.z),a}static isFrontFacing(t,e,r,i){return Un.subVectors(r,e),Nn.subVectors(t,e),Un.cross(Nn).dot(i)<0}set(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this}setFromPointsAndIndices(t,e,r,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,r,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,i),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 Un.subVectors(this.c,this.b),Nn.subVectors(this.a,this.b),.5*Un.cross(Nn).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Zn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Zn.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,r,i,n){return!1===qn&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),qn=!0),Zn.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}getInterpolation(t,e,r,i,n){return Zn.getInterpolation(t,this.a,this.b,this.c,e,r,i,n)}containsPoint(t){return Zn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Zn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const r=this.a,i=this.b,n=this.c;let s,o;Gn.subVectors(i,r),Qn.subVectors(n,r),Vn.subVectors(t,r);const a=Gn.dot(Vn),l=Qn.dot(Vn);if(a<=0&&l<=0)return e.copy(r);Hn.subVectors(t,i);const c=Gn.dot(Hn),h=Qn.dot(Hn);if(c>=0&&h<=c)return e.copy(i);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),e.copy(r).addScaledVector(Gn,s);Wn.subVectors(t,n);const d=Gn.dot(Wn),p=Qn.dot(Wn);if(p>=0&&d<=p)return e.copy(n);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),e.copy(r).addScaledVector(Qn,o);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return jn.subVectors(n,i),o=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(jn,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(r).addScaledVector(Gn,s).addScaledVector(Qn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Yn={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},Xn={h:0,s:0,l:0},Jn={h:0,s:0,l:0};function Kn(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 $n{constructor(t,e,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,r)}set(t,e,r){if(void 0===e&&void 0===r){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,r);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ye){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,mi.toWorkingColorSpace(this,e),this}setRGB(t,e,r,i=mi.workingColorSpace){return this.r=t,this.g=e,this.b=r,mi.toWorkingColorSpace(this,i),this}setHSL(t,e,r,i=mi.workingColorSpace){if(t=Zr(t,1),e=qr(e,0,1),r=qr(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=Kn(n,i,t+1/3),this.g=Kn(n,i,t),this.b=Kn(n,i,t-1/3)}return mi.toWorkingColorSpace(this,i),this}setStyle(t,e=Ye){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=Ye){const r=Yn[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=gi(t.r),this.g=gi(t.g),this.b=gi(t.b),this}copyLinearToSRGB(t){return this.r=Ai(t.r),this.g=Ai(t.g),this.b=Ai(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ye){return mi.fromWorkingColorSpace(ts.copy(this),t),65536*Math.round(qr(255*ts.r,0,255))+256*Math.round(qr(255*ts.g,0,255))+Math.round(qr(255*ts.b,0,255))}getHexString(t=Ye){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=mi.workingColorSpace){mi.fromWorkingColorSpace(ts.copy(this),e);const r=ts.r,i=ts.g,n=ts.b,s=Math.max(r,i,n),o=Math.min(r,i,n);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const t=s-o;switch(l=c<=.5?t/(s+o):t/(2-s-o),s){case r:a=(i-n)/t+(i0!=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 r=t[e];if(void 0===r){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[e]=r: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 r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const r in t){const i=t[r];delete i.metadata,e.push(i)}return e}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),void 0!==this.sheen&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(r.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(r.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(r.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(r.combine=this.combine)),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(r.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(r.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(r.size=this.size),null!==this.shadowSide&&(r.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==v&&(r.blending=this.blending),this.side!==f&&(r.side=this.side),!0===this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),!0===this.transparent&&(r.transparent=!0),this.blendSrc!==P&&(r.blendSrc=this.blendSrc),this.blendDst!==D&&(r.blendDst=this.blendDst),this.blendEquation!==E&&(r.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(r.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(r.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==q&&(r.depthFunc=this.depthFunc),!1===this.depthTest&&(r.depthTest=this.depthTest),!1===this.depthWrite&&(r.depthWrite=this.depthWrite),!1===this.colorWrite&&(r.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==yr&&(r.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(r.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==nr&&(r.stencilFail=this.stencilFail),this.stencilZFail!==nr&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==nr&&(r.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(r.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),!0===this.polygonOffset&&(r.polygonOffset=!0),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),!0===this.dithering&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),!0===this.alphaHash&&(r.alphaHash=!0),!0===this.alphaToCoverage&&(r.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=!0),!0===this.forceSinglePass&&(r.forceSinglePass=!0),!0===this.wireframe&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(r.flatShading=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),!1===this.fog&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData),e){const e=i(t.textures),n=i(t.images);e.length>0&&(r.textures=e),n.length>0&&(r.images=n)}return r}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.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,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 r=null;if(null!==e){const t=e.length;r=new Array(t);for(let i=0;i!==t;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,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.alphaHash=t.alphaHash,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++}}class is extends rs{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new $n(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=K,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}}const ns=ss();function ss(){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(;0==(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;++t)32!==t&&(a[t]=1024);return{floatView:e,uint32View:r,baseTable:i,shiftTable:n,mantissaTable:s,exponentTable:o,offsetTable:a}}function os(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=qr(t,-65504,65504),ns.floatView[0]=t;const e=ns.uint32View[0],r=e>>23&511;return ns.baseTable[r]+((8388607&e)>>ns.shiftTable[r])}function as(t){const e=t>>10;return ns.uint32View[0]=ns.mantissaTable[ns.offsetTable[e]+(1023&t)]+ns.exponentTable[e],ns.floatView[0]}const ls={toHalfFloat:os,fromHalfFloat:as},cs=new Di,hs=new ei;class us{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=Cr,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Dt,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return console.warn('THREE.BufferAttribute: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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.gpuType=t.gpuType,this}copyAt(t,e,r){t*=this.itemSize,r*=e.itemSize;for(let i=0,n=this.itemSize;i0&&(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;e0&&(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;t0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t(t.far-t.near)**2)return}Rs.copy(n).invert(),Bs.copy(t.ray).applyMatrix4(Rs),null!==r.boundingBox&&!1===Bs.intersectsBox(r.boundingBox)||this._computeIntersections(t,e,Bs)}}_computeIntersections(t,e,r){let i;const n=this.geometry,s=this.material,o=n.index,a=n.attributes.position,l=n.attributes.uv,c=n.attributes.uv1,h=n.attributes.normal,u=n.groups,d=n.drawRange;if(null!==o)if(Array.isArray(s))for(let n=0,a=u.length;nr.far?null:{distance:c,point:Ws.clone(),object:t}}(t,e,r,i,Ds,Os,ks,Hs);if(h){n&&(Fs.fromBufferAttribute(n,a),zs.fromBufferAttribute(n,l),Gs.fromBufferAttribute(n,c),h.uv=Zn.getInterpolation(Hs,Ds,Os,ks,Fs,zs,Gs,new ei)),s&&(Fs.fromBufferAttribute(s,a),zs.fromBufferAttribute(s,l),Gs.fromBufferAttribute(s,c),h.uv1=Zn.getInterpolation(Hs,Ds,Os,ks,Fs,zs,Gs,new ei),h.uv2=h.uv1),o&&(Qs.fromBufferAttribute(o,a),js.fromBufferAttribute(o,l),Vs.fromBufferAttribute(o,c),h.normal=Zn.getInterpolation(Hs,Ds,Os,ks,Qs,js,Vs,new Di),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const t={a,b:l,c,normal:new Di,materialIndex:0};Zn.getNormal(Ds,Os,ks,t.normal),h.face=t}return h}class Ys extends Is{constructor(t=1,e=1,r=1,i=1,n=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:s};const o=this;i=Math.floor(i),n=Math.floor(n),s=Math.floor(s);const a=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,r,i,n,s,p,f,m,g,A){const y=s/m,v=p/g,x=s/2,b=p/2,_=f/2,w=m+1,E=g+1;let M=0,S=0;const C=new Di;for(let s=0;s0?1:-1,c.push(C.x,C.y,C.z),h.push(a/m),h.push(1-s/g),M+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const r={};for(const t in this.extensions)!0===this.extensions[t]&&(r[t]=!0);return Object.keys(r).length>0&&(e.extensions=r),e}}class eo extends kn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new un,this.projectionMatrix=new un,this.projectionMatrixInverse=new un,this.coordinateSystem=Fr}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}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)}}class ro extends eo{constructor(t=50,e=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=i,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*Hr*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*Vr*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*Hr*Math.atan(Math.tan(.5*Vr*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,r,i,n,s){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=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*Vr*this.fov)/this.zoom,r=2*e,i=this.aspect*r,n=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;n+=s.offsetX*i/t,e-=s.offsetY*r/o,i*=s.width/t,r*=s.height/o}const o=this.filmOffset;0!==o&&(n+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+i,e,e-r,t,this.far,this.coordinateSystem),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}}const io=-90;class no extends kn{constructor(t,e,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new ro(io,1,t,e);i.layers=this.layers,this.add(i);const n=new ro(io,1,t,e);n.layers=this.layers,this.add(n);const s=new ro(io,1,t,e);s.layers=this.layers,this.add(s);const o=new ro(io,1,t,e);o.layers=this.layers,this.add(o);const a=new ro(io,1,t,e);a.layers=this.layers,this.add(a);const l=new ro(io,1,t,e);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[r,i,n,s,o,a]=e;for(const t of e)this.remove(t);if(t===Fr)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),a.up.set(0,1,0),a.lookAt(0,0,-1);else{if(t!==zr)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),a.up.set(0,-1,0),a.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[n,s,o,a,l,c]=this.children,h=t.getRenderTarget(),u=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.xr.enabled;t.xr.enabled=!1;const f=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0,i),t.render(e,n),t.setRenderTarget(r,1,i),t.render(e,s),t.setRenderTarget(r,2,i),t.render(e,o),t.setRenderTarget(r,3,i),t.render(e,a),t.setRenderTarget(r,4,i),t.render(e,l),r.texture.generateMipmaps=f,t.setRenderTarget(r,5,i),t.render(e,c),t.setRenderTarget(h,u,d),t.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class so extends Ei{constructor(t,e,r,i,n,s,o,a,l,c){super(t=void 0!==t?t:[],e=void 0!==e?e:ht,r,i,n,s,o,a,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class oo extends Ci{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const r={width:t,height:t,depth:1},i=[r,r,r,r,r,r];void 0!==e.encoding&&(hi("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===je?Ye:Ze),this.texture=new so(i,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:wt}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 r={tEquirect:{value:null}},i="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",n="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new Ys(5,5,5),o=new to({name:"CubemapFromEquirect",uniforms:Xs(r),vertexShader:i,fragmentShader:n,side:m,blending:y});o.uniforms.tEquirect.value=e;const a=new qs(s,o),l=e.minFilter;return e.minFilter===St&&(e.minFilter=wt),new no(1,10,this).update(t,a),e.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,r,i){const n=t.getRenderTarget();for(let n=0;n<6;n++)t.setRenderTarget(this,n),t.clear(e,r,i);t.setRenderTarget(n)}}const ao=new Di,lo=new Di,co=new ri;class ho{constructor(t=new Di(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,r,i){return this.normal.set(t,e,r),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,r){const i=ao.subVectors(r,e).cross(lo.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 r=t.delta(ao),i=this.normal.dot(r);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const n=-(t.start.dot(this.normal)+this.constant)/i;return n<0||n>1?null:e.copy(t.start).addScaledVector(r,n)}intersectsLine(t){const e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<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 r=e||co.getNormalMatrix(t),i=this.coplanarPoint(ao).applyMatrix4(t),n=this.normal.applyMatrix3(r).normalize();return this.constant=-i.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)}}const uo=new en,po=new Di;class fo{constructor(t=new ho,e=new ho,r=new ho,i=new ho,n=new ho,s=new ho){this.planes=[t,e,r,i,n,s]}set(t,e,r,i,n,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(r),o[3].copy(i),o[4].copy(n),o[5].copy(s),this}copy(t){const e=this.planes;for(let r=0;r<6;r++)e[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t,e=Fr){const r=this.planes,i=t.elements,n=i[0],s=i[1],o=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],A=i[13],y=i[14],v=i[15];if(r[0].setComponents(a-n,u-l,m-d,v-g).normalize(),r[1].setComponents(a+n,u+l,m+d,v+g).normalize(),r[2].setComponents(a+s,u+c,m+p,v+A).normalize(),r[3].setComponents(a-s,u-c,m-p,v-A).normalize(),r[4].setComponents(a-o,u-h,m-f,v-y).normalize(),e===Fr)r[5].setComponents(a+o,u+h,m+f,v+y).normalize();else{if(e!==zr)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);r[5].setComponents(o,h,f,y).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),uo.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),uo.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(uo)}intersectsSprite(t){return uo.center.set(0,0,0),uo.radius=.7071067811865476,uo.applyMatrix4(t.matrixWorld),this.intersectsSphere(uo)}intersectsSphere(t){const e=this.planes,r=t.center,i=-t.radius;for(let t=0;t<6;t++)if(e[t].distanceToPoint(r)0?t.max.x:t.min.x,po.y=i.normal.y>0?t.max.y:t.min.y,po.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(po)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function mo(){let t=null,e=!1,r=null,i=null;function n(e,s){r(e,s),i=t.requestAnimationFrame(n)}return{start:function(){!0!==e&&null!==r&&(i=t.requestAnimationFrame(n),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){r=t},setContext:function(e){t=e}}}function go(t,e){const r=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const r=i.get(e);r&&(t.deleteBuffer(r.buffer),i.delete(e))},update:function(e,n){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\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 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\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\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\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\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_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\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\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\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\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 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\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\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\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\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\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\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\t\t#undef SPOT_LIGHT_MAP_INDEX\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\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\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\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\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\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\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\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\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\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\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = 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\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\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\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\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\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\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\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\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\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},vo={common:{diffuse:{value:new $n(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ri},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ri}},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 ri}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ri}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ri},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ri},normalScale:{value:new ei(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ri},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ri}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ri}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ri}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new $n(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 $n(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0},uvTransform:{value:new ri}},sprite:{diffuse:{value:new $n(16777215)},opacity:{value:1},center:{value:new ei(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ri},alphaMap:{value:null},alphaMapTransform:{value:new ri},alphaTest:{value:0}}},xo={basic:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.fog]),vertexShader:yo.meshbasic_vert,fragmentShader:yo.meshbasic_frag},lambert:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new $n(0)}}]),vertexShader:yo.meshlambert_vert,fragmentShader:yo.meshlambert_frag},phong:{uniforms:Js([vo.common,vo.specularmap,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,vo.lights,{emissive:{value:new $n(0)},specular:{value:new $n(1118481)},shininess:{value:30}}]),vertexShader:yo.meshphong_vert,fragmentShader:yo.meshphong_frag},standard:{uniforms:Js([vo.common,vo.envmap,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.roughnessmap,vo.metalnessmap,vo.fog,vo.lights,{emissive:{value:new $n(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yo.meshphysical_vert,fragmentShader:yo.meshphysical_frag},toon:{uniforms:Js([vo.common,vo.aomap,vo.lightmap,vo.emissivemap,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.gradientmap,vo.fog,vo.lights,{emissive:{value:new $n(0)}}]),vertexShader:yo.meshtoon_vert,fragmentShader:yo.meshtoon_frag},matcap:{uniforms:Js([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,vo.fog,{matcap:{value:null}}]),vertexShader:yo.meshmatcap_vert,fragmentShader:yo.meshmatcap_frag},points:{uniforms:Js([vo.points,vo.fog]),vertexShader:yo.points_vert,fragmentShader:yo.points_frag},dashed:{uniforms:Js([vo.common,vo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yo.linedashed_vert,fragmentShader:yo.linedashed_frag},depth:{uniforms:Js([vo.common,vo.displacementmap]),vertexShader:yo.depth_vert,fragmentShader:yo.depth_frag},normal:{uniforms:Js([vo.common,vo.bumpmap,vo.normalmap,vo.displacementmap,{opacity:{value:1}}]),vertexShader:yo.meshnormal_vert,fragmentShader:yo.meshnormal_frag},sprite:{uniforms:Js([vo.sprite,vo.fog]),vertexShader:yo.sprite_vert,fragmentShader:yo.sprite_frag},background:{uniforms:{uvTransform:{value:new ri},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yo.background_vert,fragmentShader:yo.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:yo.backgroundCube_vert,fragmentShader:yo.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yo.cube_vert,fragmentShader:yo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yo.equirect_vert,fragmentShader:yo.equirect_frag},distanceRGBA:{uniforms:Js([vo.common,vo.displacementmap,{referencePosition:{value:new Di},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yo.distanceRGBA_vert,fragmentShader:yo.distanceRGBA_frag},shadow:{uniforms:Js([vo.lights,vo.fog,{color:{value:new $n(0)},opacity:{value:1}}]),vertexShader:yo.shadow_vert,fragmentShader:yo.shadow_frag}};xo.physical={uniforms:Js([xo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ri},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ri},clearcoatNormalScale:{value:new ei(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ri},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ri},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ri},sheen:{value:0},sheenColor:{value:new $n(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ri},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ri},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ri},transmissionSamplerSize:{value:new ei},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ri},attenuationDistance:{value:0},attenuationColor:{value:new $n(0)},specularColor:{value:new $n(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ri},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ri},anisotropyVector:{value:new ei},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ri}}]),vertexShader:yo.meshphysical_vert,fragmentShader:yo.meshphysical_frag};const bo={r:0,b:0,g:0};function _o(t,e,r,i,n,s,o){const a=new $n(0);let l,c,h=!0===s?0:1,u=null,d=0,p=null;function g(e,r){e.getRGB(bo,Ks(t)),i.buffers.color.setClear(bo.r,bo.g,bo.b,r,o)}return{getClearColor:function(){return a},setClearColor:function(t,e=1){a.set(t),h=e,g(a,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,g(a,h)},render:function(s,A){let y=!1,v=!0===A.isScene?A.background:null;v&&v.isTexture&&(v=(A.backgroundBlurriness>0?r:e).get(v)),null===v?g(a,h):v&&v.isColor&&(g(v,1),y=!0);const x=t.xr.getEnvironmentBlendMode();"additive"===x?i.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===x&&i.buffers.color.setClear(0,0,0,0,o),(t.autoClear||y)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.mapping===ft)?(void 0===c&&(c=new qs(new Ys(1,1,1),new to({name:"BackgroundCubeMaterial",uniforms:Xs(xo.backgroundCube.uniforms),vertexShader:xo.backgroundCube.vertexShader,fragmentShader:xo.backgroundCube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(t,e,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=v,c.material.uniforms.flipEnvMap.value=v.isCubeTexture&&!1===v.isRenderTargetTexture?-1:1,c.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,c.material.toneMapped=mi.getTransfer(v.colorSpace)!==tr,u===v&&d===v.version&&p===t.toneMapping||(c.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),c.layers.enableAll(),s.unshift(c,c.geometry,c.material,0,0,null)):v&&v.isTexture&&(void 0===l&&(l=new qs(new Ao(2,2),new to({name:"BackgroundMaterial",uniforms:Xs(xo.background.uniforms),vertexShader:xo.background.vertexShader,fragmentShader:xo.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=v,l.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,l.material.toneMapped=mi.getTransfer(v.colorSpace)!==tr,!0===v.matrixAutoUpdate&&v.updateMatrix(),l.material.uniforms.uvTransform.value.copy(v.matrix),u===v&&d===v.version&&p===t.toneMapping||(l.material.needsUpdate=!0,u=v,d=v.version,p=t.toneMapping),l.layers.enableAll(),s.unshift(l,l.geometry,l.material,0,0,null))}}}function wo(t,e,r,i){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||null!==s,a={},l=p(null);let c=l,h=!1;function u(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],r=[],i=[];for(let t=0;t=0){const r=n[e];let i=s[e];if(void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor)),void 0===r)return!0;if(r.attribute!==i)return!0;if(i&&r.data!==i.data)return!0;o++}return c.attributesNum!==o||c.index!==i}(n,v,d,x),b&&function(t,e,r,i){const n={},s=e.attributes;let o=0;const a=r.getAttributes();for(const e in a)if(a[e].location>=0){let r=s[e];void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor));const i={};i.attribute=r,r&&r.data&&(i.data=r.data),n[e]=i,o++}c.attributes=n,c.attributesNum=o,c.index=i}(n,v,d,x)}else{const t=!0===l.wireframe;c.geometry===v.id&&c.program===d.id&&c.wireframe===t||(c.geometry=v.id,c.program=d.id,c.wireframe=t,b=!0)}null!==x&&r.update(x,t.ELEMENT_ARRAY_BUFFER),(b||h)&&(h=!1,function(n,s,o,a){if(!1===i.isWebGL2&&(n.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const l=a.attributes,c=o.getAttributes(),h=s.defaultAttributeValues;for(const e in c){const s=c[e];if(s.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,l=o.itemSize,c=r.get(o);if(void 0===c)continue;const h=c.buffer,u=c.type,d=c.bytesPerElement,p=!0===i.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||o.gpuType===Lt);if(o.isInterleavedBufferAttribute){const r=o.data,i=r.stride,c=o.offset;if(r.isInstancedInterleavedBuffer){for(let t=0;t0&&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 s="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let o=void 0!==r.precision?r.precision:"highp";const a=n(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||e.has("WEBGL_draw_buffers"),c=!0===r.logarithmicDepthBuffer,h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),d=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),m=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),g=t.getParameter(t.MAX_VARYING_VECTORS),A=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),y=u>0,v=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const r=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:n,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:A,vertexTextures:y,floatFragmentTextures:v,floatVertexTextures:y&&v,maxSamples:s?t.getParameter(t.MAX_SAMPLES):0}}function So(t){const e=this;let r=null,i=0,n=!1,s=!1;const o=new ho,a=new ri,l={value:null,needsUpdate:!1};function c(t,r,i,n){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==n||null===c){const e=i+4*s,n=r.matrixWorldInverse;a.getNormalMatrix(n),(null===c||c.length0),e.numPlanes=i,e.numIntersection=0);else{const t=s?0:i,e=4*t;let n=f.clippingState||null;l.value=n,n=c(u,a,e,h);for(let t=0;t!==e;++t)n[t]=r[t];f.clippingState=n,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function Co(t){let e=new WeakMap;function r(t,e){return e===dt?t.mapping=ht:e===pt&&(t.mapping=ut),t}function i(t){const r=t.target;r.removeEventListener("dispose",i);const n=e.get(r);void 0!==n&&(e.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping;if(s===dt||s===pt){if(e.has(n))return r(e.get(n).texture,n.mapping);{const s=n.image;if(s&&s.height>0){const o=new oo(s.height/2);return o.fromEquirectangularTexture(t,n),e.set(n,o),n.addEventListener("dispose",i),r(o.texture,n.mapping)}return null}}}return n},dispose:function(){e=new WeakMap}}}class To extends eo{constructor(t=-1,e=1,r=1,i=-1,n=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=n,this.far=s,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,r,i,n,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=i,this.view.width=n,this.view.height=s,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),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let n=r-t,s=r+t,o=i+e,a=i-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,s=n+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(n,s,o,a,this.near,this.far,this.coordinateSystem),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}}const Io=[.125,.215,.35,.446,.526,.582],Ro=new To,Bo=new $n;let Lo=null,Po=0,Do=0;const Oo=(1+Math.sqrt(5))/2,ko=1/Oo,Uo=[new Di(1,1,1),new Di(-1,1,1),new Di(1,1,-1),new Di(-1,1,-1),new Di(0,Oo,ko),new Di(0,Oo,-ko),new Di(ko,0,Oo),new Di(-ko,0,Oo),new Di(Oo,ko,0),new Di(-Oo,ko,0)];class No{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,r=.1,i=100){Lo=this._renderer.getRenderTarget(),Po=this._renderer.getActiveCubeFace(),Do=this._renderer.getActiveMipmapLevel(),this._setSize(256);const n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(t,r,i,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=Qo(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Go(),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;tt-4?a=Io[o-t+4-1]:0===o&&(a=0),i.push(a);const l=1/(s-2),c=-l,h=1+l,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,A=new Float32Array(f*p*d),y=new Float32Array(m*p*d),v=new Float32Array(g*p*d);for(let t=0;t2?0:-1,i=[e,r,0,e+2/3,r,0,e+2/3,r+1,0,e,r,0,e+2/3,r+1,0,e,r+1,0];A.set(i,f*p*t),y.set(u,m*p*t);const n=[t,t,t,t,t,t];v.set(n,g*p*t)}const x=new Is;x.setAttribute("position",new us(A,f)),x.setAttribute("uv",new us(y,m)),x.setAttribute("faceIndex",new us(v,g)),e.push(x),n>4&&n--}return{lodPlanes:e,sizeLods:r,sigmas:i}}(i)),this._blurMaterial=function(t,e,r){const i=new Float32Array(20),n=new Di(0,1,0);return new to({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},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 \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:y,depthTest:!1,depthWrite:!1})}(i,t,e)}return i}_compileMaterial(t){const e=new qs(this._lodPlanes[0],t);this._renderer.compile(e,Ro)}_sceneToCubeUV(t,e,r,i){const n=new ro(90,1,e,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(Bo),a.toneMapping=et,a.autoClear=!1;const h=new is({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),u=new qs(new Ys,h);let d=!1;const p=t.background;p?p.isColor&&(h.color.copy(p),t.background=null,d=!0):(h.color.copy(Bo),d=!0);for(let e=0;e<6;e++){const r=e%3;0===r?(n.up.set(0,s[e],0),n.lookAt(o[e],0,0)):1===r?(n.up.set(0,0,s[e]),n.lookAt(0,o[e],0)):(n.up.set(0,s[e],0),n.lookAt(0,0,o[e]));const l=this._cubeSize;zo(i,r*l,e>2?l:0,l,l),a.setRenderTarget(i),d&&a.render(u,n),a.render(t,n)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=c,a.autoClear=l,t.background=p}_textureToCubeUV(t,e){const r=this._renderer,i=t.mapping===ht||t.mapping===ut;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Qo()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Go());const n=i?this._cubemapMaterial:this._equirectMaterial,s=new qs(this._lodPlanes[0],n);n.uniforms.envMap.value=t;const o=this._cubeSize;zo(e,0,0,3*o,2*o),r.setRenderTarget(e),r.render(s,Ro)}_applyPMREM(t){const e=this._renderer,r=e.autoClear;e.autoClear=!1;for(let e=1;e20&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,r=Math.exp(-e*e/2);m.push(r),0===t?g+=r:tA-4?i-A+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(e),a.render(c,Ro)}}function Fo(t,e,r){const i=new Ci(t,e,r);return i.texture.mapping=ft,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function zo(t,e,r,i,n){t.viewport.set(e,r,i,n),t.scissor.set(e,r,i,n)}function Go(){return new to({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 \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:y,depthTest:!1,depthWrite:!1})}function Qo(){return new to({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:y,depthTest:!1,depthWrite:!1})}function jo(t){let e=new WeakMap,r=null;function i(t){const r=t.target;r.removeEventListener("dispose",i);const n=e.get(r);void 0!==n&&(e.delete(r),n.dispose())}return{get:function(n){if(n&&n.isTexture){const s=n.mapping,o=s===dt||s===pt,a=s===ht||s===ut;if(o||a){if(n.isRenderTargetTexture&&!0===n.needsPMREMUpdate){n.needsPMREMUpdate=!1;let i=e.get(n);return null===r&&(r=new No(t)),i=o?r.fromEquirectangular(n,i):r.fromCubemap(n,i),e.set(n,i),i.texture}if(e.has(n))return e.get(n).texture;{const s=n.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;for(let r=0;r<6;r++)void 0!==t[r]&&e++;return 6===e}(s)){null===r&&(r=new No(t));const s=o?r.fromEquirectangular(n):r.fromCubemap(n);return e.set(n,s),n.addEventListener("dispose",i),s.texture}return null}}}return n},dispose:function(){e=new WeakMap,null!==r&&(r.dispose(),r=null)}}}function Vo(t){const e={};function r(r){if(void 0!==e[r])return e[r];let i;switch(r){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=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":i=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":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(r)}return e[r]=i,i}return{has:function(t){return null!==r(t)},init:function(t){t.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture")},get:function(t){const e=r(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Ho(t,e,r,i){const n={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);for(const t in a.morphAttributes){const r=a.morphAttributes[t];for(let t=0,i=r.length;te.maxTextureSize&&(M=Math.ceil(E/e.maxTextureSize),E=e.maxTextureSize);const S=new Float32Array(E*M*4*p),C=new Ti(S,E,M,p);C.type=Dt,C.needsUpdate=!0;const T=4*w;for(let R=0;R0)return t;const n=e*r;let s=na[n];if(void 0===s&&(s=new Float32Array(n),na[n]=s),0!==e){i.toArray(s,0);for(let i=1,n=0;i!==e;++i)n+=r,t[i].toArray(s,n)}return s}function ha(t,e){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r":" "} ${n}: ${r[t]}`)}return i.join("\n")}(t.getShaderSource(e),i)}return n}function ll(t,e){const r=function(t){const e=mi.getPrimaries(mi.workingColorSpace),r=mi.getPrimaries(t);let i;switch(e===r?i="":e===rr&&r===er?i="LinearDisplayP3ToLinearSRGB":e===er&&r===rr&&(i="LinearSRGBToLinearDisplayP3"),t){case Xe:case Ke:return[i,"LinearTransferOETF"];case Ye:case Je:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[i,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${r[0]}( ${r[1]}( value ) ); }`}function cl(t,e){let r;switch(e){case rt:r="Linear";break;case it:r="Reinhard";break;case nt:r="OptimizedCineon";break;case st:r="ACESFilmic";break;case ot:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),r="Linear"}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function hl(t){return""!==t}function ul(t,e){const r=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,r).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 dl(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const pl=/^[ \t]*#include +<([\w\d./]+)>/gm;function fl(t){return t.replace(pl,gl)}const ml=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function gl(t,e){let r=yo[e];if(void 0===r){const t=ml.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");r=yo[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return fl(r)}const Al=/#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 yl(t){return t.replace(Al,vl)}function vl(t,e,r,i){let n="";for(let t=parseInt(e);t0&&(v+="\n"),x=[g,"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A].filter(hl).join("\n"),x.length>0&&(x+="\n")):(v=[xl(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.batching?"#define USE_BATCHING":"",r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.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(hl).join("\n"),x=[g,xl(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,A,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+c:"",r.envMap?"#define "+h:"",r.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IRIDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&!1===r.flatShading?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+l:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==et?"#define TONE_MAPPING":"",r.toneMapping!==et?yo.tonemapping_pars_fragment:"",r.toneMapping!==et?cl("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",yo.colorspace_pars_fragment,ll("linearToOutputTexel",r.outputColorSpace),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(hl).join("\n")),o=fl(o),o=ul(o,r),o=dl(o,r),a=fl(a),a=ul(a,r),a=dl(a,r),o=yl(o),a=yl(a),r.isWebGL2&&!0!==r.isRawShaderMaterial&&(b="#version 300 es\n",v=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,x=["precision mediump sampler2DArray;","#define varying in",r.glslVersion===Ur?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===Ur?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+x);const _=b+v+o,w=b+x+a,E=nl(n,n.VERTEX_SHADER,_),M=nl(n,n.FRAGMENT_SHADER,w);function S(e){if(t.debug.checkShaderErrors){const r=n.getProgramInfoLog(y).trim(),i=n.getShaderInfoLog(E).trim(),s=n.getShaderInfoLog(M).trim();let o=!0,a=!0;if(!1===n.getProgramParameter(y,n.LINK_STATUS))if(o=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(n,y,E,M);else{const t=al(n,E,"vertex"),e=al(n,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(y,n.VALIDATE_STATUS)+"\n\nProgram Info Log: "+r+"\n"+t+"\n"+e)}else""!==r?console.warn("THREE.WebGLProgram: Program Info Log:",r):""!==i&&""!==s||(a=!1);a&&(e.diagnostics={runnable:o,programLog:r,vertexShader:{log:i,prefix:v},fragmentShader:{log:s,prefix:x}})}n.deleteShader(E),n.deleteShader(M),C=new il(n,y),T=function(t,e){const r={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let n=0;n0,Y=s.clearcoat>0,X=s.iridescence>0,J=s.sheen>0,K=s.transmission>0,$=Z&&!!s.anisotropyMap,tt=Y&&!!s.clearcoatMap,rt=Y&&!!s.clearcoatNormalMap,it=Y&&!!s.clearcoatRoughnessMap,nt=X&&!!s.iridescenceMap,st=X&&!!s.iridescenceThicknessMap,ot=J&&!!s.sheenColorMap,at=J&&!!s.sheenRoughnessMap,lt=!!s.specularMap,ct=!!s.specularColorMap,ht=!!s.specularIntensityMap,ut=K&&!!s.transmissionMap,dt=K&&!!s.thicknessMap,pt=!!s.gradientMap,mt=!!s.alphaMap,gt=s.alphaTest>0,At=!!s.alphaHash,yt=!!s.extensions,vt=!!_.attributes.uv1,xt=!!_.attributes.uv2,bt=!!_.attributes.uv3;let _t=et;return s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(_t=t.toneMapping)),{isWebGL2:h,shaderID:S,shaderType:s.type,shaderName:s.name,vertexShader:I,fragmentShader:R,defines:s.defines,customVertexShaderID:B,customFragmentShaderID:L,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,batching:k,instancing:O,instancingColor:O&&null!==x.instanceColor,supportsVertexTextures:d,outputColorSpace:null===D?t.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Xe,map:U,matcap:N,envMap:F,envMapMode:F&&E.mapping,envMapCubeUVHeight:M,aoMap:z,lightMap:G,bumpMap:Q,normalMap:j,displacementMap:d&&V,emissiveMap:H,normalMapObjectSpace:j&&s.normalMapType===qe,normalMapTangentSpace:j&&s.normalMapType===We,metalnessMap:W,roughnessMap:q,anisotropy:Z,anisotropyMap:$,clearcoat:Y,clearcoatMap:tt,clearcoatNormalMap:rt,clearcoatRoughnessMap:it,iridescence:X,iridescenceMap:nt,iridescenceThicknessMap:st,sheen:J,sheenColorMap:ot,sheenRoughnessMap:at,specularMap:lt,specularColorMap:ct,specularIntensityMap:ht,transmission:K,transmissionMap:ut,thicknessMap:dt,gradientMap:pt,opaque:!1===s.transparent&&s.blending===v,alphaMap:mt,alphaTest:gt,alphaHash:At,combine:s.combine,mapUv:U&&A(s.map.channel),aoMapUv:z&&A(s.aoMap.channel),lightMapUv:G&&A(s.lightMap.channel),bumpMapUv:Q&&A(s.bumpMap.channel),normalMapUv:j&&A(s.normalMap.channel),displacementMapUv:V&&A(s.displacementMap.channel),emissiveMapUv:H&&A(s.emissiveMap.channel),metalnessMapUv:W&&A(s.metalnessMap.channel),roughnessMapUv:q&&A(s.roughnessMap.channel),anisotropyMapUv:$&&A(s.anisotropyMap.channel),clearcoatMapUv:tt&&A(s.clearcoatMap.channel),clearcoatNormalMapUv:rt&&A(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:it&&A(s.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&A(s.iridescenceMap.channel),iridescenceThicknessMapUv:st&&A(s.iridescenceThicknessMap.channel),sheenColorMapUv:ot&&A(s.sheenColorMap.channel),sheenRoughnessMapUv:at&&A(s.sheenRoughnessMap.channel),specularMapUv:lt&&A(s.specularMap.channel),specularColorMapUv:ct&&A(s.specularColorMap.channel),specularIntensityMapUv:ht&&A(s.specularIntensityMap.channel),transmissionMapUv:ut&&A(s.transmissionMap.channel),thicknessMapUv:dt&&A(s.thicknessMap.channel),alphaMapUv:mt&&A(s.alphaMap.channel),vertexTangents:!!_.attributes.tangent&&(j||Z),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!_.attributes.color&&4===_.attributes.color.itemSize,vertexUv1s:vt,vertexUv2s:xt,vertexUv3s:bt,pointsUvs:!0===x.isPoints&&!!_.attributes.uv&&(U||mt),fog:!!b,useFog:!0===s.fog,fogExp2:b&&b.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==_.morphAttributes.position,morphNormals:void 0!==_.morphAttributes.normal,morphColors:void 0!==_.morphAttributes.color,morphTargetsCount:T,morphTextureStride:P,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numSpotLightMaps:a.spotLightMap.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numSpotLightShadowsWithMaps:a.numSpotLightShadowsWithMaps,numLightProbes:a.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:_t,useLegacyLights:t._useLegacyLights,decodeVideoTexture:U&&!0===s.map.isVideoTexture&&mi.getTransfer(s.map.colorSpace)===tr,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===m,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:yt&&!0===s.extensions.derivatives,extensionFragDepth:yt&&!0===s.extensions.fragDepth,extensionDrawBuffers:yt&&!0===s.extensions.drawBuffers,extensionShaderTextureLOD:yt&&!0===s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const r=[];if(e.shaderID?r.push(e.shaderID):(r.push(e.customVertexShaderID),r.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)r.push(t),r.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(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.anisotropyMapUv),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.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(r,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0),e.supportsVertexTextures&&a.enable(1),e.instancing&&a.enable(2),e.instancingColor&&a.enable(3),e.matcap&&a.enable(4),e.envMap&&a.enable(5),e.normalMapObjectSpace&&a.enable(6),e.normalMapTangentSpace&&a.enable(7),e.clearcoat&&a.enable(8),e.iridescence&&a.enable(9),e.alphaTest&&a.enable(10),e.vertexColors&&a.enable(11),e.vertexAlphas&&a.enable(12),e.vertexUv1s&&a.enable(13),e.vertexUv2s&&a.enable(14),e.vertexUv3s&&a.enable(15),e.vertexTangents&&a.enable(16),e.anisotropy&&a.enable(17),e.alphaHash&&a.enable(18),e.batching&&a.enable(19),t.push(a.mask),a.disableAll(),e.fog&&a.enable(0),e.useFog&&a.enable(1),e.flatShading&&a.enable(2),e.logarithmicDepthBuffer&&a.enable(3),e.skinning&&a.enable(4),e.morphTargets&&a.enable(5),e.morphNormals&&a.enable(6),e.morphColors&&a.enable(7),e.premultipliedAlpha&&a.enable(8),e.shadowMapEnabled&&a.enable(9),e.useLegacyLights&&a.enable(10),e.doubleSided&&a.enable(11),e.flipSided&&a.enable(12),e.useDepthPacking&&a.enable(13),e.dithering&&a.enable(14),e.transmission&&a.enable(15),e.sheen&&a.enable(16),e.opaque&&a.enable(17),e.pointsUvs&&a.enable(18),e.decodeVideoTexture&&a.enable(19),t.push(a.mask)}(r,e),r.push(t.outputColorSpace)),r.push(e.customProgramCacheKey),r.join()},getUniforms:function(t){const e=f[t.type];let r;if(e){const t=xo[e];r=$s.clone(t.uniforms)}else r=t.uniforms;return r},acquireProgram:function(e,r){let i;for(let t=0,e=c.length;t0?i.push(h):!0===o.transparent?n.push(h):r.push(h)},unshift:function(t,e,o,a,l,c){const h=s(t,e,o,a,l,c);o.transmission>0?i.unshift(h):!0===o.transparent?n.unshift(h):r.unshift(h)},finish:function(){for(let r=e,i=t.length;r1&&r.sort(t||Cl),i.length>1&&i.sort(e||Tl),n.length>1&&n.sort(e||Tl)}}}function Rl(){let t=new WeakMap;return{get:function(e,r){const i=t.get(e);let n;return void 0===i?(n=new Il,t.set(e,[n])):r>=i.length?(n=new Il,i.push(n)):n=i[r],n},dispose:function(){t=new WeakMap}}}function Bl(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let r;switch(e.type){case"DirectionalLight":r={direction:new Di,color:new $n};break;case"SpotLight":r={position:new Di,direction:new Di,color:new $n,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new Di,color:new $n,distance:0,decay:0};break;case"HemisphereLight":r={direction:new Di,skyColor:new $n,groundColor:new $n};break;case"RectAreaLight":r={color:new $n,position:new Di,halfWidth:new Di,halfHeight:new Di}}return t[e.id]=r,r}}}let Ll=0;function Pl(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Dl(t,e){const r=new Bl,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let r;switch(e.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ei};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ei,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=r,r}}}(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-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,numLightProbes:0};for(let t=0;t<9;t++)n.probe.push(new Di);const s=new Di,o=new un,a=new un;return{setup:function(s,o){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,d=0,p=0,f=0,m=0,g=0,A=0,y=0,v=0,x=0;s.sort(Pl);const b=!0===o?Math.PI:1;for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(n.rectAreaLTC1=vo.LTC_FLOAT_1,n.rectAreaLTC2=vo.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(n.rectAreaLTC1=vo.LTC_HALF_1,n.rectAreaLTC2=vo.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 _=n.hash;_.directionalLength===h&&_.pointLength===u&&_.spotLength===d&&_.rectAreaLength===p&&_.hemiLength===f&&_.numDirectionalShadows===m&&_.numPointShadows===g&&_.numSpotShadows===A&&_.numSpotMaps===y&&_.numLightProbes===x||(n.directional.length=h,n.spot.length=d,n.rectArea.length=p,n.point.length=u,n.hemi.length=f,n.directionalShadow.length=m,n.directionalShadowMap.length=m,n.pointShadow.length=g,n.pointShadowMap.length=g,n.spotShadow.length=A,n.spotShadowMap.length=A,n.directionalShadowMatrix.length=m,n.pointShadowMatrix.length=g,n.spotLightMatrix.length=A+y-v,n.spotLightMap.length=y,n.numSpotLightShadowsWithMaps=v,n.numLightProbes=x,_.directionalLength=h,_.pointLength=u,_.spotLength=d,_.rectAreaLength=p,_.hemiLength=f,_.numDirectionalShadows=m,_.numPointShadows=g,_.numSpotShadows=A,_.numSpotMaps=y,_.numLightProbes=x,n.version=Ll++)},setupView:function(t,e){let r=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=s.length?(o=new Ol(t,e),s.push(o)):o=s[n],o},dispose:function(){r=new WeakMap}}}class Ul extends rs{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Ve,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}}class Nl extends rs{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 Fl(t,e,r){let i=new fo;const n=new ei,s=new ei,o=new Mi,a=new Ul({depthPacking:He}),l=new Nl,c={},h=r.maxTextureSize,d={[f]:m,[m]:f,[g]:g},A=new to({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ei},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=A.clone();v.defines.HORIZONTAL_PASS=1;const x=new Is;x.setAttribute("position",new us(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new qs(x,A),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=u;let w=this.type;function E(r,i){const s=e.update(b);A.defines.VSM_SAMPLES!==r.blurSamples&&(A.defines.VSM_SAMPLES=r.blurSamples,v.defines.VSM_SAMPLES=r.blurSamples,A.needsUpdate=!0,v.needsUpdate=!0),null===r.mapPass&&(r.mapPass=new Ci(n.x,n.y)),A.uniforms.shadow_pass.value=r.map.texture,A.uniforms.resolution.value=r.mapSize,A.uniforms.radius.value=r.radius,t.setRenderTarget(r.mapPass),t.clear(),t.renderBufferDirect(i,null,s,A,b,null),v.uniforms.shadow_pass.value=r.mapPass.texture,v.uniforms.resolution.value=r.mapSize,v.uniforms.radius.value=r.radius,t.setRenderTarget(r.map),t.clear(),t.renderBufferDirect(i,null,s,v,b,null)}function M(e,r,i,n){let s=null;const o=!0===i.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)s=o;else if(s=!0===i.isPointLight?l:a,t.localClippingEnabled&&!0===r.clipShadows&&Array.isArray(r.clippingPlanes)&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0||r.map&&r.alphaTest>0){const t=s.uuid,e=r.uuid;let i=c[t];void 0===i&&(i={},c[t]=i);let n=i[e];void 0===n&&(n=s.clone(),i[e]=n),s=n}return s.visible=r.visible,s.wireframe=r.wireframe,s.side=n===p?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:d[r.side],s.alphaMap=r.alphaMap,s.alphaTest=r.alphaTest,s.map=r.map,s.clipShadows=r.clipShadows,s.clippingPlanes=r.clippingPlanes,s.clipIntersection=r.clipIntersection,s.displacementMap=r.displacementMap,s.displacementScale=r.displacementScale,s.displacementBias=r.displacementBias,s.wireframeLinewidth=r.wireframeLinewidth,s.linewidth=r.linewidth,!0===i.isPointLight&&!0===s.isMeshDistanceMaterial&&(t.properties.get(s).light=i),s}function S(r,n,s,o,a){if(!1===r.visible)return;if(r.layers.test(n.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&a===p)&&(!r.frustumCulled||i.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);const i=e.update(r),l=r.material;if(Array.isArray(l)){const e=i.groups;for(let c=0,h=e.length;ch||n.y>h)&&(n.x>h&&(s.x=Math.floor(h/g.x),n.x=s.x*g.x,u.mapSize.x=s.x),n.y>h&&(s.y=Math.floor(h/g.y),n.y=s.y*g.y,u.mapSize.y=s.y)),null===u.map||!0===f||!0===m){const t=this.type!==p?{minFilter:yt,magFilter:yt}:{};null!==u.map&&u.map.dispose(),u.map=new Ci(n.x,n.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const A=u.getViewportCount();for(let t=0;t=1):-1!==yt.indexOf("OpenGL ES")&&(At=parseFloat(/^OpenGL ES (\d)/.exec(yt)[1]),gt=At>=2);let vt=null,xt={};const bt=t.getParameter(t.SCISSOR_BOX),_t=t.getParameter(t.VIEWPORT),wt=(new Mi).fromArray(bt),Et=(new Mi).fromArray(_t);function Mt(e,r,n,s){const o=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;ai||t.height>i)&&(n=i/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 i=e?Jr:Math.floor,s=i(n*t.width),o=i(n*t.height);void 0===m&&(m=y(s,o));const a=r?y(s,o):m;return a.width=s,a.height=o,a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),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 Xr(t.width)&&Xr(t.height)}function b(t,e){return t.generateMipmaps&&e&&t.minFilter!==yt&&t.minFilter!==wt}function _(e){t.generateMipmap(e)}function w(r,i,n,s,o=!1){if(!1===a)return i;if(null!==r){if(void 0!==t[r])return t[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}let l=i;if(i===t.RED&&(n===t.FLOAT&&(l=t.R32F),n===t.HALF_FLOAT&&(l=t.R16F),n===t.UNSIGNED_BYTE&&(l=t.R8)),i===t.RED_INTEGER&&(n===t.UNSIGNED_BYTE&&(l=t.R8UI),n===t.UNSIGNED_SHORT&&(l=t.R16UI),n===t.UNSIGNED_INT&&(l=t.R32UI),n===t.BYTE&&(l=t.R8I),n===t.SHORT&&(l=t.R16I),n===t.INT&&(l=t.R32I)),i===t.RG&&(n===t.FLOAT&&(l=t.RG32F),n===t.HALF_FLOAT&&(l=t.RG16F),n===t.UNSIGNED_BYTE&&(l=t.RG8)),i===t.RGBA){const e=o?$e:mi.getTransfer(s);n===t.FLOAT&&(l=t.RGBA32F),n===t.HALF_FLOAT&&(l=t.RGBA16F),n===t.UNSIGNED_BYTE&&(l=e===tr?t.SRGB8_ALPHA8:t.RGBA8),n===t.UNSIGNED_SHORT_4_4_4_4&&(l=t.RGBA4),n===t.UNSIGNED_SHORT_5_5_5_1&&(l=t.RGB5_A1)}return l!==t.R16F&&l!==t.R32F&&l!==t.RG16F&&l!==t.RG32F&&l!==t.RGBA16F&&l!==t.RGBA32F||e.get("EXT_color_buffer_float"),l}function E(t,e,r){return!0===b(t,r)||t.isFramebufferTexture&&t.minFilter!==yt&&t.minFilter!==wt?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===yt||e===vt||e===bt?t.NEAREST:t.LINEAR}function S(t){const e=t.target;e.removeEventListener("dispose",S),function(t){const e=i.get(t);if(void 0===e.__webglInit)return;const r=t.source,n=g.get(r);if(n){const i=n[e.__cacheKey];i.usedTimes--,0===i.usedTimes&&T(t),0===Object.keys(n).length&&g.delete(r)}i.remove(t)}(e),e.isVideoTexture&&f.delete(e)}function C(e){const r=e.target;r.removeEventListener("dispose",C),function(e){const r=e.texture,n=i.get(e),s=i.get(r);if(void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let r=0;r0&&s.__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 k(s,e,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.bindTexture(t.TEXTURE_2D,s.__webglTexture,t.TEXTURE0+n)}const B={[mt]:t.REPEAT,[gt]:t.CLAMP_TO_EDGE,[At]:t.MIRRORED_REPEAT},L={[yt]:t.NEAREST,[vt]:t.NEAREST_MIPMAP_NEAREST,[bt]:t.NEAREST_MIPMAP_LINEAR,[wt]:t.LINEAR,[Et]:t.LINEAR_MIPMAP_NEAREST,[St]:t.LINEAR_MIPMAP_LINEAR},P={[vr]:t.NEVER,[Sr]:t.ALWAYS,[xr]:t.LESS,[_r]:t.LEQUAL,[br]:t.EQUAL,[Mr]:t.GEQUAL,[wr]:t.GREATER,[Er]:t.NOTEQUAL};function D(r,s,o){if(o?(t.texParameteri(r,t.TEXTURE_WRAP_S,B[s.wrapS]),t.texParameteri(r,t.TEXTURE_WRAP_T,B[s.wrapT]),r!==t.TEXTURE_3D&&r!==t.TEXTURE_2D_ARRAY||t.texParameteri(r,t.TEXTURE_WRAP_R,B[s.wrapR]),t.texParameteri(r,t.TEXTURE_MAG_FILTER,L[s.magFilter]),t.texParameteri(r,t.TEXTURE_MIN_FILTER,L[s.minFilter])):(t.texParameteri(r,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(r,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r!==t.TEXTURE_3D&&r!==t.TEXTURE_2D_ARRAY||t.texParameteri(r,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),s.wrapS===gt&&s.wrapT===gt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(r,t.TEXTURE_MAG_FILTER,M(s.magFilter)),t.texParameteri(r,t.TEXTURE_MIN_FILTER,M(s.minFilter)),s.minFilter!==yt&&s.minFilter!==wt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),s.compareFunction&&(t.texParameteri(r,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(r,t.TEXTURE_COMPARE_FUNC,P[s.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const o=e.get("EXT_texture_filter_anisotropic");if(s.magFilter===yt)return;if(s.minFilter!==bt&&s.minFilter!==St)return;if(s.type===Dt&&!1===e.has("OES_texture_float_linear"))return;if(!1===a&&s.type===Ot&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||i.get(s).__currentAnisotropy)&&(t.texParameterf(r,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,n.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function O(e,r){let i=!1;void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",S));const n=r.source;let s=g.get(n);void 0===s&&(s={},g.set(n,s));const a=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()}(r);if(a!==e.__cacheKey){void 0===s[a]&&(s[a]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,i=!0),s[a].usedTimes++;const n=s[e.__cacheKey];void 0!==n&&(s[e.__cacheKey].usedTimes--,0===n.usedTimes&&T(r)),e.__cacheKey=a,e.__webglTexture=s[a].texture}return i}function k(e,n,o){let l=t.TEXTURE_2D;(n.isDataArrayTexture||n.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),n.isData3DTexture&&(l=t.TEXTURE_3D);const c=O(e,n),u=n.source;r.bindTexture(l,e.__webglTexture,t.TEXTURE0+o);const d=i.get(u);if(u.version!==d.__version||!0===c){r.activeTexture(t.TEXTURE0+o);const e=mi.getPrimaries(mi.workingColorSpace),i=n.colorSpace===Ze?null:mi.getPrimaries(n.colorSpace),p=n.colorSpace===Ze||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);const f=function(t){return!a&&(t.wrapS!==gt||t.wrapT!==gt||t.minFilter!==yt&&t.minFilter!==wt)}(n)&&!1===x(n.image);let m=v(n.image,f,!1,h);m=Q(n,m);const g=x(m)||a,A=s.convert(n.format,n.colorSpace);let y,M=s.convert(n.type),S=w(n.internalFormat,A,M,n.colorSpace,n.isVideoTexture);D(l,n,g);const C=n.mipmaps,T=a&&!0!==n.isVideoTexture&&S!==ne,I=void 0===d.__version||!0===c,R=E(n,m,g);if(n.isDepthTexture)S=t.DEPTH_COMPONENT,a?S=n.type===Dt?t.DEPTH_COMPONENT32F:n.type===Pt?t.DEPTH_COMPONENT24:n.type===Nt?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:n.type===Dt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===jt&&S===t.DEPTH_COMPONENT&&n.type!==Bt&&n.type!==Pt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Pt,M=s.convert(n.type)),n.format===Vt&&S===t.DEPTH_COMPONENT&&(S=t.DEPTH_STENCIL,n.type!==Nt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Nt,M=s.convert(n.type))),I&&(T?r.texStorage2D(t.TEXTURE_2D,1,S,m.width,m.height):r.texImage2D(t.TEXTURE_2D,0,S,m.width,m.height,0,A,M,null));else if(n.isDataTexture)if(C.length>0&&g){T&&I&&r.texStorage2D(t.TEXTURE_2D,R,S,C[0].width,C[0].height);for(let e=0,i=C.length;e>=1,i>>=1}}else if(C.length>0&&g){T&&I&&r.texStorage2D(t.TEXTURE_2D,R,S,C[0].width,C[0].height);for(let e=0,i=C.length;e>c),i=Math.max(1,n.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?r.texImage3D(l,c,p,e,i,n.depth,0,h,u,null):r.texImage2D(l,c,p,e,i,0,h,u,null)}r.bindFramebuffer(t.FRAMEBUFFER,e),G(n)?d.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,a,l,i.get(o).__webglTexture,0,z(n)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,a,l,i.get(o).__webglTexture,c),r.bindFramebuffer(t.FRAMEBUFFER,null)}function N(e,r,i){if(t.bindRenderbuffer(t.RENDERBUFFER,e),r.depthBuffer&&!r.stencilBuffer){let n=!0===a?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(i||G(r)){const e=r.depthTexture;e&&e.isDepthTexture&&(e.type===Dt?n=t.DEPTH_COMPONENT32F:e.type===Pt&&(n=t.DEPTH_COMPONENT24));const i=z(r);G(r)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,n,r.width,r.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,i,n,r.width,r.height)}else t.renderbufferStorage(t.RENDERBUFFER,n,r.width,r.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(r.depthBuffer&&r.stencilBuffer){const n=z(r);i&&!1===G(r)?t.renderbufferStorageMultisample(t.RENDERBUFFER,n,t.DEPTH24_STENCIL8,r.width,r.height):G(r)?d.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,n,t.DEPTH24_STENCIL8,r.width,r.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,r.width,r.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===r.isWebGLMultipleRenderTargets?r.texture:[r.texture];for(let n=0;n0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==r.__useRenderToTexture}function Q(t,r){const i=t.colorSpace,n=t.format,s=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===Nr||i!==Xe&&i!==Ze&&(mi.getTransfer(i)===tr?!1===a?!0===e.has("EXT_sRGB")&&n===zt?(t.format=Nr,t.minFilter=wt,t.generateMipmaps=!1):r=vi.sRGBToLinear(r):n===zt&&s===Tt||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",i)),r}this.allocateTextureUnit=function(){const t=I;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),I+=1,t},this.resetTextureUnits=function(){I=0},this.setTexture2D=R,this.setTexture2DArray=function(e,n){const s=i.get(e);e.version>0&&s.__version!==e.version?k(s,e,n):r.bindTexture(t.TEXTURE_2D_ARRAY,s.__webglTexture,t.TEXTURE0+n)},this.setTexture3D=function(e,n){const s=i.get(e);e.version>0&&s.__version!==e.version?k(s,e,n):r.bindTexture(t.TEXTURE_3D,s.__webglTexture,t.TEXTURE0+n)},this.setTextureCube=function(e,n){const o=i.get(e);e.version>0&&o.__version!==e.version?function(e,n,o){if(6!==n.image.length)return;const l=O(e,n),h=n.source;r.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+o);const u=i.get(h);if(h.version!==u.__version||!0===l){r.activeTexture(t.TEXTURE0+o);const e=mi.getPrimaries(mi.workingColorSpace),i=n.colorSpace===Ze?null:mi.getPrimaries(n.colorSpace),d=n.colorSpace===Ze||e===i?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const p=n.isCompressedTexture||n.image[0].isCompressedTexture,f=n.image[0]&&n.image[0].isDataTexture,m=[];for(let t=0;t<6;t++)m[t]=p||f?f?n.image[t].image:n.image[t]:v(n.image[t],!1,!0,c),m[t]=Q(n,m[t]);const g=m[0],A=x(g)||a,y=s.convert(n.format,n.colorSpace),M=s.convert(n.type),S=w(n.internalFormat,y,M,n.colorSpace),C=a&&!0!==n.isVideoTexture,T=void 0===u.__version||!0===l;let I,R=E(n,g,A);if(D(t.TEXTURE_CUBE_MAP,n,A),p){C&&T&&r.texStorage2D(t.TEXTURE_CUBE_MAP,R,S,g.width,g.height);for(let e=0;e<6;e++){I=m[e].mipmaps;for(let i=0;i0&&R++,r.texStorage2D(t.TEXTURE_CUBE_MAP,R,S,m[0].width,m[0].height));for(let e=0;e<6;e++)if(f){C?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,m[e].width,m[e].height,y,M,m[e].data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,m[e].width,m[e].height,0,y,M,m[e].data);for(let i=0;i0){c.__webglFramebuffer[e]=[];for(let r=0;r0){c.__webglFramebuffer=[];for(let e=0;e0&&!1===G(e)){const i=d?l:[l];c.__webglMultisampledFramebuffer=t.createFramebuffer(),c.__webglColorRenderbuffer=[],r.bindFramebuffer(t.FRAMEBUFFER,c.__webglMultisampledFramebuffer);for(let r=0;r0)for(let i=0;i0)for(let r=0;r0&&!1===G(e)){const n=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],s=e.width,o=e.height;let a=t.COLOR_BUFFER_BIT;const l=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,h=i.get(e),u=!0===e.isWebGLMultipleRenderTargets;if(u)for(let e=0;ea+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&o<=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,r),null!==n&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,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!==o&&(i=e.getPose(t.targetRaySpace,r),null===i&&null!==n&&(i=n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Hl)))}return null!==o&&(o.visible=null!==i),null!==a&&(a.visible=null!==n),null!==l&&(l.visible=null!==s),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const r=new Vl;r.matrixAutoUpdate=!1,r.visible=!1,t.joints[e.jointName]=r,t.add(r)}return t.joints[e.jointName]}}class ql extends Gr{constructor(t,e){super();const r=this;let i=null,n=1,s=null,o="local-floor",a=1,l=null,c=null,h=null,u=null,d=null,p=null;const f=e.getContextAttributes();let m=null,g=null;const A=[],y=[],v=new ei;let x=null;const b=new ro;b.layers.enable(1),b.viewport=new Mi;const _=new ro;_.layers.enable(2),_.viewport=new Mi;const w=[b,_],E=new jl;E.layers.enable(1),E.layers.enable(2);let M=null,S=null;function C(t){const e=y.indexOf(t.inputSource);if(-1===e)return;const r=A[e];void 0!==r&&(r.update(t.inputSource,t.frame,l||s),r.dispatchEvent({type:t.type,data:t.inputSource}))}function T(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",T),i.removeEventListener("inputsourceschange",I);for(let t=0;t=0&&(y[i]=null,A[i].disconnect(r))}for(let e=0;e=y.length){y.push(r),i=t;break}if(null===y[t]){y[t]=r,i=t;break}}if(-1===i)break}const n=A[i];n&&n.connect(r)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getGripSpace()},this.getHand=function(t){let e=A[t];return void 0===e&&(e=new Wl,A[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){n=t,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===r.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(t){l=t},this.getBaseLayer=function(){return null!==u?u:d},this.getBinding=function(){return h},this.getFrame=function(){return p},this.getSession=function(){return i},this.setSession=async function(c){if(i=c,null!==i){if(m=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",T),i.addEventListener("inputsourceschange",I),!0!==f.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(v),void 0===i.renderState.layers||!1===t.capabilities.isWebGL2){const r={antialias:void 0!==i.renderState.layers||f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:n};d=new XRWebGLLayer(i,e,r),i.updateRenderState({baseLayer:d}),t.setPixelRatio(1),t.setSize(d.framebufferWidth,d.framebufferHeight,!1),g=new Ci(d.framebufferWidth,d.framebufferHeight,{format:zt,type:Tt,colorSpace:t.outputColorSpace,stencilBuffer:f.stencil})}else{let r=null,s=null,o=null;f.depth&&(o=f.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,r=f.stencil?Vt:jt,s=f.stencil?Nt:Pt);const a={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:n};h=new XRWebGLBinding(i,e),u=h.createProjectionLayer(a),i.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),g=new Ci(u.textureWidth,u.textureHeight,{format:zt,type:Tt,depthTexture:new Ko(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,r),stencilBuffer:f.stencil,colorSpace:t.outputColorSpace,samples:f.antialias?4:0}),t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(a),l=null,s=await i.requestReferenceSpace(o),D.setContext(i),D.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode};const R=new Di,B=new Di;function L(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===i)return;E.near=_.near=b.near=t.near,E.far=_.far=b.far=t.far,M===E.near&&S===E.far||(i.updateRenderState({depthNear:E.near,depthFar:E.far}),M=E.near,S=E.far);const e=t.parent,r=E.cameras;L(E,e);for(let t=0;t0&&(i.alphaTest.value=n.alphaTest);const s=e.get(n).envMap;if(s&&(i.envMap.value=s,i.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*e,r(n.lightMap,i.lightMapTransform)}n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity,r(n.aoMap,i.aoMapTransform))}return{refreshFogUniforms:function(e,r){r.color.getRGB(e.fogColor.value,Ks(t)),r.isFog?(e.fogNear.value=r.near,e.fogFar.value=r.far):r.isFogExp2&&(e.fogDensity.value=r.density)},refreshMaterialUniforms:function(t,n,s,o,a){n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(t,n):n.isMeshToonMaterial?(i(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,n)):n.isMeshPhongMaterial?(i(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,n)):n.isMeshStandardMaterial?(i(t,n),function(t,i){t.metalness.value=i.metalness,i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap,r(i.metalnessMap,t.metalnessMapTransform)),t.roughness.value=i.roughness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap,r(i.roughnessMap,t.roughnessMapTransform));e.get(i).envMap&&(t.envMapIntensity.value=i.envMapIntensity)}(t,n),n.isMeshPhysicalMaterial&&function(t,e,i){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,r(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,r(e.sheenRoughnessMap,t.sheenRoughnessMapTransform))),e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,r(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,r(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,r(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===m&&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,r(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,r(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform))),e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,r(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,r(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor)),e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,r(e.anisotropyMap,t.anisotropyMapTransform))),t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,r(e.specularColorMap,t.specularColorMapTransform)),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,r(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,n,a)):n.isMeshMatcapMaterial?(i(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,n)):n.isMeshDepthMaterial?i(t,n):n.isMeshDistanceMaterial?(i(t,n),function(t,r){const i=e.get(r).light;t.referencePosition.value.setFromMatrixPosition(i.matrixWorld),t.nearDistance.value=i.shadow.camera.near,t.farDistance.value=i.shadow.camera.far}(t,n)):n.isMeshNormalMaterial?i(t,n):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,r(e.map,t.mapTransform))}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map,r(e.map,t.uvTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap,r(e.alphaMap,t.alphaMapTransform)),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,n,s,o):n.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,r(e.map,t.mapTransform)),e.alphaMap&&(t.alphaMap.value=e.alphaMap,r(e.alphaMap,t.alphaMapTransform)),e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Yl(t,e,r,i){let n={},s={},o=[];const a=r.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(t,e,r){const i=t.value;if(void 0===r[e]){if("number"==typeof i)r[e]=i;else{const t=Array.isArray(i)?i:[i],n=[];for(let e=0;e0&&(i=r%16,0!==i&&16-i-s.boundary<0&&(r+=16-i,n.__offset=r)),r+=s.storage}i=r%16,i>0&&(r+=16-i),t.__size=r,t.__cache={}}(r),d=function(e){const r=function(){for(let t=0;t0),u=!!r.morphAttributes.position,d=!!r.morphAttributes.normal,p=!!r.morphAttributes.color;let f=et;i.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=_.toneMapping));const m=r.morphAttributes.position||r.morphAttributes.normal||r.morphAttributes.color,g=void 0!==m?m.length:0,A=rt.get(i),y=v.state.lights;if(!0===j&&(!0===V||t!==T)){const e=t===T&&i.id===C;pt.setState(i,t,e)}let x=!1;i.version===A.__version?A.needsLights&&A.lightsStateVersion!==y.state.version||A.outputColorSpace!==a||n.isBatchedMesh&&!1===A.batching?x=!0:n.isBatchedMesh||!0!==A.batching?n.isInstancedMesh&&!1===A.instancing?x=!0:n.isInstancedMesh||!0!==A.instancing?n.isSkinnedMesh&&!1===A.skinning?x=!0:n.isSkinnedMesh||!0!==A.skinning?n.isInstancedMesh&&!0===A.instancingColor&&null===n.instanceColor||n.isInstancedMesh&&!1===A.instancingColor&&null!==n.instanceColor||A.envMap!==l||!0===i.fog&&A.fog!==s?x=!0:void 0===A.numClippingPlanes||A.numClippingPlanes===pt.numPlanes&&A.numIntersection===pt.numIntersection?(A.vertexAlphas!==c||A.vertexTangents!==h||A.morphTargets!==u||A.morphNormals!==d||A.morphColors!==p||A.toneMapping!==f||!0===K.isWebGL2&&A.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,A.__version=i.version);let b=A.currentProgram;!0===x&&(b=Kt(i,e,n));let w=!1,E=!1,M=!1;const I=b.getUniforms(),R=A.uniforms;if($.useProgram(b.program)&&(w=!0,E=!0,M=!0),i.id!==C&&(C=i.id,E=!0),w||T!==t){I.setValue(_t,"projectionMatrix",t.projectionMatrix),I.setValue(_t,"viewMatrix",t.matrixWorldInverse);const e=I.map.cameraPosition;void 0!==e&&e.setValue(_t,Z.setFromMatrixPosition(t.matrixWorld)),K.logarithmicDepthBuffer&&I.setValue(_t,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&I.setValue(_t,"isOrthographic",!0===t.isOrthographicCamera),T!==t&&(T=t,E=!0,M=!0)}if(n.isSkinnedMesh){I.setOptional(_t,n,"bindMatrix"),I.setOptional(_t,n,"bindMatrixInverse");const t=n.skeleton;t&&(K.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),I.setValue(_t,"boneTexture",t.boneTexture,it)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}n.isBatchedMesh&&(I.setOptional(_t,n,"batchingTexture"),I.setValue(_t,"batchingTexture",n._matricesTexture,it));const B=r.morphAttributes;var L,P;if((void 0!==B.position||void 0!==B.normal||void 0!==B.color&&!0===K.isWebGL2)&>.update(n,r,b),(E||A.receiveShadow!==n.receiveShadow)&&(A.receiveShadow=n.receiveShadow,I.setValue(_t,"receiveShadow",n.receiveShadow)),i.isMeshGouraudMaterial&&null!==i.envMap&&(R.envMap.value=l,R.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),E&&(I.setValue(_t,"toneMappingExposure",_.toneMappingExposure),A.needsLights&&(P=M,(L=R).ambientLightColor.needsUpdate=P,L.lightProbe.needsUpdate=P,L.directionalLights.needsUpdate=P,L.directionalLightShadows.needsUpdate=P,L.pointLights.needsUpdate=P,L.pointLightShadows.needsUpdate=P,L.spotLights.needsUpdate=P,L.spotLightShadows.needsUpdate=P,L.rectAreaLights.needsUpdate=P,L.hemisphereLights.needsUpdate=P),s&&!0===i.fog&&ht.refreshFogUniforms(R,s),ht.refreshMaterialUniforms(R,i,k,O,H),il.upload(_t,$t(A),R,it)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(il.upload(_t,$t(A),R,it),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&I.setValue(_t,"center",n.center),I.setValue(_t,"modelViewMatrix",n.modelViewMatrix),I.setValue(_t,"normalMatrix",n.normalMatrix),I.setValue(_t,"modelMatrix",n.matrixWorld),i.isShaderMaterial||i.isRawShaderMaterial){const t=i.uniformsGroups;for(let e=0,r=t.length;e{function r(){i.forEach((function(t){rt.get(t).currentProgram.isReady()&&i.delete(t)})),0!==i.size?setTimeout(r,10):e(t)}null!==J.get("KHR_parallel_shader_compile")?r():setTimeout(r,10)}))};let Gt=null;function Qt(){Vt.stop()}function jt(){Vt.start()}const Vt=new mo;function Ht(t,e,r,i){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)r=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Q.intersectsSprite(t)){i&&Z.setFromMatrixPosition(t.matrixWorld).applyMatrix4(W);const e=lt.update(t),n=t.material;n.visible&&y.push(t,e,n,r,Z.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Q.intersectsObject(t))){const e=lt.update(t),n=t.material;if(i&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),Z.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),Z.copy(e.boundingSphere.center)),Z.applyMatrix4(t.matrixWorld).applyMatrix4(W)),Array.isArray(n)){const i=e.groups;for(let s=0,o=i.length;s0&&function(t,e,r,i){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;const n=K.isWebGL2;null===H&&(H=new Ci(1,1,{generateMipmaps:!0,type:J.has("EXT_color_buffer_half_float")?Ot:Tt,minFilter:St,samples:n?4:0})),_.getDrawingBufferSize(q),n?H.setSize(q.x,q.y):H.setSize(Jr(q.x),Jr(q.y));const s=_.getRenderTarget();_.setRenderTarget(H),_.getClearColor(L),P=_.getClearAlpha(),P<1&&_.setClearColor(16777215,.5),_.clear();const o=_.toneMapping;_.toneMapping=et,Xt(t,r,i),it.updateMultisampleRenderTarget(H),it.updateRenderTargetMipmap(H);let a=!1;for(let t=0,n=e.length;t0&&Xt(n,e,r),s.length>0&&Xt(s,e,r),o.length>0&&Xt(o,e,r),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function Xt(t,e,r){const i=!0===e.isScene?e.overrideMaterial:null;for(let n=0,s=t.length;n0?b[b.length-1]:null,x.pop(),y=x.length>0?x[x.length-1]:null},this.getActiveCubeFace=function(){return E},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,r){rt.get(t.texture).__webglTexture=e,rt.get(t.depthTexture).__webglTexture=r;const i=rt.get(t);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===r,i.__autoAllocateDepthBuffer||!0===J.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const r=rt.get(t);r.__webglFramebuffer=e,r.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,r=0){S=t,E=e,M=r;let i=!0,n=null,s=!1,o=!1;if(t){const a=rt.get(t);void 0!==a.__useDefaultFramebuffer?($.bindFramebuffer(_t.FRAMEBUFFER,null),i=!1):void 0===a.__webglFramebuffer?it.setupRenderTarget(t):a.__hasExternalTextures&&it.rebindTextures(t,rt.get(t.texture).__webglTexture,rt.get(t.depthTexture).__webglTexture);const l=t.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(o=!0);const c=rt.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=Array.isArray(c[e])?c[e][r]:c[e],s=!0):n=K.isWebGL2&&t.samples>0&&!1===it.useMultisampledRTT(t)?rt.get(t).__webglMultisampledFramebuffer:Array.isArray(c)?c[r]:c,I.copy(t.viewport),R.copy(t.scissor),B=t.scissorTest}else I.copy(F).multiplyScalar(k).floor(),R.copy(z).multiplyScalar(k).floor(),B=G;if($.bindFramebuffer(_t.FRAMEBUFFER,n)&&K.drawBuffers&&i&&$.drawBuffers(t,n),$.viewport(I),$.scissor(R),$.setScissorTest(B),s){const i=rt.get(t.texture);_t.framebufferTexture2D(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,_t.TEXTURE_CUBE_MAP_POSITIVE_X+e,i.__webglTexture,r)}else if(o){const i=rt.get(t.texture),n=e||0;_t.framebufferTextureLayer(_t.FRAMEBUFFER,_t.COLOR_ATTACHMENT0,i.__webglTexture,r||0,n)}C=-1},this.readRenderTargetPixels=function(t,e,r,i,n,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=rt.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){$.bindFramebuffer(_t.FRAMEBUFFER,a);try{const o=t.texture,a=o.format,l=o.type;if(a!==zt&&vt.convert(a)!==_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Ot&&(J.has("EXT_color_buffer_half_float")||K.isWebGL2&&J.has("EXT_color_buffer_float"));if(!(l===Tt||vt.convert(l)===_t.getParameter(_t.IMPLEMENTATION_COLOR_READ_TYPE)||l===Dt&&(K.isWebGL2||J.has("OES_texture_float")||J.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-i&&r>=0&&r<=t.height-n&&_t.readPixels(e,r,i,n,vt.convert(a),vt.convert(l),s)}finally{const t=null!==S?rt.get(S).__webglFramebuffer:null;$.bindFramebuffer(_t.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,r=0){const i=Math.pow(2,-r),n=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i);it.setTexture2D(e,0),_t.copyTexSubImage2D(_t.TEXTURE_2D,r,0,0,t.x,t.y,n,s),$.unbindTexture()},this.copyTextureToTexture=function(t,e,r,i=0){const n=e.image.width,s=e.image.height,o=vt.convert(r.format),a=vt.convert(r.type);it.setTexture2D(r,0),_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,r.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,r.unpackAlignment),e.isDataTexture?_t.texSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,n,s,o,a,e.image.data):e.isCompressedTexture?_t.compressedTexSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):_t.texSubImage2D(_t.TEXTURE_2D,i,t.x,t.y,o,a,e.image),0===i&&r.generateMipmaps&&_t.generateMipmap(_t.TEXTURE_2D),$.unbindTexture()},this.copyTextureToTexture3D=function(t,e,r,i,n=0){if(_.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,l=vt.convert(i.format),c=vt.convert(i.type);let h;if(i.isData3DTexture)it.setTexture3D(i,0),h=_t.TEXTURE_3D;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");it.setTexture2DArray(i,0),h=_t.TEXTURE_2D_ARRAY}_t.pixelStorei(_t.UNPACK_FLIP_Y_WEBGL,i.flipY),_t.pixelStorei(_t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),_t.pixelStorei(_t.UNPACK_ALIGNMENT,i.unpackAlignment);const u=_t.getParameter(_t.UNPACK_ROW_LENGTH),d=_t.getParameter(_t.UNPACK_IMAGE_HEIGHT),p=_t.getParameter(_t.UNPACK_SKIP_PIXELS),f=_t.getParameter(_t.UNPACK_SKIP_ROWS),m=_t.getParameter(_t.UNPACK_SKIP_IMAGES),g=r.isCompressedTexture?r.mipmaps[0]:r.image;_t.pixelStorei(_t.UNPACK_ROW_LENGTH,g.width),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,g.height),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,t.min.x),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,t.min.y),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,t.min.z),r.isDataTexture||r.isData3DTexture?_t.texSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,c,g.data):r.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),_t.compressedTexSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,g.data)):_t.texSubImage3D(h,n,e.x,e.y,e.z,s,o,a,l,c,g),_t.pixelStorei(_t.UNPACK_ROW_LENGTH,u),_t.pixelStorei(_t.UNPACK_IMAGE_HEIGHT,d),_t.pixelStorei(_t.UNPACK_SKIP_PIXELS,p),_t.pixelStorei(_t.UNPACK_SKIP_ROWS,f),_t.pixelStorei(_t.UNPACK_SKIP_IMAGES,m),0===n&&i.generateMipmaps&&_t.generateMipmap(h),$.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?it.setTextureCube(t,0):t.isData3DTexture?it.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?it.setTexture2DArray(t,0):it.setTexture2D(t,0),$.unbindTexture()},this.resetState=function(){E=0,M=0,S=null,$.reset(),xt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Fr}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===Je?"display-p3":"srgb",e.unpackColorSpace=mi.workingColorSpace===Ke?"display-p3":"srgb"}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===Ye?je:Qe}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===je?Ye:Xe}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class Jl extends Xl{}Jl.prototype.isWebGL1Renderer=!0;class Kl{constructor(t,e=25e-5){this.isFogExp2=!0,this.name="",this.color=new $n(t),this.density=e}clone(){return new Kl(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class $l{constructor(t,e=1,r=1e3){this.isFog=!0,this.name="",this.color=new $n(t),this.near=e,this.far=r}clone(){return new $l(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class tc extends kn{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}}class ec{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Cr,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Wr()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return console.warn('THREE.InterleavedBuffer: "updateRange" is deprecated and removed in r169. Use "addUpdateRange()" instead.'),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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;it.far||e.push({distance:a,point:oc.clone(),uv:Zn.getInterpolation(oc,dc,pc,fc,mc,gc,Ac,new ei),face:null,object:this})}copy(t,e){return super.copy(t,e),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function vc(t,e,r,i,n,s){cc.subVectors(t,r).addScalar(.5).multiply(i),void 0!==n?(hc.x=s*cc.x-n*cc.y,hc.y=n*cc.x+s*cc.y):hc.copy(cc),t.copy(e),t.x+=hc.x,t.y+=hc.y,t.applyMatrix4(uc)}const xc=new Di,bc=new Di;class _c extends kn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,r=e.length;t0){let r,i;for(r=1,i=e.length;r0){xc.setFromMatrixPosition(this.matrixWorld);const r=t.ray.origin.distanceTo(xc);this.getObjectForDistance(r).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){xc.setFromMatrixPosition(t.matrixWorld),bc.setFromMatrixPosition(this.matrixWorld);const r=xc.distanceTo(bc)/t.zoom;let i,n;for(e[0].object.visible=!0,i=1,n=e.length;i=t))break;e[i-1].object.visible=!1,e[i].object.visible=!0}for(this._currentLevel=i-1;i=r.length&&r.push({start:-1,count:-1,z:-1});const n=r[this.index];i.push(n),this.index++,n.start=t.start,n.count=t.count,n.z=e}reset(){this.list.length=0,this.index=0}}const Xc="batchId",Jc=new un,Kc=new un,$c=new un,th=new un,eh=new fo,rh=new Ui,ih=new en,nh=new Di,sh=new Yc,oh=new qs,ah=[];function lh(t,e,r=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const n=t.count;for(let s=0;s65536?new Uint32Array(n):new Uint16Array(n);e.setIndex(new us(t,1))}const s=i>65536?new Uint32Array(r):new Uint16Array(r);e.setAttribute(Xc,new us(s,1)),this._geometryInitialized=!0}}_validateGeometry(t){if(t.getAttribute(Xc))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Xc}"`);const e=this.geometry;if(Boolean(t.getIndex())!==Boolean(e.getIndex()))throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const r in e.attributes){if(r===Xc)continue;if(!t.hasAttribute(r))throw new Error(`BatchedMesh: Added geometry missing "${r}". All geometries must have consistent attributes.`);const i=t.getAttribute(r),n=e.getAttribute(r);if(i.itemSize!==n.itemSize||i.normalized!==n.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ui);const t=this._geometryCount,e=this.boundingBox,r=this._active;e.makeEmpty();for(let i=0;i=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const i={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let n=null;const s=this._reservedRanges,o=this._drawRanges,a=this._bounds;0!==this._geometryCount&&(n=s[s.length-1]),i.vertexCount=-1===e?t.getAttribute("position").count:e,i.vertexStart=null===n?0:n.vertexStart+n.vertexCount;const l=t.getIndex(),c=null!==l;if(c&&(i.indexCount=-1===r?l.count:r,i.indexStart=null===n?0:n.indexStart+n.indexCount),-1!==i.indexStart&&i.indexStart+i.indexCount>this._maxIndexCount||i.vertexStart+i.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,u=this._active,d=this._matricesTexture,p=this._matricesTexture.image.data;h.push(!0),u.push(!0);const f=this._geometryCount;this._geometryCount++,$c.toArray(p,16*f),d.needsUpdate=!0,s.push(i),o.push({start:c?i.indexStart:i.vertexStart,count:-1}),a.push({boxInitialized:!1,box:new Ui,sphereInitialized:!1,sphere:new en});const m=this.geometry.getAttribute(Xc);for(let t=0;t=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(e);const r=this.geometry,i=null!==r.getIndex(),n=r.getIndex(),s=e.getIndex(),o=this._reservedRanges[t];if(i&&s.count>o.indexCount||e.attributes.position.count>o.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const a=o.vertexStart,l=o.vertexCount;for(const t in r.attributes){if(t===Xc)continue;const i=e.getAttribute(t),n=r.getAttribute(t);lh(i,n,a);const s=i.itemSize;for(let t=i.count,e=l;t=e.length||!1===e[t]||(e[t]=!1,this._visibilityChanged=!0),this}getBoundingBoxAt(t,e){if(!1===this._active[t])return this;const r=this._bounds[t],i=r.box,n=this.geometry;if(!1===r.boxInitialized){i.makeEmpty();const e=n.index,s=n.attributes.position,o=this._drawRanges[t];for(let t=o.start,r=o.start+o.count;t=this._geometryCount||!1===r[t]||(e.toArray(n,16*t),i.needsUpdate=!0),this}getMatrixAt(t,e){const r=this._active,i=this._matricesTexture.image.data;return t>=this._geometryCount||!1===r[t]?null:e.fromArray(i,16*t)}setVisibleAt(t,e){const r=this._visibility,i=this._active;return t>=this._geometryCount||!1===i[t]||r[t]===e||(r[t]=e,this._visibilityChanged=!0),this}getVisibleAt(t){const e=this._visibility,r=this._active;return!(t>=this._geometryCount||!1===r[t])&&e[t]}raycast(t,e){const r=this._visibility,i=this._active,n=this._drawRanges,s=this._geometryCount,o=this.matrixWorld,a=this.geometry;oh.material=this.material,oh.geometry.index=a.index,oh.geometry.attributes=a.attributes,null===oh.geometry.boundingBox&&(oh.geometry.boundingBox=new Ui),null===oh.geometry.boundingSphere&&(oh.geometry.boundingSphere=new en);for(let a=0;a({...t}))),this._reservedRanges=t._reservedRanges.map((t=>({...t}))),this._visibility=t._visibility.slice(),this._active=t._active.slice(),this._bounds=t._bounds.map((t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()}))),this._maxGeometryCount=t._maxGeometryCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(t,e,r,i,n){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=i.getIndex(),o=null===s?1:s.array.BYTES_PER_ELEMENT,a=this._visibility,l=this._multiDrawStarts,c=this._multiDrawCounts,h=this._drawRanges,u=this.perObjectFrustumCulled;u&&(th.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse).multiply(this.matrixWorld),eh.setFromProjectionMatrix(th,t.isWebGPURenderer?zr:Fr));let d=0;if(this.sortObjects){Kc.copy(this.matrixWorld).invert(),nh.setFromMatrixPosition(r.matrixWorld).applyMatrix4(Kc);for(let t=0,e=a.length;ta)continue;u.applyMatrix4(this.matrixWorld);const s=t.ray.origin.distanceTo(u);st.far||e.push({distance:s,point:h.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}else for(let r=Math.max(0,s.start),i=Math.min(f.count,s.start+s.count)-1;ra)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;t0){const r=t[e[0]];if(void 0!==r){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=r.length;tn.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:r,index:e,face:null,object:o})}}class Th extends Ei{constructor(t,e,r,i,n,s,o,a,l){super(t,e,r,i,n,s,o,a,l),this.isVideoTexture=!0,this.minFilter=void 0!==s?s:wt,this.magFilter=void 0!==n?n:wt,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1=="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Ih extends Ei{constructor(t,e){super({width:t,height:e}),this.isFramebufferTexture=!0,this.magFilter=yt,this.minFilter=yt,this.generateMipmaps=!1,this.needsUpdate=!0}}class Rh extends Ei{constructor(t,e,r,i,n,s,o,a,l,c,h,u){super(null,s,o,a,l,c,i,n,h,u),this.isCompressedTexture=!0,this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class Bh extends Rh{constructor(t,e,r,i,n,s){super(t,e,r,n,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=gt}}class Lh extends Rh{constructor(t,e,r){super(void 0,t[0].width,t[0].height,e,r,ht),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class Ph extends Ei{constructor(t,e,r,i,n,s,o,a,l){super(t,e,r,i,n,s,o,a,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Dh{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const r=this.getUtoTmapping(t);return this.getPoint(r,e)}getPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPoint(r/t));return e}getSpacedPoints(t=5){const e=[];for(let r=0;r<=t;r++)e.push(this.getPointAt(r/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 r,i=this.getPoint(0),n=0;e.push(0);for(let s=1;s<=t;s++)r=this.getPoint(s/t),n+=r.distanceTo(i),e.push(n),i=r;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const r=this.getLengths();let i=0;const n=r.length;let s;s=e||t*r[n-1];let o,a=0,l=n-1;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),o=r[i]-s,o<0)a=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(i=l,r[i]===s)return i/(n-1);const c=r[i];return(i+(s-c)/(r[i+1]-c))/(n-1)}getTangent(t,e){const r=1e-4;let i=t-r,n=t+r;i<0&&(i=0),n>1&&(n=1);const s=this.getPoint(i),o=this.getPoint(n),a=e||(s.isVector2?new ei:new Di);return a.copy(o).sub(s).normalize(),a}getTangentAt(t,e){const r=this.getUtoTmapping(t);return this.getTangent(r,e)}computeFrenetFrames(t,e){const r=new Di,i=[],n=[],s=[],o=new Di,a=new un;for(let e=0;e<=t;e++){const r=e/t;i[e]=this.getTangentAt(r,new Di)}n[0]=new Di,s[0]=new Di;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,r.set(1,0,0)),h<=l&&(l=h,r.set(0,1,0)),u<=l&&r.set(0,0,1),o.crossVectors(i[0],r).normalize(),n[0].crossVectors(i[0],o),s[0].crossVectors(i[0],n[0]);for(let e=1;e<=t;e++){if(n[e]=n[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(i[e-1],i[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(qr(i[e-1].dot(i[e]),-1,1));n[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(i[e],n[e])}if(!0===e){let e=Math.acos(qr(n[0].dot(n[t]),-1,1));e/=t,i[0].dot(o.crossVectors(n[0],n[t]))>0&&(e=-e);for(let r=1;r<=t;r++)n[r].applyMatrix4(a.makeRotationAxis(i[r],e*r)),s[r].crossVectors(i[r],n[r])}return{tangents:i,normals:n,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Oh extends Dh{constructor(t=0,e=0,r=1,i=1,n=0,s=2*Math.PI,o=!1,a=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const r=e||new ei,i=2*Math.PI;let n=this.aEndAngle-this.aStartAngle;const s=Math.abs(n)i;)n-=i;n0?0:(Math.floor(Math.abs(l)/n)+1)*n:0===c&&l===n-1&&(l=n-2,c=1),this.closed||l>0?o=i[(l-1)%n]:(Nh.subVectors(i[0],i[1]).add(i[0]),o=Nh);const h=i[l%n],u=i[(l+1)%n];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return r.set(jh(o,a.x,l.x,c.x,h.x),jh(o,a.y,l.y,c.y,h.y)),r}copy(t){super.copy(t),this.points=[];for(let e=0,r=t.points.length;e=r){const t=i[n]-r,s=this.curves[n],o=s.getLength(),a=0===o?0:1-t/o;return s.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 r=0,i=this.curves.length;r1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,r=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),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}}class ru extends Is{constructor(t=[new ei(0,-.5),new ei(.5,0),new ei(0,.5)],e=12,r=0,i=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=Math.floor(e),i=qr(i,0,2*Math.PI);const n=[],s=[],o=[],a=[],l=[],c=1/e,h=new Di,u=new ei,d=new Di,p=new Di,f=new Di;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case t.length-1:a.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let n=0;n<=e;n++){const d=r+n*c*i,p=Math.sin(d),f=Math.cos(d);for(let r=0;r<=t.length-1;r++){h.x=t[r].x*p,h.y=t[r].y,h.z=t[r].x*f,s.push(h.x,h.y,h.z),u.x=n/e,u.y=r/(t.length-1),o.push(u.x,u.y);const i=a[3*r+0]*p,c=a[3*r+1],d=a[3*r+0]*f;l.push(i,c,d)}}for(let r=0;r0&&A(!0),e>0&&A(!1)),this.setIndex(c),this.setAttribute("position",new xs(h,3)),this.setAttribute("normal",new xs(u,3)),this.setAttribute("uv",new xs(d,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new su(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ou extends su{constructor(t=1,e=1,r=32,i=1,n=!1,s=0,o=2*Math.PI){super(0,t,e,r,i,n,s,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:i,openEnded:n,thetaStart:s,thetaLength:o}}static fromJSON(t){return new ou(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class au extends Is{constructor(t=[],e=[],r=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i};const n=[],s=[];function o(t,e,r,i){const n=i+1,s=[];for(let i=0;i<=n;i++){s[i]=[];const o=t.clone().lerp(r,i/n),a=e.clone().lerp(r,i/n),l=n-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===n?o:o.clone().lerp(a,t/l)}for(let t=0;t.9&&o<.1&&(e<.2&&(s[t+0]+=1),r<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new xs(n,3)),this.setAttribute("normal",new xs(n.slice(),3)),this.setAttribute("uv",new xs(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new au(t.vertices,t.indices,t.radius,t.details)}}class lu extends au{constructor(t=1,e=0){const r=(1+Math.sqrt(5))/2,i=1/r;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new lu(t.radius,t.detail)}}const cu=new Di,hu=new Di,uu=new Di,du=new Zn;class pu extends Is{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const r=4,i=Math.pow(10,r),n=Math.cos(Vr*e),s=t.getIndex(),o=t.getAttribute("position"),a=s?s.count:o.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),u={},d=[];for(let t=0;t0)for(s=e;s=e;s-=i)o=ku(s,t[s],t[s+1],o);return o&&Ru(o,o.next)&&(Uu(o),o=o.next),o}function gu(t,e){if(!t)return t;e||(e=t);let r,i=t;do{if(r=!1,i.steiner||!Ru(i,i.next)&&0!==Iu(i.prev,i,i.next))i=i.next;else{if(Uu(i),i=e=i.prev,i===i.next)break;r=!0}}while(r||i!==e);return e}function Au(t,e,r,i,n,s,o){if(!t)return;!o&&s&&function(t,e,r,i){let n=t;do{0===n.z&&(n.z=Mu(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,l,c=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,i=r,a=0,e=0;e0||l>0&&i;)0!==a&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=i}s.nextZ=null,c*=2}while(o>1)}(n)}(t,i,n,s);let a,l,c=t;for(;t.prev!==t.next;)if(a=t.prev,l=t.next,s?vu(t,i,n,s):yu(t))e.push(a.i/r|0),e.push(t.i/r|0),e.push(l.i/r|0),Uu(t),t=l.next,c=l.next;else if((t=l)===c){o?1===o?Au(t=xu(gu(t),e,r),e,r,i,n,s,2):2===o&&bu(t,e,r,i,n,s):Au(gu(t),e,r,i,n,s,1);break}}function yu(t){const e=t.prev,r=t,i=t.next;if(Iu(e,r,i)>=0)return!1;const n=e.x,s=r.x,o=i.x,a=e.y,l=r.y,c=i.y,h=ns?n>o?n:o:s>o?s:o,p=a>l?a>c?a:c:l>c?l:c;let f=i.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Cu(n,a,s,l,o,c,f.x,f.y)&&Iu(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function vu(t,e,r,i){const n=t.prev,s=t,o=t.next;if(Iu(n,s,o)>=0)return!1;const a=n.x,l=s.x,c=o.x,h=n.y,u=s.y,d=o.y,p=al?a>c?a:c:l>c?l:c,g=h>u?h>d?h:d:u>d?u:d,A=Mu(p,f,e,r,i),y=Mu(m,g,e,r,i);let v=t.prevZ,x=t.nextZ;for(;v&&v.z>=A&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==o&&Cu(a,h,l,u,c,d,v.x,v.y)&&Iu(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==o&&Cu(a,h,l,u,c,d,x.x,x.y)&&Iu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=A;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==o&&Cu(a,h,l,u,c,d,v.x,v.y)&&Iu(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==o&&Cu(a,h,l,u,c,d,x.x,x.y)&&Iu(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function xu(t,e,r){let i=t;do{const n=i.prev,s=i.next.next;!Ru(n,s)&&Bu(n,i,i.next,s)&&Du(n,s)&&Du(s,n)&&(e.push(n.i/r|0),e.push(i.i/r|0),e.push(s.i/r|0),Uu(i),Uu(i.next),i=t=s),i=i.next}while(i!==t);return gu(i)}function bu(t,e,r,i,n,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&Tu(o,t)){let a=Ou(o,t);return o=gu(o,o.next),a=gu(a,a.next),Au(o,e,r,i,n,s,0),void Au(a,e,r,i,n,s,0)}t=t.next}o=o.next}while(o!==t)}function _u(t,e){return t.x-e.x}function wu(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.x&&i.x>=l&&s!==i.x&&Cu(or.x||i.x===r.x&&Eu(r,i)))&&(r=i,u=h)),i=i.next}while(i!==a);return r}(t,e);if(!r)return e;const i=Ou(r,t);return gu(i,i.next),gu(r,r.next)}function Eu(t,e){return Iu(t.prev,t,e.prev)<0&&Iu(e.next,t,t.next)<0}function Mu(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 Su(t){let e=t,r=t;do{(e.x=(t-o)*(s-a)&&(t-o)*(i-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(n-o)*(i-a)}function Tu(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&&Bu(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Du(t,e)&&Du(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)&&(Iu(t.prev,t,e.prev)||Iu(t,e.prev,e))||Ru(t,e)&&Iu(t.prev,t,t.next)>0&&Iu(e.prev,e,e.next)>0)}function Iu(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ru(t,e){return t.x===e.x&&t.y===e.y}function Bu(t,e,r,i){const n=Pu(Iu(t,e,r)),s=Pu(Iu(t,e,i)),o=Pu(Iu(r,i,t)),a=Pu(Iu(r,i,e));return n!==s&&o!==a||!(0!==n||!Lu(t,r,e))||!(0!==s||!Lu(t,i,e))||!(0!==o||!Lu(r,t,i))||!(0!==a||!Lu(r,e,i))}function Lu(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 Pu(t){return t>0?1:t<0?-1:0}function Du(t,e){return Iu(t.prev,t,t.next)<0?Iu(t,e,t.next)>=0&&Iu(t,t.prev,e)>=0:Iu(t,e,t.prev)<0||Iu(t,t.next,e)<0}function Ou(t,e){const r=new Nu(t.i,t.x,t.y),i=new Nu(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 ku(t,e,r,i){const n=new Nu(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 Uu(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 Nu(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}class Fu{static area(t){const e=t.length;let r=0;for(let i=e-1,n=0;n80*r){a=c=t[0],l=h=t[1];for(let e=r;ec&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?32767/p:0}return Au(s,o,r,a,l,p,0),o}(r,i);for(let t=0;t2&&t[e-1].equals(t[0])&&t.pop()}function Gu(t,e){for(let r=0;rNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/u,f=e.y+o/u,m=((r.x-c/d-p)*c-(r.y+l/d-f)*l)/(o*c-a*l);i=p+o*m-t.x,n=f+a*m-t.y;const g=i*i+n*n;if(g<=2)return new ei(i,n);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?l>Number.EPSILON&&(t=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(i=-a,n=o,s=Math.sqrt(h)):(i=o,n=a,s=Math.sqrt(h/2))}return new ei(i/s,n/s)}const B=[];for(let t=0,e=S.length,r=e-1,i=t+1;t=0;t--){const e=t/p,r=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=S.length;t=0;){const i=r;let n=r-1;n<0&&(n=t.length-1);for(let t=0,r=a+2*p;t0)&&d.push(e,n,l),(t!==r-1||a0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class od extends rs{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new $n(16777215),this.specular=new $n(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K,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}}class ad extends rs{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new $n(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,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.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class ld extends rs{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),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.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class cd extends rs{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new $n(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new $n(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K,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.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}}class hd extends rs{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new $n(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=We,this.normalScale=new ei(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,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.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class ud extends hh{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}}function dd(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)}function pd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function fd(t){const e=t.length,r=new Array(e);for(let t=0;t!==e;++t)r[t]=t;return r.sort((function(e,r){return t[e]-t[r]})),r}function md(t,e,r){const i=t.length,n=new t.constructor(i);for(let s=0,o=0;o!==i;++s){const i=r[s]*e;for(let r=0;r!==e;++r)n[o++]=t[i+r]}return n}function gd(t,e,r,i){let n=1,s=t[0];for(;void 0!==s&&void 0===s[i];)s=t[n++];if(void 0===s)return;let o=s[i];if(void 0!==o)if(Array.isArray(o))do{o=s[i],void 0!==o&&(e.push(s.time),r.push.apply(r,o)),s=t[n++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[i],void 0!==o&&(e.push(s.time),o.toArray(r,r.length)),s=t[n++]}while(void 0!==s);else do{o=s[i],void 0!==o&&(e.push(s.time),r.push(o)),s=t[n++]}while(void 0!==s)}const Ad={convertArray:dd,isTypedArray:pd,getKeyframeOrder:fd,sortedArray:md,flattenJSON:gd,subclip:function(t,e,r,i,n=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t=i)){l.push(e.times[t]);for(let r=0;rs.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+a,e=t+l-a;d=i.values.slice(t,e)}else{const t=i.createInterpolant(),e=a,r=l-a;t.evaluate(s),d=t.resultBuffer.slice(e,r)}"quaternion"===n&&(new Pi).fromArray(d).normalize().conjugate().toArray(d);const p=o.times.length;for(let t=0;t=n)break t;{const o=e[1];t=n)break e}s=r,r=0}}for(;r>>1;te;)--s;if(++s,0!==n||s!==i){n>=s&&(s=Math.max(s,1),n=s-1);const t=this.getValueSize();this.times=r.slice(n,s),this.values=this.values.slice(n*t,s*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 r=this.times,i=this.values,n=r.length;0===n&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==n;e++){const i=r[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&pd(i))for(let e=0,r=i.length;e!==r;++e){const r=i[e];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,r),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===Pe,n=t.length-1;let s=1;for(let o=1;o0){t[s]=t[n];for(let t=n*r,i=s*r,o=0;o!==r;++o)e[i+o]=e[t+o];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=e.slice(0,s*r)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),r=new(0,this.constructor)(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}_d.prototype.TimeBufferType=Float32Array,_d.prototype.ValueBufferType=Float32Array,_d.prototype.DefaultInterpolation=Le;class wd extends _d{}wd.prototype.ValueTypeName="bool",wd.prototype.ValueBufferType=Array,wd.prototype.DefaultInterpolation=Be,wd.prototype.InterpolantFactoryMethodLinear=void 0,wd.prototype.InterpolantFactoryMethodSmooth=void 0;class Ed extends _d{}Ed.prototype.ValueTypeName="color";class Md extends _d{}Md.prototype.ValueTypeName="number";class Sd extends yd{constructor(t,e,r,i){super(t,e,r,i)}interpolate_(t,e,r,i){const n=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(r-e)/(i-e);let l=t*o;for(let t=l+o;l!==t;l+=4)Pi.slerpFlat(n,0,s,l-o,s,l,a);return n}}class Cd extends _d{InterpolantFactoryMethodLinear(t){return new Sd(this.times,this.values,this.getValueSize(),t)}}Cd.prototype.ValueTypeName="quaternion",Cd.prototype.DefaultInterpolation=Le,Cd.prototype.InterpolantFactoryMethodSmooth=void 0;class Td extends _d{}Td.prototype.ValueTypeName="string",Td.prototype.ValueBufferType=Array,Td.prototype.DefaultInterpolation=Be,Td.prototype.InterpolantFactoryMethodLinear=void 0,Td.prototype.InterpolantFactoryMethodSmooth=void 0;class Id extends _d{}Id.prototype.ValueTypeName="vector";class Rd{constructor(t,e=-1,r,i=Ue){this.name=t,this.tracks=r,this.duration=e,this.blendMode=i,this.uuid=Wr(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],r=t.tracks,i=1/(t.fps||1);for(let t=0,n=r.length;t!==n;++t)e.push(Bd(r[t]).scale(i));const n=new this(t.name,t.duration,e,t.blendMode);return n.uuid=t.uuid,n}static toJSON(t){const e=[],r=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=r.length;t!==i;++t)e.push(_d.toJSON(r[t]));return i}static CreateFromMorphTargetSequence(t,e,r,i){const n=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(r)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,r));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(t,e,r,i,n){if(0!==r.length){const s=[],o=[];gd(r,s,o,i),0!==s.length&&n.push(new t(e,s,o))}},i=[],n=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let t=0;t{e&&e(n),this.manager.itemEnd(t)}),0),n;if(void 0!==kd[t])return void kd[t].push({onLoad:e,onProgress:r,onError:i});kd[t]=[],kd[t].push({onLoad:e,onProgress:r,onError:i});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then((e=>{if(200===e.status||0===e.status){if(0===e.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const r=kd[t],i=e.body.getReader(),n=e.headers.get("Content-Length")||e.headers.get("X-File-Size"),s=n?parseInt(n):0,o=0!==s;let a=0;const l=new ReadableStream({start(t){!function e(){i.read().then((({done:i,value:n})=>{if(i)t.close();else{a+=n.byteLength;const i=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=r.length;t{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then((t=>(new DOMParser).parseFromString(t,o)));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),r=e&&e[1]?e[1].toLowerCase():void 0,i=new TextDecoder(r);return t.arrayBuffer().then((t=>i.decode(t)))}}})).then((e=>{Ld.add(t,e);const r=kd[t];delete kd[t];for(let t=0,i=r.length;t{const r=kd[t];if(void 0===r)throw this.manager.itemError(t),e;delete kd[t];for(let t=0,i=r.length;t{this.manager.itemEnd(t)})),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Fd extends Od{constructor(t){super(t)}load(t,e,r,i){const n=this,s=new Nd(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(r){try{e(n.parse(JSON.parse(r)))}catch(e){i?i(e):console.error(e),n.manager.itemError(t)}}),r,i)}parse(t){const e=[];for(let r=0;r0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const n=t.uniforms[e];switch(i.uniforms[e]={},n.type){case"t":i.uniforms[e].value=r(n.value);break;case"c":i.uniforms[e].value=(new $n).setHex(n.value);break;case"v2":i.uniforms[e].value=(new ei).fromArray(n.value);break;case"v3":i.uniforms[e].value=(new Di).fromArray(n.value);break;case"v4":i.uniforms[e].value=(new Mi).fromArray(n.value);break;case"m3":i.uniforms[e].value=(new ri).fromArray(n.value);break;case"m4":i.uniforms[e].value=(new un).fromArray(n.value);break;default:i.uniforms[e].value=n.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.glslVersion&&(i.glslVersion=t.glslVersion),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.lights&&(i.lights=t.lights),void 0!==t.clipping&&(i.clipping=t.clipping),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=r(t.map)),void 0!==t.matcap&&(i.matcap=r(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=r(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=r(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=r(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new ei).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=r(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=r(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=r(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=r(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=r(t.specularMap)),void 0!==t.specularIntensityMap&&(i.specularIntensityMap=r(t.specularIntensityMap)),void 0!==t.specularColorMap&&(i.specularColorMap=r(t.specularColorMap)),void 0!==t.envMap&&(i.envMap=r(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=r(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=r(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=r(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=r(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=r(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=r(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new ei).fromArray(t.clearcoatNormalScale)),void 0!==t.iridescenceMap&&(i.iridescenceMap=r(t.iridescenceMap)),void 0!==t.iridescenceThicknessMap&&(i.iridescenceThicknessMap=r(t.iridescenceThicknessMap)),void 0!==t.transmissionMap&&(i.transmissionMap=r(t.transmissionMap)),void 0!==t.thicknessMap&&(i.thicknessMap=r(t.thicknessMap)),void 0!==t.anisotropyMap&&(i.anisotropyMap=r(t.anisotropyMap)),void 0!==t.sheenColorMap&&(i.sheenColorMap=r(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(i.sheenRoughnessMap=r(t.sheenRoughnessMap)),i}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){return new{ShadowMaterial:rd,SpriteMaterial:nc,RawShaderMaterial:id,ShaderMaterial:to,PointsMaterial:bh,MeshPhysicalMaterial:sd,MeshStandardMaterial:nd,MeshPhongMaterial:od,MeshToonMaterial:ad,MeshNormalMaterial:ld,MeshLambertMaterial:cd,MeshDepthMaterial:Ul,MeshDistanceMaterial:Nl,MeshBasicMaterial:is,MeshMatcapMaterial:hd,LineDashedMaterial:ud,LineBasicMaterial:hh,Material:rs}[t]}}class up{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let r=0,i=t.length;r0){const r=new Pd(e);n=new Gd(r),n.setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e0){i=new Gd(this.manager),i.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e{const e=new Ui;e.min.fromArray(t.boxMin),e.max.fromArray(t.boxMax);const r=new en;return r.radius=t.sphereRadius,r.center.fromArray(t.sphereCenter),{boxInitialized:t.boxInitialized,box:e,sphereInitialized:t.sphereInitialized,sphere:r}})),s._maxGeometryCount=t.maxGeometryCount,s._maxVertexCount=t.maxVertexCount,s._maxIndexCount=t.maxIndexCount,s._geometryInitialized=t.geometryInitialized,s._geometryCount=t.geometryCount,s._matricesTexture=h(t.matricesTexture.uuid);break;case"LOD":s=new _c;break;case"Line":s=new gh(l(t.geometry),c(t.material));break;case"LineLoop":s=new xh(l(t.geometry),c(t.material));break;case"LineSegments":s=new vh(l(t.geometry),c(t.material));break;case"PointCloud":case"Points":s=new Sh(l(t.geometry),c(t.material));break;case"Sprite":s=new yc(c(t.material));break;case"Group":s=new Vl;break;case"Bone":s=new Pc;break;default:s=new kn}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(s.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.quaternion&&s.quaternion.fromArray(t.quaternion),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.up&&s.up.fromArray(t.up),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(s.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(s.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(s.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&s.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(s.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.frustumCulled&&(s.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(s.renderOrder=t.renderOrder),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.layers&&(s.layers.mask=t.layers),void 0!==t.children){const o=t.children;for(let t=0;t0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(r,i,this._addIndex*e,1,e);for(let t=e,n=e+e;t!==n;++t)if(r[t]!==r[t+e]){o.setValue(r,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,r=this.valueSize,i=r*this._origIndex;t.getValue(e,i);for(let t=r,n=i;t!==n;++t)e[t]=e[i+t%r];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 r=t;r=.5)for(let i=0;i!==n;++i)t[e+i]=t[r+i]}_slerp(t,e,r,i){Pi.slerpFlat(t,e,t,e,t,r,i)}_slerpAdditive(t,e,r,i,n){const s=this._workIndex*n;Pi.multiplyQuaternionsFlat(t,s,t,e,t,r),Pi.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,r,i,n){const s=1-i;for(let o=0;o!==n;++o){const n=e+o;t[n]=t[n]*s+t[r+o]*i}}_lerpAdditive(t,e,r,i,n){for(let s=0;s!==n;++s){const n=e+s;t[n]=t[n]+t[r+s]*i}}}const Gp="\\[\\]\\.:\\/",Qp=new RegExp("["+Gp+"]","g"),jp="[^"+Gp+"]",Vp="[^"+Gp.replace("\\.","")+"]",Hp=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",jp)+/(WCOD+)?/.source.replace("WCOD",Vp)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",jp)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",jp)+"$"),Wp=["material","materials","bones","map"];class qp{constructor(t,e,r){this.path=e,this.parsedPath=r||qp.parseTrackName(e),this.node=qp.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,r){return t&&t.isAnimationObjectGroup?new qp.Composite(t,e,r):new qp(t,e,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Qp,"")}static parseTrackName(t){const e=Hp.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const r={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=r.nodeName.substring(i+1);-1!==Wp.indexOf(t)&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=t)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const r=t.skeleton.getBoneByName(e);if(void 0!==r)return r}if(t.children){const r=function(t){for(let i=0;i=n){const s=n++,c=t[s];e[c.uuid]=l,t[l]=c,e[a]=s,t[s]=o;for(let t=0,e=i;t!==e;++t){const e=r[t],i=e[s],n=e[l];e[l]=i,e[s]=n}}}this.nCachedObjects_=n}uncache(){const t=this._objects,e=this._indicesByUUID,r=this._bindings,i=r.length;let n=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=e[a];if(void 0!==l)if(delete e[a],l0&&(e[o.uuid]=l),t[l]=o,t.pop();for(let t=0,e=i;t!==e;++t){const e=r[t];e[l]=e[n],e.pop()}}}this.nCachedObjects_=n}subscribe_(t,e){const r=this._bindingsIndicesByPath;let i=r[t];const n=this._bindings;if(void 0!==i)return n[i];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);i=n.length,r[t]=i,s.push(t),o.push(e),n.push(h);for(let r=c,i=a.length;r!==i;++r){const i=a[r];h[r]=new qp(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){const i=this._paths,n=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=r,s[r]=a,s.pop(),n[r]=n[o],n.pop(),i[r]=i[o],i.pop()}}}class Yp{constructor(t,e,r=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=r,this.blendMode=i;const n=e.tracks,s=n.length,o=new Array(s),a={endingStart:De,endingEnd:De};for(let t=0;t!==s;++t){const e=n[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ie,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,r){if(t.fadeOut(e),this.fadeIn(e),r){const r=this._clip.duration,i=t._clip.duration,n=i/r,s=r/i;t.warp(1,n,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,r){return t.crossFadeFrom(this,e,r)}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,r){const i=this._mixer,n=i.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=n,a[1]=n+r,l[0]=t/s,l[1]=e/s,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,r,i){if(!this.enabled)return void this._updateWeight(t);const n=this._startTime;if(null!==n){const i=(t-n)*r;i<0||0===r?e=0:(this._startTime=null,e=r*i)}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;if(this.blendMode===Ne)for(let r=0,i=t.length;r!==i;++r)t[r].evaluate(s),e[r].accumulateAdditive(o);else for(let r=0,n=t.length;r!==n;++r)t[r].evaluate(s),e[r].accumulate(i,o)}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const r=this._weightInterpolant;if(null!==r){const i=r.evaluate(t)[0];e*=i,t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,r=this.loop;let i=this.time+t,n=this._loopCount;const s=r===Re;if(0===t)return-1===n?i:s&&1==(1&n)?e-i:i;if(r===Te){-1===n&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===n&&(t>=0?(n=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const r=Math.floor(i/e);i-=e*r,n+=Math.abs(r);const o=this.repetitions-n;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=n,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:r})}}else this.time=i;if(s&&1==(1&n))return e-i}return i}_setEndings(t,e,r){const i=this._interpolantSettings;r?(i.endingStart=Oe,i.endingEnd=Oe):(i.endingStart=t?this.zeroSlopeAtStart?Oe:De:ke,i.endingEnd=e?this.zeroSlopeAtEnd?Oe:De:ke)}_scheduleFading(t,e,r){const i=this._mixer,n=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=n,a[0]=e,o[1]=n+t,a[1]=r,this}}const Xp=new Float32Array(1);class Jp extends Gr{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,s=t._propertyBindings,o=t._interpolants,a=r.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let t=0;t!==n;++t){const n=i[t],l=n.name;let h=c[l];if(void 0!==h)++h.referenceCount,s[t]=h;else{if(h=s[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;h=new zp(qp.create(r,l,i),n.ValueTypeName,n.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[t]=h}o[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,r=t._clip.uuid,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,r=e.length;t!==r;++t){const r=e[t];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}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=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==r;++o)e[o]._update(i,t,n,s);const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.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.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,cf).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)}}const uf=new Di,df=new Di;class pf{constructor(t=new Di,e=new Di){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){uf.subVectors(t,this.start),df.subVectors(this.end,this.start);const r=df.dot(df);let i=df.dot(uf)/r;return e&&(i=qr(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)}}const ff=new Di;class mf extends kn{constructor(t,e){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e,this.type="SpotLightHelper";const r=new Is,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,r=32;t1)for(let r=0;r.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{zf.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(zf,e)}}setLength(t,e=.2*t,r=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Vf extends vh{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],r=new Is;r.setAttribute("position",new xs(e,3)),r.setAttribute("color",new xs([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(r,new hh({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,r){const i=new $n,n=this.geometry.attributes.color.array;return i.set(t),i.toArray(n,0),i.toArray(n,3),i.set(e),i.toArray(n,6),i.toArray(n,9),i.set(r),i.toArray(n,12),i.toArray(n,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Hf{constructor(){this.type="ShapePath",this.color=new $n,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new eu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,r,i){return this.currentPath.quadraticCurveTo(t,e,r,i),this}bezierCurveTo(t,e,r,i,n,s){return this.currentPath.bezierCurveTo(t,e,r,i,n,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const r=e.length;let i=!1;for(let n=r-1,s=0;sNumber.EPSILON){if(l<0&&(r=e[s],a=-a,o=e[n],l=-l),t.yo.y)continue;if(t.y===r.y){if(t.x===r.x)return!0}else{const e=l*(t.x-r.x)-a*(t.y-r.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==r.y)continue;if(o.x<=t.x&&t.x<=r.x||r.x<=t.x&&t.x<=o.x)return!0}}return i}const r=Fu.isClockWise,i=this.subPaths;if(0===i.length)return[];let n,s,o;const a=[];if(1===i.length)return s=i[0],o=new fu,o.curves=s.curves,a.push(o),a;let l=!r(i[0].getPoints());l=t?!l:l;const c=[],h=[];let u,d,p=[],f=0;h[f]=void 0,p[f]=[];for(let e=0,o=i.length;e1){let t=!1,r=0;for(let t=0,e=h.length;t0&&!1===t&&(p=c)}for(let t=0,e=h.length;t{if(!r){var o=1/0;for(h=0;h=s)&&Object.keys(i.O).every((t=>i.O[t](r[l])))?r.splice(l--,1):(a=!1,s0&&t[h-1][2]>s;h--)t[h]=t[h-1];t[h]=[r,n,s]},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={764:0};i.O.j=e=>0===t[e];var e=(e,r)=>{var n,s,[o,a,l]=r,c=0;if(o.some((e=>0!==t[e]))){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(l)var h=l(i)}for(e&&e(r);c(self.webpackChunkitowns=self.webpackChunkitowns||[]).push([[318],{81499:(t,e,o)=>{o.r(e),o.d(e,{C3DTilesStyle:()=>A,Minimap:()=>f,Navigation:()=>c,Scale:()=>y,Searchbar:()=>T,Widget:()=>n});var i=o(36873);const n=class{#t;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;this.parentElement=e.parentElement||t.domElement,this.position=e.position||o.position,["top-left","top-right","bottom-left","bottom-right","top","bottom","left","right"].includes(this.position)||(console.warn(`'position' optional parameter for 'Widget' constructor is not a valid option. It will be set to '${o.position}'.`),this.position=o.position),this.domElement=document.createElement("div"),this.parentElement.appendChild(this.domElement),this.domElement.style.width=`${e.width||e.size||o.width}px`,this.domElement.style.height=`${e.height||e.size||o.height}px`;const i=this.position.split("-");if(this.domElement.classList.add(`${i[0]}-widget`),i[1])this.domElement.classList.add(`${i[1]}-widget`);else switch(i[0]){case"top":case"bottom":this.domElement.style.left=`calc(50% - ${this.domElement.offsetWidth/2}px)`;break;case"left":case"right":this.domElement.style.top=`calc(50% - ${this.domElement.offsetHeight/2}px)`}e.translate&&(this.domElement.style.transform=`translate(${e.translate.x||0}px, ${e.translate.y||0}px)`),this.domElement.addEventListener("pointerdown",(t=>{t.stopPropagation()})),this.domElement.addEventListener("mousedown",(t=>{t.stopPropagation()}))}show(){this.domElement.style.display=this.#t}hide(){this.#t=window.getComputedStyle(this.domElement).display,this.domElement.style.display="none"}},s={displayCompass:!0,display3DToggle:!0,displayZoomIn:!0,displayZoomOut:!0,animationDuration:500,position:"bottom-left",direction:"column"},a={id:"compass",content:"",info:"Rotate the camera to face North",parentId:"widgets"},l={id:"3d-button",content:"3D",info:"Tilt the camera"},r={id:"zoom-in-button",content:'',info:"Zoom in",parentId:"zoom-button-bar"},d={id:"zoom-out-button",content:'',info:"Zoom out",parentId:"zoom-button-bar"},c=class extends n{#e;#o(t){return t.time=this.animationDuration,this.#e.controls.lookAtCoordinate(t)}#i(t,e){return this.addButton(t.id,t.content,t.info,e,t.parentId)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.isGlobeView)throw new Error("'Navigation' plugin only supports 'GlobeView'. Therefore, the 'view' parameter must be a 'GlobeView'.");["top","bottom","left","right"].includes(e.position)&&(console.warn(`'position' optional parameter for 'Navigation' is not a valid option. It will be set to '${s.position}'.`),e.position=s.position),super(t,e,s),this.#e=t,this.direction=e.direction||s.direction,["column","row"].includes(this.direction)||(console.warn(`'direction' optional parameter for 'Navigation' constructor is not a valid option. It will be set to '${s.direction}'.`),this.direction=s.direction),this.animationDuration=void 0===e.animationDuration?s.animationDuration:e.animationDuration,this.domElement.id="widgets-navigation",this.domElement.classList.add(`${this.direction}-widget`),(e.displayCompass??s.displayCompass)&&(this.compass=this.#i(a,(()=>{this.#o({heading:0,tilt:89.5})})),t.addEventListener(i.b.CAMERA_MOVED,(t=>{this.compass.style.transform=`rotate(${-t.heading}deg)`}))),(e.display3DToggle??s.display3DToggle)&&(this.toggle3D=this.#i(l,(()=>{this.#o({tilt:this.#e.controls.getTilt()<89?89.5:40})})),t.addEventListener(i.b.CAMERA_MOVED,(t=>{this.toggle3D.innerHTML=t.tilt<89?"2D":"3D"}))),(e.displayZoomIn??s.displayZoomIn)&&(this.zoomIn=this.#i(r,(()=>{this.#o({zoom:Math.min(20,this.#e.controls.getZoom()+1)})}))),(e.displayZoomOut??s.displayZoomOut)&&(this.zoomOut=this.#i(d,(()=>{this.#o({zoom:Math.max(3,this.#e.controls.getZoom()-1)})})))}addButton(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{},n=arguments.length>4?arguments[4]:void 0,s=document.getElementById(n);s||(s=this.addButtonBar(n));const a=document.createElement("button");return a.className="widget-button",a.id=t,a.innerHTML=e,a.title=o,a.onclick=i,s.appendChild(a),a.tabIndex=-1,window.addEventListener("pointerup",(()=>{document.activeElement===a&&this.#e.domElement.focus()})),a}addButtonBar(t){const e=document.createElement("div");return e.className="widget-button-bar",t&&(e.id=t),this.domElement.appendChild(e),e}};var m=o(60145),h=o(49469),p=o(48682),u=o(800);const g={minScale:2e-6,maxScale:2e-9,zoomRatio:1/30,width:150,height:150,position:"bottom-left"},f=class extends n{constructor(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.isGlobeView)throw new Error("'Minimap' plugin only supports 'GlobeView'. Therefore, the 'view' parameter must be a 'GlobeView'.");if(!e.isColorLayer)throw new Error("'layer' parameter form 'Minimap' constructor should be a 'ColorLayer'.");if(super(t,o,g),this.minScale=o.minScale||g.minScale,this.maxScale=o.maxScale||g.maxScale,this.zoomRatio=o.zoomRatio||g.zoomRatio,this.domElement.id="widgets-minimap",o.cursor){const t=document.createElement("div");t.id="cursor-wrapper",this.domElement.appendChild(t),"string"==typeof o.cursor?t.innerHTML=o.cursor:o.cursor instanceof HTMLElement&&t.appendChild(o.cursor)}this.view=new p.Z(this.domElement,e.source.extent,{camera:{type:u.P.ORTHOGRAPHIC},placement:e.source.extent,noControls:!0,maxSubdivisionLevel:t.tileLayer.maxSubdivisionLevel,disableFocusOnStart:!0}),this.view.addLayer(e),this.domElement.addEventListener("pointerdown",(t=>{t.preventDefault()}));const i=this.view.getScale(o.pitch),n=this.view.camera3D.zoom*this.maxScale/i,s=this.view.camera3D.zoom*this.minScale/i,a=new m.Z(t.referenceCrs),l=new m.Z(this.view.referenceCrs),r=t.controls.getCameraTargetPosition();t.addFrameRequester(h.Ao.AFTER_RENDER,(()=>{const e=t.camera3D.position.distanceTo(r),i=t.getScaleFromDistance(o.pitch,e);this.view.camera3D.zoom=this.zoomRatio*s*i/this.minScale,this.view.camera3D.zoom=Math.min(Math.max(this.view.camera3D.zoom,n),s),this.view.camera3D.updateProjectionMatrix(),a.setFromVector3(t.controls.getCameraTargetPosition()),a.as(this.view.referenceCrs,l),this.view.camera3D.position.x=l.x,this.view.camera3D.position.y=l.y,this.view.camera3D.updateMatrixWorld(!0),this.view.notifyChange(this.view.camera3D)}))}};var w=o(11925),v=o(91742),E=o(44450);const b={width:200,height:30,position:"bottom-left"},y=class extends n{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e,b),this.domElement.id="widgets-scale",this.view=t,this.domElement.innerHTML="Scale",this.width=e.width||b.width,this.view.isGlobeView?(this.view.addEventListener(v.b.GLOBE_INITIALIZED,(()=>{this.update()})),this.view.controls.addEventListener(w.Q.RANGE_CHANGED,(()=>{this.update()}))):this.view.isPlanarView?(this.view.addEventListener(i.b.INITIALIZED,(()=>{this.update()})),this.view.addEventListener(E.uZ.MOVED,(()=>{this.update()}))):console.warn("The 'view' linked to scale widget is neither a 'GlobeView' nor a 'PlanarView'. The scale wont automatically update. You can implement its update automation using 'Scale.update' method.")}addEventListeners(){}update(){let t=Math.round(this.view.getPixelsToMeters(this.width));const e=10**(t.toString().length-1);t=Math.round(t/e)*e;const o=this.view.getMetersToPixels(t);let i="m";t>=1e3&&(t/=1e3,i="km"),this.domElement.innerHTML=`${t} ${i}`,this.domElement.style.width=`${o}px`}};var C=o(33347);const x={width:300,height:38,position:"top",maxSuggestionNumber:10,fontSize:16,placeholder:"Search location"};function L(t,e){var o;return t?(D(t),e>=t.length?e=0:e<0&&(e=t.length-1),null===(o=t[e])||void 0===o||o.classList.add("active"),e):e}function D(t){for(let e=0;e1;)t.removeChild(t.lastChild)}const T=class extends n{#n;constructor(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(t,o,x),!e||!e.url||!e.parser||"function"!=typeof e.parser)throw new Error("'geocodingOptions' parameter for 'Searchbar' constructor is not a valid option. Please refer to the documentation.");this.#n=e.onSelected??(()=>{}),this.domElement.id="widgets-searchbar",this.domElement.style.height="auto";const i=document.createElement("form");i.setAttribute("autocomplete","off"),i.id="searchbar-autocompletion-form",this.domElement.appendChild(i);const n=document.createElement("input");let s;n.setAttribute("type","text"),n.setAttribute("name","mySearch"),n.setAttribute("placeholder",o.placeholder||x.placeholder),n.style.height=`${o.height||o.size||x.height}px`,n.style.fontSize=`${o.fontSize||x.fontSize}px`,i.appendChild(n),n.addEventListener("input",(()=>{const t=n.value;if(S(i),s=-1,!t)return!1;e.url.searchParams.set("text",t),C.Z.json(e.url).then((a=>{const l=e.parser(a);let r=0;l.forEach(((e,a)=>{if(r===Math.min(l.size,o.maxSuggestionNumber||x.maxSuggestionNumber))return;const d=r;r++;const c=a.toUpperCase().indexOf(t.toUpperCase());if(c>-1){const l=document.createElement("div");l.style.minHeight=n.style.height,l.style.fontSize=`${o.fontSize||x.fontSize}px`;const r=a.slice(0,c),m=a.slice(c,c+t.length),h=a.slice(c+t.length,a.length);l.innerHTML=`

${r}${m}${h}

`,l.setAttribute("location",a),i.appendChild(l),l.addEventListener("mouseover",(()=>{D(i.children),s=d,l.classList.add("active")})),l.addEventListener("click",(()=>{this.#n(e),n.value=l.getAttribute("location"),S(i)}))}}))}))}));const a=(o.position||x.position).includes("top")?1:-1;n.addEventListener("keydown",(e=>{e.stopPropagation();const o=i.getElementsByTagName("div");switch(e.code){case"Escape":S(i),n.value="",t.domElement.focus();break;case"ArrowDown":e.preventDefault(),s=L(o,s+a);break;case"ArrowUp":e.preventDefault(),s=L(o,s-a);break;case"Enter":e.preventDefault(),o[Math.max(s,0)]&&(o[Math.max(s,0)].click(),t.domElement.focus())}})),n.addEventListener("focus",(()=>{i.classList.add("focus")})),n.addEventListener("blur",(()=>{i.classList.remove("focus"),D(i.children)})),i.addEventListener("mouseleave",(()=>{D(i.children),s=-1}))}};var _=o(48891),M=o(24266);const z={width:200,position:"top-right"};class I extends n{constructor(t,e){super(t,e,z),this.domElement.onclick=t=>t.stopImmediatePropagation();const o=document.createElement("select");this.domElement.appendChild(o);const i=new Map,n=()=>{for(const[t,e]of i)e.hidden=t!==o.selectedOptions[0]};o.onchange=n,t.getLayers().filter((t=>!0===t.isC3DTilesLayer)).forEach((e=>{const n=document.createElement("option");n.innerText=e.name,o.add(n);const s=document.createElement("div");this.domElement.appendChild(s),i.set(n,s),e.addEventListener(M.y.ON_TILE_CONTENT_LOADED,(()=>{for(;s.firstChild;)s.firstChild.remove();const o=new Map;for(const[,t]of e.tilesC3DTileFeatures)for(const[,e]of t)for(const t in e.getInfo().batchTable){o.has(t)||o.set(t,[]);const i=e.getInfo().batchTable[t];o.get(t).includes(i)||o.get(t).push(i)}const i=new Map,n=new Map,a=(o,a,l)=>{const r=document.createElement("input");r.setAttribute("type","color"),s.appendChild(r),r.onchange=()=>{const n=o();if(!l.includes(n))return;const s=r.value;i.set(n,(t=>t.getInfo().batchTable[a]==n?s:null)),e.updateStyle(),t.notifyChange()};const d=document.createElement("input");return d.setAttribute("type","range"),d.min=0,d.max=1,d.step=.1,d.value=1,s.appendChild(d),d.onchange=()=>{const i=o();if(!l.includes(i))return;const s=d.value;n.set(i,(t=>t.getInfo().batchTable[a]==i?s:null)),e.updateStyle(),t.notifyChange()},{inputColor:r,opacityElement:d}},l=(t,e)=>{const o=document.createElement("label");o.innerText=t,s.appendChild(o);const i=document.createElement("select");s.appendChild(i),e.forEach((t=>{const e=document.createElement("option");e.value=t,e.text=t,i.add(e)})),a((()=>i.selectedOptions[0].value),t,e)},r=(o,l)=>{const r=document.createElement("label");r.innerText=o,s.appendChild(r);const d=document.createElement("input");d.setAttribute("type","text"),s.appendChild(d);const{inputColor:c,opacityElement:m}=a((()=>d.value),o,l);d.onchange=()=>{if(!l.includes(d.value))return;const s=c.value,a=d.value;i.set(a,(t=>t.getInfo().batchTable[o]==a?s:null));const r=m.value;n.set(a,(t=>t.getInfo().batchTable[o]==a?r:null)),e.updateStyle(),t.notifyChange()}};for(const[t,e]of o)e.length{let e=null;for(const[,o]of i)e=o(t)||e;return e},opacity:t=>{let e=1;for(const[,o]of n)e=o(t)||e;return e}}})}))})),n()}static get MAX_SELECT_VALUE(){return 10}}const A=I}},t=>(81499,t(t.s=81499))]))); +"use strict";!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("itowns_widgets",[],e):"object"==typeof exports?exports.itowns_widgets=e():t.itowns_widgets=e()}(self,(()=>(self.webpackChunkitowns=self.webpackChunkitowns||[]).push([[318],{75723:(t,e,o)=>{o.r(e),o.d(e,{C3DTilesStyle:()=>A,Minimap:()=>f,Navigation:()=>c,Scale:()=>y,Searchbar:()=>T,Widget:()=>n});var i=o(73502);const n=class{#t;constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;this.parentElement=e.parentElement||t.domElement,this.position=e.position||o.position,["top-left","top-right","bottom-left","bottom-right","top","bottom","left","right"].includes(this.position)||(console.warn(`'position' optional parameter for 'Widget' constructor is not a valid option. It will be set to '${o.position}'.`),this.position=o.position),this.domElement=document.createElement("div"),this.parentElement.appendChild(this.domElement),this.domElement.style.width=`${e.width||e.size||o.width}px`,this.domElement.style.height=`${e.height||e.size||o.height}px`;const i=this.position.split("-");if(this.domElement.classList.add(`${i[0]}-widget`),i[1])this.domElement.classList.add(`${i[1]}-widget`);else switch(i[0]){case"top":case"bottom":this.domElement.style.left=`calc(50% - ${this.domElement.offsetWidth/2}px)`;break;case"left":case"right":this.domElement.style.top=`calc(50% - ${this.domElement.offsetHeight/2}px)`}e.translate&&(this.domElement.style.transform=`translate(${e.translate.x||0}px, ${e.translate.y||0}px)`),this.domElement.addEventListener("pointerdown",(t=>{t.stopPropagation()})),this.domElement.addEventListener("mousedown",(t=>{t.stopPropagation()}))}show(){this.domElement.style.display=this.#t}hide(){this.#t=window.getComputedStyle(this.domElement).display,this.domElement.style.display="none"}},s={displayCompass:!0,display3DToggle:!0,displayZoomIn:!0,displayZoomOut:!0,animationDuration:500,position:"bottom-left",direction:"column"},a={id:"compass",content:"",info:"Rotate the camera to face North",parentId:"widgets"},l={id:"3d-button",content:"3D",info:"Tilt the camera"},r={id:"zoom-in-button",content:'',info:"Zoom in",parentId:"zoom-button-bar"},d={id:"zoom-out-button",content:'',info:"Zoom out",parentId:"zoom-button-bar"},c=class extends n{#e;#o(t){return t.time=this.animationDuration,this.#e.controls.lookAtCoordinate(t)}#i(t,e){return this.addButton(t.id,t.content,t.info,e,t.parentId)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t.isGlobeView)throw new Error("'Navigation' plugin only supports 'GlobeView'. Therefore, the 'view' parameter must be a 'GlobeView'.");["top","bottom","left","right"].includes(e.position)&&(console.warn(`'position' optional parameter for 'Navigation' is not a valid option. It will be set to '${s.position}'.`),e.position=s.position),super(t,e,s),this.#e=t,this.direction=e.direction||s.direction,["column","row"].includes(this.direction)||(console.warn(`'direction' optional parameter for 'Navigation' constructor is not a valid option. It will be set to '${s.direction}'.`),this.direction=s.direction),this.animationDuration=void 0===e.animationDuration?s.animationDuration:e.animationDuration,this.domElement.id="widgets-navigation",this.domElement.classList.add(`${this.direction}-widget`),(e.displayCompass??s.displayCompass)&&(this.compass=this.#i(a,(()=>{this.#o({heading:0,tilt:89.5})})),t.addEventListener(i.b.CAMERA_MOVED,(t=>{this.compass.style.transform=`rotate(${-t.heading}deg)`}))),(e.display3DToggle??s.display3DToggle)&&(this.toggle3D=this.#i(l,(()=>{this.#o({tilt:this.#e.controls.getTilt()<89?89.5:40})})),t.addEventListener(i.b.CAMERA_MOVED,(t=>{this.toggle3D.innerHTML=t.tilt<89?"2D":"3D"}))),(e.displayZoomIn??s.displayZoomIn)&&(this.zoomIn=this.#i(r,(()=>{this.#o({zoom:Math.min(20,this.#e.controls.getZoom()+1)})}))),(e.displayZoomOut??s.displayZoomOut)&&(this.zoomOut=this.#i(d,(()=>{this.#o({zoom:Math.max(3,this.#e.controls.getZoom()-1)})})))}addButton(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{},n=arguments.length>4?arguments[4]:void 0,s=document.getElementById(n);s||(s=this.addButtonBar(n));const a=document.createElement("button");return a.className="widget-button",a.id=t,a.innerHTML=e,a.title=o,a.onclick=i,s.appendChild(a),a.tabIndex=-1,window.addEventListener("pointerup",(()=>{document.activeElement===a&&this.#e.domElement.focus()})),a}addButtonBar(t){const e=document.createElement("div");return e.className="widget-button-bar",t&&(e.id=t),this.domElement.appendChild(e),e}};var m=o(62310),h=o(99617),p=o(39510),u=o(232);const g={minScale:2e-6,maxScale:2e-9,zoomRatio:1/30,width:150,height:150,position:"bottom-left"},f=class extends n{constructor(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.isGlobeView)throw new Error("'Minimap' plugin only supports 'GlobeView'. Therefore, the 'view' parameter must be a 'GlobeView'.");if(!e.isColorLayer)throw new Error("'layer' parameter form 'Minimap' constructor should be a 'ColorLayer'.");if(super(t,o,g),this.minScale=o.minScale||g.minScale,this.maxScale=o.maxScale||g.maxScale,this.zoomRatio=o.zoomRatio||g.zoomRatio,this.domElement.id="widgets-minimap",o.cursor){const t=document.createElement("div");t.id="cursor-wrapper",this.domElement.appendChild(t),"string"==typeof o.cursor?t.innerHTML=o.cursor:o.cursor instanceof HTMLElement&&t.appendChild(o.cursor)}this.view=new p.Z(this.domElement,e.source.extent,{camera:{type:u.P.ORTHOGRAPHIC},placement:e.source.extent,noControls:!0,maxSubdivisionLevel:t.tileLayer.maxSubdivisionLevel,disableFocusOnStart:!0}),this.view.addLayer(e),this.domElement.addEventListener("pointerdown",(t=>{t.preventDefault()}));const i=this.view.getScale(o.pitch),n=this.view.camera3D.zoom*this.maxScale/i,s=this.view.camera3D.zoom*this.minScale/i,a=new m.Z(t.referenceCrs),l=new m.Z(this.view.referenceCrs),r=t.controls.getCameraTargetPosition();t.addFrameRequester(h.Ao.AFTER_RENDER,(()=>{const e=t.camera3D.position.distanceTo(r),i=t.getScaleFromDistance(o.pitch,e);this.view.camera3D.zoom=this.zoomRatio*s*i/this.minScale,this.view.camera3D.zoom=Math.min(Math.max(this.view.camera3D.zoom,n),s),this.view.camera3D.updateProjectionMatrix(),a.setFromVector3(t.controls.getCameraTargetPosition()),a.as(this.view.referenceCrs,l),this.view.camera3D.position.x=l.x,this.view.camera3D.position.y=l.y,this.view.camera3D.updateMatrixWorld(!0),this.view.notifyChange(this.view.camera3D)}))}};var w=o(61861),v=o(70378),E=o(29571);const b={width:200,height:30,position:"bottom-left"},y=class extends n{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e,b),this.domElement.id="widgets-scale",this.view=t,this.domElement.innerHTML="Scale",this.width=e.width||b.width,this.view.isGlobeView?(this.view.addEventListener(v.b.GLOBE_INITIALIZED,(()=>{this.update()})),this.view.controls.addEventListener(w.Q.RANGE_CHANGED,(()=>{this.update()}))):this.view.isPlanarView?(this.view.addEventListener(i.b.INITIALIZED,(()=>{this.update()})),this.view.addEventListener(E.uZ.MOVED,(()=>{this.update()}))):console.warn("The 'view' linked to scale widget is neither a 'GlobeView' nor a 'PlanarView'. The scale wont automatically update. You can implement its update automation using 'Scale.update' method.")}addEventListeners(){}update(){let t=Math.round(this.view.getPixelsToMeters(this.width));const e=10**(t.toString().length-1);t=Math.round(t/e)*e;const o=this.view.getMetersToPixels(t);let i="m";t>=1e3&&(t/=1e3,i="km"),this.domElement.innerHTML=`${t} ${i}`,this.domElement.style.width=`${o}px`}};var C=o(45340);const x={width:300,height:38,position:"top",maxSuggestionNumber:10,fontSize:16,placeholder:"Search location"};function L(t,e){var o;return t?(D(t),e>=t.length?e=0:e<0&&(e=t.length-1),null===(o=t[e])||void 0===o||o.classList.add("active"),e):e}function D(t){for(let e=0;e1;)t.removeChild(t.lastChild)}const T=class extends n{#n;constructor(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(t,o,x),!e||!e.url||!e.parser||"function"!=typeof e.parser)throw new Error("'geocodingOptions' parameter for 'Searchbar' constructor is not a valid option. Please refer to the documentation.");this.#n=e.onSelected??(()=>{}),this.domElement.id="widgets-searchbar",this.domElement.style.height="auto";const i=document.createElement("form");i.setAttribute("autocomplete","off"),i.id="searchbar-autocompletion-form",this.domElement.appendChild(i);const n=document.createElement("input");let s;n.setAttribute("type","text"),n.setAttribute("name","mySearch"),n.setAttribute("placeholder",o.placeholder||x.placeholder),n.style.height=`${o.height||o.size||x.height}px`,n.style.fontSize=`${o.fontSize||x.fontSize}px`,i.appendChild(n),n.addEventListener("input",(()=>{const t=n.value;if(S(i),s=-1,!t)return!1;e.url.searchParams.set("text",t),C.Z.json(e.url).then((a=>{const l=e.parser(a);let r=0;l.forEach(((e,a)=>{if(r===Math.min(l.size,o.maxSuggestionNumber||x.maxSuggestionNumber))return;const d=r;r++;const c=a.toUpperCase().indexOf(t.toUpperCase());if(c>-1){const l=document.createElement("div");l.style.minHeight=n.style.height,l.style.fontSize=`${o.fontSize||x.fontSize}px`;const r=a.slice(0,c),m=a.slice(c,c+t.length),h=a.slice(c+t.length,a.length);l.innerHTML=`

${r}${m}${h}

`,l.setAttribute("location",a),i.appendChild(l),l.addEventListener("mouseover",(()=>{D(i.children),s=d,l.classList.add("active")})),l.addEventListener("click",(()=>{this.#n(e),n.value=l.getAttribute("location"),S(i)}))}}))}))}));const a=(o.position||x.position).includes("top")?1:-1;n.addEventListener("keydown",(e=>{e.stopPropagation();const o=i.getElementsByTagName("div");switch(e.code){case"Escape":S(i),n.value="",t.domElement.focus();break;case"ArrowDown":e.preventDefault(),s=L(o,s+a);break;case"ArrowUp":e.preventDefault(),s=L(o,s-a);break;case"Enter":e.preventDefault(),o[Math.max(s,0)]&&(o[Math.max(s,0)].click(),t.domElement.focus())}})),n.addEventListener("focus",(()=>{i.classList.add("focus")})),n.addEventListener("blur",(()=>{i.classList.remove("focus"),D(i.children)})),i.addEventListener("mouseleave",(()=>{D(i.children),s=-1}))}};var _=o(49075),M=o(11707);const z={width:200,position:"top-right"};class I extends n{constructor(t,e){super(t,e,z),this.domElement.onclick=t=>t.stopImmediatePropagation();const o=document.createElement("select");this.domElement.appendChild(o);const i=new Map,n=()=>{for(const[t,e]of i)e.hidden=t!==o.selectedOptions[0]};o.onchange=n,t.getLayers().filter((t=>!0===t.isC3DTilesLayer)).forEach((e=>{const n=document.createElement("option");n.innerText=e.name,o.add(n);const s=document.createElement("div");this.domElement.appendChild(s),i.set(n,s),e.addEventListener(M.y.ON_TILE_CONTENT_LOADED,(()=>{for(;s.firstChild;)s.firstChild.remove();const o=new Map;for(const[,t]of e.tilesC3DTileFeatures)for(const[,e]of t)for(const t in e.getInfo().batchTable){o.has(t)||o.set(t,[]);const i=e.getInfo().batchTable[t];o.get(t).includes(i)||o.get(t).push(i)}const i=new Map,n=new Map,a=(o,a,l)=>{const r=document.createElement("input");r.setAttribute("type","color"),s.appendChild(r),r.onchange=()=>{const n=o();if(!l.includes(n))return;const s=r.value;i.set(n,(t=>t.getInfo().batchTable[a]==n?s:null)),e.updateStyle(),t.notifyChange()};const d=document.createElement("input");return d.setAttribute("type","range"),d.min=0,d.max=1,d.step=.1,d.value=1,s.appendChild(d),d.onchange=()=>{const i=o();if(!l.includes(i))return;const s=d.value;n.set(i,(t=>t.getInfo().batchTable[a]==i?s:null)),e.updateStyle(),t.notifyChange()},{inputColor:r,opacityElement:d}},l=(t,e)=>{const o=document.createElement("label");o.innerText=t,s.appendChild(o);const i=document.createElement("select");s.appendChild(i),e.forEach((t=>{const e=document.createElement("option");e.value=t,e.text=t,i.add(e)})),a((()=>i.selectedOptions[0].value),t,e)},r=(o,l)=>{const r=document.createElement("label");r.innerText=o,s.appendChild(r);const d=document.createElement("input");d.setAttribute("type","text"),s.appendChild(d);const{inputColor:c,opacityElement:m}=a((()=>d.value),o,l);d.onchange=()=>{if(!l.includes(d.value))return;const s=c.value,a=d.value;i.set(a,(t=>t.getInfo().batchTable[o]==a?s:null));const r=m.value;n.set(a,(t=>t.getInfo().batchTable[o]==a?r:null)),e.updateStyle(),t.notifyChange()}};for(const[t,e]of o)e.length{let e=null;for(const[,o]of i)e=o(t)||e;return e},opacity:t=>{let e=1;for(const[,o]of n)e=o(t)||e;return e}}})}))})),n()}static get MAX_SELECT_VALUE(){return 10}}const A=I}},t=>(75723,t(t.s=75723))]))); //# sourceMappingURL=itowns_widgets.js.map \ No newline at end of file diff --git a/itowns/docs/api/3D Tiles/C3DTFeature.html b/itowns/docs/api/3D Tiles/C3DTFeature.html index 074cb6ee..74eb3a38 100644 --- a/itowns/docs/api/3D Tiles/C3DTFeature.html +++ b/itowns/docs/api/3D Tiles/C3DTFeature.html @@ -50,9 +50,6 @@

groups: count:number>}, - info: - object, - userData: object, @@ -102,16 +99,6 @@

Parameters

- - -
  • - info - - - —

    info in the batchTable

    - - -
  • @@ -219,23 +206,6 @@

    -
    -

    - info - : object -

    - - -
    -

    info in the batchTable

    -
    - -
    - -
    - - -

    userData @@ -336,6 +306,10 @@

    +
    +

    Gets the information from the tile batch table for this C3DTFeature batch id.

    +
    + diff --git a/itowns/docs/api/Layer/C3DTilesLayer.html b/itowns/docs/api/Layer/C3DTilesLayer.html index e291e82f..84872947 100644 --- a/itowns/docs/api/Layer/C3DTilesLayer.html +++ b/itowns/docs/api/Layer/C3DTilesLayer.html @@ -549,77 +549,6 @@

    Parameters

    -
    - -
    - - - -
    -

    - findBatchTable - ( - - - - - object: - THREE.Object3D - - -) - : - - C3DTBatchTable - - - -

    - - - -
    -

    Finds the batch table of an object in a 3D Tiles layer. This is -for instance needed when picking because we pick the geometric -object which is not at the same level in the layer structure as -the batch table. More details here on itowns internal -organization of 3DTiles: -https://github.com/MEPP-team/RICT/blob/master/Doc/iTowns/Doc.md#itowns-internal-organisation-of-3d-tiles-data

    -
    - - - - -

    Returns

    - -
      -
    • the batch table of the object
    • -
    - - - -

    Parameters

    - - -
      - -
    • - object - - - —

      a 3D geometric object

      - - - -
    • - -
    - - - - - -

    diff --git a/itowns/docs/api/Layer/ElevationLayer.html b/itowns/docs/api/Layer/ElevationLayer.html index fd141573..15e77646 100644 --- a/itowns/docs/api/Layer/ElevationLayer.html +++ b/itowns/docs/api/Layer/ElevationLayer.html @@ -166,7 +166,7 @@

    Example

    // Create an ElevationLayer
     const elevation = new ElevationLayer('IGN_MNT', {
          source: new WMTSSource({
    -         "url": "https://wxs.ign.fr/altimetrie/geoportail/wmts",
    +         "url": "https://data.geopf.fr/wmts?",
               "crs": "EPSG:4326",
               "format": "image/x-bil;bits=32",
               "name": "ELEVATION.ELEVATIONGRIDCOVERAGE",
    diff --git a/itowns/docs/api/Layer/TiledGeometryLayer.html b/itowns/docs/api/Layer/TiledGeometryLayer.html
    index 12fd51f0..692733ae 100644
    --- a/itowns/docs/api/Layer/TiledGeometryLayer.html
    +++ b/itowns/docs/api/Layer/TiledGeometryLayer.html
    @@ -210,6 +210,24 @@ 

    +
    + + + +
    +

    + hideSkirt + : boolean +

    + + +
    +

    (default false) - Used to hide the skirt (tile borders). +Useful when the layer opacity < 1

    +
    + +
    + diff --git a/itowns/docs/api/Parser/B3dmParser.html b/itowns/docs/api/Parser/B3dmParser.html index 3f482930..51884353 100644 --- a/itowns/docs/api/Parser/B3dmParser.html +++ b/itowns/docs/api/Parser/B3dmParser.html @@ -40,179 +40,6 @@

    Static Methods

    -
    -

    - enableDracoLoader - ( - - - - - path: - string, - - config: - object - - -) - -

    - - - -
    -

    Enable Draco decoding for gltf.

    -

    The Draco library files are in folder itowns/examples/libs/draco/. -You must indicate this path when you want to enable Draco Decoding. -For more information on Draco, read /itowns/examples/libs/draco/README.md.

    -
    - - - - - - -

    Parameters

    - - -
      - -
    • - path - - - —

      path to draco library folder. -This library is mandatory to load b3dm and gltf with Draco compression.

      - - - -
    • - -
    • - config - - - —

      optional configuration for Draco compression.

      - - - -
    • - -
    - - - - - -

    Example

    - - - - - Enable draco decoder - - - -
    // if you copied /itowns/examples/libs/draco/ to the root folder of your project,you can set the path to './'.
    -itowns.enableDracoLoader('./');
    -
    - 
    - - - - -
    - -
    - - - -
    -

    - enableKtx2Loader - ( - - - - - path: - string, - - renderer: - THREE.WebGLRenderer - - -) - -

    - - - -
    -

    Enable KTX2 decoding for gltf. This library is mandatory to load b3dm and gltf with KTX2 compression.

    -

    The KTX2 library files are in folder itowns/examples/libs/basis/. -You must indicate this path when you want to enable KTX2 decoding. -For more information about KTX2, read /itowns/examples/libs/basis/README.md.

    -
    - - - - - - -

    Parameters

    - - -
      - -
    • - path - - - —

      path to KTX2 library folder.

      - - - -
    • - -
    • - renderer - - - —

      the threejs renderer

      - - - -
    • - -
    - - - - - -

    Example

    - - - - - Enable ktx2 decoder - - - -
    // if you copied /itowns/examples/libs/draco/ to the root folder of your project,you can set the path to './'.
    -itowns.enableKtx2Loader('./', view.mainLoop.gfxEngine.renderer);
    - - - - -
    - -
    - - -

    parse @@ -304,8 +131,7 @@

    Parameters

  • options.doNotPatchMaterial - (default: 'false') - + (optional) —

    disable patching material with logarithmic depth buffer support.

    @@ -325,9 +151,18 @@

    Parameters

  • - options.overrideMaterials - (default: 'false') + options.frustumCulled + (optional) + + —

    enable frustum culling.

    + + +
  • + +
  • + options.overrideMaterials + (optional) —

    override b3dm's embedded glTF materials. If true, a threejs MeshBasicMaterial diff --git a/itowns/docs/api/Parser/GLTFParser.html b/itowns/docs/api/Parser/GLTFParser.html new file mode 100644 index 00000000..89cba161 --- /dev/null +++ b/itowns/docs/api/Parser/GLTFParser.html @@ -0,0 +1,291 @@ + + + + + GLTFParser - iTowns documentation + + + + + + + + + + + + +

    + +
    + +

    + GLTFParser + +

    + + +

    Parses glTF 1.0 and 2.0 files.

    +

    Under the hood, glTF 2.0 files are parsed with THREE.GltfLoader() and GLTF 1.0 are parsed with the previous THREE +GltfLoader (for 1.0 glTF) that has been kept and maintained in iTowns.

    + + + + + + + + + + + +
    +

    Static Methods

    + + + +
    +

    + enableDracoLoader + ( + + + + + path: + String, + + config: + Object + + +) + +

    + + + +
    +

    Enable loading gltf files with Draco geometry extension.

    +
    + + + + + + +

    Parameters

    + + +
      + +
    • + path + + + —

      path to draco library folder containing the JS and WASM decoder libraries. They can be found in +itowns examples.

      + + + +
    • + +
    • + config + (optional) + + —

      optional configuration for Draco decoder (see threejs' +setDecoderConfig that +is called under the hood with this configuration for details.

      + + + +
    • + +
    + + + + + + +
    + +
    + + + +
    +

    + enableKtx2Loader + ( + + + + + path: + String, + + renderer: + THREE.WebGLRenderer + + +) + +

    + + + +
    +

    Enable loading gltf files with KTX2 texture extension.

    +
    + + + + + + +

    Parameters

    + + +
      + +
    • + path + + + —

      path to ktx2 library folder containing the JS and WASM decoder libraries. They can be found in +itowns examples.

      + + + +
    • + +
    • + renderer + + + —

      the threejs renderer

      + + + +
    • + +
    + + + + + + +
    + +
    + + + +
    +

    + parse + ( + + + + + buffer: + ArrayBuffer, + + path: + String + + +) + : + + Promise + + + +

    + + + +
    +

    Parses a gltf buffer to an object with threejs structures and applies a y-up to z-up conversion to align with +itowns convention. Essentially calls THREE.GltfLoader.parse() for glTF 2.0 files and the legacy threejs parser +for gtTF 1.0 files.

    +
    + + + + +

    Returns

    + +
      +
    • a promise that resolves with an object containing an Object that contains loaded parts: +.scene, .scenes, .cameras, .animations, and .asset.
    • +
    + + + +

    Parameters

    + + +
      + +
    • + buffer + + + —

      the glTF asset to parse, as an ArrayBuffer, JSON string or object.

      + + + +
    • + +
    • + path + + + —

      the base path from which to find subsequent glTF resources such as textures and .bin data files.

      + + + +
    • + +
    + + + + + + +
    + + + + + + + + + + + +
    +

    Source

    + + src/Parser/GLTFParser.js + + + + + +
    + +
    + + + + + \ No newline at end of file diff --git a/itowns/docs/api/Points/PointsMaterial.html b/itowns/docs/api/Points/PointsMaterial.html index a041030a..176d0fd9 100644 --- a/itowns/docs/api/Points/PointsMaterial.html +++ b/itowns/docs/api/Points/PointsMaterial.html @@ -115,13 +115,35 @@

    Parameters

  • options.intensityRange - (default: new THREE.Vector2(0, 1)) + (default: new THREE.Vector2(1, 65536)) —

    intensity range.

    +
  • + +
  • + options.elevationRange + (default: new THREE.Vector2(0, 1000)) + + + —

    elevation range.

    + + + +
  • + +
  • + options.angleRange + (default: new THREE.Vector2(-90, 90)) + + + —

    scan angle range.

    + + +
  • @@ -138,7 +160,28 @@

    Parameters

    options.classification (optional) - —

    define points classification.

    + —

    LUT for point classification colorization.

    + + + +
  • + +
  • + options.discreteScheme + (optional) + + —

    LUT for other discret point values colorization.

    + + + +
  • + +
  • + options.gradient + (optional) + + —

    Descrition of the gradient to use for continuous point values. +(Default value will be the 'SPECTRAL' gradient from Utils/Gradients)

    @@ -215,13 +258,81 @@

    Properties

    - classification - : Classification + classificationScheme + : Scheme +

    + + +
    +

    Color scheme for point classification values.

    +
    + +
    + +
    + + + +
    +

    + discreteScheme + : Scheme +

    + + +
    +

    Color scheme for all other discrete values.

    +
    + +
    + +
    + + + +
    +

    + gradients + : object +

    + + +
    +

    Descriptions of all available gradients.

    +
    + +
    + +
    + + + +
    +

    + gradient + : object +

    + + +
    +

    Description of the gradient to use for display.

    +
    + +
    + +
    + + + +
    +

    + gradientTexture + : THREE.CanvasTexture

    -

    points classification.

    +

    The texture generate from the choosen gradient.

    diff --git a/itowns/docs/api/Source/WFSSource.html b/itowns/docs/api/Source/WFSSource.html index 587dad89..b78fab91 100644 --- a/itowns/docs/api/Source/WFSSource.html +++ b/itowns/docs/api/Source/WFSSource.html @@ -95,7 +95,7 @@

    Example

    // Add color layer with WFS source
     // Create the source
     const wfsSource = new itowns.WFSSource({
    -    url: 'http://wxs.fr/wfs',
    +    url: 'https://data.geopf.fr/wfs/ows?',
         version: '2.0.0',
         typeName: 'BDTOPO_BDD_WLD_WGS84G:bati_remarquable',
         crs: 'EPSG:4326',
    @@ -127,7 +127,7 @@ 

    Example

    // Add geometry layer with WFS source
     // Create the source
     const wfsSource = new itowns.WFSSource({
    -    url: 'http://wxs.fr/wfs',
    +    url: 'https://data.geopf.fr/wfs/ows?',
         version: '2.0.0',
         typeName: 'BDTOPO_BDD_WLD_WGS84G:bati_remarquable',
         crs: 'EPSG:4326',
    diff --git a/itowns/docs/api/View/GlobeView.html b/itowns/docs/api/View/GlobeView.html
    index 99b5df0b..21f03750 100644
    --- a/itowns/docs/api/View/GlobeView.html
    +++ b/itowns/docs/api/View/GlobeView.html
    @@ -142,18 +142,6 @@ 

    Example

    } var view = new itowns.GlobeView(viewerDiv, placement);
    - - Enable WebGl 1.0 instead of WebGl 2.0. - - - -
    var viewerDiv = document.getElementById('viewerDiv');
    -const placement = {
    -    coord: new itowns.Coordinates('EPSG:4326', 2.351323, 48.856712),
    -    range: 25000000,
    -}
    -var view = new itowns.GlobeView(viewerDiv, placement, {  renderer: { isWebGL2: false } });
    - diff --git a/itowns/docs/api/View/PlanarView.html b/itowns/docs/api/View/PlanarView.html index 91dda156..b5907dac 100644 --- a/itowns/docs/api/View/PlanarView.html +++ b/itowns/docs/api/View/PlanarView.html @@ -152,15 +152,6 @@

    Example

    - Enable WebGl 1.0 instead of WebGl 2.0. - - - -
    var viewerDiv = document.getElementById('viewerDiv');
    -const extent = new Extent('EPSG:3946', 1837816.94334, 1847692.32501, 5170036.4587, 5178412.82698);
    -var view = new itowns.PlanarView(viewerDiv, extent, {  renderer: { isWebGL2: false } });
    - - Instance with placement on the ground. diff --git a/itowns/docs/api/View/View.html b/itowns/docs/api/View/View.html index cafd846e..849d10a6 100644 --- a/itowns/docs/api/View/View.html +++ b/itowns/docs/api/View/View.html @@ -128,24 +128,6 @@

    Parameters

    - - -
      - -
    • - options.renderer.isWebGL2 - (default: true) - - - —

      enable webgl 2.0 for THREE.js.

      - - - -
    • - -
    - -
  • diff --git a/itowns/docs/index.html b/itowns/docs/index.html index ea98f8ae..e015c49b 100644 --- a/itowns/docs/index.html +++ b/itowns/docs/index.html @@ -425,6 +425,11 @@
  • + + + diff --git a/itowns/docs/tutorials/3DTiles-mesh-b3dm.html b/itowns/docs/tutorials/3DTiles-mesh-b3dm.html index 212eec4b..85b5a356 100644 --- a/itowns/docs/tutorials/3DTiles-mesh-b3dm.html +++ b/itowns/docs/tutorials/3DTiles-mesh-b3dm.html @@ -52,65 +52,65 @@

    Preparing the field

    We will first create a view, add a layer with ortho images and a digital elevation model (DEM). The 3D Tiles dataset we are using is in the EPSG:3946 CRS, so we will use a PlanarView in this CRS to display it.

    We won't go into the details of creating the view, adding the ortho images and the DEM. For more information on this part, see the Raster visualization in Lambert Conformical conic projection in which we do the same but in the EPSG:2154 projection. You can use the following code that prepared the field with such data:

    -
        // Define crs projection that we will use (taken from https://epsg.io/3946, Proj4js section)
    -    itowns.proj4.defs('EPSG:3946', 
    -    '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80' + 
    -    '+towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
    +
    // Define crs projection that we will use (taken from https://epsg.io/3946, Proj4js section)
    +itowns.proj4.defs('EPSG:3946', 
    +'+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80' + 
    +'+towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
     
    -    // Define geographic extent: CRS, min/max X, min/max Y
    -    var extent = new itowns.Extent( 'EPSG:3946',
    -        1837816.94334, 1847692.32501,
    -        5170036.4587, 5178412.82698);
    +// Define geographic extent: CRS, min/max X, min/max Y
    +var extent = new itowns.Extent( 'EPSG:3946',
    +    1837816.94334, 1847692.32501,
    +    5170036.4587, 5178412.82698);
     
    -    // `viewerDiv` will contain iTowns' rendering area (`<canvas>`)
    -    var viewerDiv = document.getElementById('viewerDiv');
    +// `viewerDiv` will contain iTowns' rendering area (`<canvas>`)
    +var viewerDiv = document.getElementById('viewerDiv');
     
    -    // Instanciate PlanarView*
    -    var cameraCoord = new itowns.Coordinates('EPSG:3946', 1841980,
    -        5175682, 3000)
    -    var view = new itowns.PlanarView(viewerDiv, extent, { placement: {
    -        coord: cameraCoord, heading: 30, range: 4000, tilt: 30 } });
    +// Instanciate PlanarView*
    +var cameraCoord = new itowns.Coordinates('EPSG:3946', 1841980,
    +    5175682, 3000)
    +var view = new itowns.PlanarView(viewerDiv, extent, { placement: {
    +    coord: cameraCoord, heading: 30, range: 4000, tilt: 30 } });
     
    -    // Add a WMS imagery source
    -    var wmsImagerySource = new itowns.WMSSource({
    -        extent: extent,
    -        name: 'Ortho2009_vue_ensemble_16cm_CC46',
    -        url: 'https://download.data.grandlyon.com/wms/grandlyon',
    -        version: '1.3.0',
    -        crs: 'EPSG:3946',
    -        format: 'image/jpeg',
    -    });
    +// Add a WMS imagery source
    +var wmsImagerySource = new itowns.WMSSource({
    +    extent: extent,
    +    name: 'Ortho2009_vue_ensemble_16cm_CC46',
    +    url: 'https://download.data.grandlyon.com/wms/grandlyon',
    +    version: '1.3.0',
    +    crs: 'EPSG:3946',
    +    format: 'image/jpeg',
    +});
     
    -    // Add a WMS imagery layer
    -    var wmsImageryLayer = new itowns.ColorLayer('wms_imagery', {
    -        updateStrategy: {
    -            type: itowns.STRATEGY_DICHOTOMY,
    -            options: {},
    -        },
    -        source: wmsImagerySource,
    -    });
    +// Add a WMS imagery layer
    +var wmsImageryLayer = new itowns.ColorLayer('wms_imagery', {
    +    updateStrategy: {
    +        type: itowns.STRATEGY_DICHOTOMY,
    +        options: {},
    +    },
    +    source: wmsImagerySource,
    +});
     
    -    view.addLayer(wmsImageryLayer);
    +view.addLayer(wmsImageryLayer);
     
    -    // Add a WMS elevation source
    -    var wmsElevationSource = new itowns.WMSSource({
    -        extent: extent,
    -        url: 'https://download.data.grandlyon.com/wms/grandlyon',
    -        name: 'MNT2012_Altitude_10m_CC46',
    -        crs: 'EPSG:3946',
    -        width: 256,
    -        format: 'image/jpeg',
    -    });
    +// Add a WMS elevation source
    +var wmsElevationSource = new itowns.WMSSource({
    +    extent: extent,
    +    url: 'https://download.data.grandlyon.com/wms/grandlyon',
    +    name: 'MNT2012_Altitude_10m_CC46',
    +    crs: 'EPSG:3946',
    +    width: 256,
    +    format: 'image/jpeg',
    +});
     
    -    // Add a WMS elevation layer
    -    var wmsElevationLayer = new itowns.ElevationLayer('wms_elevation', {
    -        useColorTextureElevation: true,
    -        colorTextureElevationMinZ: 144,
    -        colorTextureElevationMaxZ: 622,
    -        source: wmsElevationSource,
    -    });
    +// Add a WMS elevation layer
    +var wmsElevationLayer = new itowns.ElevationLayer('wms_elevation', {
    +    useColorTextureElevation: true,
    +    colorTextureElevationMinZ: 144,
    +    colorTextureElevationMaxZ: 622,
    +    source: wmsElevationSource,
    +});
     
    -    view.addLayer(wmsElevationLayer);
    +view.addLayer(wmsElevationLayer);
     

    Adding the 3D Tiles Layer

    The 3D Tiles dataset we are using in this example has a geometry that is compressed with diff --git a/itowns/docs/tutorials/3DTiles-point-cloud-pnts.html b/itowns/docs/tutorials/3DTiles-point-cloud-pnts.html index 0b01a4ed..758d6afc 100644 --- a/itowns/docs/tutorials/3DTiles-point-cloud-pnts.html +++ b/itowns/docs/tutorials/3DTiles-point-cloud-pnts.html @@ -52,91 +52,91 @@

    Preparing the field

    We will first create a view, add a layer with ortho images and a digital elevation model (DEM). The 3D Tiles dataset we are using is in the EPSG:4978 CRS, so we will use a GlobeView to display it.

    We won't go into the details of creating the view, adding the ortho images and the DEM. For more information on this part, see the WGS84 tutorial in which we explain how to add similar layers. The only differences are the data sources used. Here, we use ortho images from a XYZ stream of Open Street Map tiles which will allow to better distinguish the point cloud. We also use a more precise DEM (but that only covers France).

    -
        var viewerDiv = document.getElementById('viewerDiv');
    -    var placement = {
    -        coord: new itowns.Coordinates('EPSG:4326', 3.3792, 44.3335, 844),
    -        tilt: 22,
    -        heading: -180,
    -        range: 2840
    -    };
    +
    var viewerDiv = document.getElementById('viewerDiv');
    +var placement = {
    +    coord: new itowns.Coordinates('EPSG:4326', 3.3792, 44.3335, 844),
    +    tilt: 22,
    +    heading: -180,
    +    range: 2840
    +};
     
    -    var view = new itowns.GlobeView(viewerDiv, placement);
    +var view = new itowns.GlobeView(viewerDiv, placement);
     
    -    var orthoSource = new itowns.TMSSource({
    -        crs: "EPSG:3857",
    -        isInverted: true,
    -        format: "image/png",
    -        url: "http://osm.oslandia.io/styles/klokantech-basic/${z}/${x}/${y}.png",
    -        attribution: {
    -            name:"OpenStreetMap",
    -            url: "http://www.openstreetmap.org/"
    -        },
    -        tileMatrixSet: "PM"
    -    });
    +var orthoSource = new itowns.TMSSource({
    +    crs: "EPSG:3857",
    +    isInverted: true,
    +    format: "image/png",
    +    url: "http://osm.oslandia.io/styles/klokantech-basic/${z}/${x}/${y}.png",
    +    attribution: {
    +        name:"OpenStreetMap",
    +        url: "http://www.openstreetmap.org/"
    +    },
    +    tileMatrixSet: "PM"
    +});
     
    -    var orthoLayer = new itowns.ColorLayer('Ortho', {
    -        source: orthoSource,
    -    });
    +var orthoLayer = new itowns.ColorLayer('Ortho', {
    +    source: orthoSource,
    +});
     
    -    view.addLayer(orthoLayer);
    +view.addLayer(orthoLayer);
     
    -    var elevationSource = new itowns.WMTSSource({
    -        url: 'http://wxs.ign.fr/altimetrie/geoportail/wmts',
    -        crs: 'EPSG:4326',
    -        name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES',
    -        tileMatrixSet: 'WGS84G',
    -        format: 'image/x-bil;bits=32',
    -        tileMatrixSetLimits: {
    -            11: {
    -                minTileRow: 442,
    -                maxTileRow: 1267,
    -                minTileCol: 1344,
    -                maxTileCol: 2683
    -            },
    -            12: {
    -                minTileRow: 885,
    -                maxTileRow: 2343,
    -                minTileCol: 3978,
    -                maxTileCol: 5126
    -            },
    -            13: {
    -                minTileRow: 1770,
    -                maxTileRow: 4687,
    -                minTileCol: 7957,
    -                maxTileCol: 10253
    -            },
    -            14: {
    -                minTileRow: 3540,
    -                maxTileRow: 9375,
    -                minTileCol: 15914,
    -                maxTileCol: 20507
    -            }
    +var elevationSource = new itowns.WMTSSource({
    +    url: 'https://data.geopf.fr/wmts?',
    +    crs: 'EPSG:4326',
    +    name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES',
    +    tileMatrixSet: 'WGS84G',
    +    format: 'image/x-bil;bits=32',
    +    tileMatrixSetLimits: {
    +        11: {
    +            minTileRow: 442,
    +            maxTileRow: 1267,
    +            minTileCol: 1344,
    +            maxTileCol: 2683
    +        },
    +        12: {
    +            minTileRow: 885,
    +            maxTileRow: 2343,
    +            minTileCol: 3978,
    +            maxTileCol: 5126
    +        },
    +        13: {
    +            minTileRow: 1770,
    +            maxTileRow: 4687,
    +            minTileCol: 7957,
    +            maxTileCol: 10253
    +        },
    +        14: {
    +            minTileRow: 3540,
    +            maxTileRow: 9375,
    +            minTileCol: 15914,
    +            maxTileCol: 20507
             }
    -    });
    +    }
    +});
     
    -    var elevationLayer = new itowns.ElevationLayer('MNT_WORLD', {
    -        source: elevationSource,
    -    });
    +var elevationLayer = new itowns.ElevationLayer('MNT_WORLD', {
    +    source: elevationSource,
    +});
     
    -    view.addLayer(elevationLayer);
    +view.addLayer(elevationLayer);
     

    At this point you should be zoomed on the Tarn gorges (where our 3D dataset will be displayed) and see a basemap and a 3D terrain:

    Globe, terrain and OSM basemap

    Adding the 3D Tiles Layer

    As usual, we first configure a source. Here, we will use a C3DTilesSource for which it is as simple as giving the url of the dataset to display.

    -
        const pointCloudSource = new itowns.C3DTilesSource({
    -        url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/' +
    -        'master/3DTiles/lidar-hd-gorges-saint-chely-tarn/tileset.json',
    -    });
    +
    const pointCloudSource = new itowns.C3DTilesSource({
    +    url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/' +
    +    'master/3DTiles/lidar-hd-gorges-saint-chely-tarn/tileset.json',
    +});
     

    Then, we create the C3DTilesLayer by giving it and id, the source and the view. And finally we add it to the GlobeView by using the generic method of View to not -use the GlobeView subdivision (see [the 3D Tiles textured buildings tutorial](@tutorial 3DTiles-mesh-b3dm) for more information).

    -
        const pointCloudLayer = new itowns.C3DTilesLayer('gorges', {
    -        source: pointCloudSource,
    -    }, view);
    -    itowns.View.prototype.addLayer.call(view, pointCloudLayer);
    +use the GlobeView subdivision (see the 3D Tiles textured buildings tutorial for more information).

    +
    const pointCloudLayer = new itowns.C3DTilesLayer('gorges', {
    +    source: pointCloudSource,
    +}, view);
    +itowns.View.prototype.addLayer.call(view, pointCloudLayer);
     

    At this point, you should see the point cloud displayed:

    3D tiles point cloud

    @@ -145,30 +145,24 @@

    Adding the 3D Tiles Layer

    In the next part, we will see how we can improve that.

    Updating 3D Tiles style

    3D Tiles style can be changed on the fly when loading the 3D Tiles data in itowns. It can be done with -the onTileContentLoaded callback of C3DTilesLayer that is called for each tile when the content of a tile has been loaded. The tile content is a Threejs Object3D or Group, so we can access its material and make any style changes that we want. In our case, we will modify the size of the points. +the C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED event of C3DTilesLayer that is called for each tile when the content of a tile has been loaded. The tile content is a Threejs Object3D or Group, so we can access its material and make any style changes that we want. In our case, we will modify the size of the points. First, we create a function to update the size of the point:

    -
        function updatePointCloudSize(tileContent) {
    -        tileContent.traverse(function (obj) {
    -            if (obj.isPoints) {
    -                obj.material.size = 3.0;
    -            }
    -        });
    -    }
    +
    function updatePointCloudSize(event) {
    +    event.tileContent.traverse(obj => {
    +        if (obj.isPoints) {
    +            obj.material.size = 3.0;
    +        }
    +    });
    +}
     

    In this function, we traverse the tileContent hierarchy until we find the threejs Points object with obj.isPoints. Then, we change the size of the threejs PointMaterial material. You can refer to threejs documentation for more information on Object3D, Group, Points and PointsMaterial objects.

    -

    Then, we just need to pass this callback to the C3DTilesLayer constructor:

    -
        onTileContentLoaded: updatePointCloudSize
    -
    -

    The constructor of the C3DTilesLayer therefore becomes:

    -
        const pointCloudLayer = new itowns.C3DTilesLayer('gorges', {
    -        source: pointCloudSource,
    -        onTileContentLoaded: updatePointCloudSize
    -    }, view);
    +

    Then, we just need to assign this callback as a listener to the C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED event:

    +
    pointCloudLayer.addEventListener(itowns.C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED, updatePointCloudSize);
     

    If you zoom in to the points, you can now see that they are bigger:

    3D tiles small points

    -

    Not that you can use this callback to change the style of any 3D Tiles dataset (even meshes) and to change any style property of the dataset.

    +

    Note that you can use this callback to change the style of any 3D Tiles dataset (even meshes) and to change any style property of the dataset.

    Result

    The full code to achieve this result is:

    <!DOCTYPE html>
    @@ -216,7 +210,7 @@ 

    Result

    view.addLayer(orthoLayer); var elevationSource = new itowns.WMTSSource({ - url: 'http://wxs.ign.fr/altimetrie/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: 'EPSG:4326', name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES', tileMatrixSet: 'WGS84G', @@ -260,8 +254,8 @@

    Result

    'master/3DTiles/lidar-hd-gorges-saint-chely-tarn/tileset.json', }); - function updatePointCloudSize(tileContent) { - tileContent.traverse(function (obj) { + function updatePointCloudSize(event) { + event.tileContent.traverse(obj => { if (obj.isPoints) { obj.material.size = 3.0; } @@ -270,8 +264,9 @@

    Result

    const pointCloudLayer = new itowns.C3DTilesLayer('gorges', { source: pointCloudSource, - onTileContentLoaded: updatePointCloudSize }, view); + pointCloudLayer.addEventListener(itowns.C3DTILES_LAYER_EVENTS.ON_TILE_CONTENT_LOADED, updatePointCloudSize); + itowns.View.prototype.addLayer.call(view, pointCloudLayer); </script> </body> diff --git a/itowns/docs/tutorials/Fundamentals.html b/itowns/docs/tutorials/Fundamentals.html index 67680b8f..823e3243 100644 --- a/itowns/docs/tutorials/Fundamentals.html +++ b/itowns/docs/tutorials/Fundamentals.html @@ -57,7 +57,7 @@

    Protocols and data formats

    with WFSSource and Tile Map Service and XYZ with TMSSource.

    iTowns also has sources for many data formats: vector tile resources from MapBox with VectorTilesSource, Potree (PotreeSource) and Entwine (EntwinePointTileSource) 3D point clouds, 3DTiles -mesh (b3dm) and point clouds (pnts) from web servers (C3DTilesSource) and from Cesium ion C3DTilesIonSource, +mesh (b3dm) and point clouds (pnts) from web servers (C3DTilesSource), Cesium ion C3DTilesIonSource and from Google api C3DTilesGoogleSource, GeoJSON with FileSource and GeoJsonParser, KML with FileSource and KMLParser, GPX with FileSource and GpxParser and oriented images with OrientedImageSource.

    @@ -74,7 +74,7 @@

    Layers

  • PointCloudLayer can be used to display 3D point clouds. Any point cloud formats are supported as long as the corresponding Source is provided. Some point clouds formats such as Potree, Las and Entwine already have parsers defined in itowns that you can use. For 3D Tiles point clouds (pnts), use C3DTilesLayer.
  • -
  • C3DTilesLayer can be used to display 3D Tiles layer (only b3dm and pnts).
  • +
  • C3DTilesLayer can be used to display 3D Tiles datasets in version 1.0 (b3dm, pnts and gltf tiles are supported).
  • OrientedImageLayer can be used to display oriented images.
  • diff --git a/itowns/docs/tutorials/Raster-data-Lambert93.html b/itowns/docs/tutorials/Raster-data-Lambert93.html index 65adc21f..be4df00d 100644 --- a/itowns/docs/tutorials/Raster-data-Lambert93.html +++ b/itowns/docs/tutorials/Raster-data-Lambert93.html @@ -116,7 +116,7 @@

    Add a color layer

    To do so, we must define the source at which ortho-images data can be fetched thanks to the Source class. We can start displaying ortho-images provided by the Geoportail as such :

    const sourceOrtho = new itowns.WMSSource({
    -    url: "https://wxs.ign.fr/inspire/inspire/r/wms",
    +    url: "https://data.geopf.fr/wms-r/wms?",
         name: "OI.OrthoimageCoverage.HR",
         format: 'image/png',
         crs: 'EPSG:2154',
    @@ -141,7 +141,7 @@ 

    Add an elevation layer

    At first, we need to define the source of the elevation raster data. Then we can simply create the ElevationLayer, giving it a unique id and the source configuration, and finally adding it to the view.

    const sourceDEM = new itowns.WMSSource({
    -    url: "https://wxs.ign.fr/altimetrie/geoportail/r/wms",
    +    url: "https://data.geopf.fr/wms-r/wms?",
         name: "ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES",
         format: "image/x-bil;bits=32",
         crs: 'EPSG:2154',
    @@ -172,10 +172,10 @@ 

    Result

    <div id="viewerDiv"></div> <script src="../dist/itowns.js"></script> <script type="text/javascript"> - + // Retrieve the view container const viewerDiv = document.getElementById('viewerDiv'); - + // Define the view geographic extent itowns.proj4.defs( 'EPSG:2154', @@ -186,7 +186,7 @@

    Result

    644500.0, 659499.99, 6857500.0, 6867499.99, ); - + // Define the camera initial placement const placement = { coord: viewExtent.center(), @@ -194,15 +194,15 @@

    Result

    heading: 40, range: 16000, }; - + // Create the planar view const view = new itowns.PlanarView(viewerDiv, viewExtent, { placement: placement, }); - + // Define the source of the ortho-images const sourceOrtho = new itowns.WMSSource({ - url: "https://wxs.ign.fr/inspire/inspire/r/wms", + url: "https://data.geopf.fr/wms-r/wms?", name: "OI.OrthoimageCoverage.HR", format: "image/png", crs: 'EPSG:2154', @@ -211,10 +211,10 @@

    Result

    // Create the ortho-images ColorLayer and add it to the view const layerOrtho = new itowns.ColorLayer('Ortho', { source: sourceOrtho }); view.addLayer(layerOrtho); - + // Define the source of the dem data const sourceDEM = new itowns.WMSSource({ - url: "https://wxs.ign.fr/altimetrie/geoportail/r/wms", + url: "https://data.geopf.fr/wms-r/wms?", name: "ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES", format: "image/x-bil;bits=32", crs: 'EPSG:2154', diff --git a/itowns/docs/tutorials/Raster-data-WGS84.html b/itowns/docs/tutorials/Raster-data-WGS84.html index 5f8f5d95..7b3c5634 100644 --- a/itowns/docs/tutorials/Raster-data-WGS84.html +++ b/itowns/docs/tutorials/Raster-data-WGS84.html @@ -79,7 +79,7 @@

    Adding a color layer

    Adding a layer to itowns is done in three steps: creating a data Source, adding this source to a Layer and adding this layer to the View.

    var orthoSource = new itowns.WMTSSource({
    -    url: 'http://wxs.ign.fr/decouverte/geoportail/wmts',
    +    url: 'https://data.geopf.fr/wmts?',
         crs: 'EPSG:3857',
         name: 'ORTHOIMAGERY.ORTHOPHOTOS',
         tileMatrixSet: 'PM',
    @@ -113,7 +113,7 @@ 

    Adding an elevation layer

    WMTSSource, but we need to create a new one as the elevation data source is different from the previous one.

    var elevationSource = new itowns.WMTSSource({
    -    url: 'http://wxs.ign.fr/altimetrie/geoportail/wmts',
    +    url: 'https://data.geopf.fr/wmts?',
         crs: 'EPSG:4326',
         name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3',
         tileMatrixSet: 'WGS84G',
    @@ -162,7 +162,7 @@ 

    Result

    var view = new itowns.GlobeView(viewerDiv, placement); var orthoSource = new itowns.WMTSSource({ - url: 'https://wxs.ign.fr/decouverte/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: "EPSG:3857", name: 'ORTHOIMAGERY.ORTHOPHOTOS', tileMatrixSet: 'PM', @@ -176,7 +176,7 @@

    Result

    view.addLayer(orthoLayer); var elevationSource = new itowns.WMTSSource({ - url: 'https://wxs.ign.fr/altimetrie/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: 'EPSG:4326', name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3', tileMatrixSet: 'WGS84G', diff --git a/itowns/docs/tutorials/Vector-data-3d.html b/itowns/docs/tutorials/Vector-data-3d.html index 0e57af22..fc50f4de 100644 --- a/itowns/docs/tutorials/Vector-data-3d.html +++ b/itowns/docs/tutorials/Vector-data-3d.html @@ -50,23 +50,23 @@

    Preparing the field

    tilt: 20, }; var view = new itowns.GlobeView(viewerDiv, placement); - + var colorSource = new itowns.WMTSSource({ - url: 'http://wxs.ign.fr/decouverte/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: 'EPSG:3857', name: 'ORTHOIMAGERY.ORTHOPHOTOS', tileMatrixSet: 'PM', format: 'image/jpeg' }); - + var colorLayer = new itowns.ColorLayer('Ortho', { source: colorSource, }); - + view.addLayer(colorLayer); - + var elevationSource = new itowns.WMTSSource({ - url: 'http://wxs.ign.fr/altimetrie/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: 'EPSG:4326', name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES', tileMatrixSet: 'WGS84G', @@ -98,11 +98,11 @@

    Preparing the field

    } } }); - + var elevationLayer = new itowns.ElevationLayer('MNT_WORLD', { source: elevationSource, }); - + view.addLayer(elevationLayer); </script> </body> @@ -115,7 +115,7 @@

    Adding a GeometryLayer

    Before creating this layer, let's instantiate the data source:

    
     var geometrySource = new itowns.WFSSource({
    -    url: 'https://wxs.ign.fr/topographie/geoportail/wfs?',
    +    url: 'https://data.geopf.fr/wfs/ows?',
         version: '2.0.0',
         typeName: 'BDTOPO_V3:batiment',
         crs: 'EPSG:4326',
    @@ -150,7 +150,7 @@ 

    Placing the data on the ground

    } var geometrySource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/topographie/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', typeName: 'BDTOPO_V3:batiment', crs: 'EPSG:4326', @@ -183,7 +183,7 @@

    Placing the data on the ground

    z_max: 83.7 z_min: 83.7
    -

    Reading the documentation of the database we are querying (section 7.2, page +

    Reading the documentation of the database we are querying (section 7.2, page 66, in French), we have an explanation on each property. To help us place the data correctly, let's use the altitude_minimale_sol property. @@ -203,7 +203,7 @@

    Extruding the data

    } var geometrySource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/topographie/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', typeName: 'BDTOPO_V3:batiment', crs: 'EPSG:4326', @@ -238,7 +238,7 @@

    Coloring the data

    } var geometrySource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/topographie/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', typeName: 'BDTOPO_V3:batiment', crs: 'EPSG:4326', @@ -291,7 +291,7 @@

    Result

    var view = new itowns.GlobeView(viewerDiv, placement); var colorSource = new itowns.WMTSSource({ - url: 'http://wxs.ign.fr/decouverte/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: 'EPSG:3857', name: 'ORTHOIMAGERY.ORTHOPHOTOS', tileMatrixSet: 'PM', @@ -305,7 +305,7 @@

    Result

    view.addLayer(colorLayer); var elevationSource = new itowns.WMTSSource({ - url: 'http://wxs.ign.fr/altimetrie/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: 'EPSG:4326', name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES', tileMatrixSet: 'WGS84G', @@ -356,9 +356,9 @@

    Result

    return new itowns.THREE.Color(0xaaaaaa); } - + var geometrySource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/topographie/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', typeName: 'BDTOPO_V3:batiment', crs: 'EPSG:4326', diff --git a/itowns/docs/tutorials/Vector-data-on-ground.html b/itowns/docs/tutorials/Vector-data-on-ground.html index c581d6c3..b03b2765 100644 --- a/itowns/docs/tutorials/Vector-data-on-ground.html +++ b/itowns/docs/tutorials/Vector-data-on-ground.html @@ -56,27 +56,28 @@

    Preparing the field

    coord: new itowns.Coordinates('EPSG:4326', 3.05, 48.97), range: 15000, }; - + // Create the view var view = new itowns.GlobeView(viewerDiv, placement); - + // Define the source of the ortho-images var orthoSource = new itowns.WMTSSource({ - url: 'https://wxs.ign.fr/decouverte/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: "EPSG:3857", name: 'ORTHOIMAGERY.ORTHOPHOTOS', tileMatrixSet: 'PM', format: 'image/jpeg', - }) + }); + // Create the ortho-images ColorLayer and add it to the view var orthoLayer = new itowns.ColorLayer('Ortho', { source: orthoSource, }); view.addLayer(orthoLayer); - + // Define the source of the dem data var elevationSource = new itowns.WMTSSource({ - url: 'https://wxs.ign.fr/altimetrie/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: 'EPSG:4326', name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3', tileMatrixSet: 'WGS84G', @@ -218,12 +219,13 @@

    Result

    // Define the source of the ortho-images var orthoSource = new itowns.WMTSSource({ - url: 'https://wxs.ign.fr/decouverte/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: "EPSG:3857", name: 'ORTHOIMAGERY.ORTHOPHOTOS', tileMatrixSet: 'PM', format: 'image/jpeg', - }) + }); + // Create the ortho-images ColorLayer and add it to the view var orthoLayer = new itowns.ColorLayer('Ortho', { source: orthoSource, @@ -232,7 +234,7 @@

    Result

    // Define the source of the dem data var elevationSource = new itowns.WMTSSource({ - url: 'https://wxs.ign.fr/altimetrie/geoportail/wmts', + url: 'https://data.geopf.fr/wmts?', crs: 'EPSG:4326', name: 'ELEVATION.ELEVATIONGRIDCOVERAGE.SRTM3', tileMatrixSet: 'WGS84G', diff --git a/itowns/examples/.eslintrc.js b/itowns/examples/.eslintrc.cjs similarity index 97% rename from itowns/examples/.eslintrc.js rename to itowns/examples/.eslintrc.cjs index 33a388a2..601cce02 100644 --- a/itowns/examples/.eslintrc.js +++ b/itowns/examples/.eslintrc.cjs @@ -2,7 +2,7 @@ module.exports = { extends: [ 'eslint-config-airbnb-base', 'eslint-config-airbnb-base/rules/strict', - '../.eslintrc.js', + '../.eslintrc.cjs', ], parserOptions: { ecmaVersion: 13, diff --git a/itowns/examples/effects_stereo.html b/itowns/examples/effects_stereo.html index 99c7d40f..ce0cf8e5 100644 --- a/itowns/examples/effects_stereo.html +++ b/itowns/examples/effects_stereo.html @@ -23,8 +23,8 @@ diff --git a/itowns/examples/entwine_simple_loader.html b/itowns/examples/entwine_simple_loader.html index 2951b21b..5d4dd1fa 100644 --- a/itowns/examples/entwine_simple_loader.html +++ b/itowns/examples/entwine_simple_loader.html @@ -31,14 +31,15 @@ diff --git a/itowns/examples/misc_instancing.html b/itowns/examples/misc_instancing.html index a134b9fb..05d8bb06 100644 --- a/itowns/examples/misc_instancing.html +++ b/itowns/examples/misc_instancing.html @@ -103,7 +103,7 @@ // Define the source of the building data : those are vector tiled data from the geoportail. const buildingsSource = new itowns.VectorTilesSource({ - style: "https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json", + style: "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json", // We only want to display buildings related data. filter: (layer) => { return ( diff --git a/itowns/examples/source_file_gpx_3d.html b/itowns/examples/source_file_gpx_3d.html index c968daea..d4d5f2d7 100644 --- a/itowns/examples/source_file_gpx_3d.html +++ b/itowns/examples/source_file_gpx_3d.html @@ -59,8 +59,6 @@ this.updateMatrixWorld(); } - var waypointGeometry = new itowns.THREE.BoxGeometry(1, 1, 80); - var waypointMaterial = new itowns.THREE.MeshBasicMaterial({ color: 0xffffff }); const style = { stroke: { color: 'red', @@ -70,6 +68,8 @@ color: 'white', } }; + var waypointGeometry = new itowns.THREE.BoxGeometry(1, 1, 80); + var waypointMaterial = new itowns.THREE.MeshBasicMaterial({ color: 0xffffff }); // Listen for globe full initialisation event view.addEventListener(itowns.GLOBE_VIEW_EVENTS.GLOBE_INITIALIZED, function () { console.info('Globe initialized'); diff --git a/itowns/examples/source_stream_wfs_25d.html b/itowns/examples/source_stream_wfs_25d.html index 01b691b6..53c82966 100644 --- a/itowns/examples/source_stream_wfs_25d.html +++ b/itowns/examples/source_stream_wfs_25d.html @@ -238,7 +238,7 @@ } var wfsBuildingSource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/topographie/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', typeName: 'BDTOPO_V3:batiment', crs: 'EPSG:4326', @@ -271,9 +271,9 @@ view.addLayer(wfsBuildingLayer); var wfsCartoSource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/cartovecto/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', - typeName: 'BDCARTO_BDD_WLD_WGS84G:zone_habitat_mairie', + typeName: 'BDCARTO_V5:zone_d_habitation', crs: 'EPSG:3946', ipr: 'IGN', format: 'application/json', @@ -284,24 +284,24 @@ text: { field: '{toponyme}', color: (p) => { - switch (p.importance) { - case 'Quartier de ville': - return 'Cornsilk'; - case 'Hameau': + switch (p.nature) { + case 'Quartier': return 'WhiteSmoke'; - case 'Chef-lieu de commune': + case 'Château': + return 'Cornsilk'; + case 'Lieu-dit habité': default: return 'white'; } }, transform: 'uppercase', size: (p) => { - switch (p.importance) { - case 'Quartier de ville': - return 11; - case 'Hameau': + switch (p.nature) { + case 'Quartier': return 13; - case 'Chef-lieu de commune': + case 'Château': + return 11; + case 'Lieu-dit habité': default: return 18; } diff --git a/itowns/examples/source_stream_wfs_3d.html b/itowns/examples/source_stream_wfs_3d.html index acc4ba88..0c022b94 100644 --- a/itowns/examples/source_stream_wfs_3d.html +++ b/itowns/examples/source_stream_wfs_3d.html @@ -64,16 +64,16 @@ var color = new itowns.THREE.Color(); var tile; - function altitudeLine(properties, contour) { + function altitudeLine(properties, ctx) { var result; var z = 0; - if (contour) { - result = itowns.DEMUtils.getTerrainObjectAt(view.tileLayer, contour, 0, tile); + if (ctx.coordinates) { + result = itowns.DEMUtils.getTerrainObjectAt(view.tileLayer, ctx.coordinates, 0, tile); if (!result) { - result = itowns.DEMUtils.getTerrainObjectAt(view.tileLayer, contour, 0); + result = itowns.DEMUtils.getTerrainObjectAt(view.tileLayer, ctx.coordinates, 0); } - tile = [result.tile]; if (result) { + tile = [result.tile]; z = result.coord.z; } return z + 5; @@ -95,11 +95,12 @@ return false; } - var lyonTclBusSource = new itowns.WFSSource({ + lyonTclBusSource = new itowns.WFSSource({ + url: "https://data.grandlyon.com/geoserver/sytral/ows?", protocol: 'wfs', - url: 'https://download.data.grandlyon.com/wfs/rdata?', version: '2.0.0', - typeName: 'tcl_sytral.tcllignebus', + id: 'tcl_bus', + typeName: "tcl_sytral.tcllignebus_2_0_0", crs: 'EPSG:3946', extent: { west: 1822174.60, @@ -107,7 +108,7 @@ south: 5138876.75, north: 5205890.19, }, - format: 'geojson', + format: 'application/json', }); var lyonTclBusLayer = new itowns.FeatureGeometryLayer('WFS Bus lines',{ @@ -174,7 +175,7 @@ view.addFrameRequester(itowns.MAIN_LOOP_EVENTS.BEFORE_RENDER, scaler); var wfsBuildingSource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/topographie/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', typeName: 'BDTOPO_V3:batiment', crs: 'EPSG:4326', diff --git a/itowns/examples/source_stream_wfs_raster.html b/itowns/examples/source_stream_wfs_raster.html index 204b4427..4771d488 100644 --- a/itowns/examples/source_stream_wfs_raster.html +++ b/itowns/examples/source_stream_wfs_raster.html @@ -60,7 +60,7 @@ } var wfsBuildingSource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/topographie/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', typeName: 'BDTOPO_V3:batiment', crs: 'EPSG:4326', diff --git a/itowns/examples/vector_tile_3d_mesh.html b/itowns/examples/vector_tile_3d_mesh.html index 6b1ea811..b2e7d361 100644 --- a/itowns/examples/vector_tile_3d_mesh.html +++ b/itowns/examples/vector_tile_3d_mesh.html @@ -75,7 +75,7 @@ // Define the source of the ColorLayer data : a vector tiled map from the geoportail. const mapSource = new itowns.VectorTilesSource({ - style: 'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json', + style: "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json", // We don't display mountains and parcels related data to ease visualisation. Also, we don't display // buildings related data as it will be displayed in another Layer. filter: (layer) => { @@ -110,7 +110,7 @@ // Define the source of the building data : those are vector tiled data from the geoportail. const buildingsSource = new itowns.VectorTilesSource({ - style: 'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json', + style: "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json", // We only want to display buildings related data. filter: (layer) => { return layer['source-layer'].includes('bati_surf') diff --git a/itowns/examples/vector_tile_raster_2d.html b/itowns/examples/vector_tile_raster_2d.html index e19408da..ceae0cc2 100644 --- a/itowns/examples/vector_tile_raster_2d.html +++ b/itowns/examples/vector_tile_raster_2d.html @@ -48,7 +48,7 @@ // Defines a VectorTilesSource to load Vector Tiles data from the geoportail var mvtSource = new itowns.VectorTilesSource({ - style: 'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json', + style: "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json", // We don't display mountains related data to ease visualisation filter: (layer) => !layer['source-layer'].includes('oro_') && !layer['source-layer'].includes('parcellaire'), }); diff --git a/itowns/examples/vector_tile_raster_3d.html b/itowns/examples/vector_tile_raster_3d.html index a753784a..1c5e9f9c 100644 --- a/itowns/examples/vector_tile_raster_3d.html +++ b/itowns/examples/vector_tile_raster_3d.html @@ -49,7 +49,7 @@ // Define a VectorTilesSource to load Vector Tiles data from the geoportail var mvtSource = new itowns.VectorTilesSource({ - style: 'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json', + style: "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json", // We don't display mountains related data to ease visualisation filter: (layer) => !layer['source-layer'].includes('oro_') && !layer['source-layer'].includes('parcellaire'), }); diff --git a/itowns/examples/view_25d_map.html b/itowns/examples/view_25d_map.html index 0ed8d0e3..3b4133cf 100644 --- a/itowns/examples/view_25d_map.html +++ b/itowns/examples/view_25d_map.html @@ -98,9 +98,9 @@ view.addLayer(wmsElevationLayer); var wfsCartoSource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/cartovecto/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', - typeName: 'BDCARTO_BDD_WLD_WGS84G:zone_habitat_mairie', + typeName: 'BDCARTO_V5:zone_d_habitation', crs: 'EPSG:3946', ipr: 'IGN', format: 'application/json', diff --git a/itowns/examples/view_3d_map.html b/itowns/examples/view_3d_map.html index cd3f4f17..5763cfda 100644 --- a/itowns/examples/view_3d_map.html +++ b/itowns/examples/view_3d_map.html @@ -85,7 +85,7 @@ view, new itowns.ColorLayer('minimap', { source: new itowns.VectorTilesSource({ - style: 'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/gris.json', + style: "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json", // We don't display mountains and plot related data to ease visualisation filter: (layer) => !layer['source-layer'].includes('oro_') && !layer['source-layer'].includes('parcellaire'), @@ -110,8 +110,8 @@ // Define options for geocoding service that should be used by the searchbar. const geocodingOptions = { url: new URL( - 'https://wxs.ign.fr/ayxvok72rcocdyn8xyvy32og/ols/apis/completion?text=&type=StreetAddress,' + - 'PositionOfInterest', + 'https://data.geopf.fr/geocodage/completion?' + + 'text=&type=StreetAddress,PositionOfInterest', ), parser: (response) => { const map = new Map(); diff --git a/itowns/examples/view_3d_map_webxr.html b/itowns/examples/view_3d_map_webxr.html index 7511decd..52dc69e2 100644 --- a/itowns/examples/view_3d_map_webxr.html +++ b/itowns/examples/view_3d_map_webxr.html @@ -14,7 +14,7 @@ diff --git a/itowns/examples/view_3d_mns_map.html b/itowns/examples/view_3d_mns_map.html index dcc600e3..1712654b 100644 --- a/itowns/examples/view_3d_mns_map.html +++ b/itowns/examples/view_3d_mns_map.html @@ -84,7 +84,7 @@ view, new itowns.ColorLayer('minimap', { source: new itowns.VectorTilesSource({ - style: 'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/gris.json', + style: "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json", // We don't display mountains and plot related data to ease visualisation filter: (layer) => !layer['source-layer'].includes('oro_') && !layer['source-layer'].includes('parcellaire'), @@ -109,8 +109,8 @@ // Define options for geocoding service that should be used by the searchbar. const geocodingOptions = { url: new URL( - 'https://wxs.ign.fr/ayxvok72rcocdyn8xyvy32og/ols/apis/completion?text=&type=StreetAddress,' + - 'PositionOfInterest', + 'https://data.geopf.fr/geocodage/completion?' + + 'text=&type=StreetAddress,PositionOfInterest', ), parser: (response) => { const map = new Map(); diff --git a/itowns/examples/view_immersive.html b/itowns/examples/view_immersive.html index 4757f57d..52edc3b1 100644 --- a/itowns/examples/view_immersive.html +++ b/itowns/examples/view_immersive.html @@ -117,7 +117,7 @@ view.addLayer(olayer, view.tileLayer).then(function addWfsLayer(orientedImageLayer) { // prepare WFS source for the buildings var wfsBuildingSource = new itowns.WFSSource({ - url: 'https://wxs.ign.fr/topographie/geoportail/wfs?', + url: 'https://data.geopf.fr/wfs/ows?', version: '2.0.0', typeName: 'BDTOPO_V3:batiment', crs: 'EPSG:4326', diff --git a/itowns/examples/view_multi_25d.html b/itowns/examples/view_multi_25d.html index 983225db..c348aee4 100644 --- a/itowns/examples/view_multi_25d.html +++ b/itowns/examples/view_multi_25d.html @@ -17,8 +17,8 @@ diff --git a/itowns/examples/widgets_minimap.html b/itowns/examples/widgets_minimap.html index 6ce99f6c..74d53f81 100644 --- a/itowns/examples/widgets_minimap.html +++ b/itowns/examples/widgets_minimap.html @@ -88,7 +88,7 @@ // Create a ColorLayer that shall be displayed on the minimap. const minimapColorLayer = new itowns.ColorLayer('minimap', { source: new itowns.VectorTilesSource({ - style: 'https://wxs.ign.fr/essentiels/static/vectorTiles/styles/PLAN.IGN/standard.json', + style: "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/standard.json", // We don't display mountains and plot related data to ease visualisation filter: (layer) => !layer['source-layer'].includes('oro_') && !layer['source-layer'].includes('parcellaire'), diff --git a/itowns/examples/widgets_searchbar.html b/itowns/examples/widgets_searchbar.html index 5af4a201..60a6c896 100644 --- a/itowns/examples/widgets_searchbar.html +++ b/itowns/examples/widgets_searchbar.html @@ -88,8 +88,8 @@ // Define options for geocoding service that should be used by the searchbar. const geocodingOptions = { url: new URL( - 'https://wxs.ign.fr/ayxvok72rcocdyn8xyvy32og/ols/apis/completion?text=&type=StreetAddress,' + - 'PositionOfInterest', + 'https://data.geopf.fr/geocodage/completion?' + + 'text=&type=StreetAddress,PositionOfInterest', ), // As precised in the doc (http://www.itowns-project.org/itowns/docs/#api/Widgets/Searchbar), the parser // method must parse the geocoding service response into a Map object. For each item of this Map, the